CN109522021B - Parameter callback processing method and device, electronic equipment and storage medium - Google Patents

Parameter callback processing method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN109522021B
CN109522021B CN201811279981.2A CN201811279981A CN109522021B CN 109522021 B CN109522021 B CN 109522021B CN 201811279981 A CN201811279981 A CN 201811279981A CN 109522021 B CN109522021 B CN 109522021B
Authority
CN
China
Prior art keywords
sdk
callback
function method
parameter
function
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201811279981.2A
Other languages
Chinese (zh)
Other versions
CN109522021A (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.)
MIGU Culture Technology Co Ltd
Original Assignee
MIGU Culture Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by MIGU Culture Technology Co Ltd filed Critical MIGU Culture Technology Co Ltd
Priority to CN201811279981.2A priority Critical patent/CN109522021B/en
Publication of CN109522021A publication Critical patent/CN109522021A/en
Application granted granted Critical
Publication of CN109522021B publication Critical patent/CN109522021B/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/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/42Syntactic analysis
    • G06F8/427Parsing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management

Abstract

The embodiment of the invention discloses a parameter callback processing method, a device, electronic equipment and a storage medium, wherein the parameter callback processing method comprises the following steps: when monitoring that a callback response of a third-party application program is received by a client side APP, the SDK calls pointer addresses of a first function method outside the SDK and a second function method inside the SDK; wherein the first function method is used for receiving and parsing the callback response outside the SDK; and the SDK analyzes the callback response through the second function method to obtain a callback parameter, executes corresponding processing according to the type of the callback parameter, and returns an execution result to the client APP. The embodiment of the invention reduces the code workload of the client APP, and moreover, the client APP does not need to import the SDK for callback parameters, thereby simplifying the SDK packaging interface, enhancing the reliability of the SDK on the callback parameters and simplifying the processing flow.

Description

