CN112860455B - Life cycle event processing method and device and electronic equipment - Google Patents

Life cycle event processing method and device and electronic equipment Download PDF

Info

Publication number
CN112860455B
CN112860455B CN202110171251.6A CN202110171251A CN112860455B CN 112860455 B CN112860455 B CN 112860455B CN 202110171251 A CN202110171251 A CN 202110171251A CN 112860455 B CN112860455 B CN 112860455B
Authority
CN
China
Prior art keywords
page
life cycle
type
type page
lifecycle
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
CN202110171251.6A
Other languages
Chinese (zh)
Other versions
CN112860455A (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.)
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and 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 Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN202110171251.6A priority Critical patent/CN112860455B/en
Publication of CN112860455A publication Critical patent/CN112860455A/en
Application granted granted Critical
Publication of CN112860455B publication Critical patent/CN112860455B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/542Event management; Broadcasting; Multicasting; Notifications
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3003Monitoring arrangements specially adapted to the computing system or computing system component being monitored
    • G06F11/302Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system component is a software system
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3051Monitoring arrangements for monitoring the configuration of the computing system or of the computing system component, e.g. monitoring the presence of processing resources, peripherals, I/O links, software programs

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Quality & Reliability (AREA)
  • Software Systems (AREA)
  • Mathematical Physics (AREA)
  • Multimedia (AREA)
  • Debugging And Monitoring (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The application discloses a life cycle event processing method and device and electronic equipment, and relates to the technical field of page development in computer technology. The specific implementation scheme is as follows: monitoring a life cycle instruction sent by a first type page, and broadcasting the life cycle instruction, wherein the life cycle instruction comprises a life cycle event; generating a target second type page based on a page base class of the second type page, wherein the page base class comprises a monitoring function and a life cycle event processing function; and monitoring the life cycle instruction by using the target second-type page call monitoring function, and calling the life cycle event processing function to perform service processing on the life cycle event. The problem that the life cycle event cannot be converted into the life cycle of the target second type page due to the fact that no listener is arranged on the life cycle event at present can be solved, and the processing efficiency of the target second type page on the life cycle event can be improved.

Description

Life cycle event processing method and device and electronic equipment
Technical Field
The present disclosure relates to the field of page development in computer technologies, and in particular, to a lifecycle event processing method and apparatus, and an electronic device.
Background
The lifecycle of a page is critical to the business process of a page, where it is often necessary to process different things according to different lifecycles, e.g., re-requesting data and refreshing the interface each time the page is opened. Different types of pages can be developed through different tools, namely the pages can comprise various types of pages, the pages of the first type are in iOS or Android, each page of the first type is opened to closed, the system provides life cycle callbacks of key time points, and corresponding business processing can be performed in different life cycle callbacks in development.
In practice, it is common for pages of the first type to alternate with pages of the second type, the first type being able to use the life cycles provided, but the second type being opened by the first type, they cannot themselves perceive these life cycles.
Currently, the second type of page is used as the first type of page, and essentially, the objects of the second type of page correspond to the objects of the first type of page. When a second type of page is opened, first a second type of page route is sent, while at each lifecycle of this page, the first type of page sends lifecycle instructions.
Disclosure of Invention
The application provides a life cycle event processing method and device and electronic equipment.
In a first aspect, an embodiment of the present application provides a lifecycle event processing method, the method including:
monitoring a life cycle instruction sent by a first type page, and broadcasting the life cycle instruction, wherein the life cycle instruction comprises a life cycle event;
generating a target second type page based on a page base class of the second type page, wherein the page base class comprises a monitoring function and a life cycle event processing function;
and calling the monitoring function to monitor the life cycle instruction by using the target second type page, and calling the life cycle event processing function to perform service processing on the life cycle event.
In the lifecycle event processing method of the embodiment of the present application, a listening function is added in a page base class of a second type page, and a lifecycle event processing function is defined, after a target second type page is generated based on the page base class, the target second type page may call a listening function to monitor a lifecycle instruction, and call the lifecycle event processing function to perform service processing on a lifecycle event in the lifecycle instruction, that is, a listener is in the lifecycle instruction, that is, the second type page calls the listening function to perform listening, so that the lifecycle event can be converted into a lifecycle event of a specific target second type page, and call the lifecycle event processing function to perform lifecycle event processing, so that the target second type page implements lifecycle management. The problem that the life cycle event cannot be converted into the life cycle of the target second type page due to the fact that no listener is arranged on the life cycle event at present can be solved, and the processing efficiency of the target second type page on the life cycle event can be improved.
In a second aspect, one embodiment of the present application provides a lifecycle event processing apparatus, the apparatus comprising:
the monitoring module is used for monitoring a life cycle instruction sent by the first type page and broadcasting the life cycle instruction, wherein the life cycle instruction comprises a life cycle event;
the generation module is used for generating a target second type page based on a page base class of the second type page, wherein the page base class comprises a monitoring function and a life cycle event processing function;
and the processing module is used for calling the monitoring function to monitor the life cycle instruction by using the target second type page and calling the life cycle event processing function to perform service processing on the life cycle event.
In a third aspect, an embodiment of the present application further provides an electronic device, including:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the lifecycle event processing methods provided by the embodiments of the present application.
In a fourth aspect, one embodiment of the present application also provides a non-transitory computer-readable storage medium storing computer instructions for causing the computer to perform the lifecycle event processing method provided by the embodiments of the present application.
In a fifth aspect, an embodiment of the present application provides a computer program product comprising a computer program which, when executed by a processor, implements the lifecycle event processing method provided by embodiments of the present application.
Drawings
The drawings are for better understanding of the present solution and do not constitute a limitation of the present application. Wherein:
FIG. 1 is a flow diagram of a lifecycle event processing method of an embodiment provided herein;
FIG. 2 is a schematic diagram of the alternation of Native and Flutter pages;
FIG. 3 is a schematic diagram of Fluter page route management according to one embodiment provided herein;
FIG. 4 is a schematic diagram of lifecycle monitoring of one embodiment provided herein;
FIG. 5 is a block diagram of a lifecycle event processing apparatus of one embodiment provided herein;
fig. 6 is a block diagram of an electronic device for implementing a lifecycle event processing method of an embodiment of the present application.
Detailed Description
Exemplary embodiments of the present application are described below in conjunction with the accompanying drawings, which include various details of the embodiments of the present application to facilitate understanding, and should be considered as merely exemplary. Accordingly, one of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present application. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
As shown in fig. 1, according to an embodiment of the present application, the present application provides a lifecycle event processing method, including:
step S101: and monitoring the life cycle instruction sent by the first type page, and broadcasting the life cycle instruction, wherein the life cycle instruction comprises a life cycle event.
It will be appreciated that the second type page management module may be pre-created, the lifecycle instructions sent by the first type page may be monitored by the second type page management module, and the lifecycle instructions may be broadcast if the lifecycle instructions sent by the first type page are monitored.
Step S102: and generating a target second type page based on a page base class of the second type page, wherein the page base class comprises a monitoring function and a life cycle event processing function.
The page base class of the second type page can be created in advance, namely, a base class is provided for the second type page in advance, and a specific page object, namely, a target second type page, can be obtained by instantiating based on the page base class. During the instantiation process, the monitoring function and the life cycle event processing function in the page base class can be inherited.
Step S103: and monitoring the life cycle instruction by using the target second-type page call monitoring function, and calling the life cycle event processing function to perform service processing on the life cycle event.
The target second class page can call a monitoring function to monitor the broadcast life cycle instruction, and can call a life cycle event processing function to process business on the life cycle event under the condition of monitoring the life cycle instruction. It may be understood that the page base class may include a plurality of lifecycle event processing functions, that is, processing functions corresponding to a plurality of lifecycle events, a lifecycle event included in the lifecycle instruction may be at least one event of the plurality of lifecycle events, and after the lifecycle instruction is monitored, a processing function corresponding to a lifecycle event of the lifecycle instruction in the plurality of lifecycle event processing functions may be called to perform service processing, which may be understood as calling a processing function corresponding to a lifecycle event of the lifecycle instruction to execute the lifecycle event, that is, perform corresponding processing of the lifecycle event. For example, the lifecycle event in the lifecycle instruction is a target lifecycle event, and a processing function corresponding to the target lifecycle event in the plurality of lifecycle event processing functions is called to perform service processing.
In the lifecycle event processing method of the embodiment of the present application, a listening function is added in a page base class of a second type page, and a lifecycle event processing function is defined, after a target second type page is generated based on the page base class, the target second type page may call a listening function to monitor a lifecycle instruction, and call the lifecycle event processing function to perform service processing on a lifecycle event in the lifecycle instruction, that is, a listener is in the lifecycle instruction, that is, the second type page calls the listening function to perform listening, so that the lifecycle event can be converted into a lifecycle event of a specific target second type page, and call the lifecycle event processing function to perform lifecycle event processing, so that the target second type page implements lifecycle management. The problem that the life cycle event cannot be converted into the life cycle of the target second type page due to the fact that no listener is arranged on the life cycle event at present can be solved, and the processing efficiency of the target second type page on the life cycle event can be improved.
In one embodiment, the first type of page comprises a Native page and the second type of page comprises a Flutter page.
Fluter is a software development kit that can help developers build iOS and Android applications using a single code library. Native is a Native platform that can be used to create mobile applications and the like. Native pages may be understood as Native pages, pages developed by Native, and Flutter pages may be understood as pages developed by Flutter. The system provides life cycle callback of key time point from opening to closing of each Native page, so that corresponding business processing can be performed in different life cycle callbacks.
In this embodiment, by monitoring the lifecycle instruction sent by the Native page and broadcasting the lifecycle instruction, the base class of the router page is provided in advance, the target router page can be generated based on the base class, the target router page can be used to call a monitoring function to monitor the broadcasted lifecycle instruction, and the lifecycle event processing function can be called to process the lifecycle event subsequently, so that the service processing similar to Native and responding in different lifecycle callbacks can be realized.
In one embodiment, the lifecycle instruction further includes a target page identifier, and invoking the lifecycle event processing function to perform service processing on the lifecycle event includes:
and calling a life cycle event processing function to carry out service processing on the life cycle event under the condition that the target page identification is consistent with the page identification of the target second type page.
In this embodiment, the lifecycle instruction further includes a target page identifier, and after the lifecycle instruction is monitored by using the target second-type page call monitoring function, the party may call the lifecycle event processing function to perform service processing on the lifecycle event under the condition that the target page identifier is consistent with the page identifier of the target second-type page, so as to improve accuracy of processing the lifecycle event in the lifecycle instruction.
In one embodiment, the method further comprises at least one of:
creating a second type page stack;
adding a second type page in a second type page stack;
removing the second type page in the second type page stack;
the second type page order in the second type page stack is adjusted.
The second type page management module can maintain a second type page stack, for example, the second type page stack can be created, the second type page can be added into the second type page stack, the second type page in the second type page stack can be deleted, and the sequence of the second type page in the second type page stack can be adjusted. It will be appreciated that the second type of page stack may be considered as a box with a bottom and no lid, into which things can be put or from which things can be taken, and that all of the generated second type of pages are stored in the second type of page stack. For example, the target second type page is generated based on the page base class, and after the second type page stack is created, the target second type page may be added to the second type page stack, and the second type page stack may include the target second type page. It should be noted that the above-mentioned creation, addition, removal and adjustment actions are all driven by Native pages.
In this embodiment, during the life cycle event processing method, at least one of creating a second type page stack, adding a second type page to the second type page stack, removing the second type page from the second type page stack, and adjusting the order of the second type pages in the second type page stack may be performed, and management of the second type page may be implemented through the second type page stack, so as to improve the management effect on the second type page.
In one embodiment, the first type of page is used for creating a second type of page container and sending a life cycle instruction, the identification of the second type of page container corresponds to the generated identification of the second type of page one by one, and the second type of page container is used for storing the corresponding second type of page.
The first type of page may send lifecycle instructions such that the lifecycle instructions sent by the first type of page may be broadcast by monitoring them. In addition, the first type page can also create a second type page container, namely, each time the first type page opens a new second type page, a corresponding second type page container needs to be created, and the identification of each second type page container corresponds to the identification of one generated second type page one by one. The second type of page generated herein may be understood as a second type of web page obtained by instantiating the page base class. It may be understood that the generated second type of web page is a widget (component) and is formed by at least one sub-widget, and the second type of web page container is used for storing sub-widgets forming the corresponding generated second type of web page.
In this embodiment, a second type page container may be created by the first type page and corresponds to the generated identifier of the second type page one by one, and the second type page container is used to store the corresponding second type page. It can be understood that when a new second type web page is opened, a second type web page container can be created, the second type web page container has a unique identifier, and the identifiers of one page in the generated second type web pages correspond to each other, namely, the second type web page container corresponding to the page can be created through the first type web page, and the second type web page container is used for storing the corresponding second type web page, so that the storage of the second type web page is realized.
The procedure of the above method is specifically described in the following with reference to an embodiment. Taking the first type of page as a Native page and the second type of page as a router page as an example for illustration.
In mobile end application development, the life cycle of a page is critical to business processing of a page, and business often needs to process different things according to different life cycles, for example, when the page is opened each time, data needs to be re-requested and an interface needs to be refreshed. In Native (iOS or Android), the system provides lifecycle callbacks (processing functions) at key points in time, from open to closed for each page. Thus, corresponding business processing can be performed in different life cycle callbacks in development. Taking iOS as an example, table 1 below lists the main lifecycle callbacks and uses for page open to close.
TABLE 1
Business requirements: in the actual application of Flutter, native and Flutter pages alternate, as shown in fig. 2. Native pages can use the life cycles provided by Native, but Flutter pages are opened by Native pages and they cannot themselves perceive these life cycles.
Development habit: from development habit, similar life cycle callback is realized in the router, so that developers can use the router to develop more easily, and the router can develop more simply just like developing Native pages.
Currently, in the prior art, the Flutter page is used as a Native page, and essentially, objects of one Flutter page correspond to a Native page object, for example, one Flutter page is a FlutterViewController (Flutter view controller) on the iOS, which is itself a UIViewController (interface view controller). When a Fluter page is opened, fluter page routes are first sent to the Fluter engine, and at the same time, lifecycle instructions are sent every lifecycle of the page. However, each lifecycle in the process of opening to closing any one of the Flutter pages will send related lifecycle instructions to the Flutter, but the lifecycle events in these lifecycle instructions are not uniform listeners, and therefore cannot be converted into the lifecycle of each Flutter page, and cannot be conveniently made as simple as Native development when developing each Flutter page.
In the embodiment of the application, in the large-scale App (application program) hybrid development using the Flutter, a set of life cycle templates which are identical to Native are customized in the Flutter, and all page development only needs to process specific transactions based on the set of life cycles. Currently, some clients are using this scheme as one large commercial App.
The embodiment of the application is developed on the basis of the scheme, and comprises page router route management, life cycle instruction sending, life cycle management life cycle monitoring and life cycle base class implementation simulating Native.
For router route management, in the case of mixing Native and router pages, a router page stack is maintained for the router pages, and is responsible for adding the router pages (which may be understood as the router widgets), removing the router pages, adjusting the order of the router pages (which may be understood as the router widgets), and so on, all opening and removing actions are driven by Native. When a new Flutter page is opened, a Flutter page container is created just like a Native page, which container has a unique id (identification) that corresponds to a page in Flutter, as shown in fig. 3.
For lifecycle instruction sending, in the process of opening to closing each Flutter page, each lifecycle Native sends a lifecycle event to the Flutter, which is implemented by the Platform Channel technology provided by the Flutter for Native and Flutter communications. These events are sent to the router page management module and broadcast by this module to all listeners.
For life cycle monitoring, as shown in fig. 4, in the router, a base class is provided for all pages, and a monitoring function for life cycle events is added in the base class, so that all page objects derived from the base class can monitor the life cycle events when initializing. Because the instruction carries the page id, after the life cycle instruction is monitored, whether the life cycle event is related to the Flutter page or not can be judged by checking the carried page id. The Flutter page can process corresponding transactions in different life cycle functions according to business needs.
For the life cycle of the simulated Native, in the base class of the router page, these life cycle events are distributed after being received. First see if the carried page id is itself or not, if so, distribute it. The distribution is performed by defining a set of processing functions corresponding to each lifecycle event in the base class. When a life cycle event is received, a corresponding function is called, the page subclass (namely, the instantiated result) can cover the function according to the requirement, and specific transactions are carried out in the function, so that life cycle management similar to Native is realized.
The development efficiency can be improved by using the Flutter as the mobile terminal development, a plurality of platforms can be developed once to operate, but the Flutter has defects in page life cycle management. This can save development costs and improve development efficiency.
As shown in fig. 5, according to an embodiment of the present application, there is further provided a life cycle event processing apparatus 500, including:
the monitoring module 501 is configured to monitor a lifecycle instruction sent by the first type page, and broadcast the lifecycle instruction, where the lifecycle instruction includes a lifecycle event;
the generating module 502 is configured to generate a target second type page based on a page base class of the second type page, where the page base class includes a listening function and a life cycle event processing function;
the processing module 503 is configured to monitor the lifecycle instruction using the target second type page call monitor function, and call the lifecycle event processing function to perform service processing on the lifecycle event.
In one embodiment, the lifecycle instruction further includes a target page identifier, and invoking the lifecycle event processing function to perform service processing on the lifecycle event includes:
and calling a life cycle event processing function to carry out service processing on the life cycle event under the condition that the target page identification is consistent with the page identification of the target second type page.
In one embodiment, the apparatus further comprises at least one of:
the creation module is used for creating a second type page stack;
the adding module is used for adding the second type page in the second type page stack;
the removing module is used for removing the second type page in the second type page stack;
and the adjusting module is used for adjusting the second type page sequence in the second type page stack.
In one embodiment, the first type of page is used for creating a second type of page container and sending a life cycle instruction, the identification of the second type of page container corresponds to the generated identification of the second type of page one by one, and the second type of page container is used for storing the corresponding second type of page.
In one embodiment, the first type of page comprises a Native page and the second type of page comprises a Flutter page.
The lifecycle event processing apparatus of each embodiment is an apparatus for implementing the lifecycle event processing method of each embodiment, and the technical features and the technical effects are corresponding, which are not described herein.
According to embodiments of the present application, there is also provided an electronic device, a readable storage medium and a computer program product.
The non-transitory computer readable storage medium of the embodiments of the present application stores computer instructions for causing a computer to perform the lifecycle event processing methods provided herein.
The computer program product of the embodiments of the present application includes a computer program for causing a computer to execute the lifecycle event processing method provided by the embodiments of the present application.
Fig. 6 shows a schematic block diagram of an example electronic device 600 that may be used to implement embodiments of the present application. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular telephones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the application described and/or claimed herein.
As shown in fig. 6, the electronic device 600 includes a computing unit 601 that can perform various appropriate actions and processes according to a computer program stored in a Read Only Memory (ROM) 602 or a computer program loaded from a storage unit 608 into a Random Access Memory (RAM) 603. In the RAM603, various programs and data required for the operation of the device 600 may also be stored. The computing unit 601, ROM 602, and RAM603 are connected to each other by a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
A number of components in the electronic device 600 are connected to the I/O interface 605, including: an input unit 606 such as a keyboard, mouse, etc.; an output unit 607 such as various types of displays, speakers, and the like; a storage unit 608, such as a magnetic disk, optical disk, or the like; and a communication unit 609 such as a network card, modem, wireless communication transceiver, etc. The communication unit 609 allows the electronic device 600 to exchange information/data with other devices through a computer network, such as the internet, and/or various telecommunication networks.
The computing unit 601 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of computing unit 601 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various computing units running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 601 performs the various methods and processes described above, such as lifecycle event processing methods. For example, in some embodiments, the lifecycle event processing method may be implemented as a computer software program tangibly embodied on a machine-readable medium, such as the storage unit 608. In some embodiments, part or all of the computer program may be loaded and/or installed onto the device 600 via the ROM 602 and/or the communication unit 609. When the computer program is loaded into RAM603 and executed by the computing unit 601, one or more steps of the lifecycle event processing method described above may be performed. Alternatively, in other embodiments, the computing unit 601 may be configured to perform the lifecycle event processing method by any other suitable means (e.g., by means of firmware). Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuit systems, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), systems On Chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs, the one or more computer programs may be executed and/or interpreted on a programmable system including at least one programmable processor, which may be a special purpose or general-purpose programmable processor, that may receive data and instructions from, and transmit data and instructions to, a storage system, at least one input device, and at least one output device.
Program code for carrying out methods of the present application may be written in any combination of one or more programming languages. These program code may be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus such that the program code, when executed by the processor or controller, causes the functions/operations specified in the flowchart and/or block diagram to be implemented. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package, partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of this application, 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. The 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.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and pointing device (e.g., a mouse or trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic input, speech input, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a background component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such background, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), the internet, and blockchain networks.
The computer system may include a client and a server. The client and server are typically remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, also called a cloud computing server or a cloud host, and is a host product in a cloud computing service system, so that the defects of high management difficulty and weak service expansibility in the traditional physical hosts and VPS service ("Virtual Private Server" or simply "VPS") are overcome. The server may also be a server of a distributed system or a server that incorporates a blockchain.
It should be appreciated that various forms of the flows shown above may be used to reorder, add, or delete steps. For example, the steps described in the present application may be performed in parallel, sequentially, or in a different order, provided that the desired results of the technical solutions disclosed in the present application can be achieved, and are not limited herein.
The above embodiments do not limit the scope of the application. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives are possible, depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present application are intended to be included within the scope of the present application.

