CN110032406A - Message based view loading method, device, equipment and storage medium - Google Patents
Message based view loading method, device, equipment and storage medium Download PDFInfo
- Publication number
- CN110032406A CN110032406A CN201910304351.4A CN201910304351A CN110032406A CN 110032406 A CN110032406 A CN 110032406A CN 201910304351 A CN201910304351 A CN 201910304351A CN 110032406 A CN110032406 A CN 110032406A
- Authority
- CN
- China
- Prior art keywords
- view
- protocol
- function
- load
- target
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/44—Arrangements for executing specific programs
- G06F9/445—Program loading or initiating
- G06F9/44505—Configuring for program initiating, e.g. using registry, configuration files
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Stored Programmes (AREA)
Abstract
The embodiment of the invention discloses a kind of message based view loading method, device, equipment and storage mediums.This method comprises: determining the target view mark of target view according to function initiation message when receiving the function initiation message of triggering view load;Input parameter is identified as with target view, object acquisition function is called by object set, it obtains target view and identifies corresponding target view protocol object, wherein, object set is that initial views class is based on view predetermined load agreement and generates for storing each view identification and view protocol object corresponding with each view identification, view protocol object;View is called to load protocol function by target view protocol object, to load target view, wherein view load protocol function is that view loads the protocol function for including in agreement.Through the above technical solutions, realizing the distributing load of each view in the page, improves the page and start speed.
Description
Technical field
The present embodiments relate to computer technology more particularly to a kind of message based view loading method, device, set
Standby and storage medium.
Background technique
Currently, each view in a page is in the page in the application program based on android system exploitation
It is loaded when starting.If shown comprising very more views when the page starts in the page, started in the page
Many view load operations are just needed to be implemented in journey, so that the start-up course of full page takes a long time, the page are caused to start
It slows, influences user experience.
Summary of the invention
The embodiment of the present invention provides a kind of message based view loading method, device, equipment and storage medium, to realize
The distributing load of each view, improves the page and starts speed in the page.
In a first aspect, the embodiment of the invention provides a kind of message based view loading methods, comprising:
When receiving the function initiation message of triggering view load, target view is determined according to the function initiation message
Target view mark;
It is identified as input parameter with the target view, object acquisition function is called by object set, obtains the mesh
Mark the corresponding target view protocol object of view identification, wherein the object set for store each view identification and with it is each
The corresponding view protocol object of the view identification, the view protocol object are that initial views class is based on view predetermined
It loads agreement and generates;
View is called to load protocol function by the target view protocol object, to load the target view, wherein
The view load protocol function is that the view loads the protocol function for including in agreement.
Optionally, input parameter is being identified as with the target view, object acquisition function is called by object set, is obtained
Before the target view identifies corresponding target view protocol object, further includes:
After generating any view protocol object, assisted with the view identification of the view protocol object and the view
Discussing object is input parameter, by message distribution object reference object registration function, by the view mark of the view protocol object
Know and the view protocol object is stored to the object set.
Further, generating view protocol object includes:
The initial views class inherits the view by protocol inheritance keyword and loads agreement, and makes carbon copies the view and add
The protocol function in agreement is carried, the view obtained in protocol view class and the protocol view class loads protocol function;
The view protocol object is generated according to the protocol view class, the view protocol object is that view loads agreement
The view object of type.
Optionally, the object set has private permission modifier, and the object set is key-value pair predetermined
The set of type, and the type of the key of the object set is that view loads protocol type.
Optionally, the view load protocol function realizes the function of loading the target view in the following way:
It is that input parameter is obtained by context object calling system object acquisition function with system layout service keyword
Obtain system loads object;
It is identified as input parameter with the corresponding topology file of the target view, is regarded by the system loads object reference
Figure layout function, loads the topology file of the target view, and generates the load view object of view type.
Further, after the load view object for generating view type, further includes:
It is respectively input parameter with the corresponding sub- view identification of each sub- view in the target view, passes through the load
View object calls sub- view lookup function, obtains each sub- view object and the corresponding load of each sub- view object is believed
Breath, to fill the target view.
Second aspect, the embodiment of the invention also provides a kind of message based view loading device, which includes:
Target view identifies determining module, for when receiving the function initiation message of triggering view load, according to institute
State the target view mark that function initiation message determines target view;
Target view protocol object obtains module and passes through object set for being identified as input parameter with the target view
It closes and calls object acquisition function, obtain the target view and identify corresponding target view protocol object, wherein the object set
It shares in storing each view identification and view protocol object corresponding with each view identification, the view protocol object are
Initial views class is based on view predetermined load agreement and generates;
Target view loading module, for calling view to load protocol function by the target view protocol object, with
Load the target view, wherein the view load protocol function is that the view loads the protocol function for including in agreement.
Optionally, on the basis of above-mentioned apparatus, which further includes object storage module, is used for:
It is being identified as input parameter with the target view, object acquisition function is being called by object set, described in acquisition
Before target view identifies corresponding target view protocol object, after generating any view protocol object, with the view
The view identification of figure protocol object and the view protocol object are input parameter, pass through message distribution object reference object registration
Function stores the view identification of the view protocol object and the view protocol object to the object set.
Further, the object storage module includes that view protocol object generates submodule, in the following way
Generate the view protocol object:
The initial views class inherits the view by protocol inheritance keyword and loads agreement, and makes carbon copies the view and add
The protocol function in agreement is carried, the view obtained in protocol view class and the protocol view class loads protocol function;
The view protocol object is generated according to the protocol view class, the view protocol object is that view loads agreement
The view object of type.
Optionally, the object set has private permission modifier, and the object set is key-value pair predetermined
The set of type, and the type of the key of the object set is that view loads protocol type.
Optionally, the target view loading module includes function implementation sub-module, is added for realizing in the following way
Carry the function of the target view:
It is that input parameter is obtained by context object calling system object acquisition function with system layout service keyword
Obtain system loads object;
It is identified as input parameter with the corresponding topology file of the target view, is regarded by the system loads object reference
Figure layout function, loads the topology file of the target view, and generates the load view object of view type.
Further, function implementation sub-module is specifically used for:
It is corresponding with each sub- view in the target view respectively after the load view object for generating view type
Sub- view identification is input parameter, calls sub- view lookup function by the load view object, obtains each sub- view object
And the corresponding load information of each sub- view object, to fill the target view.
The third aspect, the embodiment of the invention also provides a kind of equipment, which includes:
One or more processors;
Storage device, for storing one or more programs,
When one or more of programs are executed by one or more of processors, so that one or more of processing
Device realizes message based view loading method provided by any embodiment of the invention.
Fourth aspect, the embodiment of the invention also provides a kind of computer readable storage mediums, are stored thereon with computer
Program, the computer program realize message based view load provided by any embodiment of the invention when being executed by processor
Method.
The embodiment of the present invention is by when receiving the function initiation message of triggering view load, according to function initiation message
Determine the target view mark of target view;It is identified as input parameter with target view, object acquisition is called by object set
Function obtains target view and identifies corresponding target view protocol object;View load is called by target view protocol object
Protocol function, to load target view.Realizing in message distributor function initiation message based on the received and determining needs
The load operation of target view to be loaded and performance objective view, solving all views in the page must be when the page starts
All the page caused by load starts slow problem, has reached according to message and has loaded each view distributing in the page,
To improve page starting speed and promote the technical effect of user experience.
Detailed description of the invention
Fig. 1 is the flow chart of the message based view loading method of one of embodiment of the present invention one;
Fig. 2 is the structural schematic diagram of the message based view loading device of one of embodiment of the present invention two;
Fig. 3 is the structural schematic diagram of one of the embodiment of the present invention three equipment.
Specific embodiment
The present invention is described in further detail with reference to the accompanying drawings and examples.It is understood that this place is retouched
The specific embodiment stated is used only for explaining the present invention rather than limiting the invention.It also should be noted that in order to just
Only the parts related to the present invention are shown in description, attached drawing rather than entire infrastructure.
Embodiment one
Message based view loading method provided in this embodiment is applicable to the application program based on android system
Start situation.This method can be executed by message based view loading device, which can be by software and/or hardware
Mode realizes that the device can integrate in the equipment for carrying android system, such as typically subscriber terminal equipment, example
Such as mobile phone, tablet computer or smart television.Referring to Fig. 1, the method for the present embodiment includes:
S110, receive triggering view load function initiation message when, according to function initiation message determine target regard
The target view of figure identifies.
Wherein, function initiation message refers to that trigger control executes first message of control function, when issuing of the message
Machine is related to specifically business demand, such as can be and issue again when needing displaying target view, rather than target view institute
The page starting when issue.Its corresponding view identification and message content are included at least in function initiation message.Target view
It is to need view to be loaded.Target view mark is the mark of target view, can be title, generation claims or other can be unique
Characterize at least one of number, letter and symbol of target view etc..
Specifically, when view loading device receives a function initiation message, the function initiation message can be parsed,
To obtain the view identification for including in message, i.e., the target view mark of target view is obtained by function initiation message.
The reception of message is usually provided with message sink channel, alternatively referred to as message distributor or messaging bus.
S120, it is identified as input parameter with target view, object acquisition function is called by object set, obtain target view
The corresponding target view protocol object of map logo.
Wherein, object set is one predetermined set, for the adduction relationship of storage object, can be array
Type or list type etc. can store the data type of multiple objects.Object acquisition function is the member function of object set,
It is used to obtain set element value from object set.
Illustratively, object set has private permission modifier, and object set is key-value pair type predetermined
Set, and the type of the key of object set is that view loads protocol type.Here, view load agreement is predetermined, is used
In realizing the agreement for carrying out view load according to message, interior includes the view load protocol function for realizing view load operation.
For example, agreement is realized with interface form, then the definition code example of view load agreement is Public interface
IInflate{Public void inflateView();, IInflate is just the title of view load agreement,
InflateView () just loads protocol function for view.By taking map key-value pair as an example, example that object set is defined and initialized
Code be private Map<String, IInflate>mapList=new HashMap<String, IInflate>(),
Maplist is the title of object set, is a global private variable, ensures that the object set in this way
MapList is merely able to be accessed by message distributor, other classes can not access to it.Key information in object set is character
Go here and there String type, can respective view mark, what the value information in object set represented is view load protocol type
The object data of IInflate.
Illustratively, object set is for storing each view identification and view agreement pair corresponding with each view identification
As.Wherein, view protocol object is the view object of a view load protocol type, and it is fixed in advance to be based on for initial views class
The view of justice loads agreement and generates, wherein loading protocol function comprising view.Key letter in object set according to the above description
Breath can correspond to view identification, and value information can correspond to view protocol object, that is to say, that object set constructs view information
With the mapping relations between view protocol object, the corresponding view protocol object of a view identification.
Specifically, it after view loading device has determined target view mark, in order to load target view, just needs to obtain
The corresponding view protocol object of target view (i.e. target view protocol object), and then adjusted by the target view protocol object
Protocol function is loaded with view, to realize the load of target view.
It is stored in due to view protocol object in the object set of message distributor maintenance, therefore view loading device needs
Object set is accessed first, come determine object set mapList whether is empty by way of mapList==null.Such as
Fruit is sky, just terminates this message based view load process.If being not sky, (such as A) is just identified with target view
For function input parameters, object acquisition function, i.e. mapList.get (A) are called by object set.Inside object acquisition function
A can be identified according to target view and to search the value in corresponding key-value pair and return to the value, i.e., acquisition target view mark is corresponding
View protocol object mIInflate, referred to as target view protocol object.
Illustratively, before S120, further includes: after generating any view protocol object, with view protocol object
View identification and view protocol object are input parameter, by message distribution object reference object registration function, by view agreement
The view identification and view protocol object of object are stored to object set.
Wherein, message distribution object is the corresponding instance object of message distributor, be used to handle message distribution and
View load in the embodiment of the present invention.Object registration function is the function defined in message distribution class in advance, be used for by
Set element be written object set, that is to say, that the adduction relationship of view protocol object is registered to message distributor, so as to
Each view protocol object can be directly accessed when executing view load operation.The code sample of the object registration function are as follows:
Public void setInflateListener (String viewName, IInflate inflateListener), the letter
Several function names is setInflateListener, is the function of a publicly-owned public type, and return value is sky void
Type.It is to object set carry out write-access, therefore by its function input parameters in object set key and be worth be arranged phase
Together, first function parameter is the parameter viewName of String type, and second function parameter is view load agreement
The parameter inflateListener of IInflate type.
Specifically, according to the above description, what is stored in object set is view identification and its corresponding view protocol object,
Therefore before the set element for executing S120 obtains, need to first carry out the addition process of set element.When it is implemented, generating
It is just letter by the corresponding view identification of view protocol object and the view protocol object after any one view protocol object
Number input parameter, calls the object registration function setInflateListener in message distribution object.Object registration function
It realizes the inside of setInflateListener are as follows: may determine that input parameter, i.e. view protocol object and its view mark first
Know, if be correct function input parameters, such as may determine that whether view protocol object and its view identification are empty.If
For sky, then terminate this set element addition process.If being not sky, using view protocol object and its view identification as function
Parameter is inputted, calls the element in object set mapList to add function add (), by the view identification of the view protocol object
It stores with the view protocol object to object set.
Illustratively, generating view protocol object includes: that initial views class is added by protocol inheritance keyword succession view
Agreement is carried, and makes carbon copies the protocol function in view load agreement, obtains the view load in protocol view class and protocol view class
Protocol function;View protocol object is generated according to protocol view class, view protocol object is the view that view loads protocol type
Object.
Specifically, it before the write-access for executing object set, needs first to generate view protocol object.Since view is assisted
View object is the view object of view load protocol type, therefore needs for the view class (i.e. initial views class) initially defined to be arranged
Agreement is loaded to inherit view.When it is implemented, make initial views class by protocol inheritance keyword implements come after
It holds view load agreement, and makes carbon copies and realize the protocol function in view load agreement, that is, the view load protocol function defined,
The view class (i.e. protocol view class) and its interior view that view load protocol type can be obtained load protocol function.Later,
Based on protocol view class instance object, view protocol object is generated.
S130, view is called to load protocol function by target view protocol object, to load target view.
Specifically, after obtaining target view protocol object, in order to improve logic preciseness, pass through mIInflate first
The mode of==null judges whether the target view protocol object is empty.If it is empty, then terminate this message based view
Load process.If not empty, then the view in the target view protocol object is called to load protocol function, i.e.,
MIInflate.inflateView (), to trigger and realize the load operation of target view.
Illustratively, view load protocol function realizes the function of load target view in the following way: with system cloth
Office's service keyword is input parameter, passes through context object calling system object acquisition function, acquisition system loads object;With
The corresponding topology file of target view is identified as input parameter, by system loads object reference view layout function, loads mesh
The topology file of view is marked, and generates the load view object of view type.
Wherein, system layout service keyword refers to what android system provided, opens for realizing the system of view layout
The title or mark of service are sent out, such as can be LAYOUT_INFLATER_SERVICE.System loads object is Android system
What system provided, for realizing the object of view load, the interior function comprising realizing view layout and load operation, i.e. view cloth
Office's function.Topology file is the file of the information such as the layout parameter for recording each view and control.Load view object refers to view
The object generated after figure load.
Specifically, in the inside of view load protocol function, view load is realized by following process: first with system cloth
Office service keyword LAYOUT_INFLATER_SERVICE is function input parameters, and in calling context object Context is
Unite object acquisition function getSystemService, i.e. Context.getSystemService (Context.LAYOUT_
INFLATER_SERVICE), function return value is obtained, i.e., the system of the layout loading type LayoutInflater in system adds
Carry object mInflater.Later, it is inputted and is joined as function using the corresponding topology file mark R.layout.view_a of target view A
Number, calling system loads the view layout function inflate in object mInflater, to load the topology file of target view A
Information, and the load view object mView of view view type is generated come packing objective view according to topology file information.?
What the load view object mView of view type was just represented in memory is to need target view to be loaded, is so far just completed whole
The load of a target view A.
The technical solution of the present embodiment, by when receiving the function initiation message of triggering view load, according to function
Initiation message determines the target view mark of target view;It is identified as input parameter with target view, is called by object set
Object acquisition function obtains target view and identifies corresponding target view protocol object;It is called by target view protocol object
View loads protocol function, to load target view.Function starting based on the received is realized in message distributor to disappear
Breath determines the load operation for needing target view to be loaded and performance objective view, and solving all views in the page must be in page
The page caused by all loading when face starts starts slow problem, has reached according to message and has dispersed each view in the page
Formula load, to improve page starting speed and promote the technical effect of user experience.
Based on the above technical solution, generate view type load view object after, further includes: respectively with
The corresponding sub- view identification of each sub- view in target view is input parameter, passes through load view object and calls sub- view lookup
Function obtains each sub- view object and the corresponding load information of every sub- view object, to fill target view.
Wherein, sub- view identification refers to the mark for uniquely characterizing sub- view, is character string type, such as can be word
At least one of mother, numbers and symbols etc..Sub- view lookup function is the sub- view layout function that android system provides,
It is used to determine layout information of sub- view from topology file, and is laid out to it and fills.
Specifically, above-mentioned loaded target view is father's view, also referred to as view container, is used to accommodate specific aobvious
Show control, the referred to as sub- view of father's view.After target view load, can be to be filled for the sub- view of include in it each in
Hold, to carry out subsequent display operation.When it is implemented, just executing in target view A comprising several sub- views as follows several times
Process: using sub- view identification as function input parameters, the sub- view lookup function in load view object mView is called
FindViewById (), to obtain the sub- view object and its layout information and load information (such as filling content), to realize son
The load of view and fills.After the load of all sub- views operation is finished, target view is just also filled and finishes.
The advantages of this arrangement are as follows corresponding display fills can be directly executed after target view load, it can be further
The display speed of target view is improved, to further increase page starting speed.
It is the embodiment of message based view loading device provided in an embodiment of the present invention below, the device and above-mentioned each
The message based view loading method of embodiment belongs to the same inventive concept, in the reality of message based view loading device
The detail content of not detailed description in example is applied, the embodiment of above-mentioned message based view loading method can be referred to.
Embodiment two
The present embodiment provides a kind of message based view loading devices, and referring to fig. 2, which specifically includes:
Target view identify determining module 210, for receive triggering view load function initiation message when, foundation
Function initiation message determines the target view mark of target view;
Target view protocol object obtains module 220 and passes through object set for being identified as input parameter with target view
Object acquisition function is called, target view is obtained and identifies corresponding target view protocol object, wherein object set is for storing
Each view identification and view protocol object corresponding with each view identification, view protocol object are that initial views class is based in advance
The view of definition loads agreement and generates;
Target view loading module 230, for calling view to load protocol function by target view protocol object, to add
Carry target view, wherein view load protocol function is that view loads the protocol function for including in agreement.
Optionally, on the basis of above-mentioned apparatus, which further includes object storage module, is used for:
It is being identified as input parameter with target view, object acquisition function is called by object set, obtains target view
Before identifying corresponding target view protocol object, after generating any view protocol object, with the view of view protocol object
Mark and view protocol object are input parameter, by message distribution object reference object registration function, by view protocol object
View identification and view protocol object store to object set.
Further, object storage module includes that view protocol object generates submodule, for generating in the following way
View protocol object:
Initial views class inherits view by protocol inheritance keyword and loads agreement, and makes carbon copies the association in view load agreement
Function is discussed, the view obtained in protocol view class and protocol view class loads protocol function;
View protocol object is generated according to protocol view class, view protocol object is the view pair that view loads protocol type
As.
Optionally, object set has private permission modifier, and object set is the collection of key-value pair type predetermined
It closes, and the type of the key of object set is that view loads protocol type.
Optionally, target view loading module 230 includes function implementation sub-module, for realizing load in the following way
The function of target view:
It is that input parameter is obtained by context object calling system object acquisition function with system layout service keyword
Obtain system loads object;
It is identified as input parameter with the corresponding topology file of target view, passes through system loads object reference view layout letter
Number, loads the topology file of target view, and generate the load view object of view type.
Further, function implementation sub-module is specifically used for:
After the load view object for generating view type, respectively with the corresponding sub- view of each sub- view in target view
Map logo is input parameter, calls sub- view lookup function by load view object, obtains each sub- view object and every height
The corresponding load information of view object, to fill target view.
Two a kind of message based view loading device through the embodiment of the present invention, realizes each view in the page
Distributing load improves page starting speed.
Message based view loading device provided by the embodiment of the present invention can be performed any embodiment of that present invention and be mentioned
The message based view loading method supplied, has the corresponding functional module of execution method and beneficial effect.
It is worth noting that, in the embodiment of above-mentioned message based view loading device, included each unit and
Module is only divided according to the functional logic, but is not limited to the above division, as long as corresponding functions can be realized
?;In addition, the specific name of each functional unit is also only for convenience of distinguishing each other, the protection being not intended to restrict the invention
Range.
Embodiment three
Referring to Fig. 3, a kind of equipment 300 is present embodiments provided comprising: one or more processors 320;Storage device
310, for storing one or more programs, when one or more programs are executed by one or more processors 320, so that one
Or multiple processors 320 realize message based view loading method provided by the embodiment of the present invention, comprising:
When receiving the function initiation message of triggering view load, the mesh of target view is determined according to function initiation message
Mark view identification;
It is identified as input parameter with target view, object acquisition function is called by object set, obtains target view mark
Know corresponding target view protocol object, wherein object set is for storing each view identification and corresponding with each view identification
View protocol object, view protocol object be initial views class be based on view predetermined load agreement and generate;
View is called to load protocol function by target view protocol object, to load target view, wherein view load
Protocol function is that view loads the protocol function for including in agreement.
Certainly, it will be understood by those skilled in the art that processor 320 can also realize that any embodiment of that present invention is provided
Message based view loading method technical solution.
The equipment 300 that Fig. 3 is shown is only an example, should not function to the embodiment of the present invention and use scope bring
Any restrictions.As shown in figure 3, the equipment 300 includes processor 320, storage device 310, input unit 330 and output device
340;The quantity of processor 320 can be one or more in equipment, in Fig. 3 by taking a processor 320 as an example;Place in equipment
Reason device 320, storage device 310, input unit 330 can be connected with output device 340 by bus or other modes, in Fig. 3
For being connected by bus 350.
Storage device 310 is used as a kind of computer readable storage medium, and it is executable to can be used for storing software program, computer
Program and module, such as the corresponding program instruction of message based view loading method/module (example in the embodiment of the present invention
Such as, in message based view loading device target view mark determining module, target view protocol object obtain module and
Target view loading module).
Storage device 310 can mainly include storing program area and storage data area, wherein storing program area can store operation
Application program needed for system, at least one function;Storage data area, which can be stored, uses created data etc. according to terminal.
In addition, storage device 310 may include high-speed random access memory, it can also include nonvolatile memory, for example, at least
One disk memory, flush memory device or other non-volatile solid state memory parts.In some instances, storage device 310
It can further comprise the memory remotely located relative to processor 320, these remote memories can be by being connected to the network extremely
Equipment.The example of above-mentioned network includes but is not limited to internet, intranet, local area network, mobile radio communication and combinations thereof.
Input unit 330 can be used for receiving the number or character information of input, and generate with the user setting of equipment with
And the related key signals input of function control.Output device 340 may include that display screen etc. shows equipment.
Example IV
The present embodiment provides a kind of storage mediums comprising computer executable instructions, and computer executable instructions are by counting
For executing a kind of message based view loading method when calculation machine processor executes, this method comprises:
When receiving the function initiation message of triggering view load, the mesh of target view is determined according to function initiation message
Mark view identification;
It is identified as input parameter with target view, object acquisition function is called by object set, obtains target view mark
Know corresponding target view protocol object, wherein object set is for storing each view identification and corresponding with each view identification
View protocol object, view protocol object be initial views class be based on view predetermined load agreement and generate;
View is called to load protocol function by target view protocol object, to load target view, wherein view load
Protocol function is that view loads the protocol function for including in agreement.
Certainly, a kind of storage medium comprising computer executable instructions, computer provided by the embodiment of the present invention
Executable instruction is not limited to method operation as above, and message based view provided by any embodiment of the invention can also be performed
Relevant operation in figure loading method.
By the description above with respect to embodiment, it is apparent to those skilled in the art that, the present invention
It can be realized by software and required common hardware, naturally it is also possible to which by hardware realization, but in many cases, the former is more
Good embodiment.Based on this understanding, technical solution of the present invention substantially in other words contributes to the prior art
Part can be embodied in the form of software products, which can store in computer readable storage medium
In, floppy disk, read-only memory (Read-Only Memory, ROM), random access memory (Random such as computer
Access Memory, RAM), flash memory (FLASH), hard disk or CD etc., including some instructions are used so that a carrying
The equipment (can be mobile phone, palm PC or smart television etc.) of android system executes each embodiment of the present invention and is provided
Message based view loading method.
Note that the above is only a better embodiment of the present invention and the applied technical principle.It will be appreciated by those skilled in the art that
The invention is not limited to the specific embodiments described herein, be able to carry out for a person skilled in the art it is various it is apparent variation,
It readjusts and substitutes without departing from protection scope of the present invention.Therefore, although being carried out by above embodiments to the present invention
It is described in further detail, but the present invention is not limited to the above embodiments only, without departing from the inventive concept, also
It may include more other equivalent embodiments, and the scope of the invention is determined by the scope of the appended claims.
Claims (10)
1. a kind of message based view loading method characterized by comprising
When receiving the function initiation message of triggering view load, the mesh of target view is determined according to the function initiation message
Mark view identification;
It is identified as input parameter with the target view, object acquisition function is called by object set, obtains the target view
The corresponding target view protocol object of map logo, wherein the object set for store each view identification and with it is each described
The corresponding view protocol object of view identification, the view protocol object are that initial views class is loaded based on view predetermined
Agreement and generate;
View is called to load protocol function by the target view protocol object, to load the target view, wherein described
View load protocol function is that the view loads the protocol function for including in agreement.
2. the method according to claim 1, wherein passing through being identified as input parameter with the target view
Object set calls object acquisition function, before obtaining the corresponding target view protocol object of the target view mark, also wraps
It includes:
After generating any view protocol object, with the view identification of the view protocol object and the view agreement pair
As to input parameter, by message distribution object reference object registration function, by the view identification of the view protocol object and
The view protocol object is stored to the object set.
3. according to the method described in claim 2, it is characterized in that, generation view protocol object includes:
The initial views class inherits the view by protocol inheritance keyword and loads agreement, and makes carbon copies view load association
Protocol function in view, the view obtained in protocol view class and the protocol view class load protocol function;
The view protocol object is generated according to the protocol view class, the view protocol object is that view loads protocol type
View object.
4. method according to claim 1-3, which is characterized in that the object set is modified with private permission
Symbol, the object set is the set of key-value pair type predetermined, and the type of the key of the object set adds for view
Carry protocol type.
5. the method according to claim 1, wherein view load protocol function is realized in the following way
Load the function of the target view:
It is that input parameter is by context object calling system object acquisition function with system layout service keyword
System load object;
It is identified as input parameter with the corresponding topology file of the target view, passes through the system loads object reference view cloth
Office's function, loads the topology file of the target view, and generate the load view object of view type.
6. according to the method described in claim 5, it is characterized in that, being gone back after the load view object for generating view type
Include:
It is respectively input parameter with the corresponding sub- view identification of each sub- view in the target view, passes through the load view
The sub- view lookup function of object reference obtains each sub- view object and the corresponding load information of each sub- view object, with
Fill the target view.
7. a kind of message based view loading device characterized by comprising
Target view identify determining module, for receive triggering view load function initiation message when, according to the function
Energy initiation message determines the target view mark of the target view;
Target view protocol object obtains module and passes through object set tune for being identified as input parameter with the target view
With object acquisition function, obtains the target view and identify corresponding target view protocol object, wherein the object set is used
In storing each view identification and view protocol object corresponding with each view identification, the view protocol object is initial
View class is based on view predetermined load agreement and generates;
Target view loading module, for calling view to load protocol function by the target view protocol object, with load
The target view, wherein the view load protocol function is that the view loads the protocol function for including in agreement.
8. device according to claim 7, which is characterized in that the target view loading module includes that function executes submodule
Block, for realizing the function of loading the target view in the following way:
It is that input parameter is by context object calling system object acquisition function with system layout service keyword
System load object;
It is identified as input parameter with the corresponding topology file of the target view, passes through the system loads object reference view cloth
Office's function, loads the topology file of the target view, and generate the load view object of view type.
9. a kind of equipment, which is characterized in that the equipment includes:
One or more processors;
Storage device, for storing one or more programs,
When one or more of programs are executed by one or more of processors, so that one or more of processors are real
The now message based view loading method as described in any in claim 1-7.
10. a kind of computer readable storage medium, is stored thereon with computer program, which is characterized in that the computer program
The message based view loading method as described in any in claim 1-7 is realized when being executed by processor.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910304351.4A CN110032406B (en) | 2019-04-16 | 2019-04-16 | Message-based view loading method, device, equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910304351.4A CN110032406B (en) | 2019-04-16 | 2019-04-16 | Message-based view loading method, device, equipment and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN110032406A true CN110032406A (en) | 2019-07-19 |
CN110032406B CN110032406B (en) | 2022-07-05 |
Family
ID=67238604
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910304351.4A Active CN110032406B (en) | 2019-04-16 | 2019-04-16 | Message-based view loading method, device, equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110032406B (en) |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106598588A (en) * | 2016-12-09 | 2017-04-26 | 武汉斗鱼网络科技有限公司 | Method and device for loading page element |
CN107491298A (en) * | 2017-07-07 | 2017-12-19 | 武汉斗鱼网络科技有限公司 | A kind of button object automatic scanning method and system |
CN108196929A (en) * | 2018-01-09 | 2018-06-22 | 武汉斗鱼网络科技有限公司 | A kind of intelligence loading system, method, storage medium and equipment |
-
2019
- 2019-04-16 CN CN201910304351.4A patent/CN110032406B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106598588A (en) * | 2016-12-09 | 2017-04-26 | 武汉斗鱼网络科技有限公司 | Method and device for loading page element |
CN107491298A (en) * | 2017-07-07 | 2017-12-19 | 武汉斗鱼网络科技有限公司 | A kind of button object automatic scanning method and system |
CN108196929A (en) * | 2018-01-09 | 2018-06-22 | 武汉斗鱼网络科技有限公司 | A kind of intelligence loading system, method, storage medium and equipment |
Non-Patent Citations (1)
Title |
---|
CSDN: "View的inflate详解", 《HTTPS://BLOG.CSDN.NET/BOYELEVEN/ARTICLE/DETAILS/82776485》 * |
Also Published As
Publication number | Publication date |
---|---|
CN110032406B (en) | 2022-07-05 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108763090A (en) | Test environment dispositions method, device, computer equipment and storage medium | |
CN111596965B (en) | Project engineering initialization method, device, computer equipment and storage medium | |
US8549471B2 (en) | Method and apparatus for providing API service and making API mash-up, and computer readable recording medium thereof | |
CN105453078A (en) | Bundle package retrieving | |
CN108984388A (en) | A kind of method and terminal device generating automatic test cases | |
CN108959384B (en) | Webpage data acquisition method and device, computer equipment and storage medium | |
CN105337928A (en) | User identity identification method and apparatus, and safety protection problem generation method and apparatus | |
CN105378740A (en) | Bundle package signing | |
CN107957837B (en) | Method and device for generating shortcut of webpage application program and terminal equipment | |
CN106250104A (en) | A kind of remote operating system for server, method and device | |
CN108279882B (en) | Framework generation method, device, equipment and computer readable medium | |
CN108881393B (en) | Data issuing method, device, computer and storage medium | |
CN104423961A (en) | Method and system for generating testing script | |
CN108132797A (en) | A kind of upgrade method of remote controler, SoC chip and its application program | |
CN113010224A (en) | Front-end micro-service method, device, computer equipment and storage medium | |
CN109343983A (en) | Information interacting method, device, equipment and storage medium between functional module | |
CN110968296B (en) | Data acquisition method, device, equipment and readable storage medium | |
CN105354195A (en) | Information search method and apparatus | |
CN107423395A (en) | Navigation data processing system | |
CN111209061A (en) | Method and device for filling in user information, computer equipment and storage medium | |
CN114385382A (en) | Light application access method and device, computer equipment and storage medium | |
CN110032406A (en) | Message based view loading method, device, equipment and storage medium | |
CN110889670A (en) | Service approval system, method and device and computer readable storage medium | |
CN113144619B (en) | Method and system for visually configuring dynamic functions | |
CN106528196B (en) | The APP loading method of smart machine and the smart machine, system of application this method |
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 |