Parameter callback processing method and device, electronic equipment and storage medium
Technical Field
The invention relates to the technical field of computers, in particular to a parameter callback processing method and device, electronic equipment and a storage medium.
Background
In the application of the client APP, in order to meet the requirement of a user for fast login, payment or sharing, a plurality of third-party login, payment or sharing modes are generally provided. In the prior art, after a client APP calls a third party to log in or pay, a callback response of a third party SDK generally needs to be analyzed through a trigger function in the client APP, an analyzed parameter is transmitted to an authentication payment SDK through an interface, and a result after internal processing of the SDK needs to be returned to the client APP through the callback function.
The inventor finds out in the process of implementing the embodiment of the invention that: the existing client side APP analyzes the callback response of the third-party SDK through a trigger function, so that more parameters are generated on the client side APP, and the SDK packaging interface is complicated; in addition, the callback response needs to be analyzed by the client side APP, the analyzed callback parameter is led into the authentication payment SDK through the client side APP, and the result after internal processing is returned to the client side APP through a callback function by the authentication payment SDK, so that the problem of complex processing flow exists.
Disclosure of Invention
In view of this, embodiments of the present invention provide a parameter callback processing method and apparatus, an electronic device, and a storage medium, so as to solve the technical problems that when an existing client APP calls a third-party application program, there are many parameters generated on the client APP side, and an interface and a processing flow of SDK encapsulation are complex.
The technical scheme of the embodiment of the invention is realized as follows:
in a first aspect, an embodiment of the present invention provides a parameter callback processing method, where the method includes:
when monitoring that a callback response of a third-party application program is received by a client side APP, the SDK calls pointer addresses of a first function method outside the SDK and a second function method inside the SDK; wherein the first function method is used for receiving and parsing the callback response outside the SDK;
and the SDK analyzes the callback response through the second function method to obtain a callback parameter, executes corresponding processing according to the type of the callback parameter, and returns an execution result to the client APP.
In a second aspect, an embodiment of the present invention provides a parameter callback processing apparatus, including:
the function exchanging module is used for exchanging pointer addresses of a first function method outside the SDK and a second function method inside the SDK when the SDK monitors that a client APP receives a callback response of a third-party application program; wherein the first function method is used for receiving and parsing the callback response outside the SDK;
and the analysis processing module is used for analyzing the callback response by the SDK through the second function method to obtain a callback parameter, executing corresponding processing according to the type of the callback parameter, and returning an execution result to the client APP.
In a third aspect, an embodiment of the present invention provides an electronic device, including:
a memory for storing an executable program;
and the processor is used for realizing the parameter callback processing method in any embodiment of the invention when the executable program stored in the memory is executed.
In a fourth aspect, an embodiment of the present invention provides a computer storage medium, which stores an executable program, and when the executable program is executed by a processor, the method for parameter callback processing according to any embodiment of the present invention is implemented.
In the technical scheme of the embodiment of the invention, when monitoring that a client side APP receives a callback response of a third-party application program, an SDK (software development kit) adjusts pointer addresses of a first function method outside the SDK and a second function method inside the SDK, the SDK analyzes the callback response through the second function method to obtain a callback parameter, executes corresponding processing according to the type of the callback parameter and returns an execution result to the client side APP, so that the client side APP does not need to analyze the callback response of the third-party application program, the code workload of the client side APP is reduced, in addition, the callback parameter does not need to be led in the SDK by the client side APP, an SDK packaging interface is simplified, the reliability of the SDK on the callback parameter is enhanced, and the processing flow is simplified.
Drawings
FIG. 1 is a flowchart illustrating a parameter callback processing method according to an embodiment of the present invention;
FIG. 2 is a schematic diagram illustrating a first function method and a second function method for swapping addresses of pointers according to an embodiment of the present invention;
FIG. 3 is a second flowchart illustrating a parameter callback processing method according to the embodiment of the present invention;
FIG. 4 is a third schematic flow chart of a parameter callback processing method according to the embodiment of the present invention;
FIG. 5 is a schematic structural diagram of a parameter callback processing apparatus according to an embodiment of the present invention;
fig. 6 is a schematic diagram of a hardware structure of an electronic device according to an embodiment of the present invention.
Detailed Description
The technical scheme of the invention is further elaborated by combining the drawings and the specific embodiments in the specification. It should be understood that the examples provided herein are merely illustrative of the present invention and are not intended to limit the present invention. In addition, the following embodiments are provided as partial embodiments for implementing the present invention, not all embodiments for implementing the present invention, and the technical solutions described in the embodiments of the present invention may be implemented in any combination without conflict.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs. The terminology used herein in the description of the invention is for the purpose of describing particular embodiments only and is not intended to be limiting of the application.
It should be noted that, in the embodiments of the present invention, the terms "comprises", "comprising" or any other variation thereof are intended to cover a non-exclusive inclusion, so that a method or apparatus including a series of elements includes not only the explicitly recited elements but also other elements not explicitly listed or inherent to the method or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other related elements in a method or apparatus including the element (e.g., steps in a method or elements in an apparatus, such as a unit may be part of a circuit, part of a processor, part of a program or software, etc.).
Fig. 1 is a flowchart illustrating a parameter callback processing method according to an embodiment of the present invention. Referring to fig. 1, an embodiment of the present invention provides a parameter callback processing method, where the parameter callback processing method includes:
101, when monitoring that a callback response of a third-party application program is received by a client side APP, an SDK (software development kit) exchanges pointer addresses of a first function method outside the SDK and a second function method inside the SDK; wherein the first function method is to receive and parse the callback response outside the SDK.
In the prior art, when a client APP running on an electronic device (such as a mobile phone, an IPAD, a notebook, a desktop, etc.) calls a third party to log in or pay, a callback response of a third party application program needs to be received through a trigger function at the client APP side, and then a parameter of the callback response is transmitted to a software development kit SDK through an interface for processing. For example, for an IOS system, in a file such as appfile, the parameter needs to be returned to the authentication payment IOS-SDK through an interface by a- (bol) application (url) application url (id) application (IOS9 or more) or by a- (bol) application (url) application (url) application (NSString) application (id) authentication (below IOS 9) method, and the parameter for login or payment can be retrieved from the SDK internally by calling back the parameter and performing corresponding processing uniformly.
In the embodiment of the invention, when monitoring that the client APP receives the callback response of the third-party application program, the SDK exchanges pointer addresses of a first function method outside the SDK and a second function method inside the SDK. The first function method is used for receiving and analyzing the callback response outside the SDK, namely the first function method is a trigger function method on the side of the client APP, and the second function method is a method which is set in the SDK and used for receiving and analyzing the callback response.
In an alternative embodiment, 2 trigger functions are called from the runtime method hook to the first function method on the client side APP in the SDK, for example to the file such as appfile. m, - (BOOL) Application (APP) APP options (NSURL) options (NSDic) options (id >) options (IOS9 or above) and- (BOOL) Application (APP) options (NSURL) resource (id) options (IOS9 or below). For convenience of description later, the 2 trigger functions are referred to herein as SEL1 and SEL2, with corresponding pointers being IMP1 and IMP2, respectively; then, two corresponding (BOOL) SDK _ application (application) app options (NSURL) options (NSDictional < Utility _ UrloadingsKey, id >) options and (BOOL) SDK _ application (application) application options (NSURL) url (NSString) resource application (id) annotation function method are written in the SDK, and the third party login or payment callback processing method is written, and the 2 function methods are also called SEL3 and SEL4, and the corresponding pointers are IMP3 and IMP 4.
When the client side APP receives a callback response of the third-party application program, for example, after the client side APP starts the third-party application program, a user inputs authorization information on a login webpage or a program page of the third-party application program, the third-party application program generates the callback response to the client side APP according to the received information, and because the SDK hook reaches a first function method on the client side APP side, the client side APP monitors that the callback response of the third-party application program is received, and pointer addresses of the first function method and a second function method are exchanged through a method swizzle dynamic calling method, for example. Referring to fig. 2, i.e. the pointer of SEL1 is replaced by IMP3 from the original IMP1, the pointer of SEL2 is replaced by IMP4 from the original IMP2, the pointer of SEL3 is replaced by IMP1 from the original IMP3, and the pointer of SEL4 is replaced by IMP2 from the original IMP 4.
And 102, the SDK analyzes the callback response through the second function method to obtain a callback parameter, executes corresponding processing according to the type of the callback parameter, and returns an execution result to the client APP.
Specifically, when receiving a callback response, the client APP triggers the first function method SEL1 or SEL2 to process the callback response, and since the pointer addresses of the first function method and the second function method are already exchanged, the client APP triggers the first function method to process the callback response, and actually triggers the second function method, that is, the SDK analyzes the callback response through the second function method to obtain a callback parameter, executes corresponding processing according to the type of the callback parameter, and returns the execution result to the client APP.
In an optional implementation manner, the SDK analyzes the callback response to obtain a callback parameter, executes a logic judgment process of login authentication when determining that the callback parameter belongs to the login authentication callback, and returns an execution result to the client APP; and when the callback parameter is determined to belong to payment callback, executing a logic judgment flow of payment, and returning an execution result to the client APP.
According to the parameter callback processing method, analysis and processing of callback responses in the SDK are achieved through the dynamic calling method, the client side APP does not need to analyze the callback responses of the third-party application program, code workload of the client side APP is reduced, besides, the callback parameters do not need to be led into the SDK through the client side APP, an SDK packaging interface is simplified, reliability of the SDK on the callback parameters is enhanced, and the processing flow is simplified.
The inventor discovers that in the process of realizing the technical scheme of the embodiment of the invention: the existing method for analyzing the callback response of the third-party SDK by the client APP through the trigger function has the following defects:
if the client side APP is also bound with applications such as third-party sharing, the client side APP analyzes the callback response through the trigger function, and the callback response cannot be identified to be authentication, payment or sharing through any parameter in the trigger function, so that the analyzed parameters can only be transmitted into the authentication payment SDK, and various callback responses can be identified after the parameters are processed through the corresponding analysis function. For example, if the client APP integrates a microblog sharing function, since any parameter in the trigger function cannot distinguish whether the returned response is authentication, payment or sharing, the trigger function can only transfer all the parameters into the SDK and then call the parsing function of the microblog SDK for processing, so that the microblog sharing function can be distinguished. However, the analysis that the client APP alone realizes the microblog sharing cannot be responded, and if the analysis in the SDK judges that the microblog sharing is achieved, the data obtained by the microblog sharing analysis needs to be returned to the client APP in an agent delete mode, so that the function that the client APP alone realizes the microblog sharing is influenced.
In order to overcome the defects of the existing method for analyzing callback response by adopting the trigger function, the invention provides another embodiment parameter callback method. Fig. 3 is a second flowchart illustrating a parameter callback processing method according to a second embodiment of the present invention. Referring to fig. 3, in this embodiment, the parameter callback processing method includes:
step 301, monitoring whether the third-party application program calls the SDK by the SDK, and assigning a platform identifier when determining that the third-party application program calls the SDK; wherein the platform identification is used to characterize a type of the third party application.
In an optional implementation manner, after the client APP is started, the SDK is called to a first function method through a hook script, and the SDK sets a second function method; and the SDK initializes a platform identification and pointer addresses corresponding to the first function method and the second function method.
The first function method is used for receiving and analyzing the callback response outside the SDK, namely the first function method is a trigger function method on the side of the client APP, and the second function method is a method which is set in the SDK and used for receiving and analyzing the callback response. Optionally, the first function method includes at least two first processing methods, which are used for systems corresponding to different versions to meet the requirement of program compatibility.
Optionally, the SDK sets a second function method, including:
the SDK recursively traverses to find the first function method;
when the first function method is found, converting the first processing method in the SDK according to the first processing method included in the found first function method to generate a corresponding number of second processing methods to form a second function method;
and when the first function method is determined not to be found outside the SDK, generating the second function method according to a preset trigger function method inside the SDK.
Through the setting, the fault caused by the default first function method of the client APP when the SDK sets the second function method is avoided, the second function method is generated through the preset trigger function method in the SDK, and the running reliability of the method is enhanced.
At initialization, the platform identifier platform is set to NO, that is, the platform is-1, and the pointer addresses corresponding to the first function method and the second function method are set, such as IMP1 → SEL1, IMP2 → SEL2, IMP3 → SEL3, IMP4 → SEL4 in one example.
And when the SDK monitors that a third-party application program started by the client APP calls the SDK, the platform identification is assigned. In one example, when different API interfaces in the SDK are called, the platform id is assigned according to a predetermined rule, for example, if the platform id is called for the WeChat SDK, the platform id is called for 1, if the platform id is called for the microblog SDK, the platform id is called for 2, and if the platform id is called for the Paibao SDK, the platform id is called for 3. In this manner, the platform identification can characterize the type of the third party application. When the client APP starts applications such as microblog sharing, the third-party webpage is generated directly through the client APP, the SDK does not need to be called, and the platform identification is still in an unassigned state.
Step 302, when monitoring that the client APP receives a callback response of a third-party application program, the SDK calls pointer addresses of a first function method outside the SDK and a second function method inside the SDK, wherein the first function method is used for receiving and analyzing the callback response outside the SDK.
The implementation of step 302 may specifically refer to step 101 described above, and is not described herein again.
Step 303, detecting whether the platform identifier is assigned, if so, executing step 304, otherwise, executing step 305.
And 304, the SDK analyzes the callback response through the second function method to obtain a callback parameter.
When the platform identification is determined to be assigned, the third application calls the SDK, the SDK actively analyzes the callback response through the second function method, the SDK does not need to provide an interface and passively provides for the triggering function of the client side APP to call, the code workload of the client side APP is reduced, and the SDK packaging interface is simplified. And because the parameters are not required to be analyzed by the client APP and are imported into the SDK through the interface, the reliability of the SDK on callback parameters is enhanced, and the processing flow is simplified.
Step 305, restoring the pointer addresses of the first function method and the second function method, and receiving and analyzing the callback response outside the SDK through the first function method.
In an example, if the client side APP starts microblog sharing, the SDK returns the control right to the client side APP for operation because the platform identification is not assigned, so that the client side APP can respond to the analysis of the microblog sharing independently without transmitting the callback parameter, and the data processing flow is simplified.
As can be seen from the above, the parameter callback method of the embodiment implements callback responses such as third login or payment for calling the SDK by the dynamic calling method, and the SDK performs analysis and processing inside the SDK, and returns a processing result to the client APP, thereby reducing code workload and data processing flow of the client APP; in addition, functions such as client APP independent use third party sharing are compatible through judgment of whether the platform identification is assigned or not.
Optionally, in an embodiment, before the SDK monitors that the client APP receives a callback response of the third-party application, the parameter callback processing method further includes:
and when the SDK monitors that the third-party application program exits, restoring the initial value of the platform identifier.
In an example, when the SDK monitors that the client APP enters foreground operation from a background, that is, when the third-party application program exits before callback responses such as authorization are not generated, the initial value of the platform identifier is recovered, that is, the platform identifier platform is set to NO.
Optionally, in an embodiment, after the execution result is returned to the client APP, the parameter callback processing method further includes:
and restoring the initial value of the platform identification and the initial values of the pointer addresses corresponding to the first function method and the second function method.
Fig. 4 is a third schematic flow chart of a parameter callback processing method according to the embodiment of the present invention. Referring to fig. 4, the parameter callback processing method according to the embodiment of the present invention specifically includes:
step 401, the SDK recursively traverses to find a first function method.
Step 402, set the second function method in the SDK.
When the first function method is found, converting the first processing method in the SDK according to the first processing method included in the found first function method to generate a corresponding number of second processing methods to form a second function method;
and when the first function method is determined not to be found outside the SDK, generating the second function method according to a preset trigger function method inside the SDK.
In an alternative embodiment, the SDK finds the SELs 1, SEL2 corresponding to different versions of the system and writes the corresponding SELs 3, SEL4 inside the SDK.
In step 403, parameter settings are initialized.
In an alternative embodiment, at initialization, the platform identifier platform is set to NO, that is, the platform is-1, and the pointer addresses corresponding to the first function method and the second function method are set, such as IMP1 → SEL1, IMP2 → SEL2, IMP3 → SEL3, and IMP4 → SEL4, in an example.
And step 404, when the SDK monitors that the third-party application program started by the client APP calls the SDK, the platform identification is assigned.
And when the SDK monitors that a third-party application program started by the client APP calls the SDK, the platform identification is assigned. In one example, when different API interfaces in the SDK are called, the platform id is assigned according to a predetermined rule, for example, if the platform id is called for the WeChat SDK, the platform id is called for 1, if the platform id is called for the microblog SDK, the platform id is called for 2, and if the platform id is called for the Paibao SDK, the platform id is called for 3. In this manner, the platform identification can characterize the type of the third party application. When the client APP starts the microblog sharing application, the third-party webpage is directly generated through the client APP, and the SDK does not need to be called, so that the platform identification is still in an unassigned state.
Step 405, when the SDK monitors that the third-party application program exits, the initial value of the platform identifier is restored.
In an example, when the SDK monitors that the client APP enters foreground operation from a background, that is, when the third-party application program exits before callback responses such as authorization are not generated, the initial value of the platform identifier is recovered, that is, the platform identifier platform is set to NO.
And 406, when monitoring that the client side APP receives a callback response of the third-party application program, the SDK calls a dynamic exchange method to exchange the pointer addresses of the first function method and the second function method.
In one example, a dynamic call method, such as a method switzling, calls pointer addresses of a first function method and a second function method. The pointer of SEL1 is replaced by IMP3 from the original IMP1, the pointer of SEL2 is replaced by IMP4 from the original IMP2, the pointer of SEL3 is replaced by IMP1 from the original IMP3, and the pointer of SEL4 is replaced by IMP2 from the original IMP 4.
Step 407, judging whether the platform identifier is assigned; if so, step 408 is performed, otherwise, step 410 is performed.
And step 408, the SDK analyzes and processes the callback response through the second function method and returns an execution result to the client APP.
When the platform identification is determined to be assigned, the third application calls the SDK, the SDK actively analyzes the callback response through the second function method, the SDK does not need to provide an interface and passively provides for the triggering function of the client side APP to call, the code workload of the client side APP is reduced, and the SDK packaging interface is simplified. And because the parameters are not required to be analyzed by the client APP and are imported into the SDK through the interface, the reliability of the SDK on callback parameters is enhanced, and the processing flow is simplified.
Step 409, restoring the initial value of the platform identifier and the initial values of the pointer addresses corresponding to the first function method and the second function method.
The platform identification platform is restored to be NO, that is, the platform is-1, the initial values of the pointer addresses corresponding to the first function method and the second function method are restored, IMP1 → SEL1, IMP2 → SEL2, IMP3 → SEL3, and IMP4 → SEL 4.
And 410, restoring the pointer addresses of the first function method and the second function method, and receiving and analyzing the callback response outside the SDK through the first function method.
In an example, if the third-party application started by the client APP is microblog sharing, and the pointer addresses of the first function method and the second function method are restored due to the fact that the platform identifier is not assigned, the SDK will give control back to the client APP to operate, so that the client APP can respond to the analysis of the microblog sharing by independently realizing the analysis, call-back parameters do not need to be transmitted, and the data processing flow is simplified.
An embodiment of the present invention further provides a parameter callback processing apparatus, and referring to fig. 5, the parameter callback processing apparatus includes:
the function swapping module 501 is configured to swap pointer addresses of a first function method outside the SDK and a second function method inside the SDK when the SDK monitors that the client APP receives a callback response of a third-party application; wherein the first function method is used for receiving and parsing the callback response outside the SDK;
and the analysis processing module 502 is configured to analyze the callback response by the SDK through the second function method to obtain a callback parameter, execute corresponding processing according to the type of the callback parameter, and return an execution result to the client APP.
In an optional embodiment, the parsing processing module 502 is configured to parse the callback response by the SDK to obtain a callback parameter, execute a logic determination process of login authentication when determining that the callback parameter belongs to the login authentication callback, and return an execution result to the client APP; and when the callback parameter is determined to belong to payment callback, executing a logic judgment flow of payment, and returning an execution result to the client APP.
Optionally, the parameter callback processing apparatus in this embodiment further includes:
an initialization module (not shown in the figure) for calling the first function method and setting the second function method by the SDK through the hook script; initializing a platform identification and pointer addresses corresponding to the first function method and the second function method.
Optionally, the parameter callback processing apparatus in this embodiment further includes:
an identification module (not shown in the figure) for monitoring whether the third-party application program calls the SDK by the SDK, and assigning a platform identification when determining that the third-party application program calls the SDK; wherein the platform identification is used to characterize a type of the third party application.
Optionally, in the parameter callback processing apparatus in this embodiment, the parsing processing module 502 is configured to, when determining that the platform identifier is assigned, parse the callback response by using the second function method by using the SDK to obtain a callback parameter, execute corresponding processing according to the type of the callback parameter, and return an execution result to the client APP.
Optionally, the parameter callback processing apparatus in this embodiment further includes:
and a callback response module (not shown in the figure) for restoring the pointer addresses of the first function method and the second function method when determining that the platform identifier is not assigned, and receiving and parsing the callback response outside the SDK through the first function method.
Optionally, the parameter callback processing apparatus in this embodiment further includes:
and a first restoring module (not shown in the figure) configured to restore the initial value of the platform identifier when the SDK monitors that the third-party application exits.
Optionally, the parameter callback processing apparatus in this embodiment further includes:
a second restoring module (not shown in the figure), configured to restore the initial value of the platform identifier and the initial values of the pointer addresses corresponding to the first function method and the second function method after the SDK returns the execution result to the client APP.
It should be noted that: in the parameter callback processing apparatus provided in the above embodiment, only the division of each program module is described as an example when performing parameter callback, and in practical applications, the processing may be distributed to different program modules as needed. In addition, the parameter callback processing apparatus and the parameter callback processing method provided in the above embodiments are based on the same design concept, and the implementation process of each program module may refer to the above method embodiments, which are not described herein again.
The embodiment of the invention also provides electronic equipment which can be a smart phone or a tablet computer and the like. Fig. 6 shows only an exemplary structure of the electronic device, not the entire structure, and a part of or the entire structure shown in fig. 6 may be implemented as necessary.
The electronic device 600 provided by the embodiment of the invention comprises: at least one processor 601, memory 602, user interface 603, and at least one network interface 604. The various components in the electronic device 600 are coupled together by a bus system 605. It will be appreciated that the bus system 605 is used to enable communications among the components. The bus system 605 includes a power bus, a control bus, and a status signal bus in addition to a data bus. For clarity of illustration, however, the various buses are labeled as bus system 405 in fig. 6.
The user interface 603 may include a display, a keyboard, a mouse, a track ball, a click wheel, a key, a button, a touch pad, a touch screen, or the like, for performing related input operations and displaying related application interfaces, and the like.
It will be appreciated that the memory 602 can be either volatile memory or nonvolatile memory, and can include both volatile and nonvolatile memory.
The memory 602 in embodiments of the present invention is used to store various types of data to support the execution of the parameter callback processing method. Examples of such data include: any executable program for running on the electronic device 600, such as the executable program 6021, the program implementing the parameter callback processing method of the embodiment of the present invention may be included in the executable program 6021.
The parameter callback processing method disclosed by the embodiment of the invention can be applied to the processor 601 or realized by the processor 601. The processor 601 may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the parameter callback processing method may be implemented by an instruction in the form of hardware, integrated logic circuit, or software in the processor 601. The Processor 601 may be a general purpose Processor, a Digital Signal Processor (DSP), or other programmable logic device, discrete gate or transistor logic device, discrete hardware components, or the like. Processor 601 may implement or perform the methods, steps, and logic blocks disclosed in embodiments of the present invention. A general purpose processor may be a microprocessor or any conventional processor or the like. The steps of the method disclosed by the embodiment of the invention can be directly implemented by a hardware decoding processor, or can be implemented by combining hardware and software modules in the decoding processor. The software module may be located in a storage medium located in the memory 602, and the processor 601 reads the information in the memory 602, and completes the steps of the parameter callback processing method provided by the embodiment of the present invention in combination with the hardware thereof.
An embodiment of the present invention further provides a readable storage medium, where the storage medium may include: various media that can store program codes, such as a removable Memory device, a Random Access Memory (RAM), a Read-Only Memory (ROM), a magnetic disk, and an optical disk. The readable storage medium stores an executable program; the executable program is used for realizing the parameter callback processing method in any embodiment of the invention when being executed by the processor.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, embodiments of the present invention may take the form of a hardware embodiment, a software embodiment, or an embodiment combining software and hardware aspects. Furthermore, embodiments of the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, optical storage, and the like) having computer-usable program code embodied therein.
Embodiments of the present invention are described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing system to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing system, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing system to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing system to cause a series of operational steps to be performed on the computer or other programmable system to produce a computer implemented process such that the instructions which execute on the computer or other programmable system provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
The above description is only for the specific embodiments of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present invention, and all the changes or substitutions should be covered within the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the appended claims.

