CN102841780B - A kind ofly create and call the method and apparatus of general purpose module - Google Patents

A kind ofly create and call the method and apparatus of general purpose module Download PDF

Info

Publication number
CN102841780B
CN102841780B CN201110170947.3A CN201110170947A CN102841780B CN 102841780 B CN102841780 B CN 102841780B CN 201110170947 A CN201110170947 A CN 201110170947A CN 102841780 B CN102841780 B CN 102841780B
Authority
CN
China
Prior art keywords
general purpose
purpose module
module
mark
storehouse
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
CN201110170947.3A
Other languages
Chinese (zh)
Other versions
CN102841780A (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.)
Alibaba Group Holding Ltd
Original Assignee
Alibaba Group Holding 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 Alibaba Group Holding Ltd filed Critical Alibaba Group Holding Ltd
Priority to CN201110170947.3A priority Critical patent/CN102841780B/en
Publication of CN102841780A publication Critical patent/CN102841780A/en
Priority to HK13102774.3A priority patent/HK1175552A1/en
Application granted granted Critical
Publication of CN102841780B publication Critical patent/CN102841780B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

This application discloses and a kind ofly create and call the method and apparatus of general purpose module, main contents comprise: in software initialization process, complete the unified of general purpose module create and the unified process being stored in general purpose module storehouse, when other common component need to call general purpose module, without the need to creating general purpose module respectively, and only need directly to call the general purpose module created, due in the scheme of the embodiment of the present application, general purpose module only need create once, decrease the establishment quantity of general purpose module, therefore, can effectively reduce the system resource taken in general purpose module constructive process, and improve the travelling speed of other common component.

Description

