CN111367590A - Interrupt event processing method and device - Google Patents

Interrupt event processing method and device Download PDF

Info

Publication number
CN111367590A
CN111367590A CN202010123846.XA CN202010123846A CN111367590A CN 111367590 A CN111367590 A CN 111367590A CN 202010123846 A CN202010123846 A CN 202010123846A CN 111367590 A CN111367590 A CN 111367590A
Authority
CN
China
Prior art keywords
jump
annotation
program
processing
event
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010123846.XA
Other languages
Chinese (zh)
Inventor
邓振宇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing ByteDance Network Technology Co Ltd
Original Assignee
Beijing ByteDance Network 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 Beijing ByteDance Network Technology Co Ltd filed Critical Beijing ByteDance Network Technology Co Ltd
Priority to CN202010123846.XA priority Critical patent/CN111367590A/en
Publication of CN111367590A publication Critical patent/CN111367590A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/448Execution paradigms, e.g. implementations of programming paradigms
    • G06F9/4482Procedural
    • G06F9/4484Executing subprograms
    • G06F9/4486Formation of subprogram jump address

Abstract

The present disclosure provides an interrupt event processing method, apparatus, and computer-readable recording medium. The interrupt event processing method comprises the following steps: injecting an annotation processing class corresponding to an annotation created according to a jump interruption event into a program being executed by referring the annotation to an occurrence position of the jump interruption event in the program; and processing logic corresponding to the jump interruption event using the corresponding annotation processing class to continue execution of the program interrupted by the operation corresponding to the jump interruption event.

Description

