CN104461618B - The method and device of load-on module - Google Patents

The method and device of load-on module Download PDF

Info

Publication number
CN104461618B
CN104461618B CN201410692666.8A CN201410692666A CN104461618B CN 104461618 B CN104461618 B CN 104461618B CN 201410692666 A CN201410692666 A CN 201410692666A CN 104461618 B CN104461618 B CN 104461618B
Authority
CN
China
Prior art keywords
module
customs assigned
assigned number
program
modular
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
CN201410692666.8A
Other languages
Chinese (zh)
Other versions
CN104461618A (en
Inventor
马燕龙
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Gridsum Technology Co Ltd
Original Assignee
Beijing Gridsum Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Gridsum Technology Co Ltd filed Critical Beijing Gridsum Technology Co Ltd
Priority to CN201410692666.8A priority Critical patent/CN104461618B/en
Publication of CN104461618A publication Critical patent/CN104461618A/en
Application granted granted Critical
Publication of CN104461618B publication Critical patent/CN104461618B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Stored Programmes (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The invention discloses a kind of method and devices of load-on module.Wherein, this method includes:Acquisition module table, module table include the correspondence between pre-set module number ID, Customs Assigned Number ID and module number ID and Customs Assigned Number ID;Customs Assigned Number ID according to currently recognizing is inquired from module table, gets the module number ID corresponding to the Customs Assigned Number ID currently recognized;Obtain the corresponding modular program packets of Customs Assigned Number ID currently recognized;Parsing module program bag, and modular program packet is loaded onto application program, the present invention is solved in the method for existing load-on module, and all function modules need to be all loaded into the problem of application program could use by user including the unwanted module of user.

Description

The method and device of load-on module
Technical field
The present invention relates to computer software fields, in particular to a kind of method and device of load-on module.
Background technology
Silverlight is a kind of Rich Client Technology, is the plug-in unit of cross-platform cross browser, can be application program Exploitation provides relatively rich media function and interactive mode.Above application program can include many functions.In order to use and manage Above-mentioned multiple functions can be divided into different modules, such as news template, sport module, electric business function mould by the convenience of reason system Block etc., each module can all meet a kind of functional requirement of user.User is in the application program that Silverlight is used to develop When, be all by the locally downloading operation of Silverlight application programs, it is and stronger and stronger with the function of application program, Comprising module it is also more and more, Silverlight application programs also can be increasing, and user is needed to use application program The time to be downloaded is also increasingly longer.
What needs to be explained here is that the function module that above application program provides, is not that each user is required for, has A little function modules are just for particular kind of user's.For example electric business function module is just for electric business user, non-electric business Class user does not need to such function module.But it no matter whether user needs is required for that all functions will be contained at present The entire application program of module is locally downloading, can just use application program.
For in the method for existing load-on module, user need to be by all function modules including the unwanted mould of user Block is all loaded into the problem of application program could use, and currently no effective solution has been proposed.
Invention content
It is a primary object of the present invention to provide a kind of method and device of load-on module, to solve existing load-on module In method, all function modules need to be all loaded into application program including the unwanted module of user and could used by user The problem of.
To achieve these goals, one side according to embodiments of the present invention provides a kind of method of load-on module. This method includes:Acquisition module table, module table include pre-set module number ID, Customs Assigned Number ID and module number ID With the correspondence between Customs Assigned Number ID;Customs Assigned Number ID according to currently recognizing is inquired from module table, is obtained To the module number ID corresponding to the Customs Assigned Number ID currently recognized;Obtain the corresponding moulds of Customs Assigned Number ID currently recognized Block program bag;Parsing module program bag, and modular program packet is loaded onto application program.
To achieve these goals, another aspect according to embodiments of the present invention provides a kind of device of load-on module. The device includes:First acquisition unit, for acquisition module table, wherein, module table includes pre-set module number ID, uses Correspondence between family number ID and module number ID and Customs Assigned Number ID;Query unit currently recognizes for basis Customs Assigned Number ID inquired from module table, get corresponding to the Customs Assigned Number ID currently recognized module number ID;Second acquisition unit, for obtaining the corresponding modular program packets of Customs Assigned Number ID currently recognized;Resolution unit is used for Parsing module program bag, and modular program packet is loaded onto application program.
According to inventive embodiments, by acquisition module table, module table includes pre-set module number ID, Customs Assigned Number Correspondence between ID and module number ID and Customs Assigned Number ID;According to the Customs Assigned Number ID currently recognized from module table In inquired, get the module number ID corresponding to the Customs Assigned Number ID currently recognized;Obtain the use currently recognized The corresponding modular program packets of family number ID;Parsing module program bag, and modular program packet is loaded onto application program, it has solved In the method for load-on module, all function modules need to be all loaded into including the unwanted module of user using journey by user The problem of sequence could use.
Description of the drawings
The attached drawing for forming the part of the application is used to provide further understanding of the present invention, schematic reality of the invention Example and its explanation are applied for explaining the present invention, is not constituted improper limitations of the present invention.In the accompanying drawings:
Fig. 1 is the flow chart of the method for according to embodiments of the present invention one load-on module;
Fig. 2 is the structure diagram of according to embodiments of the present invention two load-on module device;
Fig. 3 is the structure diagram of according to embodiments of the present invention two optional load-on module device;And
Fig. 4 is the structure diagram of according to embodiments of the present invention two optional load-on module device.
Specific embodiment
It should be noted that in the absence of conflict, the feature in embodiment and embodiment in the application can phase Mutually combination.The present invention will be described in detail below with reference to the accompanying drawings and in conjunction with the embodiments.
In order to which those skilled in the art is made to more fully understand the present invention program, below in conjunction in the embodiment of the present invention The technical solution in the embodiment of the present invention is clearly and completely described in attached drawing, it is clear that described embodiment is only The embodiment of a part of the invention, instead of all the embodiments.Based on the embodiments of the present invention, ordinary skill people Member's all other embodiments obtained without making creative work should all belong to the model that the present invention protects It encloses.
It should be noted that term " first " in description and claims of this specification and above-mentioned attached drawing, " Two " etc. be the object for distinguishing similar, and specific sequence or precedence are described without being used for.It should be appreciated that it uses in this way Data can be interchanged in the appropriate case, so as to the embodiment of the present invention described herein.In addition, term " comprising " and " tool Have " and their any deformation, it is intended that cover it is non-exclusive include, for example, containing series of steps or unit Process, method, system, product or equipment are not necessarily limited to those steps or unit clearly listed, but may include without clear It is listing to Chu or for the intrinsic other steps of these processes, method, product or equipment or unit.
Embodiment one
An embodiment of the present invention provides a kind of methods of load-on module.As shown in Figure 1, that the method comprising the steps of is as follows:
Step S12, acquisition module table, module table include pre-set module number ID, Customs Assigned Number ID and module Correspondence between number ID and Customs Assigned Number ID.
Specifically, application program can have multiple function modules, for example, Reports module, electric business module etc., in step S12 In, module table can define the disparate modules that different user needs load, as shown in table 1.
Table 1:
ModuleId AccountId
01 user001
02 user001
03 user002
In table 1, user001 represents the number ID i.e. account of user of user, and 01 is the number of module, can with reference to table 1 To learn, the number of the module loaded required for user user001 is 01 and 02, and user user002 needs the module loaded Number is 03, and optionally, the content in above-mentioned module table can be that system manager is preconfigured according to actual conditions.
Step S14 is inquired from module table according to the Customs Assigned Number ID currently recognized, is got and currently recognize Customs Assigned Number ID corresponding to module number ID.
Specifically, when user uses application program by terminal device, the scheme that the application provides can recognize user Number, the number to obtain the module corresponding to Customs Assigned Number is inquired in above-mentioned module table, that is, obtains current identification To user need which module loaded, with reference to upper table 1, by Customs Assigned Number for for user001, user user001 is being opened During application program, system can automatic identification user user001 Customs Assigned Number, then to inquiry user user001 in module table Need module of the module loaded corresponding to 01 and 02.
Step S16 obtains the corresponding modular program packets of Customs Assigned Number ID currently recognized.
Specifically, can be that each function module develops a program bag, optionally, above procedure packet can be XAP Packet, XAP packets are a compressed package, the procedure set needed when being run in compressed package comprising above application program and configuration.
Step S18, parsing module program bag, and modular program packet is loaded onto application program.
Specifically, the text in above-mentioned XAP packets can be obtained after the corresponding XAP packets of above-mentioned modules are parsed Above-mentioned file is loaded onto application program by part.In a kind of optional embodiment, user downloads Silverlight application journeys During sequence, that is, XAP packets are downloaded, then perform the procedure set in XAP packets so as to complete the loading procedure to each function module, here It should be noted that XAP file is a file after the packing of Silverlight compiling of application, it is a standard Zip compressed files include all files needed for Silverlight application programs, such as procedure set, resource file.
There is also the need to explanation, the function of the modular program packet loaded at this time loading required for above-mentioned Customs Assigned Number All corresponding program bags of function module in program bag rather than application program corresponding to module.
In the embodiment of the present application, acquisition module table first is obtained in above-mentioned module table corresponding to Customs Assigned Number ID Module is numbered, and is then obtained the corresponding program bag of above-mentioned module number, is then parsed above procedure packet, finally correspond to module Program be loaded onto application program.In the method for solving load-on module, user need to by all function modules including with The unwanted module in family is all loaded into the problem of application program could use, and the mould of its needs need to only be loaded by realizing specific user Block can also use the effect of application program.
Optionally, in step S12 before acquisition module table, method provided in an embodiment of the present invention can also include:
Step S10 adds XML (Extensible Markup Language, extensible markup language) file, wherein, XML file includes following at least one element:The path that module title, module number ID, modular program packet are stored.
Optionally, the title of module can also be included in above-mentioned xml document.
Specifically, Module.xml files can be added in the application, definition application include which module with And the store path where modular program packet, it the following is the partial code in xml document:
<Xml version=" 1.0 " encoding=" utf-8 ">
<Modules>
<Module Id=" 2 " Name=" Report " XapPath=" ClientBin/Report.xap "/>
<Module Id=" 1 " Name=" ECommerce " XapPath=" ClientBin/ECommerce.xap "/>
</Modules>
What needs to be explained here is that it is found that the module name that block code ID is 2 is Report in above-mentioned code, The store path of XAP program bags corresponding to Report function modules is ClientBin/Report.xap.
Optionally, after the corresponding modular program packets of the Customs Assigned Number ID currently recognized are obtained in step S16, this implementation The method that example provides can also include:
Step S17 obtains the storage road of the corresponding modular program packets of the Customs Assigned Number ID currently recognized in XML file Diameter, and pass through the modular program packet stored corresponding to the Customs Assigned Number ID that path download currently recognizes.
Specifically, with reference to above-mentioned xml code, it is found that the module name that block code ID is 1 is in above-mentioned code The store path of XAP program bags corresponding to ECommerce, ECommerce function module is ClientBin/ ECommerce.xap, in the present solution, the journey corresponding to different function module can be downloaded to by above-mentioned XML file Sequence packet.
Optionally, the module journey corresponding to Customs Assigned Number ID currently recognized in step S17 by storing path download The step of sequence packet, can also include:
Step S171 creates WebClient (network agent class) object.
Step S172, by calling the asynchronous read method in WebClient (network agent class) object (OpenReadAsync) the modular program packet according to corresponding to Customs Assigned Number ID is downloaded in storage path.
Specifically, after above-mentioned WebClient (network agent class) object is created, above-mentioned WebClient can be called The asynchronous read method (OpenReadAsync) of (network agent class) object, above-mentioned asynchronous read method is in xml document The value of XapPath downloads the corresponding XAP packets of above-mentioned module as parameter.
Optionally, XAML (eXtensible Application Markup can be included in above-mentioned XAP packets Language, Scalable Application Markup Language) file, in a kind of optional embodiment, parsing module journey in step S18 Sequence packet, and the step of modular program packet is loaded onto application program can include:
Step S181 parses XAML files, obtains the target program collection in XAML files, wherein, target program collection is used for Characterize the corresponding modular programs of Customs Assigned Number ID recognized.
Specifically, after above-mentioned WebClient (network agent class) object is created, WebClient (networks can be registered Proxy class) OpenReadCompleted events in object processing function, it is above-mentioned after the completion of above-mentioned XAP downloads OpenReadCompleted events can be triggered, then event handling function can be performed parsing XAML files and obtain in XAP packets AppManifest.xaml files, this document definition XAP packet interfaces and comprising component.It is xaml files as follows Partial code:
In the present solution, file above can be parsed, the EntryPointAssembly of Deployment elements is obtained Attribute, according to title in all AssemblyPart elements of the attribute under Deployment.Parts elements and The identical AssemblyPart elements of EntryPointAssembly attributes reuse the above-mentioned AssemblyPart elements found The procedure set specified of Source attributes, above procedure collection, that is, above-mentioned target program collection.
Step S182 searches pre-defined homepage class from target program collection.
Homepage class (MainPage) is searched specifically, can be concentrated in above-mentioned target program.
Step S183 is grouped as homepage class in target program and creates object, and add the objects in application program.
Homepage class (MainPage) object is created specifically, can be concentrated in above-mentioned target program, which is added to In some container of current application program.What needs to be explained here is which container be specifically added to, application program can be with It is determined according to the situation of oneself, but whether which kind of situation is all within the protection domain of the application.
Optionally, step S14, before being inquired from module table according to the Customs Assigned Number ID currently recognized, this reality The method for applying example offer can also include:
Step S13 carries out module table according to the selection of user any one or more following operation:Delete arbitrary a line The record of module, the record of the arbitrary a line module of modification, the record for adding a line module.
Specifically, system can be deleted, changed or be added to above-mentioned module table according to the selection of user, example Such as, user can select new module by triggering a button of Application Program Interface, the operation of system response user from And module table is updated.User's next time when opening application program, can download according to the updated content of module table New function module realizes the function module needed before the download that user can be selective.
The application is prepared under specific application scenarios by device below, and device processing and device are for the use of three Expansion description:
Device prepares:
1. the function of application program is divided, multiple modules are divided into, each module completes relatively independent one kind Function.For example it is divided into Reports module, electric business module.Each module must include homepage class (MainPage), this class is equivalent to The main interface of this module, institute is functional all to be added in this main interface.
2. for each one XAP packet of Development of Module, entire one XAP packet of application program before.XAP packets are exactly one in fact Compressed package, the inside include the procedure set needed when application program is run and configuration.User downloads Silverlight application programs When, it is exactly to download XAP packets in fact, then performs the procedure set in XAP packets.
3. adding Module.xml files in the application, which module is definition application include.As follows Example:
4. adding Module tables, which, which defines each user, needs the module loaded, structure such as the following table 2 of table.
Table 2:
ModuleId Module unique numbers
AccountId Customs Assigned Number
5. defining InstallModule operations, parameter ModuleId, AccountId is specified for designated user's installation Module, this operates with two parameters and a line record is added in Module tables.
6. defining UninstallModule operations, parameter ModuleId, AccountId is specified for designated user's unloading Module, the operation are deleted a line according to that two parameters in Module tables and are recorded.
7. defining GetAllModuleIds operations, parameter AccountId, acquisition designated user needs to load all Module is numbered.Qualified all records are searched in the operation according to AccountId from Module tables.
Device processing:
1. addition installation functions of modules, user use the function mounting module after logging in.Specifically, it calls InstallModule is operated, and transmits the module number of active user's number and installation as parameter.
2. defining Unload module function, user uses the function Unload module after logging in.Specifically, it calls UninstallModule is operated, and transmits the module number of active user's number and installation as parameter.
Device uses:
1. after user logs in, calling GetAllModules operations, the AccountId for transmitting active user is parameter, is obtained Active user needs the module loaded number.
2. being numbered for each module, corresponding module definition is found in XML file, according in module definition XapPath loads the XAP packets of this module, and specific logic is as follows:
2.1. WebClient (network agent class) object is created.
2.2. the processing function of the OpenReadCompleted events of registration WebClient (network agent class) object.
2.3. the asynchronous read method (OpenReadAsync) of WebClient (network agent class) object is called, it is above-mentioned different Read method is walked using the XapPath in above-mentioned xml document as parameter, and then downloads the corresponding XAP packets of above-mentioned module.
2.4. after the completion of XAP downloads, OpenReadCompleted events can be triggered, the event handling function of 2.2 steps It can be performed.
2.5. in event handling function, XAP packets are read, obtain the AppManifest.xaml files in XAP packets, this Document definition XAP packet interfaces and comprising component.It is an example as follows, raw content is simplified, deleting need not Want content:
2.6. file above is parsed, the EntryPointAssembly attributes of Deployment elements are obtained, according to this Title and EntryPointAssembly in all AssemblyPart elements of the attribute under Deployment.Parts elements The identical AssemblyPart elements of attribute.
2.7. the procedure set specified using the Source attributes of the above-mentioned AssemblyPart elements found, in this program It concentrates and searches homepage class (MainPage).
2.8. homepage class (MainPage) object is created, which is added to some container of current application program In.Here without which specific container of explanation, application program can be determined according to the situation of oneself, no matter which kind of situation all should It should be in the scope of this patent.
To sum up, the present invention can realize following technique effect:User can select the function of oneself needing, and only download oneself The function of needing, and when needing using other functions, it is also very simple, it is only necessary to reconfigure, i.e., system manager can To increase, be deleted or modified the record of any row module in above-mentioned module table acording to the requirement of user, application program is in next time During startup, system can be all modules of user's loading corresponding thereto again according to new allocation list, so, under user The time for carrying application program substantially reduces, and response speed improves, while does not influence the use of client also, while the application innovates Point be embodied in installation module and Unload module process and will be in functions of modules loading application programs according to module XAP packets path Process.
Embodiment two
The embodiment of the present invention additionally provides a kind of device of load-on module, as shown in Fig. 2, the device can include:
First acquisition unit 22, for acquisition module table, wherein, module table includes pre-set module number ID, uses Correspondence between family number ID and module number ID and Customs Assigned Number ID.
Specifically, application program can have multiple function modules, for example, Reports module, electric business module etc., module table can be with The disparate modules that different user needs load are defined, as shown in table 3.
Table 3:
ModuleId AccountId
01 user001
02 user001
03 user002
In table 3, user001 represents the number ID i.e. account of user of user, and 01 is the number of module, can with reference to table 1 To learn, the number of the module loaded required for user user001 is 01 and 02, and user user002 needs the module loaded Number is 03, and optionally, the content in above-mentioned module table can be that system manager is preconfigured according to actual conditions.
Query unit 24 for being inquired from module table according to the Customs Assigned Number ID currently recognized, gets and works as Before module number ID corresponding to the Customs Assigned Number ID that recognizes.
Specifically, when user uses application program by terminal device, the use that can recognize of scheme that the application provides The number at family is inquired the number to obtain the module corresponding to Customs Assigned Number in above-mentioned module table, that is, obtains current knowledge The user being clipped to needs which module loaded, with reference to upper table 3, by Customs Assigned Number for for user001, user user001 is being beaten When opening application program, system can automatic identification user user001 Customs Assigned Number, then to inquiring user in module table Module of the module that user001 needs load corresponding to 01 and 02.
Second acquisition unit 26, for obtaining the corresponding modular program packets of Customs Assigned Number ID currently recognized.
Specifically, can be that each function module develops a program bag, optionally, above procedure packet can be XAP Packet, XAP packets are a compressed package, the procedure set needed when being run in compressed package comprising above application program and configuration.
Modular program packet for parsing module program bag, and is loaded onto application program by resolution unit 28.
Specifically, the text in above-mentioned XAP packets can be obtained after the corresponding XAP packets of above-mentioned modules are parsed Above-mentioned file is loaded onto application program by part.In a kind of optional embodiment, user downloads Silverlight application journeys During sequence, that is, XAP packets are downloaded, then perform the procedure set in XAP packets so as to complete the loading procedure to each function module.Here It should be noted that the journey corresponding to the function module that the modular program packet loaded at this time loads required for above-mentioned Customs Assigned Number The corresponding program bag of all function modules in sequence packet rather than application program.
The embodiment of the present application acquisition module table first obtains the module corresponding to Customs Assigned Number ID in above-mentioned module table and compiles Number, the corresponding program bag of above-mentioned module number is then obtained, above procedure packet is then parsed, finally by the corresponding program of module It is loaded onto application program.In the method for solving load-on module, all function modules need to be not required to by user including user The module wanted all is loaded into the problem of application program could use, realize specific user need to only load its needs module also may be used To use the effect of application program.
Optionally, as shown in figure 3, device provided in an embodiment of the present invention can also include:
Adding device 20, for adding XML file, wherein, XML file includes following at least one element:Module title, Module number ID, the path of modular program packet storage.
Specifically, Module.xml files can be added in the application, definition application include which module with And the store path where modular program packet, it the following is the partial code in xml document:
What needs to be explained here is that it is found that the module name that block code ID is 2 is Report in above-mentioned code, The store path of XAP program bags corresponding to Report function modules is ClientBin/Report.xap.
Optionally, as shown in figure 4, above-mentioned second acquisition unit 26 can also include:
Download module 261, for obtaining the corresponding modular program packets of Customs Assigned Number ID currently recognized in XML file Storage path, and pass through and store path and download modular program packet corresponding to the Customs Assigned Number ID that currently recognizes.
Specifically, with reference to above-mentioned xml code, it is found that the module name that block code ID is 1 is in above-mentioned code The store path of XAP program bags corresponding to ECommerce, ECommerce function module is ClientBin/ ECommerce.xap, in the present solution, the journey corresponding to different function module can be downloaded to by above-mentioned XML file Sequence packet.
Optionally, above-mentioned download module 261 can also include:
Creation module 2611, for creating WebClient (network agent class) object.
Sub- download module 2612, for passing through the asynchronous read method called in WebClient (network agent class) object (OpenReadAsync) the modular program packet according to corresponding to Customs Assigned Number ID is downloaded in storage path.
Specifically, after above-mentioned WebClient (network agent class) object is created, above-mentioned WebClient can be called The asynchronous read method (OpenReadAsync) of (network agent class) object, above-mentioned asynchronous read method is in above-mentioned xml document XapPath as parameter, and then download the corresponding XAP packets of above-mentioned module.
Optionally, above-mentioned resolution unit 28 can also include:
Parsing module 281 for parsing XAML files, obtains the target program collection in XAML files, wherein, target program The corresponding modular programs of Customs Assigned Number ID that collection recognizes for characterization.
Specifically, after above-mentioned WebClient (network agent class) object is created, WebClient (networks can be registered Proxy class) OpenReadCompleted events in object processing function, it is above-mentioned after the completion of above-mentioned XAP downloads OpenReadCompleted events can be triggered, then event handling function can be performed parsing XAML files and obtain in XAP packets AppManifest.xaml files, this document definition XAP packet interfaces and comprising component.It is xaml files as follows Partial code:
In the present solution, file above can be parsed, the EntryPointAssembly of Deployment elements is obtained Attribute, according to title in all AssemblyPart elements of the attribute under Deployment.Parts elements and The identical AssemblyPart elements of EntryPointAssembly attributes reuse the above-mentioned AssemblyPart elements found The procedure set specified of Source attributes, above procedure collection, that is, above-mentioned target program collection.
Searching module 282, for searching pre-defined homepage class from target program collection.
Homepage class (MainPage) is searched specifically, can be concentrated in above-mentioned target program.
Add module 283 creates object, and add the objects to application program for being grouped as homepage class in target program In.
Homepage class (MainPage) object is created specifically, can be concentrated in above-mentioned target program, which is added to In some container of current application program.What needs to be explained here is which container be specifically added to, application program can be with It is determined according to the situation of oneself, but whether which kind of situation is all within the protection domain of the application.
Optionally, device provided in an embodiment of the present invention further includes:
Operating unit 30 carries out module table for the selection according to user any one or more following operation:It deletes The record of arbitrary a line module, the record of the arbitrary a line module of modification, the record for adding a line.
Specifically, system can be deleted, changed or be added to above-mentioned module table according to the selection of user, example Such as, user can select new module by triggering a button of Application Program Interface, the operation of system response user from And module table is updated.User's next time when opening application program, can download according to the updated content of module table New function module realizes the function module needed before the download that user can be selective.
The application is prepared under specific application scenarios by device below, and device processing and device are for the use of three Expansion description:
Device prepares:
1. the function of application program is divided, multiple modules are divided into, each module completes relatively independent one kind Function.For example it is divided into Reports module, electric business module.Each module must include homepage class (MainPage), this class is equivalent to The main interface of this module, institute is functional all to be added in this main interface.
2. for each one XAP packet of Development of Module, entire one XAP packet of application program before.XAP packets are exactly one in fact Compressed package, the inside include the procedure set needed when application program is run and configuration.User downloads Silverlight application programs When, it is exactly to download XAP packets in fact, then performs the procedure set in XAP packets.
3. adding Module.xml files in the application, which module is definition application include.As follows Example:
4. adding Module tables, which, which defines each user, needs the module loaded.Structure such as the following table 4.
Table 4:
ModuleId Module unique numbers
AccountId Customs Assigned Number
5. defining InstallModule operations, parameter ModuleId, AccountId is specified for designated user's installation Module, this operates with two parameters and a line record is added in Module tables.
6. defining UninstallModule operations, parameter ModuleId, AccountId is specified for designated user's unloading Module, the operation are deleted a line according to that two parameters in Module tables and are recorded.
7. defining GetAllModuleIds operations, parameter AccountId, acquisition designated user needs to load all Module is numbered.Qualified all records are searched in the operation according to AccountId from Module tables.
Device processing:
1. addition installation functions of modules, user use the function mounting module after logging in.Specifically, it calls InstallModule is operated, and transmits the module number of active user's number and installation as parameter.
2. defining Unload module function, user uses the function Unload module after logging in.Specifically, it calls UninstallModule is operated, and transmits the module number of active user's number and installation as parameter.
Device uses:
1. after user logs in, calling GetAllModules operations, the AccountId for transmitting active user is parameter, is obtained Active user needs the module loaded number.
2. being numbered for each module, corresponding module definition is found in XML file, according in module definition XapPath loads the XAP packets of this module, and specific logic is as follows:
2.1. WebClient (network agent class) object is created.
2.2. the processing function of the OpenReadCompleted events of registration WebClient (network agent class) object.
2.3. the asynchronous read method (OpenReadAsync) of WebClient (network agent class) object is called, it is above-mentioned different Read method is walked using the XapPath in above-mentioned xml document as parameter, and then downloads the corresponding XAP packets of above-mentioned module.
2.4. after the completion of XAP downloads, OpenReadCompleted events can be triggered, the event handling function of 2.2 steps It can be performed.
2.5. in event handling function, XAP packets are read, obtain the AppManifest.xaml files in XAP packets, this Document definition XAP packet interfaces and comprising component.It is an example as follows, raw content is simplified, deleting need not Want content:
2.6. file above is parsed, the EntryPointAssembly attributes of Deployment elements are obtained, according to this Title and EntryPointAssembly in all AssemblyPart elements of the attribute under Deployment.Parts elements The identical AssemblyPart elements of attribute.
2.7. the procedure set specified using the Source attributes of the above-mentioned AssemblyPart elements found, in this program It concentrates and searches homepage class (MainPage).
2.8. homepage class (MainPage) object is created, which is added to some container of current application program In.Here without which specific container of explanation, application program can be determined according to the situation of oneself, no matter which kind of situation all should It should be in the scope of this patent.
To sum up, the present invention can realize following technique effect:User can select the function of oneself needing, and only download oneself The function of needing, and when needing using other functions, it is also very simple, it is only necessary to reconfigure, i.e., system manager can To increase, be deleted or modified the record of any row module in above-mentioned module table acording to the requirement of user, application program is in next time During startup, system can be all modules of user's loading corresponding thereto again according to new allocation list, so, under user The time for carrying application program substantially reduces, and response speed improves, while does not influence the use of client also, while the application innovates Point be embodied in installation module and Unload module process and will be in functions of modules loading application programs according to module XAP packets path Process.
It should be noted that for aforementioned each method embodiment, in order to be briefly described, therefore it is all expressed as a series of Combination of actions, but those skilled in the art should know, the present invention is not limited by described sequence of movement because According to the present invention, certain steps may be used other sequences or be carried out at the same time.Secondly, those skilled in the art should also know It knows, embodiment described in this description belongs to preferred embodiment, and involved action and module are not necessarily of the invention It is necessary.
In the above-described embodiments, it all emphasizes particularly on different fields to the description of each embodiment, there is no the portion being described in detail in some embodiment Point, it may refer to the associated description of other embodiment.
In several embodiments provided herein, it should be understood that disclosed device, it can be by another way It realizes.For example, the apparatus embodiments described above are merely exemplary, such as the division of the unit, it is only a kind of Division of logic function, can there is an other dividing mode in actual implementation, such as multiple units or component can combine or can To be integrated into another system or some features can be ignored or does not perform.Another point, shown or discussed is mutual Coupling, direct-coupling or communication connection can be by some interfaces, the INDIRECT COUPLING or communication connection of device or unit, Can be electrical or other forms.
The unit illustrated as separating component may or may not be physically separate, be shown as unit The component shown may or may not be physical unit, you can be located at a place or can also be distributed to multiple In network element.Some or all of unit therein can be selected according to the actual needs to realize the mesh of this embodiment scheme 's.
In addition, each functional unit in each embodiment of the present invention can be integrated in a processing unit, it can also That each unit is individually physically present, can also two or more units integrate in a unit.Above-mentioned integrated list The form that hardware had both may be used in member is realized, can also be realized in the form of SFU software functional unit.
If the integrated unit is realized in the form of SFU software functional unit and is independent product sale or uses When, it can be stored in a computer read/write memory medium.Based on such understanding, technical scheme of the present invention is substantially The part to contribute in other words to the prior art or all or part of the technical solution can be in the form of software products It embodies, which is stored in a storage medium, is used including some instructions so that a computer Equipment (can be personal computer, mobile terminal, server or network equipment etc.) is performed described in each embodiment of the present invention The all or part of step of method.And aforementioned storage medium includes:USB flash disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disc or CD etc. are various The medium of program code can be stored.
The foregoing is only a preferred embodiment of the present invention, is not intended to restrict the invention, for the skill of this field For art personnel, the invention may be variously modified and varied.All within the spirits and principles of the present invention, that is made any repaiies Change, equivalent replacement, improvement etc., should all be included in the protection scope of the present invention.

Claims (12)

  1. A kind of 1. method of load-on module, which is characterized in that including:
    Acquisition module table, the module table includes pre-set module number ID, Customs Assigned Number ID and the module is numbered Correspondence between ID and the Customs Assigned Number ID;
    It is inquired from the module table according to the Customs Assigned Number ID currently recognized, gets the use currently recognized Module number ID corresponding to the number ID of family;
    The corresponding modular program packets of the Customs Assigned Number ID currently recognized are obtained, wherein, including obtaining the current identification The corresponding modular program packets of module number ID corresponding to the Customs Assigned Number ID arrived;
    The modular program packet is parsed, and the modular program packet is loaded onto application program;
    Wherein, the method further includes:Pass through the Customs Assigned Number ID currently recognized and module number ID definition peaces Die-filling piece of operation calls the operation of the installation module, the Customs Assigned Number ID currently recognized and the module is compiled Number ID is as parameter, to install the modular program packet.
  2. 2. according to the method described in claim 1, it is characterized in that, before the acquisition module table, the method further includes:
    XML file is added, wherein, the XML file includes following element:Module number ID, the path of modular program packet storage.
  3. 3. according to the method described in claim 2, it is characterized in that, the acquisition Customs Assigned Number ID currently recognized is corresponding The step of modular program packet, includes:
    The storage path of the corresponding modular program packets of the Customs Assigned Number ID currently recognized is obtained in the XML file, And the modular program packet corresponding to the Customs Assigned Number ID currently recognized is downloaded by the storage path.
  4. 4. according to the method described in claim 3, it is characterized in that, the user currently recognized is downloaded by the storage path The step of modular program packet corresponding to number ID, includes:
    Create network agent class object;
    It is compiled by the way that the asynchronous read method in the network agent class object is called to download the user according to the storage path The modular program packet corresponding to number ID.
  5. 5. according to the method described in claim 1, it is characterized in that, institute corresponding to the Customs Assigned Number ID currently recognized It states modular program packet and includes XAML files, wherein, the parsing modular program packet, and the modular program packet is loaded Include to the step of application program:
    The XAML files are parsed, obtain the target program collection in the XAML files, wherein, the target program collection is used for table The corresponding modular programs of Customs Assigned Number ID recognized described in sign;
    Pre-defined homepage class is searched from the target program collection;
    The homepage class, which is grouped as, in the target program creates object, and the object is added in the application program.
  6. 6. according to the method described in claim 1, it is characterized in that, the Customs Assigned Number ID that currently recognizes of the basis is from described Before being inquired in module table, the method includes:
    Any one or more following operation is carried out to the module table according to the selection of user:Delete the note of arbitrary a line module Record, the record of addition a line record, changed arbitrary a line module.
  7. 7. a kind of device of load-on module, which is characterized in that including:
    First acquisition unit, for acquisition module table, wherein, the module table includes pre-set module number ID, user Correspondence between number ID and the module number ID and the Customs Assigned Number ID;
    Query unit for being inquired from the module table according to the Customs Assigned Number ID currently recognized, is got described Module number ID corresponding to the Customs Assigned Number ID currently recognized;
    Second acquisition unit, for obtaining the corresponding modular program packets of the Customs Assigned Number ID currently recognized,
    Wherein, including obtaining the corresponding modular programs of module number ID corresponding to the Customs Assigned Number ID currently recognized Packet;
    The modular program packet for parsing the modular program packet, and is loaded onto application program by resolution unit;
    Wherein, described device is additionally operable to through the Customs Assigned Number ID currently recognized and module number ID definition installations The operation of module calls the operation of the installation module, the Customs Assigned Number ID currently recognized and the module is numbered ID is as parameter, to install the modular program packet.
  8. 8. device according to claim 7, which is characterized in that described device further includes:
    Adding device, for adding XML file, wherein, the XML file includes following at least one element:Module title, mould Block number ID, the path of modular program packet storage.
  9. 9. device according to claim 8, which is characterized in that the second acquisition unit includes:
    Download module, for obtaining the corresponding modular programs of Customs Assigned Number ID currently recognized in the XML file The storage path of packet, and the modular program corresponding to by the Customs Assigned Number ID for storing path download and currently recognizing Packet.
  10. 10. device according to claim 9, which is characterized in that the download module includes:
    Creation module, for creating network agent class object;
    Sub- download module calls the asynchronous read method in the network agent class object according to the storage path for passing through Download the modular program packet corresponding to the Customs Assigned Number ID.
  11. 11. device according to claim 7, which is characterized in that corresponding to the Customs Assigned Number ID currently recognized The modular program packet includes XAML files, wherein, the resolution unit includes:
    Parsing module for parsing the XAML files, obtains the target program collection in the XAML files, wherein, the mesh Mark procedure set is used to characterize the corresponding modular programs of Customs Assigned Number ID recognized;
    Searching module, for searching pre-defined homepage class from the target program collection;
    Add module creates object, and the object is added to institute for being grouped as the homepage class in the target program It states in application program.
  12. 12. device according to claim 7, which is characterized in that described device further includes:
    Operating unit carries out the module table for the selection according to user any one or more following operation:
    Delete the record of arbitrary a line module, the record of the arbitrary a line module of modification, the record for adding a line.
CN201410692666.8A 2014-11-26 2014-11-26 The method and device of load-on module Active CN104461618B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410692666.8A CN104461618B (en) 2014-11-26 2014-11-26 The method and device of load-on module

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410692666.8A CN104461618B (en) 2014-11-26 2014-11-26 The method and device of load-on module

Publications (2)

Publication Number Publication Date
CN104461618A CN104461618A (en) 2015-03-25
CN104461618B true CN104461618B (en) 2018-06-26

Family

ID=52907723

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410692666.8A Active CN104461618B (en) 2014-11-26 2014-11-26 The method and device of load-on module

Country Status (1)

Country Link
CN (1) CN104461618B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105094830B (en) * 2015-07-31 2019-07-09 小米科技有限责任公司 A kind of method and apparatus of performance objective function
US10705857B2 (en) * 2018-04-25 2020-07-07 Hewlett Packard Enterprise Development Lp Initialising operations support systems
CN109840086A (en) * 2018-12-14 2019-06-04 深圳壹账通智能科技有限公司 Program code acquisition methods and device, computer installation and readable storage medium storing program for executing
CN113176901B (en) * 2021-05-17 2023-09-19 上海云扩信息科技有限公司 Program running loading optimization method

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102486734A (en) * 2010-12-03 2012-06-06 上海宝信软件股份有限公司 Rich client application system
CN103744667A (en) * 2013-12-27 2014-04-23 高新兴科技集团股份有限公司 Silverlight-based configuration function achieving system
CN104009866A (en) * 2014-05-09 2014-08-27 烽火通信科技股份有限公司 WEB network management system modularization implementing method and device based on RIA

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102486734A (en) * 2010-12-03 2012-06-06 上海宝信软件股份有限公司 Rich client application system
CN103744667A (en) * 2013-12-27 2014-04-23 高新兴科技集团股份有限公司 Silverlight-based configuration function achieving system
CN104009866A (en) * 2014-05-09 2014-08-27 烽火通信科技股份有限公司 WEB network management system modularization implementing method and device based on RIA

Also Published As

Publication number Publication date
CN104461618A (en) 2015-03-25

Similar Documents

Publication Publication Date Title
CN104572114B (en) A kind of binding device, using updating device and method
CN104461618B (en) The method and device of load-on module
CN102546708B (en) Plug-in obtaining method and system as well as relevant devices
CN106406844B (en) Method and device for realizing public number menu of communication interaction platform
CN105303112B (en) The detection method and device of component call loophole
CN104580093A (en) Processing method, device and system for notification messages of websites
EP2664998B1 (en) Microblog message processing method and device thereof
CN105373390A (en) OEM-oriented online software customization packaging release method and apparatus
CN109558202A (en) Original list development approach, device, equipment and storage medium based on small routine
CN103544220A (en) Method and device for recommending applications
CN102647414A (en) Protocol analysis method, protocol analysis device and protocol analysis system
CN110442826B (en) Cross-layer page jumping method, device and system based on page identification
CN105488223A (en) Analyzing and subscribing method and system of business data events
CN104407901A (en) Code adding method and device
CN106604109B (en) Configuration method and device of smart television
CN104301139A (en) Router adaptation method and device and terminal device
CN104951484A (en) Search result processing method and search result processing device
CN104426868A (en) Request processing method and processing apparatus
CN104408193B (en) The processing method and processing device of data visualization model
US20020103558A1 (en) Method and computer program product for realizing a system specification which is described in a system description language
CN104572981B (en) A kind of Webpage method for caching and processing and mobile terminal device
CN106412003A (en) Information pushing method and device, and information request device
CN107315576A (en) A kind of method and system of dynamic expansion software flow
CN101964742B (en) Method, system and device for using network open ability
CN107357605A (en) The method and apparatus for running installation file

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
PE01 Entry into force of the registration of the contract for pledge of patent right

Denomination of invention: Method and device for loading modules

Effective date of registration: 20190531

Granted publication date: 20180626

Pledgee: Shenzhen Black Horse World Investment Consulting Co.,Ltd.

Pledgor: BEIJING GRIDSUM TECHNOLOGY Co.,Ltd.

Registration number: 2019990000503

PE01 Entry into force of the registration of the contract for pledge of patent right
CP02 Change in the address of a patent holder

Address after: 100083 No. 401, 4th Floor, Haitai Building, 229 North Fourth Ring Road, Haidian District, Beijing

Patentee after: BEIJING GRIDSUM TECHNOLOGY Co.,Ltd.

Address before: 100086 Beijing city Haidian District Shuangyushu Area No. 76 Zhichun Road cuigongfandian 8 layer A

Patentee before: BEIJING GRIDSUM TECHNOLOGY Co.,Ltd.

CP02 Change in the address of a patent holder
PP01 Preservation of patent right

Effective date of registration: 20240604

Granted publication date: 20180626