Claims (6)

1. A lifecycle event processing method, the method comprising:
monitoring a life cycle instruction sent by a first type page, and broadcasting the life cycle instruction, wherein the life cycle instruction comprises a life cycle event;
generating a target second type page based on a page base class of the second type page, wherein the page base class comprises a monitoring function and a life cycle event processing function;
calling the monitoring function to monitor the life cycle instruction by using the target second type page, and calling the life cycle event processing function to perform service processing on the life cycle event;
the lifecycle instruction further includes a target page identifier, and the calling the lifecycle event processing function to perform service processing on the lifecycle event includes:
calling the life cycle event processing function to process business for the life cycle event under the condition that the target page identification is consistent with the page identification of the target second type page;
wherein the method further comprises at least one of:
creating a second type page stack;
adding a second type page in a second type page stack;
removing the second type page in the second type page stack;
adjusting a second type page order in a second type page stack;
the first type page is used for creating a second type page container and sending the life cycle instruction, the identification of the second type page container corresponds to the generated identification of the second type page one by one, and the second type page container is used for storing the corresponding second type page.
2. The method of claim 1, wherein the first type of page comprises a Native page and the second type of page comprises a Flutter page.
3. A lifecycle event processing apparatus, the apparatus comprising:
the monitoring module is used for monitoring a life cycle instruction sent by the first type page and broadcasting the life cycle instruction, wherein the life cycle instruction comprises a life cycle event;
the generation module is used for generating a target second type page based on a page base class of the second type page, wherein the page base class comprises a monitoring function and a life cycle event processing function;
the processing module is used for calling the monitoring function to monitor the life cycle instruction by using the target second type page and calling the life cycle event processing function to perform service processing on the life cycle event;
the lifecycle instruction further includes a target page identifier, and the calling the lifecycle event processing function to perform service processing on the lifecycle event includes:
calling the life cycle event processing function to process business for the life cycle event under the condition that the target page identification is consistent with the page identification of the target second type page;
wherein the apparatus further comprises at least one of:
the creation module is used for creating a second type page stack;
the adding module is used for adding the second type page in the second type page stack;
the removing module is used for removing the second type page in the second type page stack;
the adjusting module is used for adjusting the second type page sequence in the second type page stack;
the first type page is used for creating a second type page container and sending the life cycle instruction, the identification of the second type page container corresponds to the generated identification of the second type page one by one, and the second type page container is used for storing the corresponding second type page.
4. The apparatus of claim 3, wherein the first type of page comprises a Native page and the second type of page comprises a Flutter page.
5. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the lifecycle event processing method of any of claims 1-2.
6. A non-transitory computer readable storage medium storing computer instructions for causing the computer to perform the lifecycle event processing method of any of claims 1-2.
CN202110171251.6A 2021-02-08 2021-02-08 Life cycle event processing method and device and electronic equipment Active CN112860455B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110171251.6A CN112860455B (en) 2021-02-08 2021-02-08 Life cycle event processing method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110171251.6A CN112860455B (en) 2021-02-08 2021-02-08 Life cycle event processing method and device and electronic equipment