Interrupt event processing method and device
Technical Field
The present disclosure relates to the field of software technologies, and in particular, to an interrupt event processing method and apparatus for continuing to execute a program after a jump interrupt, an electronic device and a computer-readable recording medium for implementing the program.
Background
The existing scheme for continuing to execute the program after the jump interruption generally records the operation to be executed when a page is jumped, realizes jump interception by using a startActityForResult method, requires the jump intercepted page to return the result to the current page, then obtains the jump interception result in an ActityResult method, and executes the operation which is interrupted before according to the obtained result.
However, the above scheme is complicated in process, and if there are a plurality of jump interception operations on the current page, the judgment logic in the onActivityResult method is very complex. For example, when a user clicks on an operation in an APP, it is necessary to determine whether the user has logged into an account, purchased VIP, performed risk assessment, etc., and the complexity of the decision logic increases exponentially, not to mention the priority of handling these cases. Each time a logic needing to be judged is added, a corresponding processing code needs to be added to a corresponding page, if one code needs to be modified, other codes need to be modified, and great difficulty is brought to a program developer to maintain a program.
Disclosure of Invention
This summary is provided to introduce a selection of concepts in a simplified form that are further described below in the detailed description. This summary is not intended to identify key features or essential features of the claimed subject matter, nor is it intended to be used to limit the scope of the claimed subject matter.
An exemplary embodiment of the present disclosure is to provide an interrupt event processing method and apparatus thereof to improve program development efficiency of a program developer and to avoid time for the program developer to maintain program codes while continuing to execute a program after resolving a jump interrupt.
An aspect of the present disclosure is to provide an interrupt event processing method, including: injecting an annotation processing class corresponding to an annotation created according to a jump interruption event into a program being executed by referring the annotation to an occurrence position of the jump interruption event in the program; and processing logic corresponding to the jump interruption event using the corresponding annotation processing class to continue execution of the program interrupted by the operation corresponding to the jump interruption event.
Another aspect of the present disclosure is to provide an interrupt event processing apparatus, including: a jump interruption module configured to inject an annotation processing class corresponding to an annotation created according to a jump interruption event into a program being executed by referring the annotation to an occurrence position of the jump interruption event in the program; and an execution module configured to process logic corresponding to the jump interruption event using the corresponding annotation processing class to continue executing the program interrupted by the operation corresponding to the jump interruption event.
Another aspect of the present disclosure is to provide an electronic device including a memory for storing a program; and one or more processors, wherein when the program is executed, the one or more processors perform the above-described interrupt event processing method.
Another aspect of the present disclosure is to provide a computer-readable recording medium having stored thereon computer-executable instructions that, when executed, perform the above-described interrupt event processing method.
Additional aspects and/or advantages of the present general inventive concept will be set forth in part in the description which follows and, in part, will be obvious from the description, or may be learned by practice of the general inventive concept.
Drawings
The above and other features, advantages and aspects of various embodiments of the present disclosure will become more apparent by referring to the following detailed description when taken in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numbers refer to the same or similar elements. It should be understood that the drawings are schematic, that elements and features are not necessarily drawn to scale, and that:
FIG. 1 illustrates a flow diagram of an interrupt event processing method according to an exemplary embodiment of the present disclosure;
FIG. 2 illustrates a block diagram of an interrupt event processing apparatus according to an exemplary embodiment of the present disclosure;
fig. 3 shows a block diagram of an electronic device according to an exemplary embodiment of the present disclosure.
Detailed Description
Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While certain embodiments of the present disclosure are shown in the drawings, it is to be understood that the present disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein, but rather are provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the disclosure are for illustration purposes only and are not intended to limit the scope of the disclosure.
It should be understood that the various steps recited in the method embodiments of the present disclosure may be performed in a different order, and/or performed in parallel. Moreover, method embodiments may include additional steps and/or omit performing the illustrated steps. The scope of the present disclosure is not limited in this respect.
The term "include" and variations thereof as used herein are open-ended, i.e., "including but not limited to". The term "based on" is "based, at least in part, on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Relevant definitions for other terms will be given in the following description.
It is noted that references to "a", "an", and "the" modifications in this disclosure are intended to be illustrative rather than limiting, and that those skilled in the art will recognize that "one or more" may be used unless the context clearly dictates otherwise.
It should be noted that the terms "first", "second", and the like in the present disclosure are only used for distinguishing different devices, modules or units, and are not used for limiting the order or interdependence relationship of the functions performed by the devices, modules or units.
The names of messages or information exchanged between devices in the embodiments of the present disclosure are for illustrative purposes only, and are not intended to limit the scope of the messages or information.
The continuous execution after the jump interruption means that after the user operation is interrupted by an operation such as a jump interruption event (for example, it is determined whether the user logs in an account), the interrupted operation is continuously executed after the corresponding condition is satisfied. For example: an application starts to allow a user to browse in the identity of a tourist, when the user clicks certain operations, the login state of the user needs to be judged, if the user logs in an account, corresponding operations are executed, if the user does not log in the account, the user jumps to a login page to perform login operations, and after the login is completed, the previous operations are continuously executed.
Hereinafter, according to various embodiments of the present disclosure, a method and an apparatus of the present disclosure will be described with reference to the accompanying drawings.
Fig. 1 illustrates a flowchart of an interrupt event processing method according to an exemplary embodiment of the present disclosure.
Referring to fig. 1, in step S101, an annotation processing class corresponding to an annotation is injected into a program being executed by referring the annotation created according to a jump interruption event to an occurrence position of the jump interruption event in the program. The skip interruption event may include at least one of determining whether the user logs in to an account, determining whether the user binds to a phone number, determining whether the user has an authority, determining whether the user is a VIP, determining whether the user is authenticated by real name, and determining whether to perform a risk assessment. However, the present disclosure is not so limited and other jump interruption events may be added according to customer requirements.
For each jump interruption event, each jump interruption event may be abstracted into an annotation. Taking as an example a jump interruption event to determine whether a user is logged into an account, first an annotation, RequireLogin, is established regarding the login. For example, annotations that need to be logged can be established as follows:
@Retention(AnnotationRetention.RUNTIME)
annotation class RequireLogin(val proceed:Boolean=true)。
an annotation processing class is then established with respect to the login annotation. When executing the function needing to log in the annotation mark, the logic in the log-in annotation processing class is executed, whether the user logs in the account or not can be judged in the log-in annotation processing class, if the user logs in the account, the method of the function is continuously executed, and if the user does not log in the account, the log-in page is called. For example, an annotation handling class for a login annotation may be established as follows:
Figure BDA0002393813100000041
for other jump interruption events, the corresponding annotation and annotation processing class may be established in the above manner, however, the above manner of establishing the annotation and annotation processing class is only exemplary, and the disclosure is not limited thereto.
As an example, after the login annotation and the login annotation handling class are established, the logic of the login annotation handling class may be directly injected by the @ login annotation at the location where it needs to verify whether the user is logged in to the account. For example, the login annotation handling class may be injected into the executive in the following manner:
@ RequireLogin (showDialog true, dialogDesc true after Login')
private fun clickFollow(data:LiveSquareFeed){
}. However, the above examples are merely exemplary, and the present disclosure is not limited thereto.
In the present disclosure, the plurality of annotations may be dynamically arranged according to the occurrence order of the jump interruption event. For example, assume that when a user purchases a product, it is necessary to verify whether the user is logged into an account, bound to a cell phone number, and has rights to the corresponding product. According to the method and the device, three conditions of whether the user logs in the account, whether the user is bound with the mobile phone number and whether the user has the right of the corresponding product can be abstracted into three notes, and then the established notes can be combined randomly to finish the logic processing and judgment of the three conditions. For example, the above three annotations may be combined/arranged in the following way:
@RequireLogin;
@RequirePhone;
@RequireProductUnable
fun createPurchaseOrder(itemId:String,productId:String){
},
wherein, requireLogin represents the annotation about login, requirePhone represents the annotation about binding mobile phone number, and requireProductUnable represents the annotation about product authority. However, the above examples are merely exemplary, and the present disclosure is not limited thereto.
When the sequence of the jump interruption event is changed, only the sequence of the corresponding annotation needs to be changed. When other jump interruption events are needed, the annotation of the needed jump interruption events can be established, and then the newly established annotation is referred to the executive program according to the mode. For example, when a user wants to comment on news in an application and the application requires the user to log in and perform real-name authentication, a log-in annotation requireLogin and a real-name authentication annotation requireAuth can be established to realize jump interception requiring log-in and real-name authentication. When a user watches VIP content in video software and the video software requires that the user is a VIP and real-name authentication is carried out, a VIP annotation RequireVip and a real-name authentication annotation RequireAuth can be established to realize jump interception which is required to be used as the VIP and the real-name authentication, so that a corresponding annotation processing class is injected to a calling position.
The method disclosed by the invention depends on the annotation, and only one line of annotation is added to the method for judging the skip interruption, so that the access is simple.
In step S102, the logic corresponding to the jump interruption event is processed using the corresponding annotation processing class to continue executing the execution program interrupted by the operation corresponding to the jump interruption event. If it is desired to process the associated logic after the jump interruption is implemented and then to continue the operation before the jump interruption, it is possible to judge how to operate thereafter only after the processing result of the associated logic is obtained.
In the prior art, a page for a jump interruption event (such as a landing page) is an independent functional module, requiring interfacing with multiple calling methods. A uniform notification approach is typically employed. For example, the notification of the processing result may adopt three modes of startactiveforresult mode, message notification mechanism based on observer mode and broadcast.
The annotation processing class is a dynamically added logical block that cannot register for a broadcast, i.e., receive no broadcast message, because it has no context information. Likewise, since there is no context information, the observer pattern based messaging mechanism has no opportunity to register and de-register, and forced registration may risk memory leaks, leading to oom errors. Therefore, in the present disclosure, a startActivityForResult mode may be employed to start a page of a jump interruption event, and when the page returns, the return result is processed in the onaactivityResult. However, this has the following problems: the state during calling must be recorded, and then the processing result is transmitted to the place needing processing layer by layer; all return logic is handled while executing the onactive result of the main page, which makes the processing logic very complex if there are multiple return logics and interdependent. It follows that the problem with the onactive result is the logical separation of the call and the processing, while the logic of the processing is entirely in the onactive result. This results in bulky processing logic, distributed code logic, and is not easy to understand, and is not easy to maintain and expand.
According to the embodiment of the disclosure, the corresponding annotation processing class can be used for determining the processing result of the corresponding jump interruption event, and when the processing result meets the preset condition, the execution program interrupted by the operation corresponding to the jump interruption event is continuously executed. And when the processing result does not meet the preset condition, starting a method corresponding to the jump interruption event by using the fragment without the page and calling back the processing result of the method. Here, the pageless fragment mainly includes a startactiveforresult method and an onactiveresult method to implement a page to start a jump interruption event and to receive a result of processing the jump interruption event, respectively. The fragment has a mCallbacks, stores the corresponding relation of the requestCode and the callback, and then finds the same-name method startActivityForResult, namely only two lines of codes are used: 1. storing a callback; 2. calling the fragment's startActivityForResult can be realized. The onActivityResult method of fragment acquires a callback corresponding to the requestCode from the mCallbacks, and calls the onActivityResult method of the callback. When the current page executes the actionResult method, the actionResult method of fragment is automatically executed, and thus the logic processing is completed.
Taking whether the user logs in the account as an example, in the login annotation processing class, whether the user logs in the account can be judged, if the user logs in the account, the subsequent operation is continuously executed, if the user does not log in the account, the login page can be started through fragment without the page, and after the user logs in successfully, the login annotation processing class is notified to continuously execute the interrupted logic.
In addition, for fragment without page, it is necessary to establish a management class for maintaining fragment, call a method in fragment for starting corresponding to the jump interruption event by calling a method in management class for starting corresponding to the jump interruption event, and call back a processing result of the method corresponding to the jump interruption event to an execution program according to a callback function in fragment. For example, the management class aviidcallbackmanager has an aviidcallbackfragment stored therein, and the fragment is initialized first when the fragment is initialized. When the fragment exists in the target page, the fragment can be used directly, and when the fragment does not exist in the target page, a new AvoidCallbackFragment can be added to the target page through the fragment manager in the management class AvoidCallbackManager. When the startForResult method of the management class AvoidCalkmanager is called and the login page is started, the corresponding method of the AvoidCallbackFragment is called. A callback exists in the parameters in the corresponding method of the Avoid CallbackFragment, and the callback can realize the callback which is required to be called after the jump interrupt processing is completed and enables the program to continue to execute. In this way, the execution of both calls and callbacks can be handled centrally in the management class AvoidCallbackManager.
The present disclosure does not use fragments to expose pages, only uses the properties of fragments' lifecycle to simplify the invocation of code.
Fig. 2 illustrates a block diagram of an interrupt event processing apparatus according to an exemplary embodiment of the present disclosure. Referring to fig. 2, the interrupt event processing apparatus 200 may include a jump interrupt module 201 and an execution module 202.
The jump interruption module 201 is configured to inject an annotation processing class corresponding to an annotation created according to a jump interruption event into a program being executed by referring the annotation to an occurrence position of the jump interruption event in the program. The skip interruption event may include at least one of determining whether the user logs in to an account, determining whether the user binds to a phone number, determining whether the user has an authority, determining whether the user is a VIP, determining whether the user is authenticated by real name, and determining whether to perform a risk assessment. However, the present disclosure is not so limited and other jump interruption events may be added according to customer requirements.
For example, when a user login is required, an annotation RequireLogin may be created for the login, and then an annotation processing class may be created for the login annotation. When executing the function needing to log in the annotation mark, the logic in the log-in annotation processing class is executed, whether the user logs in the account or not can be judged in the log-in annotation processing class, if the user logs in the account, the method of the function is continuously executed, and if the user does not log in the account, the log-in page is called. For other jump interruption events, the annotation of the corresponding jump interruption event and the annotation processing class can be established according to the logic of the corresponding jump interruption event.
As an example, after the login annotation and the login annotation handling class are established, the jump interruption module 201 is configured to directly inject the logic of the login annotation handling class by @ login annotation at a location where it is required to verify whether the user is logged into the account.
In the present disclosure, the plurality of annotations may also be dynamically arranged according to the occurrence order of the jump interruption event. Jump interruption module 201 may sequentially reference respective annotations to inject logic of respective annotation processing classes according to an order of arrangement of the plurality of annotations. For example, assume that when a user purchases a product, it is necessary to verify whether the user is logged into an account, bound to a cell phone number, and has rights to the corresponding product. At this time, an annotation and an annotation processing class are respectively established for three conditions of verifying whether the user logs in the account, whether the user is bound with the mobile phone number and whether the user has the authority of the corresponding product. Then, the created annotations may be arbitrarily combined and arranged, so that the jump interruption module 201 may invoke the logic processing and judgment of the above three cases according to the sequence of the combined and arranged annotations.
When the sequence of the jump interruption event is changed, only the sequence of the corresponding annotation needs to be changed. When other jump interruption events are needed, the annotation of the needed jump interruption event can be established, and then the newly established annotation is referred to the execution program by using the jump interruption module 201 according to the above mode.
The execution module 202 may be configured to process logic corresponding to the jump interruption event using the corresponding annotation processing class to continue execution of the execution program interrupted by the operation corresponding to the jump interruption event. Specifically, the execution module 202 may be configured to determine a processing result of the corresponding jump interruption event using the corresponding annotation processing class, and when the processing result satisfies a preset condition, continue to execute the execution program interrupted by the operation corresponding to the jump interruption event. And when the processing result does not meet the preset condition, starting a method corresponding to the jump interruption event by using the fragment without the page and calling back the processing result of the method. Here, the pageless fragment mainly includes a startactiveforresult method and an onactiveresult method to implement a page to start a jump interruption event and to receive a result of processing the jump interruption event, respectively.
Taking as an example the determination of whether the user is logged into an account, the execution module 202 may be configured to use the login annotation processing class to determine whether the user has logged into an account, if the user has logged into an account, continue to perform subsequent operations, if the user has not logged into an account, the login page may be launched by calling a no-page fragment, notify the login annotation processing class after the user has logged into successfully to continue to execute the interrupted logic.
For the pageless fragment, after the management class for maintaining the pageless fragment is established, the execution module 202 calls the method corresponding to the jump interruption event in the fragment by calling the method corresponding to the jump interruption event in the management class for maintaining the pageless fragment, and calls the processing result of the method corresponding to the jump interruption event back to the execution program according to the callback function in the fragment.
The method adds a fragment without a page to a current page, hosts and starts login operation, calls a startActivityForResult method by the fragment, and calls the onActiviyResult method of the fragment when calling the onActivityResult method of the current page. Thus, when starting the page of the jump interruption event, the callback of the jump interruption result is all carried out in the fragment, therefore, when generating the fragment in the annotation processing class, the callback of the jump interruption result is transmitted to the fragment, and when the onactive result method is executed, the callback is executed, thereby continuing to execute the interrupted operation.
Fig. 3 shows a block diagram of an electronic device according to an exemplary embodiment of the present disclosure.
Referring now to FIG. 3, a block diagram of an electronic device 300 suitable for use in implementing embodiments of the present disclosure is shown. The electronic devices in the embodiments of the present disclosure may include, but are not limited to, mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., car navigation terminals), and the like, and fixed terminals such as digital TVs, desktop computers, and the like. The electronic device shown in fig. 3 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
As shown in fig. 3, the electronic device 300 may include a processing means (e.g., a central processing unit, a graphics processor, etc.) 301 that may perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)302 or a program loaded from a storage means 308 into a Random Access Memory (RAM) 303. In the RAM 303, various programs and data necessary for the operation of the electronic apparatus 300 are also stored. The processing device 301, the ROM 302, and the RAM 303 are connected to each other via a bus 304. An input/output (I/O) interface 305 is also connected to bus 304.
Generally, the following devices may be connected to the I/O interface 305: input devices 306 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; an output device 307 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage devices 308 including, for example, magnetic tape, hard disk, etc.; and a communication device 309. The communication means 309 may allow the electronic device 300 to communicate wirelessly or by wire with other devices to exchange data. While fig. 3 illustrates an electronic device 300 having various means, it is to be understood that not all illustrated means are required to be implemented or provided. More or fewer devices may alternatively be implemented or provided.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program carried on a non-transitory computer readable medium, the computer program containing program code for performing the method illustrated by the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication means 309, or installed from the storage means 308, or installed from the ROM 302. The computer program, when executed by the processing device 301, performs the above-described functions defined in the methods of the embodiments of the present disclosure.
It should be noted that the computer readable medium in the present disclosure can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In contrast, in the present disclosure, a computer readable signal medium may comprise a propagated data signal with computer readable program code embodied therein, either in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, RF (radio frequency), etc., or any suitable combination of the foregoing.
In some embodiments, the clients, servers may communicate using any currently known or future developed network protocol, such as HTTP (HyperText transfer protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communications network). Examples of communication networks include a Local Area Network (LAN), a Wide Area Network (WAN), the internet (e.g., the internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed network.
The computer readable medium may be embodied in the electronic device; or may exist separately without being assembled into the electronic device.
The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: acquiring at least two internet protocol addresses; sending a node evaluation request comprising the at least two internet protocol addresses to node evaluation equipment, wherein the node evaluation equipment selects the internet protocol addresses from the at least two internet protocol addresses and returns the internet protocol addresses; receiving an internet protocol address returned by the node evaluation equipment; wherein the obtained internet protocol address indicates an edge node in the content distribution network.
Alternatively, the computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: receiving a node evaluation request comprising at least two internet protocol addresses; selecting an internet protocol address from the at least two internet protocol addresses; returning the selected internet protocol address; wherein the received internet protocol address indicates an edge node in the content distribution network.
Computer program code for carrying out operations for the present disclosure may be written in any combination of one or more programming languages, including but not limited to an object oriented programming language such as Java, Smalltalk, C + +, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present disclosure may be implemented by software or hardware. Where the name of a unit does not in some cases constitute a limitation of the unit itself, for example, the first retrieving unit may also be described as a "unit for retrieving at least two internet protocol addresses".
The functions described herein above may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), systems on a chip (SOCs), Complex Programmable Logic Devices (CPLDs), and the like.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
The method and apparatus for continuing to execute a program after a jump interruption according to an exemplary embodiment of the present disclosure have been described above with reference to fig. 1 to 3. However, it should be understood that the apparatus and its units shown in fig. 2 may be respectively configured as software, hardware, firmware or any combination thereof to perform a specific function, the electronic device shown in fig. 3 is not limited to include the above-illustrated components, but some components may be added or deleted as needed, and the above components may also be combined.
According to one or more embodiments of the present disclosure, there is provided an interrupt event processing method including: injecting an annotation processing class corresponding to an annotation created according to a jump interruption event into a program being executed by referring the annotation to an occurrence position of the jump interruption event in the program; and processing logic corresponding to the jump interruption event using a corresponding annotation processing class to continue execution of the program interrupted by the operation corresponding to the jump interruption event.
According to one or more embodiments of the present disclosure, the step of processing logic corresponding to the jump interruption event using a corresponding annotation processing class may include: determining a processing result of the corresponding jump interruption event using the corresponding annotation processing class; when the processing result meets a preset condition, continuing to execute the program interrupted by the operation corresponding to the jump interruption event; and when the processing result does not meet the preset condition, starting a method corresponding to the jump interruption event by using the fragment without the page and calling back the processing result of the method.
According to one or more embodiments of the present disclosure, the method for continuing to execute a program after jumping to an interrupt may further include: calling a method in the fragment for starting the method corresponding to the jump interruption event by calling a method in a management class for maintaining the fragment for starting the method corresponding to the jump interruption event; and calling back the processing result of the method corresponding to the jump interruption event to the program according to the callback function in the fragment.
According to one or more embodiments of the present disclosure, at least one of the annotations may be dynamically arranged according to an occurrence order of the jump interruption events.
According to one or more embodiments of the present disclosure, the skip interruption event may include at least one of determining whether a user logs in an account, determining whether the user binds a mobile phone number, determining whether the user has an authority, determining whether the user is a VIP, determining whether the user is authenticated by real name, and determining whether to perform risk assessment.
According to one or more embodiments of the present disclosure, there is provided an interrupt event processing apparatus including a jump interrupt module for injecting an annotation processing class corresponding to an annotation created according to a jump interrupt event into a program being executed by referring to the annotation to an occurrence position of the jump interrupt event in the program; and an execution module for processing the logic corresponding to the jump interruption event using the corresponding annotation processing class to continue executing the program interrupted by the operation corresponding to the jump interruption event.
According to one or more embodiments of the present disclosure, the execution module is configured to determine a processing result of a corresponding jump interruption event using a corresponding annotation processing class, when the processing result satisfies a preset condition, continue to execute the program interrupted by the operation corresponding to the jump interruption event, and when the processing result does not satisfy the preset condition, start a method corresponding to the jump interruption event using a fragment without page and call back a processing result of the method.
According to one or more embodiments of the present disclosure, the execution module is configured to call a method in the fragment for starting the method corresponding to the jump interruption event by calling a method in the management class for maintaining the fragment for starting the method corresponding to the jump interruption event, and call back a processing result of the method corresponding to the jump interruption event to the program according to a callback function in the fragment.
According to one or more embodiments of the present disclosure, there is provided an electronic device including a memory for storing a program; and one or more processors, wherein when the program is executed, the one or more processors perform a method of continuing to execute the program after the jump interruption.
According to one or more embodiments of the present disclosure, there is provided a computer-readable recording medium having stored thereon computer-executable instructions that, when executed, perform a method of continuing to execute a program after the above-described jump interruption.
The method aims to solve the problems that the existing scheme for continuously executing the program after the jump interruption is complex in implementation, complex in code logic, difficult to maintain, serious in code coupling and inconvenient to transplant and expand, adopts a tangent plane-oriented mode, depends on annotations, completes complex interruption logic processing through dynamic combination of a plurality of annotations, and integrates processing callback and called logic through a pageless fragment, so that the processing logic is uniformly managed in functions corresponding to the annotations, and the program maintenance is convenient.
The foregoing description is only exemplary of the preferred embodiments of the disclosure and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the disclosure herein is not limited to the particular combination of features described above, but also encompasses other embodiments in which any combination of the features described above or their equivalents does not depart from the spirit of the disclosure. For example, the above features and (but not limited to) the features disclosed in this disclosure having similar functions are replaced with each other to form the technical solution.
Further, while operations are depicted in a particular order, this should not be understood as requiring that such operations be performed in the particular order shown or in sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Likewise, while several specific implementation details are included in the above discussion, these should not be construed as limitations on the scope of the disclosure. Certain features that are described in the context of separate embodiments can also be implemented in combination in a single embodiment. Conversely, various features that are described in the context of a single embodiment can also be implemented in multiple embodiments separately or in any suitable subcombination.
Although the subject matter has been described in language specific to structural features and/or methodological acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are disclosed as example forms of implementing the claims.