A kind ofly create and call the method and apparatus of general purpose module
Technical field
The application relates to field of computer technology, particularly relates to a kind ofly to create general purpose module and to the method and apparatus that calls of general purpose module created.
Background technology
Along with the development of computer software technology, software is more and more towards the large and future development of complexity, in order to this large and the software of complexity effectively uses, these software demarcation can be become a series of and can realize in advance, be easy to develop, understand and the assembly of adjustment.Each assembly function after division is determined, separately design, encode respectively, together by multiple assembling components, complete the operation of software finally.
In software development process, in order to improve the reusability of software code, improving development efficiency, conventional interface element can be packaged into one group of relatively independent assembly, graphic user interface (Graphical User Interface, GUI) storehouse or GUI platform is formed by these assemblies.Can there are tens kinds of even hundreds of available assemblies in GUI platform, often kind of assembly can realize the visible or sightless function of one on interface.
Assembly in GUI platform can exist with tree structure, and any one assembly can using the sub-component of other several assemblies as self, the nest relation between constituent components.As shown in Figure 1, be the nest relation schematic diagram between GUI platform inner assembly, as can be seen from Figure 1, assembly 1 has been nested with assembly 2 and assembly 3, and nested further assembly 4 in assembly 2.As sub-component assembly 4 can call by assembly 2, same, as the assembly 2 of sub-component and assembly 3 again can call by assembly 1.
And in fact, as by the function of some nested assembly, there is versatility, namely these assemblies are often by nested extremely multiple assembly, and when being nested in often kind of assembly, the attribute of these assemblies is all identical, then these assemblies with general utility functions are referred to as general purpose module (Common Component).
Such as, border component in instant communication software can be nested by various window class assembly institute, for drawing the frame of window class assembly, background assemblies also can be nested by various window class assembly institute, for drawing the background of window class assembly, therefore, border component and background assemblies can be referred to as general purpose module.
Suppose that window class assembly has session window assembly and system information window assembly, according to current assembly regional model, as shown in Figure 2, session window assembly is nested by what create that border component and background assemblies realize border component and background assemblies, and then obtains the function of border component and background assemblies; System information window assembly is equally also nested by what create that border component and background assemblies realize border component and background assemblies, and then obtains the function of border component and background assemblies.
As can be seen from the nested structure shown in Fig. 2, for general purpose module, when general purpose module is nested by other assemblies multiple, even if the attribute that these general purpose modules are nested in other assemblies is identical, other assemblies also must distinguish nested general purpose module, and can only call self nested general purpose module, reach the object running general purpose module function.Under this nested mode, system needs for other building component general purpose modules each divide the system resource being used in establishment, even if when identical general purpose module is by other building components multiple, system will be also each constructive process distributing system resource, causes a large amount of wastes of memory source; Meanwhile, each assembly is before operation general purpose module, and all will create this general purpose module, because each constructive process can take certain duration, therefore, the normal running speed of assembly is also subject to great impact.
Summary of the invention
The object of the application is: provide a kind of and create and call the method and apparatus of general purpose module, in order to solve exist in prior art due to nested establishment general purpose module, cause a large amount of waste of memory source and the low problem of assembly operating speed.
Create a method for general purpose module, be applied in the software systems of the assembly after there is encapsulation, comprise:
When software initialization, generate general purpose module storehouse;
According to the attribute information of the general purpose module recorded in configuration file, create general purpose module;
The general purpose module of establishment and the mark of this general purpose module are stored in described general purpose module storehouse.
Call a method for general purpose module, comprising:
Determine the mark of general purpose module to be called;
According to the described mark determined, from the general purpose module storehouse storing multiple general purpose module, search the general purpose module represented by described mark;
Call the general purpose module found out.
Create an equipment for general purpose module, be applied in the software systems of the assembly after there is encapsulation, comprise:
Storehouse creation module, for when software initialization, generates general purpose module storehouse;
Building component module, for the attribute information according to the general purpose module recorded in configuration file, creates general purpose module;
Memory module, for being stored to the general purpose module of establishment and the mark of this general purpose module in described general purpose module storehouse.
Call an equipment for general purpose module, comprising:
Mark determination module, for determining the mark of general purpose module to be called;
Search module, for according to the described mark determined, from the general purpose module storehouse storing multiple general purpose module, search the general purpose module represented by described mark;
Calling module, for calling the general purpose module found out.
The application's beneficial effect is as follows:
The scheme that the embodiment of the present application provides, in software initialization process, complete the unified of general purpose module to create, and the unified process being stored in general purpose module storehouse, when other common component need to call general purpose module, without the need to creating general purpose module respectively, and only need directly to call the general purpose module created.In the scheme of the embodiment of the present application, general purpose module only need create once, which reduces the establishment quantity of general purpose module, can effectively reduce the system resource taken in general purpose module constructive process, and improve the travelling speed of other common component.
Accompanying drawing explanation
Fig. 1 is the nest relation schematic diagram in background technology between assembly;
Fig. 2 is the nest relation schematic diagram in background technology between assembly;
Fig. 3 is the method step schematic diagram creating general purpose module in the embodiment of the present application one;
Fig. 4 is the method step schematic diagram calling general purpose module in the embodiment of the present application two;
Fig. 5 is the method step schematic diagram calling general purpose module in the embodiment of the present application three;
Fig. 6 is the call relation schematic diagram in the embodiment of the present application three between common component and general purpose module;
Fig. 7 is the device structure schematic diagram creating general purpose module in the embodiment of the present application four;
Fig. 8 is the device structure schematic diagram calling general purpose module in the embodiment of the present application five.
Embodiment
For realizing the application's object, the scheme that the embodiment of the present application proposes a kind of new establishment for general purpose module and calls, at the initial phase of software, create general purpose module and successful for establishment general purpose module and its mark are stored in general purpose module storehouse, when common component needs the function using general purpose module, without the need to distinguishing this general purpose module nested again, but directly call the general purpose module in general purpose module storehouse.By the scheme of the embodiment of the present application, each common component in software program is without the need to creating general purpose module respectively, as long as and need the general purpose module called in general purpose module storehouse just can obtain the function of general purpose module, owing to only needing to create a general purpose module at the initial phase of software, common component just at any time freely can call general purpose module, decrease the establishment number of times of general purpose module, effectively can reduce taking system memory resource when general purpose module creates, simultaneously, for common component, do not need to create general purpose module separately, and only need to call general purpose module, drastically increase the travelling speed of assembly, and then improve the travelling speed of software.
Be described in detail below in conjunction with the scheme of Figure of description to the embodiment of the present application.
It should be noted that, in order to distinguish with establishment and invoked general purpose module, be referred to as common component by needing other assemblies calling general purpose module in the software program related in each for the application embodiment.
Embodiment one
As shown in Figure 3, for creating the method step schematic diagram of general purpose module in the embodiment of the present application one, said method comprising the steps of:
Step 101: when software starts initialization, generates general purpose module storehouse.
The scheme of the embodiment of the present application is, starts to perform the operation creating general purpose module when software initialization, and before initialization terminates, complete the constructive process of general purpose module.The object done like this is: the operation of the complete establishment general purpose module of executed before software normally runs, can make when software normally runs, the common component in software is directly called according to demand and created complete general purpose module.If also do not complete the operation creating general purpose module at the end of software initialization, the words just created when common component even in software needs to call general purpose module, need to take certain duration owing to creating general purpose module, therefore, the process that this way can cause common component to call general purpose module has comparatively long time delay.
When performing step 101, after software is initialised startup, be just this Software Create general purpose module storehouse.
Be instant communication software for described software, the specific implementation process of this step 101 is:
First, whether detect in real time described instant communication software and to be initialised startup, namely whether this instant communication software starts in installed equipment.
Then, when detect described instant communication software be initialised start time, the memory source of the equipment at instant communication software place is scanned, and distributing the memory source of a certain amount of memory source as general purpose module storehouse, the memory source of described distribution is used in general purpose module storehouse, store follow-up created general purpose module.
In the general purpose module storehouse storage allocation resource for instant communication software, for the read-write operation distribution process in general purpose module storehouse, and the record entry address in general purpose module storehouse and other are for after the information that operates the content in general purpose module storehouse, described general purpose module storehouse just generates complete.
In order to improve the access speed in general purpose module storehouse, the data structure of mapping (map) or Hash mapping (hashmap) in the general purpose module storehouse generated in the present embodiment, can be adopted.
Step 102: according to the attribute information of the general purpose module recorded in configuration file, creates general purpose module.
In the performance history of software, some conventional elements are packaged into relatively independent assembly, these relatively independent assemblies encapsulated comprise general purpose module, therefore, when software development completes, the attribute information of general purpose module has been recorded in configuration file, have recorded the attribute information that can be used in creating general purpose module, and this configuration file is stored in the text storage region of software in this configuration file.
Described attribute information includes but not limited to one or more the combination in following information:
1, the type of general purpose module, represents that general purpose module is the assembly of what function.
Such as: if the type of general purpose module is Background, represent that this general purpose module is the assembly for generation background; If the type of general purpose module is Border, represent that this general purpose module is the assembly for generating frame.
2, the title of general purpose module.
Still for the general purpose module of a Background type, its title can be the title defined in software development process.
3, run the memory address of desired data during general purpose module, for representing that general purpose module is when called operation, needed for the memory address of other data called.
Such as, when the general purpose module of a Background type is called with generation background, need to call each background picture simultaneously, therefore, the memory address recording each background picture is needed, so that quick calling every background picture can be shown when generation background in the attribute information of the general purpose module of Background type.
In the implementation of step 102, owing to have recorded the attribute information of multiple general purpose module in configuration file, each group attribute information represents the attribute of a general purpose module, therefore, after correctly reading out the often group attribute information recorded in configuration file, this attribute information can be used to create multiple general purpose module respectively, and concrete constructive process is:
The first step: create mode according to the example of setting, create the example of general purpose module.
In the scheme of the present embodiment, the instance creation process of each general purpose module is identical, and detailed process comprises:
Corresponding class factory (class factory) is gone out according to the type search of general purpose module to be created, and complete the establishment to general purpose module of the same type by establishment example (CreateInstance) member function calling described class factory, and return the example of the general purpose module after establishment.
The essence of described class factory is the object in a Component Object Model (COM), an IClassFactory interface is defined in class factory, by the CreateInstance member function in this IClassFactory interface, complete the instantiation to general purpose module.
In addition, according to the definition of COM specification, component object type (COM Class) and class factory are that pairing occurs, that is, to certain type general purpose module instantiation, will be realized by the class factory that the general purpose module of the type is corresponding.
Second step: according to the attribute information of the general purpose module recorded in configuration file, for the example created sets a property, obtains the general purpose module created.
Describedly to refer to for example sets a property: by initialization (Initialize) algorithm of invocation component, one group of attribute information is imported into example, realize object attribute being applied to general purpose module example.
Below for the general purpose module of Background type, the process of use attribute information creating general purpose module is described:
Suppose in configuration file, have two Backgound general purpose modules, the attribute information of these two general purpose modules is different, first Background general purpose module loads a picture to fill background, and second Background general purpose module uses white to fill background.
The attribute information of these two the Backgound general purpose modules recorded in configuration file can be as follows:
In constructive process, when after the attribute information reading above-mentioned first general purpose module in configuration file, determine that the type of this general purpose module is Background, then find out corresponding class factory BackgroundFactory.
Then the CreateInstance member function calling BackgroundFactory completes the establishment of first Backgound general purpose module, supposes that the example of first the Backgound general purpose module returned is kept in spBackground1.
Then, the attribute of first Backgound general purpose module is set, calls the Initialize algorithm of general purpose module, the attribute information of first Backgound general purpose module is imported in the example of first Backgound general purpose module.Concrete mode of importing into is:
Run Initialize algorithm, read out each attribute information of first Backgound general purpose module successively, for each attribute information read, call corresponding setup of attribute function and import into.
Such as, the attribute information of reading is the filling mode (Style) of first Backgound general purpose module, then call SetStyle function, imports the filling mode " image completion Image " of first Backgound general purpose module into example; Again such as, the attribute information read is the image completion mode (FillType) of first Backgound general purpose module, then call SetFillType function, import the image completion mode " tiling Tile " of first Backgound general purpose module into example.
Above-mentioned created for first general purpose module after, continue the attribute information of reading second general purpose module, establishment mode for second general purpose module is identical with the establishment mode for first general purpose module, but, time in the example attribute information of second Backgound general purpose module being imported into second Backgound general purpose module, because first general purpose module is different with the content of the attribute information of second general purpose module, therefore, two the Backgound general purpose modules finally created out can realize the background of different appearance.
Step 103: the general purpose module of establishment and the mark of general purpose module are stored in described general purpose module storehouse.
As can be seen from the implementation of step 102, the embodiment of the present application is when creating example, create with the class factory that the general purpose module of a certain type is corresponding, the general purpose module of the same type created can have Multi-instance, therefore, in order to distinguish each general purpose module in detail, after creating example, it can be just example allocation mark (ID) of each establishment.
Example for general purpose module in the scheme of the embodiment of the present application distributes ID, the object done like this is: the general purpose module of the same type created by identical class factory, although the type of these general purpose modules is identical but its attribute information is incomplete same, the behavior outcome produced is also different, therefore, if distribute ID for similar assembly synoptically, follow-up invoked procedure may be caused to occur mistake, but for the mode of example allocation ID in use the present embodiment, just can avoid investigating to the general purpose module of different instances, ensure the degree of accuracy that general purpose module calls.
Particularly, this step 103 can the storage mode of Key-Value (key-be worth to) in a distributed manner store, and implementation is as follows:
The first step: determine to point to the content pointers of example in the memory location in general purpose module storehouse created.
To create the general purpose module (being referred to as general purpose module _ 1) of Background type, after the attribute information in a step 102 according to general purpose module _ 1 creates example (being referred to as example _ 1), this example _ 1 is stored in general purpose module storehouse, and the content pointers (being referred to as content pointers _ 1) of memory location, example _ 1 is pointed in definition.
Second step: for the example allocation of the general purpose module created identifies.
Still to create general purpose module _ 1 of Background type, after the attribute information in a step 102 according to general purpose module _ 1 creates example _ 1, for the ID that uniquely represents this example _ 1 is distributed in this example _ 1, such as, distribute to being designated " ID_COMMON_BKGND1 " of this example _ 1.
The realization order of the above-mentioned first step and second step is not fixed, and performs the first step, also can the first step and second step perform side by side after also can first performing second step.
3rd step: set up the corresponding relation between the mark of the example of general purpose module and content pointers.
Be the example _ 1 distribution ID of general purpose module _ 1 in a first step, and define content pointers _ 1 of the memory location of sensing example _ 1 in general purpose module storehouse in second step after, can set up the corresponding relation between ID and content pointers _ 1, the example represented by the mark in described corresponding relation is identical with the example that corresponding content pointers is pointed to.
4th step: the corresponding relation between the mark of example and content pointers is stored in described general purpose module storehouse.
Now, in general purpose module storehouse, not only store the content of general purpose module, also with the form of key-value distributed memory system, the corresponding relation between mark and content pointers is stored in general purpose module storehouse simultaneously.
In the step 102 of the embodiment of the present application one and step 103, read by the attribute information of each general purpose module recorded in configuration file and operate successively, create corresponding general purpose module respectively and be stored in general purpose module storehouse, until all create recording general purpose module corresponding to each attribute information in configuration file and store.
By the scheme of the embodiment of the present application one, in software program initializes process, complete the unified of general purpose module create and the unified process stored, compared with the existing mode being created general purpose module by common component separately, effectively can reduce the number of times creating general purpose module, and then reduce the amount of memory shared by constructive process of general purpose module, improve the travelling speed of common component, simultaneously, the present embodiment completes the creation operation of general purpose module in software initialization process, common component directly can be called according to demand and created complete general purpose module, and without the need to waiting for the constructive process of general purpose module again, and the mode by creating example in the present embodiment creates general purpose module, and be the unique mark of example allocation, even if store multiple general purpose modules of the same type in general purpose module storehouse, also the general purpose module of particular community can be inquired according to the ID of example, avoid obscuring of multiple general purpose modules of the same type, ensure that calling of general purpose module pinpoint accuracy.
Embodiment two
After adopting the scheme of embodiment one to create general purpose module, just can call the general purpose module in general purpose module storehouse further, as shown in Figure 4, for calling the method step schematic diagram of general purpose module in the embodiment of the present application two, said method comprising the steps of:
Step 201: the mark determining general purpose module to be called.
In the scheme of the present embodiment, in common component, store the mark of the general purpose module that can call, when common component needs to call general purpose module, read the mark of the general purpose module that self stores to carry out call operation.
Step 202: according to the described mark determined, searches the general purpose module represented by described mark from the general purpose module storehouse storing multiple general purpose module.
Different according to the form of the general purpose module stored in general purpose module storehouse, the specific implementation of this step is also different.Suppose in embodiment one, what store in general purpose module storehouse is the example of general purpose module, and the corresponding relation between the mark of example and content pointers, then in this step, the specific implementation process of searching the general purpose module represented by described mark from general purpose module storehouse is:
The first step: according to the corresponding relation between the mark of the example of general purpose module and content pointers, determine the content pointers of the mark correspondence of the example of general purpose module to be called.
The mark of the general purpose module to be called determined in step 201 is the mark that uniquely can represent this general purpose module, if what store in a kind of general purpose module storehouse of embodiment is the mark of the example of general purpose module, then the mark of the general purpose module determined in step 201 is the mark of the example of this general purpose module.
After the mark determining general purpose module to be called, just can inquire about the content pointers corresponding with this mark from general purpose module storehouse.
Second step: using the example of the example pointed by the content pointers determined as the general purpose module found out.
Because general purpose module is created by example, therefore, after finding out the example of general purpose module, the general purpose module created namely has been found out.
Step 203: call the general purpose module found out.
If what find out in step 202. is the example of general purpose module, then in this step by calling the example entrance of general purpose module, and runs described example, calling, running the object of general purpose module to reach.
By the scheme of the embodiment of the present application two, common component is when needing operation general purpose module, obtaining the function of general purpose module, without the need to creating general purpose module respectively, but directly call the general purpose module created in general purpose module storehouse, eliminate time loss when common component creates general purpose module respectively and memory source consumption, improve assembly operating efficiency; And in the scheme of the embodiment of the present application, by carrying out the access of general purpose module in general purpose module storehouse for the fixing ID of each example stored, without the need to being dynamically example allocation ID by system, ensureing, on the basis that general purpose module correctly calls, to reduce taking of resource.
Embodiment three
The embodiment of the present application three passes through a concrete example, describes the scheme of the embodiment of the present application two in detail.
Suppose: the common component calling general purpose module is session window assembly, the general purpose module that session window assembly can call is background general purpose module and frame general purpose module, background general purpose module be designated BackgroundID, drawn by which background general purpose module for the background indicating session window assembly; Frame general purpose module be designated BorderID, drawn by which frame general purpose module for the frame indicating session window assembly.The mark of these two general purpose modules is documented in session window assembly.
As shown in Figure 5, be the present embodiment three kinds, the step schematic diagram of corresponding general purpose module in session window component call general purpose module storehouse, comprises the following steps:
Step 301: when session window assembly will start to draw window, determine the mark BackgroundID of the background general purpose module of rendering context, and the mark BorderID determining the frame general purpose module drawing frame.
Step 302: session window assembly judges that whether BackgroundID and BorderID be effective respectively, if so, then performs step 303; Otherwise if only have one to identify effectively, then effective mark continues to perform step 303; If two marks are all invalid, then stop the operation of calling general purpose module, utilize the drafting function of session window assembly self to draw.
In the scheme of the present embodiment, although store the mark of background general purpose module and frame general purpose module in session window assembly, but the mark of the general purpose module stored may be invalid mark, general purpose module is called in order to what ensure that session window assembly can be correct, and avoid the failure of invalidated identification to call the situation of extra occupying system resources, in this step, the validity of the mark for inquiring about general purpose module is checked, only have the mark of effective general purpose module just can carry out follow-up general purpose module search procedure, mark for invalid general purpose module does not allow to use.
To judge that whether BackgroundID is effective, its judgment mode includes but not limited to following content:
The first step: the value range presetting the string length of effective general purpose module sign content.
In the scheme of each embodiment of the application, the mark of general purpose module (distinguishingly, the mark of general purpose module example) content is character string, for effective mark, in its content, the length of character string should in certain scope, therefore, the value range of the string length of effective sign content can be preset.String length in content is designated effective mark in this value range, otherwise is invalidated identification.
Second step: judge that whether the content of BackgroundID is empty, if so, then determine that described BackgroundID is invalid; Otherwise, perform the 3rd step.
3rd step: judge that the string length of BackgroundID content is whether in the value range of setting; If so, then determine that described BackgroundID is effective; Otherwise, determine that described BackgroundID is invalid.
Step 303: session window assembly, by effective BackgroundID and BorderID, finds out corresponding content pointers from general purpose module storehouse.
In the scheme of the present embodiment, session window assembly can in a synchronous manner, carries out calling of example by the multiple content pointers of function lookup preset.
Found out the content pointers of the example pointing to background general purpose module by effective BackgroundID, found out the content pointers of the example pointing to frame general purpose module by effective BorderID.
Step 304: session window assembly utilizes the content pointers found out, calls the example of the background general purpose module of sensing and the example of frame general purpose module from general purpose module storehouse.
Because the content pointers corresponding by BackgroundID can determine the example of background general purpose module, therefore, session window component call also runs the example of background general purpose module, draws the background of window; In like manner, by calling and running the example of frame general purpose module, the frame of window is drawn.
As shown in Figure 6, be the scheme by the present embodiment three, the call relation schematic diagram between common component and general purpose module, wherein, the general purpose module of left side solid line is the general purpose module creating and be stored in general purpose module storehouse; The general purpose module that called by common component of general purpose module of the right dotted line.Except session window assembly, when the common component of other such as system information window assemblies needs to call background general purpose module and frame general purpose module, also can carry out in the manner described above.
Embodiment four
The embodiment of the present application four also provides a kind of equipment belonging to the establishment general purpose module under same inventive concept with embodiment one, as shown in Figure 7, be applied in the software systems of the assembly after there is encapsulation, comprise: storehouse creation module 11, building component module 12 and memory module 13, wherein: storehouse creation module 11, for when software initialization, generates general purpose module storehouse; Building component module 12, for the attribute information according to the general purpose module recorded in configuration file, creates general purpose module; Memory module 13 is for being stored to the general purpose module of establishment and the mark of general purpose module in described general purpose module storehouse.
Described building component module 12 comprises: example creates submodule 21 and setup of attribute submodule 22, wherein: example creates submodule 21 and creates mode for the example according to setting, creates the example of general purpose module; Setup of attribute submodule 22 for the attribute information according to the general purpose module recorded in configuration file, for create example set a property.
Described memory module 13 comprises: corresponding relation sets up submodule 23 and implementation sub-module 24, wherein: corresponding relation sets up submodule 23 for determining to point to the content pointers of the example memory location in general purpose module storehouse created, and the example allocation mark for creating, and set up the corresponding relation between the mark of example and content pointers; Implementation sub-module 24 is for being stored to the corresponding relation between the mark of example and content pointers in described general purpose module storehouse.
The equipment of the establishment general purpose module in the present embodiment four can be the equipment that can perform each step of embodiment one, and the logical block of each step of current embodiment one repeats no longer one by one in fact.
The equipment of the establishment general purpose module in the present embodiment four can be integrated client in software, also can be independent of software but can call the client of every terms of information in software.
Embodiment five
The embodiment of the present application five also provides a kind of equipment calling general purpose module belonged to embodiment two and embodiment three under same inventive concept, as shown in Figure 8, comprise: identify determination module 31, search module 32 and calling module 33, wherein: mark determination module 31 is for determining the mark of general purpose module to be called; Search module 32 for according to the described mark determined, from the general purpose module storehouse storing multiple general purpose module, search the general purpose module represented by described mark; Calling module 33 is for calling the general purpose module found out.
Also comprise determination module 34, for judging whether the content identifying the described mark that determination module 31 is determined is empty, when the content of described mark is not empty, and when determining that the string length of described sign content is in setting range value, described in triggering, search module 32.
Described module 32 of searching comprises: pointer determination submodule 41 and operator module 42, wherein: pointer determination submodule 41, for the corresponding relation between the mark of the example according to general purpose module and content pointers, determines the content pointers of the mark correspondence of the example of general purpose module to be called; Operator module 42 is for using the example of the example pointed by the content pointers determined as the general purpose module found out.
Described calling module 33, specifically for calling the example entrance of the general purpose module found out, and runs described example.
The equipment calling general purpose module in the present embodiment five can be the equipment that can perform embodiment two and each step of embodiment three, and the logical block of current embodiment two and each step of embodiment three repeats no longer one by one in fact.
The equipment calling general purpose module in the present embodiment five can in integrated each common component in software, when a certain common component needs to call general purpose module, and can according to the function complete call of the integrated equipment of general purpose module that calls in this locality; First the equipment calling general purpose module also independent of the common component of software, when a certain common component needs to call general purpose module, should can run the equipment calling general purpose module, complete calling general purpose module by this equipment.
Those skilled in the art should understand, the embodiment of the application can be provided as method, system or computer program.Therefore, the application can adopt the form of complete hardware embodiment, completely software implementation or the embodiment in conjunction with software and hardware aspect.And the application can adopt in one or more form wherein including the upper computer program implemented of computer-usable storage medium (including but not limited to magnetic disk memory, CD-ROM, optical memory etc.) of computer usable program code.
The application describes with reference to according to the process flow diagram of the method for the embodiment of the present application, equipment (system) and computer program and/or block scheme.Should understand can by the combination of the flow process in each flow process in computer program instructions realization flow figure and/or block scheme and/or square frame and process flow diagram and/or block scheme and/or square frame.These computer program instructions can being provided to the processor of multi-purpose computer, special purpose computer, Embedded Processor or other programmable data processing device to produce a machine, making the instruction performed by the processor of computing machine or other programmable data processing device produce device for realizing the function of specifying in process flow diagram flow process or multiple flow process and/or block scheme square frame or multiple square frame.
These computer program instructions also can be stored in can in the computer-readable memory that works in a specific way of vectoring computer or other programmable data processing device, the instruction making to be stored in this computer-readable memory produces the manufacture comprising command device, and this command device realizes the function of specifying in process flow diagram flow process or multiple flow process and/or block scheme square frame or multiple square frame.
These computer program instructions also can be loaded in computing machine or other programmable data processing device, make on computing machine or other programmable devices, to perform sequence of operations step to produce computer implemented process, thus the instruction performed on computing machine or other programmable devices is provided for the step realizing the function of specifying in process flow diagram flow process or multiple flow process and/or block scheme square frame or multiple square frame.
Although described the preferred embodiment of the application, those skilled in the art once obtain the basic creative concept of cicada, then can make other change and amendment to these embodiments.So claims are intended to be interpreted as comprising preferred embodiment and falling into all changes and the amendment of the application's scope.
Obviously, those skilled in the art can carry out various change and modification to the application and not depart from the spirit and scope of the application.Like this, if these amendments of the application and modification belong within the scope of the application's claim and equivalent technologies thereof, then the application is also intended to comprise these change and modification.