Claims (9)

1. A method for parameter callback processing, comprising:
the SDK monitors whether a third-party application program calls the SDK or not, and assigns a platform identifier when the third-party application program calls the SDK; wherein the platform identification is used to characterize a type of the third-party application;
when monitoring that a callback response of a third-party application program is received by a client side APP, the SDK calls pointer addresses of a first function method outside the SDK and a second function method inside the SDK; wherein the first function method is used for receiving and parsing the callback response outside the SDK;
and when the platform identification is determined to be assigned, the SDK analyzes the callback response through the second function method to obtain a callback parameter, executes corresponding processing according to the type of the callback parameter, and returns an execution result to the client APP.
2. The parameter callback processing method of claim 1, wherein the method further comprises:
and when the platform identification is determined not to be assigned, restoring the pointer addresses of the first function method and the second function method, and receiving and analyzing the callback response outside the SDK through the first function method.
3. The parameter callback processing method of claim 1, wherein before the SDK monitors that the client APP receives the callback response of the third-party application, further comprising:
the SDK calls the first function method through a hook script, and the SDK sets a second function method;
and the SDK initializes the platform identification and the pointer address corresponding to the first function method and the second function method.
4. The parameter callback processing method of claim 1, wherein before the SDK monitors that the client APP receives the callback response of the third-party application, further comprising:
and when the SDK monitors that the third-party application program exits, restoring the initial value of the platform identifier.
5. The parameter callback processing method according to claim 1, wherein after returning the execution result to the client APP, further comprising:
and restoring the initial value of the platform identification and the initial values of the pointer addresses corresponding to the first function method and the second function method.
6. The parameter callback processing method according to claim 3, wherein the first function method includes at least two first processing methods for systems corresponding to different versions, and the SDK sets a second function method including:
the SDK recursively traverses to find the first function method;
when the first function method is found, converting the first processing method in the SDK according to the first processing method included in the found first function method to generate a corresponding number of second processing methods to form a second function method;
and when the first function method is determined not to be found outside the SDK, generating the second function method according to a preset trigger function method inside the SDK.
7. A parameter callback processing apparatus, comprising:
the identification module is used for monitoring whether a third-party application program calls the SDK or not by the SDK and assigning a platform identification when the third-party application program calls the SDK; wherein the platform identification is used to characterize a type of the third-party application;
the function exchanging module is used for exchanging pointer addresses of a first function method outside the SDK and a second function method inside the SDK when the SDK monitors that a client APP receives a callback response of a third-party application program; wherein the first function method is used for receiving and parsing the callback response outside the SDK;
and the analysis processing module is used for analyzing the callback response by the SDK through the second function method to obtain a callback parameter when the platform identifier is assigned, executing corresponding processing according to the type of the callback parameter, and returning an execution result to the client APP.
8. An electronic device, comprising:
a memory for storing an executable program;
a processor, configured to implement the parameter callback processing method according to any one of claims 1 to 6 when executing the executable program stored in the memory.
9. A computer storage medium storing an executable program which, when executed by a processor, implements the parameter callback processing method as claimed in any one of claims 1 to 6.
CN201811279981.2A 2018-10-30 2018-10-30 Parameter callback processing method and device, electronic equipment and storage medium Active CN109522021B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811279981.2A CN109522021B (en) 2018-10-30 2018-10-30 Parameter callback processing method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811279981.2A CN109522021B (en) 2018-10-30 2018-10-30 Parameter callback processing method and device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN109522021A CN109522021A (en) 2019-03-26
CN109522021B true CN109522021B (en) 2022-03-25

