CN111459565B - Client page rendering method and device and mobile terminal - Google Patents

Client page rendering method and device and mobile terminal Download PDF

Info

Publication number
CN111459565B
CN111459565B CN202010123826.2A CN202010123826A CN111459565B CN 111459565 B CN111459565 B CN 111459565B CN 202010123826 A CN202010123826 A CN 202010123826A CN 111459565 B CN111459565 B CN 111459565B
Authority
CN
China
Prior art keywords
preset
module
rendering
service module
protocol
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
CN202010123826.2A
Other languages
Chinese (zh)
Other versions
CN111459565A (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.)
Shanghai Junzheng Network Technology Co Ltd
Original Assignee
Shanghai Junzheng 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 Shanghai Junzheng Network Technology Co Ltd filed Critical Shanghai Junzheng Network Technology Co Ltd
Priority to CN202010123826.2A priority Critical patent/CN111459565B/en
Publication of CN111459565A publication Critical patent/CN111459565A/en
Application granted granted Critical
Publication of CN111459565B publication Critical patent/CN111459565B/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/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44521Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/34Graphical or visual programming
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/38Creation or generation of source code for implementing user interfaces
    • 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/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45504Abstract machines for programme code execution, e.g. Java virtual machine [JVM], interpreters, emulators
    • G06F9/45529Embedded in an application, e.g. JavaScript in a Web browser

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The application discloses a method, a device and a mobile terminal for rendering a client page, which aim to find an implementation scheme for finding more effective client page rendering, and the method comprises the following steps: acquiring at least one service module configuration data keyword, and commanding a corresponding module realization party in a preset management warehouse based on the service module configuration data keyword; initializing a module realization party and distributing a life cycle, and calling the initialized module realization party and distributing the life cycle to realize a predefined method in a preset general protocol; integrating each rendered business module in a preset container page to render the page. The application builds a rendering scheme based on the multi-service module container of the preset management warehouse class and the preset general protocol, and solves the problem of building and rendering an application program for bearing a multi-service module scene for one page container.

Description