Claims (8)

1. A method of interrupt event processing, the method comprising:
injecting an annotation processing class corresponding to an annotation created according to a jump interruption event into a program being executed by referring the annotation to an occurrence position of the jump interruption event in the program; and is
Processing logic corresponding to the jump interrupt event using the corresponding annotation processing class to continue execution of the program interrupted by the operation corresponding to the jump interrupt event.
2. The method of claim 1, wherein processing logic corresponding to the jump interruption event using the corresponding annotation processing class comprises:
determining a processing result of a corresponding jump interruption event using the corresponding annotation processing class;
when the processing result meets a preset condition, continuing to execute the program interrupted by the operation corresponding to the jump interruption event;
and when the processing result does not meet the preset condition, starting a method corresponding to the jump interruption event by using the fragment without the page and calling back the processing result of the method.
3. The method of claim 2, wherein the method further comprises:
calling a method in the fragment for starting the method corresponding to the jump interruption event by calling a method in a management class for maintaining the fragment for starting the method corresponding to the jump interruption event;
and calling back the processing result of the method corresponding to the jump interruption event to the program according to the callback function in the fragment.
4. The method of claim 1, wherein at least one of the annotations is dynamically arranged according to an order of occurrence of the jump interruption events.
5. The method of claim 1, wherein the jump interruption event comprises at least one of determining whether a user logs into an account, determining whether a user binds a phone number, determining whether a user has rights, determining whether a user is a VIP, determining whether a user is authenticated by real name, and determining whether to perform a risk assessment.
6. An interrupt event processing apparatus, the apparatus comprising:
a jump interruption module configured to inject an annotation processing class corresponding to an annotation created according to a jump interruption event into a program being executed by referring the annotation to an occurrence position of the jump interruption event in the program;
an execution module configured to process logic corresponding to the jump interrupt event using the corresponding annotation processing class to continue execution of the program interrupted by the operation corresponding to the jump interrupt event.
7. An electronic device, comprising:
a memory for storing a program; and
one or more processors for performing one or more of the above-described operations,
wherein the one or more processors perform the method of any one of claims 1 to 5 when the program is run.
8. A computer-readable recording medium having stored thereon computer-executable instructions that, when executed, perform the method of any one of claims 1 to 5.
CN202010123846.XA 2020-02-27 2020-02-27 Interrupt event processing method and device Pending CN111367590A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010123846.XA CN111367590A (en) 2020-02-27 2020-02-27 Interrupt event processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010123846.XA CN111367590A (en) 2020-02-27 2020-02-27 Interrupt event processing method and device