Family

ID=65772732

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811279981.2A Active CN109522021B (en) 2018-10-30 2018-10-30 Parameter callback processing method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN109522021B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110377383B (en) * 2019-07-02 2023-02-03 上海上湖信息技术有限公司 Method, device and storage medium for checking performance parameters of application software
CN111309407B (en) * 2020-02-21 2023-07-11 咪咕文化科技有限公司 Processing method and device for integrated third party library
CN112764729B (en) * 2021-01-08 2024-02-06 深圳依时货拉拉科技有限公司 Application software development method, device, computer equipment and readable storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103942093A (en) * 2013-01-23 2014-07-23 阿里巴巴集团控股有限公司 Service processing method and system
CN106325847A (en) * 2015-07-02 2017-01-11 杭州海康机器人技术有限公司 Method and device for obtaining application functions based on iOS platform
CN107463359A (en) * 2016-06-02 2017-12-12 深圳市慧动创想科技有限公司 A kind of convenient method in iOS ipa bag code implants
CN107885982A (en) * 2017-09-29 2018-04-06 五八有限公司 Log in control process method and terminal

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9483283B1 (en) * 2014-11-20 2016-11-01 Apptimize, Inc. Enhanced code callback

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103942093A (en) * 2013-01-23 2014-07-23 阿里巴巴集团控股有限公司 Service processing method and system
CN106325847A (en) * 2015-07-02 2017-01-11 杭州海康机器人技术有限公司 Method and device for obtaining application functions based on iOS platform
CN107463359A (en) * 2016-06-02 2017-12-12 深圳市慧动创想科技有限公司 A kind of convenient method in iOS ipa bag code implants
CN107885982A (en) * 2017-09-29 2018-04-06 五八有限公司 Log in control process method and terminal

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
"(方法调配)Method Swizzling";weixin_30768661;《CSDN博客 公开网址:https://blog.csdn.net/weixin_30768661/article/details/99201456》;20150908;1-4 *