Client page rendering method and device and mobile terminal
Technical Field
The application relates to the field of mobile communication, in particular to a method and a device for rendering a client page and a mobile terminal.
Background
In large-scale application program project development, service growth is rapid, main service is more, the scene is complex and various, different service modules or independent functions are generally split according to the service, and rich service is grown in a concurrent mode of each service line. This causes a problem in rendering applications where the container carries multiple business module scenarios, as the container needs to carry more and more independent business scenarios to support business development. In addition, code coupling is easy to occur, and maintenance cost is increased.
Disclosure of Invention
In order to find a more effective implementation scheme of client page rendering, the application provides a method, a device and a mobile terminal for client page rendering.
Scheme one:
there is provided a method of client page rendering, the method of client page rendering comprising the steps of:
acquiring at least one service module configuration data keyword, and commanding a corresponding module realization party in a preset management warehouse class based on the service module configuration data keyword;
initializing the module realization party and distributing the life cycle, and calling the initialized module realization party and distributing the life cycle to realize a predefined method in a preset general protocol, wherein the predefined method is used for rendering and/or loading a service module;
integrating each rendered business module in a preset container page to render the page.
Preferably, before the obtaining the at least one service module configuration data keyword, the method includes the following steps:
and each parallel service module registers a respective module realization party to a preset management warehouse class by using a key value mode.
Preferably, the module implementation method based on the service module configuration data keyword and corresponding to the preset management warehouse class command includes the following steps:
acquiring a preset searching priority of a service module;
and according to the preset searching priority and based on the service module configuration data keyword, commanding the corresponding module realization party in a preset management warehouse class.
Preferably, before the obtaining the at least one service module configuration data keyword, the method includes the following steps:
and removing the key value pair registered by the business module in the preset management warehouse class.
Preferably, the invoking the pre-defined method in the preset universal protocol implemented by the module implementer initialized and distributing the life cycle comprises the following steps:
acquiring a preset rendering priority of a service module;
and calling the initialized module implementer for distributing the life cycle according to the preset rendering priority to implement a predefined method in a preset general protocol.
Preferably, the preset general protocol includes one or more of the following:
a data protocol;
a lifecycle protocol;
an event protocol;
proxy event handling.
Preferably, the preset general protocol is user-defined based.
Scheme II:
there is provided an apparatus for client page rendering, the apparatus for client page rendering comprising:
the acquisition hit module is used for acquiring at least one service module configuration data keyword and hit a corresponding module realization party in a preset management warehouse class based on the service module configuration data keyword;
the initial implementation module is used for initializing the module implementation party and distributing the life cycle, and calling the initialized module implementation party which distributes the life cycle to implement a predefined method in a preset universal protocol, wherein the predefined method is used for rendering and/or loading a service module;
and the integration module is used for integrating each rendered business module into a preset container page so as to render the page.
Preferably, the device for rendering the client page comprises:
and the registration module is used for registering respective module realization parties to the preset management warehouse class by using a key value mode before acquiring at least one service module configuration data keyword.
Preferably, the acquisition hit module includes:
the first acquisition unit is used for acquiring the preset searching priority of the service module;
hit the unit, is used for looking up the priority and based on the said business module and dispose the data keyword and hit the correspondent module realization party in the preset management warehouse class according to the said preseting.
Preferably, the device for rendering the client page comprises:
and the removing unit is used for removing the key value pair registered by the service module in the preset management warehouse class before acquiring at least one service module configuration data keyword.
Preferably, the initial implementation module includes:
the second acquisition unit is used for acquiring the preset rendering priority of the service module;
and the realization unit is used for calling the initialized module realization party which distributes the life cycle according to the preset rendering priority to realize the predefined method in the preset general protocol.
Preferably, the preset general protocol includes one or more of the following:
a data protocol;
a lifecycle protocol;
an event protocol;
proxy event handling.
Preferably, the preset general protocol is user-defined based.
Scheme III:
there is provided a mobile terminal including:
one or more processors;
a memory;
one or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the one or more processors, the one or more applications configured to perform the method of client page rendering of any of scheme one.
Compared with the prior art, the method and the device for rendering the client page and the mobile terminal have the following beneficial effects:
the method and the device for rendering the client page and the mobile terminal construct the rendering scheme based on the multi-service module container of the preset management warehouse class and the preset general protocol, can improve the parallel development and bearing support capacity under the multi-service scene, and simultaneously solve the problem of constructing and rendering the application program for bearing the multi-service module scene for one page container.
The scheme provided by the application has little change to the existing system, does not influence the compatibility of the system, and is simple and efficient to realize.
Additional aspects and advantages of the application 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 application.
Drawings
The foregoing and/or additional aspects and advantages of the application will become apparent and readily appreciated from the following description of the embodiments, taken in conjunction with the accompanying drawings, in which:
FIG. 1 is a flow chart of a method for rendering a client page according to an embodiment of the present application;
fig. 2 is a schematic block diagram of an apparatus for rendering a client page according to another embodiment of the present application;
fig. 3 is a schematic block diagram of a mobile terminal according to still another embodiment of the present application.
Detailed Description
In order to enable those skilled in the art to better understand the present application, the following description will make clear and complete descriptions of the technical solutions according to the embodiments of the present application with reference to the accompanying drawings.
In some of the flows described in the specification and claims of the present application and in the foregoing figures, a plurality of operations occurring in a particular order are included, but it should be understood that the operations may be performed out of order or performed in parallel, the order of operations being 202, 204, etc., merely for distinguishing between the various operations, the order of the operations itself not representing any order of execution. In addition, the flows may include more or fewer operations, and the operations may be performed sequentially or in parallel. It should be noted that, the descriptions of "first" and "second" herein are used to distinguish different messages, devices, modules, etc., and do not represent a sequence, and are not limited to the "first" and the "second" being different types.
The following description of the embodiments of the present application will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present application, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to fall within the scope of the application.
The embodiment of the application provides a client page rendering method which is applied to a multi-team collaborative development module block scheme of a client container page and is suitable for rendering pages by using stream service module layouts such as a Ha-Zha travel user end travel home page, a wallet home page and the like.
Referring to fig. 1, fig. 1 shows a flowchart of a method for rendering a client page according to an embodiment of the present application, and as shown in fig. 1, the method for rendering a client page according to an embodiment of the present application includes steps S101 to S105, specifically as follows:
step S101: and acquiring at least one service module configuration data keyword, and commanding a corresponding module realization party in a preset management warehouse class based on the service module configuration data keyword.
In some embodiments, before obtaining the at least one service module configuration data key, the method comprises the steps of:
and each parallel service module registers a respective module realization party to a preset management warehouse class by using a key value mode.
In some embodiments, before obtaining the at least one service module configuration data key, the method comprises the steps of:
and removing the key value pair registered by the business module in the preset management warehouse class.
Preferably, the key-value pair is preferably a key-value pair, where key is a key and value is a value.
For ease of understanding, a method for rendering a client page according to an embodiment of the present application is exemplified herein by a JSON-based object profile (JavaScript Object Notation, JSON for short) and implementing a preset management repository class in the form of key-value to maintain a service module registration list, where the JSON data format is a lightweight data exchange format that stores and represents data in a text format that is completely independent of programming language based on a subset of JS specifications set by the european computer institute. The compact and clear hierarchical structure makes JSON an ideal data exchange language. Is easy to read and write by people, is easy to analyze and generate by machines, and effectively improves the network transmission efficiency.
Illustratively, the key: defining types and sequences supporting business capabilities in unique character strings
Value; object BusinessObject List implementing a generic protocol
The data structure is as follows:
it should be understood that the above examples are merely for ease of understanding the preset management warehouse class and are not intended as limitations of embodiments of the present application. In fact, in a specific development process, the preset management repository class may have basic interface capabilities such as interception, basic general protocol, and the like, besides the registration and removal functions, which the embodiment of the present application does not limit.
It should be noted that, considering that the number of the acquired service module configuration data keywords may be multiple, for convenience in processing, a preset search priority may be set so as to improve processing efficiency, that is, a module implementation party corresponding to the service module configuration data keywords in a preset management warehouse class command includes the following steps:
acquiring a preset searching priority of a service module;
and according to the preset searching priority and based on the service module configuration data keywords, commanding the corresponding module realization party in the preset management warehouse class.
Step S103: initializing the module realization party and distributing the life cycle, and calling the initialized module realization party and distributing the life cycle to realize a predefined method in a preset general protocol, wherein the predefined method is used for rendering and/or loading a business module.
The lifecycle is the whole process of an object from loading to unloading, and the complete lifecycle of a class includes 7 parts: load-verify-prepare-parse-initialize-use-unload, wherein,
the authentication-preparation-parsing phase, also called the connection phase, except for parsing, other phases occur sequentially, and parsing can be performed across these phases, because Java supports dynamic binding, and a specific type can be determined at runtime; instantiating the object at a use stage;
the loading mechanism of a class has no explicit trigger conditions, but in 5 cases the class must be initialized, then the load-verify-prepare must be completed before this: the first case is to instantiate an object by a new keyword, read or set a static variable of a class, call a static method of the class; the second case is to perform the above three actions by reflection; the third case is when the subclass is initialized, the initialization of the parent class is triggered; the fourth case is when the virtual machine is started, initializing an execution main class; the fifth case is that when jdk1.7 is used for dynamic language support, if a java. Lang. Invoke. Method handle instance final analysis result ref_ getStatic, REF _putstatic, re_invoke static method handle is not initialized, and the class corresponding to the method handle needs to be triggered first for initialization. Notably, there are and only five cases where a class must be initialized, which are referred to as "active references", except for those cases where all other class references do not trigger class initialization, which are referred to as "passive references";
the use of classes includes active references and passive references, where active references refer to initialization; passive references refer to static fields of the parent class, which only cause initialization of the parent class, but not of the child class; defining class arrays, and initializing the classes; referencing the constant of the class does not cause the initialization of the class. In summary, active references will cause the initialization of a class, while passive references will not cause the initialization of a class;
after the class is used, the class is unloaded if the following condition is satisfied:
all instances of the class have been reclaimed, i.e., there are no instances of the class in the java heap;
the class loader that loaded the class has been reclaimed;
the java.lang.class object corresponding to the class is not referenced anywhere, and the method of the class cannot be accessed by reflection anywhere;
if all the three conditions are met, the virtual machine can unload the class when the garbage in the method area is recovered, the class unloading process is to empty class information in the method area, and the whole life cycle of the java class is finished.
In particular, the method for rendering the client page in the embodiment of the application distributes life cycle opportunities to the realization sides of each service module mainly through the bearing container to the universal protocol, and processes rendering logic, processing layout and container typesetting to meet the requirements.
In some embodiments, the preset general protocol includes one or more of the following:
a data protocol;
a lifecycle protocol;
an event protocol;
proxy event handling.
The data protocol is a necessary method for implementing the data protocol to be complied with for implementing a service module;
- (nsintelger) number ofrows; for setting how many entries a business module can display
- (uikiewcell x) creatCellForRowAtIndex: (NSIntger) index; style for setting specific items
- (void) bindDataForCell: (uiiviewcell x) cell index: (NSIntger) index; binding for data
- (NSString x) reusablecellwithidentifier ratindex: (NSIntger) index; the multiplexing identifier used for setting the specific item is used for reducing the system overhead when the effect of a multi-item User Interface (UI) is consistent;
and the lifecycle protocol calls the reloadadaptation data to inform the business module to remotely or locally obtain the data to be rendered by the database to refresh the UI when the container needs to load the business module. When the user needs to automatically play when the user slides into the screen display range and automatically play when the user slides out of the screen range, the-willdisplayidapteratindex can be used: and-didEndDisplayingAdapterAtIndex: the protocol method is used for sensing the life cycle realization of the sliding-in and the sliding-out; if the video needs to be played when the user enters the page or the playing is paused when the user switches out of the current container page, the method can be used for playing
-viewWillAppear;
-viewWillDisappear;
-viewDidAppear;
-viewddispearer;
event protocol, when selecting an item in a business module, the framework will call the- (void) didSelectTowAtIndex of the corresponding business module: (NSIntger) index; protocol method tells business module to respond event to process
When multiple service modules previously need to communicate with each other, the sender may utilize the-flowLayoutAdapter in the proxy: postEvent: targetKey: sending data message to designated service module can implement the method to receive and process message
-receiveTargetAdapterEvent:fromKey;
Proxy event processing, when network data or local data is changed/loaded successfully, the method can be used for refreshing UI layout of self modules in the current container
Area layout of a current module adapter is/are refreshed
-reloadDataForFlowLayoutAdpater:
The postEvent corresponding module can be used to process the received method when the data message communication with other parallel modules is needed
-a receivetargetadaptaterevent: from Key: method of
-(void)flowLayoutAdapter:(NSObject<JYFlowLayoutAdapterProtocol>*)adpater postEvent:(id)event targetKey:(NSString*)key。
It should be noted that, in order to facilitate development of the developer, the preset general protocol may also be customized based on the user, which is not limited in the embodiment of the present application.
In order to improve processing efficiency, the method for rendering a client page in the embodiment of the present application further sets a preset rendering priority, that is, invokes the initialized module implementation party which distributes the life cycle to implement a predefined method in a preset general protocol, including the following steps:
acquiring a preset rendering priority of a service module;
and calling the initialized module implementer for distributing the life cycle according to the preset rendering priority to implement a predefined method in a preset general protocol.
Step S105: integrating each rendered business module in a preset container page to render the page.
In some embodiments, the predetermined container is a carrier container.
A container is an abstraction of the application layer that packages code and dependencies together. Multiple containers may run on the same machine and share the operating system kernel with other containers, each running as a stand-alone process in user space. In the method for rendering the client page, the preset container only performs overall rendering layout and event data forwarding, has clear responsibility, only depends on preset management warehouse class and preset general protocol, has no code coupling between service modules, and reduces maintenance cost.
Compared with the prior art, the method for rendering the client page has the following beneficial effects:
the method for rendering the client page builds a rendering scheme based on the multi-service module container of the preset management warehouse class and the preset general protocol, can improve parallel development and bearing and supporting capacity under the multi-service scene, and solves the problem of building and rendering an application program for bearing the multi-service module scene for one page container.
Referring to fig. 2, another embodiment of the present application provides an apparatus for rendering a client page, based on the same inventive concept as the method for rendering a client page according to the embodiment of the present application, wherein the apparatus for rendering a client page includes:
the acquisition hit module 2002 is configured to acquire at least one service module configuration data keyword, and hit a corresponding module implementation party in a preset management warehouse class based on the service module configuration data keyword;
an initial implementation module 2004, configured to initialize the module implementer and distribute a lifecycle, and invoke the initialized module implementer and distribute the lifecycle to implement a predefined method in a preset generic protocol, where the predefined method is used for rendering and/or loading a business module;
and the integration module 2006 is used for integrating each rendered business module into a preset container page so as to render the page.
Preferably, the device for rendering the client page comprises:
and the registration module is used for registering respective module realization parties to the preset management warehouse class by using a key value mode before acquiring at least one service module configuration data keyword.
In some implementations, the fetch hit module 2002 includes:
the first acquisition unit is used for acquiring the preset searching priority of the service module;
hit the unit, is used for searching the priority and based on the business module and dispose the data keyword and hit the correspondent module realization party in the warehouse class of preset management according to the preseting.
In some embodiments, an apparatus for client page rendering includes:
and the removing unit is used for removing the key value pair registered by the service module in the preset management warehouse class before acquiring at least one service module configuration data keyword.
Preferably, the initial implementation module 2004 includes:
the second acquisition unit is used for acquiring the preset rendering priority of the service module;
and the realization unit is used for calling the initialized module realization party which distributes the life cycle according to the preset rendering priority to realize the predefined method in the preset general protocol.
In some embodiments, the preset general protocol includes one or more of the following:
a data protocol;
a lifecycle protocol;
an event protocol;
proxy event handling.
In some embodiments, the preset generic protocol is user-defined based.
Compared with the prior art, the device for rendering the client page has the following beneficial effects:
according to the device for rendering the client page, provided by the embodiment of the application, through the arrangement of the acquisition hit module 2002, the initial implementation module 2004 and the integration module 2006, the parallel development and bearing and supporting capacity under the multi-service scene can be improved, and meanwhile, the problem of building and rendering an application program for bearing the multi-service module scene for one page container is solved.
Referring to fig. 3, a further embodiment of the present application provides a mobile terminal based on the same inventive concept as a method for rendering a client page according to the embodiment of the present application. Fig. 3 is a block diagram showing a part of the structure of a mobile phone related to a mobile terminal according to still another embodiment of the present application. The mobile phone comprises: radio Frequency (RF) circuitry 1510, memory 1520, input unit 1530, display unit 1540, sensor 1550, audio circuitry 1560, wireless fidelity (wireless fidelity, wiFi) module 1570, processor 1580, power supply 1590, and the like. Those skilled in the art will appreciate that the handset configuration shown in fig. 3 is not limiting of the handset and may include more or fewer components than shown, or may combine certain components, or may be arranged in a different arrangement of components.
The following describes the components of the mobile phone in detail with reference to fig. 3:
the RF circuit 1510 may be used for receiving and transmitting signals during a message or a call, and particularly, after receiving downlink information of a base station, the signal is processed by the processor 1580; in addition, the data of the design uplink is sent to the base station. Generally, RF circuitry 1510 includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a Low noise amplifier (Low NoiseAmplifier, LNA), a duplexer, and the like. In addition, the RF circuitry 1510 may also communicate with networks and other devices through wireless communication. The wireless communications may use any communication standard or protocol including, but not limited to, global system for mobile communications (Global System of Mobile communication, GSM), general packet radio service (General Packet Radio Service, GPRS), code division multiple access (Code Division Multiple Access, CDMA), wideband code division multiple access (Wideband Code Division Multiple Access, WCDMA), long term evolution (Long Term Evolution, LTE), email, short message service (Short Messaging Service, SMS), and the like.
The memory 1520 may be used to store software programs and modules, and the processor 1580 performs various functional applications and data processing of the cellular phone by executing the software programs and modules stored in the memory 1520. The memory 1520 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data (such as audio data, phonebook, etc.) created according to the use of the handset, etc. In addition, memory 1520 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device.
The input unit 1530 may be used to receive input numerical or character information and generate key signal inputs related to user settings and function control of the handset. In particular, the input unit 1530 may include a touch panel 1531 and other input devices 1532. The touch panel 1531, also referred to as a touch screen, may collect touch operations thereon or thereabout by a user (e.g., operations of the user on the touch panel 1531 or thereabout by using any suitable object or accessory such as a finger, a stylus, etc.), and drive the corresponding connection device according to a predetermined program. Alternatively, the touch panel 1531 may include two parts, a touch detection device and a touch controller. The touch detection device detects the touch azimuth of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch detection device, converts it into touch point coordinates, and sends the touch point coordinates to the processor 1580, and can receive and execute commands sent from the processor 1580. In addition, the touch panel 1531 may be implemented in various types such as resistive, capacitive, infrared, and surface acoustic wave. The input unit 1530 may include other input devices 1532 in addition to the touch panel 1531. In particular, other input devices 1532 may include, but are not limited to, one or more of a physical keyboard, function keys (e.g., volume control keys, switch keys, etc.), a trackball, mouse, joystick, etc.
The display unit 1540 may be used to display information input by a user or information provided to the user and various menus of the mobile phone. The display unit 1540 may include a display panel 1541, and alternatively, the display panel 1541 may be configured in the form of a liquid crystal display (Liquid Crystal Display, LCD), an Organic Light-Emitting Diode (OLED), or the like. Further, the touch panel 1531 may cover the display panel 1541, and when the touch panel 1531 detects a touch operation thereon or thereabout, the touch operation is transferred to the processor 1580 to determine the type of touch event, and then the processor 1580 provides a corresponding visual output on the display panel 1541 according to the type of touch event. Although in fig. 3, the touch panel 1531 and the display panel 1541 are two separate components for implementing the input and input functions of the mobile phone, in some embodiments, the touch panel 1531 may be integrated with the display panel 1541 to implement the input and output functions of the mobile phone.
The handset may also include at least one sensor 1550, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor that may adjust the brightness of the display panel 1541 according to the brightness of ambient light, and a proximity sensor that may turn off the display panel 1541 and/or the backlight when the phone is moved to the ear. As one of the motion sensors, the accelerometer sensor can detect the acceleration in all directions (generally three axes), and can detect the gravity and direction when stationary, and can be used for applications of recognizing the gesture of a mobile phone (such as horizontal and vertical screen switching, related games, magnetometer gesture calibration), vibration recognition related functions (such as pedometer and knocking), and the like; other sensors such as gyroscopes, barometers, hygrometers, thermometers, infrared sensors, etc. that may also be configured with the handset are not described in detail herein.
Audio circuitry 1560, a speaker 1561, and a microphone 1562 may provide an audio interface between a user and a cell phone. The audio circuit 1560 may transmit the received electrical signal converted from audio data to the speaker 1561, and be converted into a sound signal by the speaker 1561 for output; on the other hand, the microphone 1562 converts the collected sound signals into electrical signals, which are received by the audio circuit 1560 for conversion into audio data, which is processed by the audio data output processor 1580 for transmission to, for example, another cellular phone via the RF circuit 1510 or for output to the memory 1520 for further processing.
WiFi belongs to a short-distance wireless transmission technology, and a mobile phone can help a user to send and receive emails, browse webpages, access streaming media and the like through a WiFi module 1570, so that wireless broadband Internet access is provided for the user. Although fig. 3 shows WiFi module 1570, it is understood that it is not a necessary component of a cell phone and may be omitted entirely as desired within the scope of not changing the essence of the application.
The processor 1580 is a control center of the mobile phone, connects various parts of the entire mobile phone using various interfaces and lines, and performs various functions and processes data of the mobile phone by running or executing software programs and/or modules stored in the memory 1520 and calling data stored in the memory 1520, thereby performing overall monitoring of the mobile phone. In the alternative, processor 1580 may include one or more processing units; preferably, the processor 1580 can integrate an application processor and a modem processor, wherein the application processor primarily processes operating systems, user interfaces, application programs, and the like, and the modem processor primarily processes wireless communications. It is to be appreciated that the modem processor described above may not be integrated into the processor 1580.
The handset further includes a power supply 1590 (e.g., a battery) for powering the various components, which may preferably be logically connected to the processor 1580 via a power management system so as to provide for the management of charging, discharging, and power consumption by the power management system.
Although not shown, the mobile phone may further include a camera, a bluetooth module, etc., which will not be described herein.
In yet another embodiment of the present application, the processor 1580 included in the terminal further has the following functions:
one or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the one or more processors, the one or more applications configured to:
acquiring at least one service module configuration data keyword, and commanding a corresponding module realization party in a preset management warehouse class based on the service module configuration data keyword;
initializing the module realization party and distributing the life cycle, and calling the initialized module realization party and distributing the life cycle to realize a predefined method in a preset general protocol, wherein the predefined method is used for rendering and/or loading a service module;
integrating each rendered business module in a preset container page to render the page.
In some embodiments, the predetermined container is a carrier container.
A container is an abstraction of the application layer that packages code and dependencies together. Multiple containers may run on the same machine and share the operating system kernel with other containers, each running as a stand-alone process in user space. In the method for rendering the client page, the preset container only performs overall rendering layout and event data forwarding, has clear responsibility, only depends on preset management warehouse class and preset general protocol, has no code coupling between service modules, and reduces maintenance cost.
Preferably, before the obtaining the at least one service module configuration data keyword, the method includes the following steps:
and each parallel service module registers a respective module realization party to a preset management warehouse class by using a key value mode.
In some embodiments, before the obtaining the at least one service module configuration data keyword, the method includes the following steps:
and removing the key value pair registered by the business module in the preset management warehouse class.
Preferably, the key-value pair is preferably a key-value pair, where key is a key and value is a value.
For ease of understanding, a method for rendering a client page according to an embodiment of the present application is exemplified herein by a JSON-based object profile (JavaScript Object Notation, JSON for short) and implementing a preset management repository class in the form of key-value to maintain a service module registration list, where the JSON data format is a lightweight data exchange format that stores and represents data in a text format that is completely independent of programming language based on a subset of JS specifications set by the european computer institute. The compact and clear hierarchical structure makes JSON an ideal data exchange language. Is easy to read and write by people, is easy to analyze and generate by machines, and effectively improves the network transmission efficiency.
In some embodiments, the module implementation method based on the service module configuration data keyword and corresponding to the preset management warehouse class command includes the following steps:
acquiring a preset searching priority of a service module;
and according to the preset searching priority and based on the service module configuration data keyword, commanding the corresponding module realization party in a preset management warehouse class.
In some embodiments, the invoking the initialized and distributed lifecycle module implementer implements a predefined method in a preset generic protocol comprising the steps of:
acquiring a preset rendering priority of a service module;
and calling the initialized module implementer for distributing the life cycle according to the preset rendering priority to implement a predefined method in a preset general protocol.
The lifecycle is the whole process of an object from loading to unloading, and the complete lifecycle of a class includes 7 parts: load-verify-prepare-parse-initialize-use-unload, wherein,
the authentication-preparation-parsing phase, also called the connection phase, except for parsing, other phases occur sequentially, and parsing can be performed across these phases, because Java supports dynamic binding, and a specific type can be determined at runtime; instantiating the object at a use stage;
the loading mechanism of a class has no explicit trigger conditions, but in 5 cases the class must be initialized, then the load-verify-prepare must be completed before this: the first case is to instantiate an object by a new keyword, read or set a static variable of a class, call a static method of the class; the second case is to perform the above three actions by reflection; the third case is when the subclass is initialized, the initialization of the parent class is triggered; the fourth case is when the virtual machine is started, initializing an execution main class; the fifth case is that when jdk1.7 is used for dynamic language support, if a java. Lang. Invoke. Method handle instance final analysis result ref_ getStatic, REF _putstatic, re_invoke static method handle is not initialized, and the class corresponding to the method handle needs to be triggered first for initialization. Notably, there are and only five cases where a class must be initialized, which are referred to as "active references", except for those cases where all other class references do not trigger class initialization, which are referred to as "passive references";
the use of classes includes active references and passive references, where active references refer to initialization; passive references refer to static fields of the parent class, which only cause initialization of the parent class, but not of the child class; defining class arrays, and initializing the classes; referencing the constant of the class does not cause the initialization of the class. In summary, active references will cause the initialization of a class, while passive references will not cause the initialization of a class;
after the class is used, the class is unloaded if the following condition is satisfied:
all instances of the class have been reclaimed, i.e., there are no instances of the class in the java heap;
the class loader that loaded the class has been reclaimed;
the java.lang.class object corresponding to the class is not referenced anywhere, and the method of the class cannot be accessed by reflection anywhere;
if all the three conditions are met, the virtual machine can unload the class when the garbage in the method area is recovered, the class unloading process is to empty class information in the method area, and the whole life cycle of the java class is finished.
In some embodiments, the preset general protocol includes one or more of the following:
a data protocol;
a lifecycle protocol;
an event protocol;
proxy event handling.
In some embodiments, the preset generic protocol is user-defined based.
It will be clear to those skilled in the art that, for convenience and brevity of description, specific working procedures of the above-described systems, apparatuses and units may refer to corresponding procedures in the foregoing method embodiments, which are not repeated herein.
Compared with the prior art, the mobile terminal provided by the application has the following beneficial effects:
according to the multi-service module container construction rendering scheme based on the preset management warehouse class and the preset general protocol, the mobile terminal can improve parallel development and bearing and supporting capacity under the multi-service scene, and meanwhile, the problem of construction rendering of an application program for bearing the multi-service module scene for one page container is solved.
In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices, and methods may be implemented in other manners. For example, the apparatus embodiments described above are merely illustrative, e.g., the division of the units is merely a logical function division, and there may be additional divisions when actually implemented, e.g., multiple units or components may be combined or integrated into another system, or some features may be omitted or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or units, which may be in electrical, mechanical or other form.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in the embodiments of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
Those of ordinary skill in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be implemented by a program to instruct related hardware, the program may be stored in a computer readable storage medium, and the storage medium may include: read Only Memory (ROM), random access Memory (RAM, randomAccess Memory), magnetic disk or optical disk, and the like.
The foregoing is only a partial embodiment of the present application, and it should be noted that it will be apparent to those skilled in the art that modifications and adaptations can be made without departing from the principles of the present application, and such modifications and adaptations are intended to be comprehended within the scope of the present application.