Publications (1)

Publication Number Publication Date
CN111367590A true CN111367590A (en) 2020-07-03

Family

ID=71208255

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010123846.XA Pending CN111367590A (en) 2020-02-27 2020-02-27 Interrupt event processing method and device

Country Status (1)

Country Link
CN (1) CN111367590A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112416364A (en) * 2020-12-11 2021-02-26 成都商通数治科技有限公司 Method for Android jump interface and receiving return value

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO1999030229A1 (en) * 1997-12-11 1999-06-17 Digits Corp. Object code analysis and remediation system and method
US20020165997A1 (en) * 2001-05-04 2002-11-07 International Business Machines Corporation Dynamically adapting events to capabilities of a management system
US20130283017A1 (en) * 2010-12-10 2013-10-24 Daniel Shawcross Wilkerson Hard object: constraining control flow and providing lightweight kernel crossings
CN107357496A (en) * 2017-07-19 2017-11-17 掌阅科技股份有限公司 Annotation process method, electronic equipment and computer-readable storage medium
CN108897612A (en) * 2018-07-17 2018-11-27 北京京东金融科技控股有限公司 Route the method and apparatus jumped
CN108985533A (en) * 2017-06-02 2018-12-11 四川理工学院 A kind of exercise management system and method based on Android platform
CN109597621A (en) * 2018-08-24 2019-04-09 天津字节跳动科技有限公司 Encapsulate method, apparatus, Dagger, decoupling method, device, equipment and the medium of Dagger
CN110704102A (en) * 2019-09-12 2020-01-17 北京字节跳动网络技术有限公司 Page jump protocol interface document generation method, system, medium and electronic device
CN110716786A (en) * 2019-10-16 2020-01-21 腾讯科技(深圳)有限公司 Page display method, system and storage medium

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO1999030229A1 (en) * 1997-12-11 1999-06-17 Digits Corp. Object code analysis and remediation system and method
US20020165997A1 (en) * 2001-05-04 2002-11-07 International Business Machines Corporation Dynamically adapting events to capabilities of a management system
US20130283017A1 (en) * 2010-12-10 2013-10-24 Daniel Shawcross Wilkerson Hard object: constraining control flow and providing lightweight kernel crossings
CN108985533A (en) * 2017-06-02 2018-12-11 四川理工学院 A kind of exercise management system and method based on Android platform
CN107357496A (en) * 2017-07-19 2017-11-17 掌阅科技股份有限公司 Annotation process method, electronic equipment and computer-readable storage medium
CN108897612A (en) * 2018-07-17 2018-11-27 北京京东金融科技控股有限公司 Route the method and apparatus jumped
CN109597621A (en) * 2018-08-24 2019-04-09 天津字节跳动科技有限公司 Encapsulate method, apparatus, Dagger, decoupling method, device, equipment and the medium of Dagger
CN110704102A (en) * 2019-09-12 2020-01-17 北京字节跳动网络技术有限公司 Page jump protocol interface document generation method, system, medium and electronic device
CN110716786A (en) * 2019-10-16 2020-01-21 腾讯科技(深圳)有限公司 Page display method, system and storage medium

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
LUISXU: "教你在Android中写\"注解\"处理程序" *
奔跑的杰尼龟: "Android AOP编程学习与实践" *
有没有口罩给我一个: "使用编译期注解对Activity和Fragment动态注入参数" *
程序员小三: "关于fragment多界面跳转的问题" *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112416364A (en) * 2020-12-11 2021-02-26 成都商通数治科技有限公司 Method for Android jump interface and receiving return value