Claims (9)

1. create a method for general purpose module, it is characterized in that, be applied in the software systems of the assembly after there is encapsulation, comprise:
When software initialization, generate general purpose module storehouse;
According to the attribute information of the general purpose module recorded in configuration file, create general purpose module;
The general purpose module of establishment and the mark of this general purpose module are stored in described general purpose module storehouse;
According to the attribute information of the general purpose module recorded in configuration file, create general purpose module, specifically comprise:
Create mode according to the example of setting, create the example of general purpose module, and according to the attribute information of the general purpose module recorded in configuration file, for the example created sets a property.
2. the method for claim 1, is characterized in that, described attribute information comprises one or more combinations in following information:
The memory address of desired data when the type of general purpose module, the title of general purpose module and operation general purpose module.
3. the method for claim 1, is characterized in that, the general purpose module of establishment and the mark of general purpose module is stored in described general purpose module storehouse, specifically comprises:
Determine the content pointers pointing to the example memory location in general purpose module storehouse created, and the example allocation mark for creating, and set up the corresponding relation between the mark of example and content pointers;
Corresponding relation between the mark of example and content pointers is stored in described general purpose module storehouse.
4. call a method for general purpose module, it is characterized in that, comprising:
Determine the mark of general purpose module to be called;
According to the described mark determined, search the general purpose module represented by described mark from the general purpose module storehouse storing multiple general purpose module, described general purpose module storehouse utilizes the method in claim 1 to create;
Call the general purpose module found out.
5. method as claimed in claim 4, it is characterized in that, after determining the mark of general purpose module to be called, and search the general purpose module represented by described mark from general purpose module storehouse before, described method also comprises:
Judge that whether the content of described mark is empty;
When the content of described mark is not empty, determine that the string length of described sign content is in setting range value further.
6. method as claimed in claim 4, is characterized in that, according to the described mark determined, search the general purpose module represented by described mark, specifically comprise from general purpose module storehouse:
According to the corresponding relation between the mark of the example of general purpose module and content pointers, determine the content pointers of the mark correspondence of the example of general purpose module to be called;
Using the example of the example pointed by the content pointers determined as the general purpose module found out.
7. method as claimed in claim 6, is characterized in that, call the general purpose module found out, specifically comprise:
Call the example entrance of general purpose module, and run described example.
8. create an equipment for general purpose module, it is characterized in that, be applied in the software systems of the assembly after there is encapsulation, comprise:
Storehouse creation module, for when software initialization, generates general purpose module storehouse;
Building component module, for the attribute information according to the general purpose module recorded in configuration file, creates general purpose module;
Memory module, for being stored in described general purpose module storehouse by the general purpose module of establishment and the mark of this general purpose module;
Described building component module comprises: example creates submodule and setup of attribute submodule, wherein: example creates submodule and is used for creating mode according to the example of setting, creates the example of general purpose module; Setup of attribute submodule is used for the attribute information according to the general purpose module recorded in configuration file, for the example created sets a property.
9. call an equipment for general purpose module, it is characterized in that, comprising:
Mark determination module, for determining the mark of general purpose module to be called;
Search module, for according to the described mark determined, from the general purpose module storehouse storing multiple general purpose module, search the general purpose module represented by described mark, wherein, the general purpose module storehouse of storage is that the equipment of the establishment general purpose module utilized described in claim 8 creates;
Calling module, for calling the general purpose module found out.
CN201110170947.3A 2011-06-23 2011-06-23 A kind ofly create and call the method and apparatus of general purpose module Active CN102841780B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201110170947.3A CN102841780B (en) 2011-06-23 2011-06-23 A kind ofly create and call the method and apparatus of general purpose module
HK13102774.3A HK1175552A1 (en) 2011-06-23 2013-03-06 Method and device for creating and invoking common components

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201110170947.3A CN102841780B (en) 2011-06-23 2011-06-23 A kind ofly create and call the method and apparatus of general purpose module