Publications (2)

Publication Number Publication Date
CN112860455A CN112860455A (en) 2021-05-28
CN112860455B true CN112860455B (en) 2023-07-21

Family

ID=75989097

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110171251.6A Active CN112860455B (en) 2021-02-08 2021-02-08 Life cycle event processing method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN112860455B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7917130B1 (en) * 2003-03-21 2011-03-29 Stratosaudio, Inc. Broadcast response method and system
CN106293972A (en) * 2016-08-12 2017-01-04 金蝶软件(中国)有限公司 The single page application page means of communication and device
CN107870933A (en) * 2016-09-27 2018-04-03 北京京东尚科信息技术有限公司 Count the method, apparatus and system of Android five application page navigation patterns
CN111966421A (en) * 2020-06-29 2020-11-20 北京百度网讯科技有限公司 Page component operation monitoring method, device, equipment and storage medium

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7849437B2 (en) * 2005-09-01 2010-12-07 Microsoft Corporation Object oriented web application framework
US20180165349A1 (en) * 2016-12-14 2018-06-14 Linkedin Corporation Generating and associating tracking events across entity lifecycles

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7917130B1 (en) * 2003-03-21 2011-03-29 Stratosaudio, Inc. Broadcast response method and system
CN106293972A (en) * 2016-08-12 2017-01-04 金蝶软件(中国)有限公司 The single page application page means of communication and device
CN107870933A (en) * 2016-09-27 2018-04-03 北京京东尚科信息技术有限公司 Count the method, apparatus and system of Android five application page navigation patterns
CN111966421A (en) * 2020-06-29 2020-11-20 北京百度网讯科技有限公司 Page component operation monitoring method, device, equipment and storage medium

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
JSF框架在J2EE Web应用中的研究与实现;万正景;中国优秀硕士学位论文全文数据库(第7期);全文 *
基于JSF定制生命周期的Ajax组件开发;彭胜;刘卫国;;计算机应用(07);全文 *