Similar Documents

Publication Publication Date Title
CN111679990B (en) Test data generation method and device, readable medium and electronic equipment
CN111432001B (en) Method, apparatus, electronic device and computer readable medium for jumping scenes
CN111209306A (en) Business logic judgment method and device, electronic equipment and storage medium
US20240104671A1 (en) Method and apparatus for group management, electronic device, and storage medium
CN110908921A (en) Game problem positioning method and device, electronic equipment and storage medium
CN112714042B (en) Pressure testing method and device, electronic equipment and storage medium
CN111460432B (en) On-line document authority control method, device, equipment and computer readable medium
WO2023207788A1 (en) Information processing method and apparatus, electronic device, and storage medium
CN111367590A (en) Interrupt event processing method and device
CN116302271A (en) Page display method and device and electronic equipment
CN111538717B (en) Data processing method, device, electronic equipment and computer readable medium
CN114428925A (en) Page rendering method and device, electronic equipment and computer readable medium
CN109669679B (en) Service detection and processing method and device and electronic equipment
CN113518183A (en) Camera calling method and device and electronic equipment
CN111831566A (en) Test method, test device, electronic equipment and computer readable storage medium
CN113391860A (en) Service request processing method and device, electronic equipment and computer storage medium
CN111310175A (en) iOS application safety monitoring and protecting method and device based on plug-in
CN110855655A (en) Information verification method, device, equipment and storage medium
CN111626787B (en) Resource issuing method, device, medium and equipment
CN113760563B (en) Data processing method and device based on open platform and data processing system
CN111262776B (en) Method, device, electronic equipment and computer readable medium for sending notification message
CN116506452B (en) Multi-cloud data storage method, device, equipment and storage medium
CN112261659B (en) Control method and device for terminal and server, terminal and storage medium
WO2023116167A1 (en) Lifecycle event management method and apparatus, storage medium and electronic device
WO2023116503A1 (en) Function processing method and apparatus, device and storage medium

Legal Events

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