Publications (2)

Publication Number Publication Date
CN102841780A CN102841780A (en) 2012-12-26
CN102841780B true CN102841780B (en) 2015-10-14

Family

ID=47369185

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201110170947.3A Active CN102841780B (en) 2011-06-23 2011-06-23 A kind ofly create and call the method and apparatus of general purpose module

Country Status (2)

Country Link
CN (1) CN102841780B (en)
HK (1) HK1175552A1 (en)

Families Citing this family (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104915185B (en) * 2014-03-11 2019-04-02 腾讯科技(深圳)有限公司 Program assembly coupled processing method and relevant apparatus
CN104933083B (en) * 2014-03-19 2018-02-09 国家电网公司 A kind of processing method and processing device of sensing data dynamic retractility
CN105183760B (en) * 2015-07-24 2020-04-10 北京奇虎科技有限公司 Webpage component loading method and device
CN105786522A (en) * 2016-03-17 2016-07-20 无锡威泰迅电力科技有限公司 WEB (World Wide Web) front-end universal component unit based on Node. js platform
CN107015787B (en) * 2016-09-30 2020-05-05 腾讯科技(深圳)有限公司 Method and device for designing interactive application framework
CN108664507B (en) * 2017-03-31 2022-03-22 武汉斗鱼网络科技有限公司 User information processing method and device
CN107315580B (en) * 2017-04-17 2020-06-02 阿里巴巴集团控股有限公司 User interface component processing method, device and equipment and readable medium
CN109582303B (en) * 2018-10-31 2024-05-03 平安科技(深圳)有限公司 General component calling method, device, computer equipment and storage medium
CN110347379B (en) * 2019-07-15 2023-12-29 网易(杭州)网络有限公司 Processing method, device and storage medium for combined crowdsourcing questions
CN113553058B (en) * 2021-07-23 2022-08-23 深圳万顺叫车云信息技术有限公司 Front-end page access method and system and electronic equipment
CN115543322A (en) * 2022-11-28 2022-12-30 成都摹客科技有限公司 UI component processing method and device and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101359999A (en) * 2007-07-30 2009-02-04 中兴通讯股份有限公司 Method and apparatus for network element data synchronization
US7624397B1 (en) * 2002-10-22 2009-11-24 Adobe Systems Incorporated Universal component system for application servers
CN101739254A (en) * 2009-12-31 2010-06-16 山东中创软件商用中间件股份有限公司 Method and device for realizing multiplexing of multi-platform communication assemblies

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7624397B1 (en) * 2002-10-22 2009-11-24 Adobe Systems Incorporated Universal component system for application servers
CN101359999A (en) * 2007-07-30 2009-02-04 中兴通讯股份有限公司 Method and apparatus for network element data synchronization
CN101739254A (en) * 2009-12-31 2010-06-16 山东中创软件商用中间件股份有限公司 Method and device for realizing multiplexing of multi-platform communication assemblies

Also Published As

Publication number Publication date
HK1175552A1 (en) 2013-07-05
CN102841780A (en) 2012-12-26

Similar Documents

Publication Publication Date Title
CN102841780B (en) A kind ofly create and call the method and apparatus of general purpose module
CN107656759B (en) Rendering method and device for user interface
EP3543847A1 (en) Service processing method and device
CN108572965A (en) A kind of resource loading method and device
WO2005096139A1 (en) System and method for program execution
CN104268229A (en) Resource obtaining method and device based on multi-process browser
US8694972B2 (en) System and method for interoperating with foreign objects from a single language computing environment
CN108376066B (en) Code processing device and code processing method
CN114398194A (en) Data collection method and device, electronic equipment and readable storage medium
US20120159515A1 (en) Sharing object representations
CN103473113A (en) Universal virtual-machine adopting method
CN110851123A (en) WebGIS power grid visualization framework construction method, system and device based on SpringMVC
CN105045571A (en) Novel WebGIS architecture
US9141352B2 (en) Dynamically building locale objects at run-time
CN110795454A (en) Service request method, device, server and storage medium
CN113448650A (en) Live broadcast function plug-in loading method, device, equipment and storage medium
CN110837446A (en) Equipment management method and device applied to embedded system, medium and embedded equipment
CN103186386A (en) Application loading method and system
CN107092494B (en) Method and device for accessing APK (android Package) resource
CN110532022B (en) Method, device, equipment and storage medium for acquiring different cloud platform versions
KR20180098584A (en) Method and apparatus for executing APP program
CN116521181A (en) Script data processing method, device, equipment and medium based on game system
CN111221560B (en) Resource management method and device and electronic equipment
CN114588638A (en) Method for developing game based on Lua language and program development device
CN103473116A (en) Remote call method and device for data with large data volume

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
REG Reference to a national code

Ref country code: HK

Ref legal event code: DE

Ref document number: 1175552

Country of ref document: HK

C14 Grant of patent or utility model
GR01 Patent grant
REG Reference to a national code

Ref country code: HK

Ref legal event code: GR

Ref document number: 1175552

Country of ref document: HK