Claims (11)

1. A method for client page rendering, the method for client page rendering comprising the steps of:
acquiring at least one service module configuration data keyword, and commanding a corresponding module realization party in a preset management warehouse class based on the service module configuration data keyword;
initializing the module realization party and distributing the life cycle, and calling the initialized module realization party and distributing the life cycle to realize a predefined method in a preset general protocol, wherein the predefined method is used for rendering and/or loading a service module;
integrating each rendered business module in a preset container page to render the page;
the module realization method based on the service module configuration data keywords corresponding to the preset management warehouse class command comprises the following steps:
acquiring a preset searching priority of a service module;
according to the preset searching priority and based on the service module configuration data keyword, commanding the corresponding module realization party in a preset management warehouse class;
the method for calling the initialized module implementer to realize the pre-definition in the preset general protocol comprises the following steps:
acquiring a preset rendering priority of a service module;
and calling the initialized module implementer for distributing the life cycle according to the preset rendering priority to implement a predefined method in a preset general protocol.
2. The method for rendering a client page according to claim 1, wherein before the step of obtaining at least one service module configuration data key, the method comprises the steps of:
and each parallel service module registers a respective module realization party to a preset management warehouse class by using a key value mode.
3. The method for rendering a client page according to claim 1, wherein before the step of obtaining at least one service module configuration data key, the method comprises the steps of:
and removing the key value pair registered by the business module in the preset management warehouse class.
4. The method of client page rendering of claim 1, wherein the preset common protocol includes one or more of:
a data protocol;
a lifecycle protocol;
an event protocol;
proxy event handling.
5. The method of client page rendering of claim 1, wherein the preset generic protocol is user-defined based.
6. An apparatus for client page rendering, wherein the apparatus for client page rendering comprises:
the acquisition hit module is used for acquiring at least one service module configuration data keyword and hit a corresponding module realization party in a preset management warehouse class based on the service module configuration data keyword;
the initial implementation module is used for initializing the module implementation party and distributing the life cycle, and calling the initialized module implementation party which distributes the life cycle to implement a predefined method in a preset universal protocol, wherein the predefined method is used for rendering and/or loading a service module;
the integration module is used for integrating each rendered business module into a preset container page so as to render the page;
the acquisition hit module includes:
the first acquisition unit is used for acquiring the preset searching priority of the service module;
hit the unit, is used for looking up the priority and based on the said business module and dispose the data keyword and hit the correspondent module realization party in the preset management warehouse class according to the said preset;
the initial implementation module includes:
the second acquisition unit is used for acquiring the preset rendering priority of the service module;
and the realization unit is used for calling the initialized module realization party which distributes the life cycle according to the preset rendering priority to realize the predefined method in the preset general protocol.
7. The apparatus for client page rendering of claim 6, wherein the apparatus for client page rendering comprises:
and the registration module is used for registering respective module realization parties to the preset management warehouse class by using a key value mode before acquiring at least one service module configuration data keyword.
8. The apparatus for client page rendering of claim 6, wherein the apparatus for client page rendering comprises:
and the removing unit is used for removing the key value pair registered by the service module in the preset management warehouse class before acquiring at least one service module configuration data keyword.
9. The apparatus for client page rendering of claim 6, wherein the preset common protocol comprises one or more of:
a data protocol;
a lifecycle protocol;
an event protocol;
proxy event handling.
10. The apparatus for client page rendering of claim 6, wherein the preset generic protocol is user-defined based.
11. A mobile terminal, comprising:
one or more processors;
a memory;
one or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the one or more processors, the one or more applications configured to perform the method of client page rendering of any of claims 1-5.
CN202010123826.2A 2020-02-27 2020-02-27 Client page rendering method and device and mobile terminal Active CN111459565B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010123826.2A CN111459565B (en) 2020-02-27 2020-02-27 Client page rendering method and device and mobile terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010123826.2A CN111459565B (en) 2020-02-27 2020-02-27 Client page rendering method and device and mobile terminal