Also Published As

Publication number Publication date
CN109522021A (en) 2019-03-26

Similar Documents

Publication Publication Date Title
CN109325195B (en) Rendering method and system for browser, computer device and computer storage medium
US10298469B2 (en) Automatic asynchronous handoff identification
CN109522021B (en) Parameter callback processing method and device, electronic equipment and storage medium
CN105718313A (en) Application operation method and device
US10084637B2 (en) Automatic task tracking
US9535666B2 (en) Dynamic agent delivery
CN104756080A (en) Augmenting capabilities of a host device
CN109787959B (en) Account information processing method and related device
US20170147462A1 (en) Agent dynamic service
CN110007936B (en) Data processing method and device
CN109218393B (en) Push implementation method, device, equipment and computer storage medium
CN111124668A (en) Memory release method and device, storage medium and terminal
CN111259382A (en) Malicious behavior identification method, device and system and storage medium
US9916391B2 (en) Method, apparatus and terminal for webpage content browsing
CN114490266A (en) Data acquisition method, device, equipment and storage medium
CN110262856B (en) Application program data acquisition method, device, terminal and storage medium
US10165074B2 (en) Asynchronous custom exit points
CN111885152B (en) Promotion information processing method, electronic device and computer-readable storage medium
US9838488B2 (en) Agent asynchronous transaction monitor
CN111124627A (en) Method, device, terminal and storage medium for determining application program caller
CN110737911A (en) Data processing method, device and computer readable storage medium
CN109783329B (en) Application program blank data prompting method and system and terminal equipment
CN104834432A (en) Terminal
CN104834443A (en) Interface management method
US20160119199A1 (en) Reporting page composition data

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