Also Published As

Publication number Publication date
CN112860455A (en) 2021-05-28

Similar Documents

Publication Publication Date Title
US9678723B2 (en) Application programming interface (API) engine
WO2021023149A1 (en) Method and apparatus for dynamically returning message
WO2019169723A1 (en) Test case selection method, device and equipment, and computer-readable storage medium
CN114418828B (en) Video memory management method, device, equipment, storage medium and program product
CN114202027A (en) Execution configuration information generation method, model training method and device
WO2022156087A1 (en) Data blood relationship establishing method and apparatus, computer device, and storage medium
CN114911598A (en) Task scheduling method, device, equipment and storage medium
CN115373861A (en) GPU resource scheduling method and device, electronic equipment and storage medium
CN113572833B (en) Cloud mobile phone maintenance method and device, electronic equipment and storage medium
CN113094125A (en) Business process processing method, device, server and storage medium
CN112860455B (en) Life cycle event processing method and device and electronic equipment
CN116302218B (en) Function information adding method, device, equipment and storage medium
CN111414154A (en) Method and device for front-end development, electronic equipment and storage medium
CN110765610A (en) PDM (product data management) integration method and device, computer equipment and storage medium
CN113612643B (en) Network configuration method, device and equipment of cloud mobile phone and storage medium
CN112380031A (en) Method and device for pushing messages in real time in cross-application mode and computing equipment
US9946749B2 (en) Rewriting inequality queries
CN110780864A (en) Control method and device for class method replacement, storage medium and electronic equipment
CN113157360B (en) Method, apparatus, device, medium, and article for processing an API
CN113961263B (en) Applet distribution method, device, apparatus and storage medium
CN116561075B (en) Method for generating dynamic link library file, method and device for calling operator
CN113342413B (en) Method, apparatus, device, medium, and article for processing components
EP4123523A1 (en) Method and apparatus for sharing resource, method and apparatus for creating service, and electronic device
US20240134723A1 (en) Technology and protocol agnostic key-value pair based user interface and data rendering to support a transaction
CN117032859A (en) Layered development device, method, equipment and medium for UI (user interface) and business application

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