Publications (2)

Publication Number Publication Date
CN111459565A CN111459565A (en) 2020-07-28
CN111459565B true CN111459565B (en) 2023-08-18

Family

ID=71684171

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010123826.2A Active CN111459565B (en) 2020-02-27 2020-02-27 Client page rendering method and device and mobile terminal

Country Status (1)

Country Link
CN (1) CN111459565B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114201227A (en) * 2020-08-31 2022-03-18 武汉斗鱼鱼乐网络科技有限公司 Time-sharing loading management method, storage medium, electronic device and system
CN113467876A (en) * 2021-07-01 2021-10-01 稿定(厦门)科技有限公司 Page component generation method and device
CN113672829B (en) * 2021-07-20 2024-03-26 北京达佳互联信息技术有限公司 Page display method and device, electronic equipment and storage medium
CN114416113B (en) * 2021-12-30 2023-05-12 中国电信股份有限公司 Data release system, method and device based on containerization

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106202096A (en) * 2015-05-05 2016-12-07 阿里巴巴集团控股有限公司 Customer terminal webpage rendering intent and device
CN108334387A (en) * 2017-01-20 2018-07-27 阿里巴巴集团控股有限公司 Dynamic interface rendering intent and device
CN109101300A (en) * 2018-06-14 2018-12-28 腾讯科技(深圳)有限公司 A kind of page rendering method, apparatus and terminal

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106202096A (en) * 2015-05-05 2016-12-07 阿里巴巴集团控股有限公司 Customer terminal webpage rendering intent and device
CN108334387A (en) * 2017-01-20 2018-07-27 阿里巴巴集团控股有限公司 Dynamic interface rendering intent and device
CN109101300A (en) * 2018-06-14 2018-12-28 腾讯科技(深圳)有限公司 A kind of page rendering method, apparatus and terminal

Also Published As

Publication number Publication date
CN111459565A (en) 2020-07-28

Similar Documents

Publication Publication Date Title
CN111459565B (en) Client page rendering method and device and mobile terminal
US11388220B2 (en) Image distribution method and apparatus, and image obtaining method and apparatus
US10186244B2 (en) Sound effect processing method and device, plug-in unit manager and sound effect plug-in unit
CN106502703B (en) Function calling method and device
CN103473092B (en) A kind of download the processing method of application, device and terminal unit
CN104252341A (en) Method and device for resurfacing application program and client side device of application program
CN114185491B (en) Partition file downloading method and device, storage medium and computer equipment
CN110046497B (en) Function hook realization method, device and storage medium
CN111770009B (en) Data transmission method and related equipment
CN106202422B (en) The treating method and apparatus of Web page icon
CN103793267B (en) The access method and device of queue
CN111309325B (en) Third party library reference method and device and mobile terminal
CN109189576B (en) Redis-based request processing method, server and computer-readable storage medium
CN111813296A (en) View component display method and device and terminal
CN105528220B (en) Method and device for loading dynamic shared object
CN111367502A (en) Numerical value processing method and device
KR101981885B1 (en) Application Acceleration Methods and Devices
CN115065609A (en) B-end SaaS system hybrid deployment method and system
CN109471708B (en) Task processing method, device and system
CN115373865A (en) Concurrent thread management method, device, electronic equipment and storage medium
CN106775745A (en) The method and device of consolidation procedure code
CN108984227A (en) A kind of method, device and mobile terminal of quick opening application program
CN105208064A (en) Method and device for acquiring micro blog messages
CN113821276B (en) Custom service management method and related device
CN116775158A (en) Method, device, equipment and storage medium for processing configuration file

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