CN109144478B - Component frame system and method of using the same - Google Patents

Component frame system and method of using the same Download PDF

Info

Publication number
CN109144478B
CN109144478B CN201810766348.XA CN201810766348A CN109144478B CN 109144478 B CN109144478 B CN 109144478B CN 201810766348 A CN201810766348 A CN 201810766348A CN 109144478 B CN109144478 B CN 109144478B
Authority
CN
China
Prior art keywords
target
component
name
platform
resource
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
CN201810766348.XA
Other languages
Chinese (zh)
Other versions
CN109144478A (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 Cat Eyes Culture Media Co ltd
Original Assignee
Beijing Cat Eyes Culture Media 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 Cat Eyes Culture Media Co ltd filed Critical Beijing Cat Eyes Culture Media Co ltd
Priority to CN201810766348.XA priority Critical patent/CN109144478B/en
Publication of CN109144478A publication Critical patent/CN109144478A/en
Application granted granted Critical
Publication of CN109144478B publication Critical patent/CN109144478B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/20Software design
    • G06F8/24Object-oriented
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/76Adapting program code to run in a different environment; Porting

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

The invention provides a component frame system and a method of using the same. The system comprises: the business component layer comprises business components; an interface component layer comprising a plurality of common service interfaces; the platform component layer comprises a plurality of platform component modules, each platform component module comprises a plurality of packaging methods and resources of a corresponding host application program, the plurality of packaging methods comprise implementation methods of all common service interfaces which are needed to be used by the corresponding host application program aiming at the business components, and the resources comprise all the resources which are needed to be used by the corresponding host application program when at least one business component is called; different platform component modules comprise different configuration files, and the configuration files are used for describing the calling relationship among the service component layer, the interface component layer and the platform component layer; the configuration file of each platform component module comprises the name of the service component, the name of the public service interface and the corresponding relation of the name of the packaging method for realizing the public service interface by the platform component module.

Description

Component frame system and method of using the same
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a component framework system and a method for using the component framework system.
Background
At present, service type Applications (APPs) are mainly platform APPs, so-called platform APPs, that is, they can also access various service lines (such as travel, take-out, hotel, movie, etc.) on the premise of providing their own functions. The code organization form of a service line existing in a platform APP is called a service component, for example, a movie service in a Mei Gong APP (a platform App) is a service component. After the platform APP accesses the service component, the platform APP is a host APP for the service component, for example, if the movie component accesses the masque APP, the masque APP is a host APP for the movie component.
The technology stacks of different platforms APP (various basic technologies and frameworks used by the platform APP) are different, and therefore, the technology stacks of the service plug-ins used by the different platforms APP are also different. Therefore, in the prior art, when developing the service components of each platform APP, the service components used by each platform APP need to be developed according to the technology stack of each platform APP, but service components with the same function, such as movie service components, often exist between different platform APPs, and if the same service component is repeatedly developed for each platform APP, development resources are wasted, and code development efficiency is reduced.
If can be with on a plurality of platforms APP of different technology stacks of code multiplexing of same business module, for example same code can regard as film business module direct access on beautiful group platform APP, also can directly access on cat eye platform APP simultaneously, then reduction code development cost that can be great promotes code development efficiency.
However, as described above, even for the same service component on different platforms APP, the technology stacks of the service component on different platforms APP are corresponding to the technology stacks of the belonging platforms APP, the service component and the platform APP have high coupling, and are heavily dependent on the platform, and the movie service component that cannot be written by the technology stack a can be applied to the platform APP1 that uses the technology stack B, and conversely, the movie service component that is written by the technology stack a can only be applied to the platform APP2 that uses the technology stack a.
Therefore, there is no solution to the need of how to multiplex the codes of the same set of business components directly to multiple host APPs.
Disclosure of Invention
The invention provides a component framework system and a using method of the component framework system, which aim to solve the problem that codes of the same service component cannot be directly used in multiple hosts of APP in the prior art.
To solve the above problems, according to one aspect of the present invention, a method of using a component frame system is disclosed.
The component frame system includes:
a business component layer comprising at least one business component, wherein the at least one business component is used for accessing to a plurality of host applications;
the interface component layer comprises a plurality of common service interfaces, wherein each common service interface is used for describing a service which can be provided by the host applications in common;
a platform component layer including a plurality of platform component modules, wherein the plurality of platform component modules respectively correspond to the plurality of host application programs, each platform component module includes a plurality of encapsulation methods and resources of the corresponding host application program, wherein the plurality of encapsulation methods include implementation methods of all common service interfaces that the corresponding host application program needs to use for the at least one business component, and the resources include all resources that the corresponding host application program needs to use when calling the at least one business component;
the different platform component modules comprise different configuration files, and the configuration files are used for describing calling relations among the service component layer, the interface component layer and the platform component layer;
each configuration file corresponds to the identifier of one platform component module;
the configuration file of each platform component module comprises the name of a business component, the name of a public service interface and the corresponding relation of the name of a method for realizing the encapsulation of the public service interface by the platform component module;
the method comprises the following steps:
accessing the component framework system to a target host application of the plurality of host applications;
a target public service interface receives a calling request of a target service component in the at least one service component to the target public service interface, wherein the calling request comprises an identification of a target platform component module of the target host application program, a name of the target service component and a name of the target public service interface;
the target public service interface determines a target configuration file of the target platform component module corresponding to the identifier of the target platform component module according to the calling request;
the target public service interface determines the name of a target packaging method corresponding to the name of the target business component and the name of the target public service interface according to the target configuration file;
the target public service interface acquires a target packaging method from the target platform component module according to the name of the target packaging method;
and the target public service interface responds to the calling request and returns the target packaging method to the target business component.
According to another aspect of the present invention, there is also disclosed a component frame system comprising:
a business component layer comprising at least one business component, wherein the at least one business component is used for accessing to a plurality of host applications;
the interface component layer comprises a plurality of common service interfaces, wherein each common service interface is used for describing a service which can be provided by the host applications in common;
a platform component layer including a plurality of platform component modules, wherein the plurality of platform component modules respectively correspond to the plurality of host application programs, each platform component module includes a plurality of encapsulation methods and resources of the corresponding host application program, wherein the plurality of encapsulation methods include implementation methods of all common service interfaces that the corresponding host application program needs to use for the at least one business component, and the resources include all resources that the corresponding host application program needs to use when calling the at least one business component;
the different platform component modules comprise different configuration files, and the configuration files are used for describing calling relations among the service component layer, the interface component layer and the platform component layer;
each configuration file corresponds to the identifier of one platform component module;
the configuration file of each platform component module comprises a corresponding relation between the name of the public service interface and the name of a packaging method for realizing the public service interface by the platform component module;
a target public service interface, configured to receive a call request of a target service component in the at least one service component to the target public service interface if the component framework system is accessed to a target host application in the plurality of host applications, where the call request includes an identifier of a target platform component module of the target host application, a name of the target service component, and a name of the target public service interface;
the target public service interface is used for determining a target configuration file of the target platform component module corresponding to the identifier of the target platform component module according to the calling request;
the target public service interface is used for determining the name of a target packaging method corresponding to the name of the target business component and the name of the target public service interface according to the target configuration file;
the target public service interface is used for acquiring a target packaging method from the target platform component module according to the name of the target packaging method;
and the target public service interface is used for responding to the calling request and returning the target packaging method to the target business component.
Compared with the prior art, the invention has the following advantages:
thus, in the embodiment of the present invention, by setting an abstract interface component layer between a service component layer and a platform component layer, services that can be provided by each host APP together are abstracted into a common service interface in the interface component layer, and a packaging method and resources of each common service interface that needs to be used for each interface component are set in a platform component module of each host APP in the platform component layer; and setting configuration files in each platform component module, wherein the configuration files comprise names of service components, names of public service interfaces and corresponding relations of the platform component modules for realizing the names of the packaging methods of the public service interfaces, so that when a certain service component is used, the packaging method of the service required to be used by the service component can be obtained only by means of the configuration files, and the packaging method is returned to the service component through the public service interface accessed by the service component, so that the same service component can be applied to various host APPs (application applications) using different technical stacks, namely platform APPs, the code development efficiency is greatly improved, and the code maintenance cost is reduced.
Drawings
FIG. 1 is a block diagram of an embodiment of an assembly frame system of the present invention;
FIG. 2 is a flow chart of steps of a method embodiment of the present invention for using a component framework system;
FIG. 3 is a block diagram of another embodiment of the component framework system of the present invention.
Detailed Description
In order to make the aforementioned objects, features and advantages of the present invention comprehensible, embodiments accompanied with figures are described in further detail below.
Referring to fig. 1, a block diagram of a component framework system according to an embodiment of the present invention is shown, where the component framework system may be applied to a platform APP with an IOS system, and the component framework system may specifically include:
the business component layer (i.e., the business component in fig. 1) includes at least one business component, here including business component 1, business component 2, business component 3, and business component 4. The at least one service component is used for accessing to multiple host applications, that is, each service component in the service component layer in the component framework system can access to each platform application, such as a cat eye APP, a popular comment APP, a midget APP, and the like.
And the service component layer is extensible, and in the actual development process, new service components which can be tiled to each platform APP can be added in the service component layer according to application requirements, for example, the service components 5 are extended.
An interface component layer (i.e. the interface component in fig. 1) including a plurality of common service interfaces, wherein each common service interface is used for describing a service which can be provided by the plurality of host applications in common;
the interface component layer is an important part of the connection platform APP (i.e. host application), because each platform uses some common components, but the usage modes of these common components are very different (for example, different processing modes when the sharing component shares field values such as title and content, or different login modes of the login component, etc.). Therefore, in the embodiment of the present invention, firstly, the services that can be provided by each platform APP that needs to tile the same service component are determined, then, a common service is determined among the services that can be provided by each platform APP, and then, the common service of each platform APP is abstracted into an interface, that is, a common service interface here. Among them, various capabilities of the host APP (i.e., platform APP) are a service.
In the embodiment of the present invention, each host APP is an IOS system, that is, the component framework system of the embodiment of the present invention is applied to the IOS system, so as to implement a componentization scheme of cross-platform APPs on the IOS system. The embodiment of the invention utilizes the characteristic of the iOS platform during operation to package the common component part of each platform APP into a uniform interface, so that a service layer developer can quickly realize own service through the uniform interface without concerning the realization of a bottom layer.
Wherein, in various embodiments, the common service interface includes, but is not limited to, a hardware service interface, a picture service interface, a network service interface, a location service interface, and the like.
The platform component layer, which includes a plurality of platform component modules, here includes platform component module 1 corresponding to hosting APP1, platform component module 2 corresponding to hosting APP2, platform component module 3 corresponding to hosting APP3, and platform component module 4 corresponding to hosting APP 4. The platform component layer is extensible, and in the actual development process, more platforms APP to which the service components in the service component layer need to be tiled can be added to the platform component layer according to application requirements, for example, the platform APP is extended to the platform component module 5.
The plurality of platform component modules respectively correspond to the plurality of host application programs, that is, the plurality of host application programs to which the service component needs to access. For example, the component framework system developed by the embodiment of the invention needs to be applied to a cat eye APP, a public comment APP and a beauty group APP, and the platform component layer comprises a platform component module of the cat eye APP, a platform component module of the public comment APP and a platform component module of the beauty group APP.
The platform component module is mainly used for storing resource files (such as picture resources) related to the platform and some special processing codes (namely packaging methods). The specific realization of the platform component module completely depends on the platform difference and has higher platform dependency.
As described above, the common service interface in the interface component layer is an abstract interface, and there is no specific implementation of the service, and the specific implementation manners of the platforms for the same common service interface are different, so that the embodiment of the present invention encapsulates the differentiation implementation of the common service interface for each platform in each platform component module in the platform component layer. For example, a specific implementation method, namely an encapsulation method, of the host APP1 for the hardware service interface is stored in the platform component module 1 corresponding to the host APP 1; the platform component module 2 corresponding to the host APP2 stores a specific implementation method, namely a packaging method, of the host APP2 for the same hardware service interface in the interface component layer.
Each platform component module comprises a plurality of encapsulation methods and resources of a corresponding host application program, wherein the encapsulation methods comprise implementation methods of all common service interfaces which are needed to be used by the corresponding host application program aiming at the at least one business component, and the resources comprise all resources which are needed to be used by the corresponding host application program when the at least one business component is called;
taking the service component 1 in the service component layer as an example for explanation, the common service interface that the service component 1 needs to use includes a picture service interface, a network service interface and a location service interface, and then the platform component module 1 needs to implement the three service interfaces, and the implementation method is an implementation method related to the technology stack of the host APP1, and the implementation method has higher dependency and higher coupling with the host APP 1. Taking the picture service interface as an example, the host APP1 may encapsulate the picture service interface used by the service component 1 by one or more methods. In addition, if the business component 2 also needs to use the picture service interface, the host APP1 may encapsulate the picture service interface used by the business component 2 by the same method as or different from the method for encapsulating the picture service interface used by the business component 1.
That is, the implementing methods of the same common service interface used by a certain host APP for different service components may be the same or different. That is, for the encapsulation method in a certain platform component module, it is associated with both the common service interface and the business component.
The interface component comprises services which can be provided by all the platforms together, but the implementation modes of the services by all the platforms are different, so that the implementation methods of the common services need to be encapsulated according to the platform characteristics in the platform component layer.
In addition, the platform component module of each host APP also comprises resources, and the resources comprise all resources required to be used by the host APP when the host APP calls the at least one service component;
for example, the platform component module of the host APP1 includes all resources that the host APP1 needs to use when calling any one of the business components in the business component layer.
Wherein different platform assembly modules comprise different configuration files;
the configuration file is used for describing the calling relationship among the service component layer, the interface component layer and the platform component layer;
each configuration file corresponds to an identifier of one platform component module, that is, a unique configuration file is allocated to each platform component module hosting the APP, and the configuration files of the platform component modules are unrelated.
The configuration file of each platform component module comprises the name of a business component, the name of a public service interface and the corresponding relation of the name of a method for realizing the encapsulation of the public service interface by the platform component module;
taking the configuration file of the platform component module 1 hosting the APP1 as an example for explanation:
the name of the service component 1, the name of the public service interface 1 and the name of the packaging method 1 realized by the host APP 1;
the name of the service component 1, the name of the public service interface 1 and the name of the encapsulation method 2 realized by the host APP 1;
the name of the service component 2, the name of the public service interface 1 and the name of the encapsulation method 3 realized by the host APP 1;
service component 2 name-public service interface 1 name-name of encapsulation method 4 implemented by host APP 1.
Optionally, the component frame system further comprises:
a resource management component for managing resources in the plurality of platform component modules;
the resource management component mainly realizes loading and acquisition of resource files, and guarantees that different hosts APP can acquire the resource files required by the hosts.
Because the resource files displayed by different host APPs in the same area in the same service page are different, for example, the color displayed by the host APP1 for the ticket buying button in the movie ticket buying page is color 1, and the color displayed by the host APP2 for the ticket buying button at the same position in the movie ticket buying page is color 2. Therefore, the resources (such as picture resources, color value styles, and the like) shown by the same business component of different hosts APP are different. Therefore, a resource management component is required to be arranged to obtain different resources for different host APPs.
Each configuration file also corresponds to a resource package name of a platform component module;
and the personalized display resources aiming at the same service component among all host APPs are stored in the resource package with the resource package name.
Optionally, the different service components in the service component layer jump through a preset protocol.
For example, the service component 1 is a movie ticket purchasing page, the service component is a movie detail page, after the movie ticket purchasing page is displayed in the service component layer, the display service of the movie detail page can be skipped to through a preset protocol, and then the different service components are skipped through a preset protocol (for example, a Scheme skip protocol).
For example "maoyan:// maoyan. com/moviesgoodsId ═ 8897";
maoyan stands for Scheme protocol name;
com represents the address domain of Scheme role;
the/movies represents a specified page (path).
Therefore, the embodiment of the invention can realize independent addition and removal of each service component in the service component layer and realize transverse skip among the service components.
Optionally, as shown in fig. 1, the assembly frame system may further include: a base component.
The embodiment of the invention can extract basic components which have no dependency relationship with the platform in each host APP, such as independent UI components, tool components and general processing (date processing, security check and the like), wherein the basic components are implemented components which can be used for general application of any platform APP, but not abstract interfaces. It is independent of the platform dependent components.
As shown in fig. 1, the service component layer can directly access the base component, the interface component, and the resource management component, but cannot directly access the platform component layer.
Based on the component framework system in the foregoing embodiment, referring to fig. 2, a flowchart of steps of an embodiment of a method for using the component framework system of the present invention is shown, which may specifically include the following steps:
step 101, accessing the component framework system to a target host application program in the plurality of host application programs;
after the component framework system shown in fig. 1 is developed, the component framework system may be accessed to any one APP among the host APP1, the host APP2, the host APP3 and the host APP4, for example, the component framework system may be accessed to the host APP 1.
In one example, a package manager (CocoaPods) may be utilized to access the component framework system of embodiments of the present invention into a host APP1 and establish the above-described configuration file for the host APP 1. This configuration file is mainly used to obtain component codes, resource files, and version number management of the component framework system shown in fig. 1.
It should be noted that, along with the extension of the service component layer, the interface component layer, and the platform component layer, the component framework system according to the embodiment of the present invention may have a variety of versions, and therefore, the version of the component framework system accessed on the host APP1 may be updated according to the version number of the component framework system, so that the component framework system with more service components can be accessed.
102, a target public service interface receives a calling request of a target service component in the at least one service component to the target public service interface, wherein the calling request comprises an identifier of a target platform component module of the target host application program, a name of the target service component and a name of the target public service interface;
wherein, for example, if service component 1 (i.e. target service component) is called by host APP1 (i.e. target host application), then service component 1 needs to use public service interface 1 (i.e. target public service interface) in the interface component layer, so service component 1 can send a call request to public service interface 1, where the call request carries the identifier of platform component module 1 of host APP1, the name of service component 1, and the name of public service interface 1. The common service interface 1 can receive the invocation request from the business component 1.
103, the target public service interface determines a target configuration file of the target platform component module corresponding to the identifier of the target platform component module according to the calling request;
since the public service interface 1 does not have a specific implementation method for the public service 1, the public service interface 1 first needs to determine the configuration file 1 of the platform component module 1 corresponding to the identifier of the platform component module 1 according to the identifier of the platform component module 1 in the call request.
Step 104, the target public service interface determines the name of the target packaging method corresponding to the name of the target business component and the name of the target public service interface according to the target configuration file;
optionally, in an embodiment, when step 104 is executed, the target public service interface may search, in the correspondence in the target configuration file, names of the target encapsulation methods corresponding to both the name of the target business component and the name of the target public service interface.
According to the embodiment shown in fig. 1, the configuration file 1 records the corresponding relationship between the name of each service component in the service component layer, the name of the public service interface, and the name of the encapsulation method for realizing the public service interface by the platform component module 1;
the configuration file of the platform component module 1 hosting the APP1 includes the following correspondence:
the name of the service component 1, the name of the public service interface 1 and the name of the packaging method 1 realized by the host APP 1;
the name of the service component 1, the name of the public service interface 1 and the name of the encapsulation method 2 realized by the host APP 1;
the name of the service component 2, the name of the public service interface 1 and the name of the encapsulation method 3 realized by the host APP 1;
service component 2 name-public service interface 1 name-name of encapsulation method 4 implemented by host APP 1.
Then, the names of the target encapsulation methods corresponding to the name of the service component 1 and the name of the public service interface 1, including the name of the encapsulation method 1 and the name of the encapsulation method 2, may be found in the corresponding relationship in the configuration file. That is, in the hosting APP1, when executing the service of the service component 1, the common service interface 1 needs to be also implemented using the encapsulation method 1 and the encapsulation method 2.
The number of target packaging methods is two, and in other embodiments, the target packaging method may be one or more.
105, the target public service interface acquires a target packaging method from the target platform component module according to the name of the target packaging method;
the calling request carries the identifier of the platform component module 1, so that the public service interface 1 can directly go to the platform component module 1 to obtain the encapsulation method 1 corresponding to the name of the encapsulation method 1 and the encapsulation method 2 corresponding to the name of the encapsulation method 2.
And step 106, the target public service interface responds to the calling request and returns the target packaging method to the target business component.
After receiving the encapsulation method 1 and the encapsulation method 2 from the platform component module 1, the common service interface 1 may return the encapsulation method 1 and the encapsulation method 2 to the business component 1 in response to a call request of the business component 1.
Thus, in the embodiment of the present invention, by setting an abstract interface component layer between a service component layer and a platform component layer, services that can be provided by each host APP together are abstracted into a common service interface in the interface component layer, and a packaging method and resources of each common service interface that needs to be used for each interface component are set in a platform component module of each host APP in the platform component layer; and setting configuration files in each platform component module, wherein the configuration files comprise names of service components, names of public service interfaces and corresponding relations of the platform component modules for realizing the names of the packaging methods of the public service interfaces, so that when a certain service component is used, the packaging method of the service required to be used by the service component can be obtained only by means of the configuration files, and the packaging method is returned to the service component through the public service interface accessed by the service component, so that the same service component can be applied to various host APPs (application applications) using different technical stacks, namely platform APPs, the code development efficiency is greatly improved, and the code maintenance cost is reduced.
Optionally, as shown in fig. 1, the component frame system may further include:
a resource management component for managing resources in the plurality of platform component modules;
each configuration file also corresponds to a resource package name of a platform component module;
wherein each of the configuration files comprises a correspondence of a resource identification and a resource name associated with the host application.
That is to say, for different host APPs, the resource identifiers of the resource files in the same display area in the same service component are the same, but the resource names corresponding to the resource identifiers in different platform component modules are different, so that different host APPs may be different for the resource in the same display area in the same service component, for example, the host APP1 is color 1 for the color of the picture a displayed at position 1 in page 1, and the host APP2 is color 2 for the color of the picture a displayed at position 1 in page 1. Therefore, the resource exposed in the same position of the same service component on different platforms may be different, but the identification of the resource is not changed. The name of the color resource of the picture a in the platform component module 1 of the host APP1 is name 1, and the corresponding color resource is red; the name of the color resource of the picture a in the platform component module 2 of the host APP2 is name 2, and the corresponding color resource is green;
that is, the resource identification is platform independent, but the resource name is platform (i.e., hosting APP) dependent.
Then the method according to an embodiment of the present invention may further include:
the resource management component receives a resource request of the target service component, wherein the resource request comprises a target resource identifier and a target resource packet name where the target resource is located;
that is, the service component 1 may also obtain the required platform-related resource from the platform component module 1, and the resource request may be related to the call request or not, which is not limited in the present invention.
The service component 1 may send a resource request to the resource management component, where the resource request includes a target resource identifier to be acquired and a target resource package name where the target resource is located;
each platform assembly module has a resource package, and the resource packages of different platform assembly modules have different resource package names.
The resource management component determines a target configuration file of a target platform component module corresponding to the target resource package name in the resource request;
after receiving the resource request sent by the service component 1, the resource management component may first determine a target platform component module corresponding to a target resource package name in the resource request, that is, the platform component module 1, and then determine the configuration file 1 of the platform component module 1.
The resource management component determines a target resource name corresponding to the target resource identifier according to the target configuration file;
since the configuration file 1 is written with the correspondence between the resource identifiers and the resource names of all the resources related to the platform used by the host APP1, the target resource name corresponding to the target resource identifier can be searched from the correspondence.
The resource management component acquires target resources from the resources of the target platform component module according to the target resource name;
since the platform component module 1 includes the resource related to the host APP dependency, the resource corresponding to the target resource name can be obtained from the resource package of the platform component module 1.
The resource management component returns the target resource to the target business component in response to the resource request.
After acquiring the target resource from the platform component module 1, the resource management component may respond to the resource request and return the target resource to the service component 1.
In one embodiment, if the call request and the resource request are directed to the same page, the target resource may be applied to the encapsulation method 1 and/or the encapsulation method 2, so as to expose a service page corresponding to the service component 1, and the resource exposed in the service page is the same resource as the host APP 1.
Optionally, in an embodiment, when service component 1 is called by host APP1, the service component may also use a basic component, such as a common UI component (e.g. a button or a tag) of any general platform, then service component 1 may directly initiate a call request for the target basic component to base component 1, and then the target basic component in the basic component may obtain, for example, the requested button or tag according to the call request and then directly return to service component 1 without communicating with the platform component layer.
Optionally, the different service components in the service component layer jump through a preset protocol.
For example, after the service component 1 calls the basic component, the interface component, and the resource management component, and acquires the required basic component, the encapsulation method, and the resource, the service processing may be completed, for example, a movie ticket purchasing page is displayed, and after the service component 1 completes the execution, since the service component 1 may register a protocol address in advance, then, according to the protocol address, a horizontal jump may be performed in a service component layer, for example, a jump is performed to the service component 2 to display a movie detail page. Then, the service component 2 initiates a request to the interface component layer in fig. 1, or further includes a base component and/or a resource management component, so as to display the movie detail page, and the specific method is similar to the execution method of the request to the service component 1 in the above embodiment, and is not described here again.
By means of the technical solutions of the foregoing embodiments of the present invention, embodiments of the present invention provide a component framework system, in which a unified interface component is provided to smooth differences between APP platforms of an IOS system. Providing component framework systems of different versions for different APP platforms by utilizing the characteristics of the packet manager; in addition, the embodiment of the invention creates a set of resource management mode, and the scheme can ensure that different platforms can acquire different resources only according to the resource identification when the resources are acquired. In addition, each component is managed in a layered mode, and meanwhile, each component is a relatively independent part. The service component layer is only connected with the interface component layer, the basic component layer and the resource management component in the middle, and does not directly communicate with the platform component layer. In addition, the assembly framework system of the embodiment of the invention is convenient to integrate, and the platform APP can be called in a project in a protocol mode only by introducing the name and the version number of the assembly framework system into the packet manager of the platform APP. In addition, the component framework system is convenient to expand, and all layers can be expanded quickly.
The component framework system of the embodiment of the invention isolates the differences of the APP platform through the bottom layer unified interface, the upper layer structure only needs to concern the realization of specific services, and simultaneously all different service components and basic components are developed and integrated in a component mode of the same layer, thereby realizing a scheme which has clear hierarchical structure, can be developed in a modularized way, is easy to expand, has high code reuse rate and can be rapidly deployed by modifying multiple ends at one time.
It should be noted that, for simplicity of description, the method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present invention is not limited by the illustrated order of acts, as some steps may occur in other orders or concurrently in accordance with the embodiments of the present invention. Further, those skilled in the art will appreciate that the embodiments described in the specification are presently preferred and that no particular act is required to implement the invention.
Corresponding to the method provided by the embodiment of the present invention, referring to fig. 3, a block diagram of a component framework system embodiment of the present invention is shown, which may specifically include:
a business component layer 31 comprising at least one business component, wherein the at least one business component is used for accessing to a plurality of host applications;
an interface component layer 32, including a plurality of common service interfaces, wherein each common service interface is used for describing a service which can be provided by the plurality of host applications in common;
a platform component layer 33, including a plurality of platform component modules, where the plurality of platform component modules respectively correspond to the plurality of host applications, and each platform component module includes a plurality of encapsulation methods and resources of the corresponding host application, where the plurality of encapsulation methods includes implementation methods of all common service interfaces that the corresponding host application needs to use for the at least one business component, and the resources include all resources that the corresponding host application needs to use when calling the at least one business component;
the different platform component modules comprise different configuration files, and the configuration files are used for describing calling relations among the service component layer, the interface component layer and the platform component layer;
each configuration file corresponds to the identifier of one platform component module;
the configuration file of each platform component module comprises a corresponding relation between the name of the public service interface and the name of a packaging method for realizing the public service interface by the platform component module;
a target public service interface, configured to receive a call request of a target service component in the at least one service component to the target public service interface if the component framework system is accessed to a target host application in the plurality of host applications, where the call request includes an identifier of a target platform component module of the target host application, a name of the target service component, and a name of the target public service interface;
the target public service interface is used for determining a target configuration file of the target platform component module corresponding to the identifier of the target platform component module according to the calling request;
the target public service interface is used for determining the name of a target packaging method corresponding to the name of the target business component and the name of the target public service interface according to the target configuration file;
the target public service interface is used for acquiring a target packaging method from the target platform component module according to the name of the target packaging method;
and the target public service interface is used for responding to the calling request and returning the target packaging method to the target business component.
Optionally, the target public service interface is configured to search, in the correspondence in the target configuration file, names of target encapsulation methods corresponding to the name of the target service component and the name of the target public service interface.
Optionally, the component frame system further comprises:
a resource management component for managing resources in the plurality of platform component modules;
each configuration file also corresponds to a resource package name of a platform component module;
each configuration file comprises a corresponding relation between a resource identifier and a resource name associated with a host application program;
the resource management component is used for receiving a resource request of the target service component, wherein the resource request comprises a target resource identifier and a target resource packet name where the target resource is located;
the resource management component is used for determining a target configuration file of a target platform component module corresponding to the target resource package name in the resource request;
the resource management component is used for determining a target resource name corresponding to the target resource identifier according to the target configuration file;
the resource management component is used for acquiring target resources from the resources of the target platform component module according to the target resource name;
the resource management component is used for responding to the resource request and returning the target resource to the target business component.
Optionally, the different service components in the service component layer jump through a preset protocol.
For the device embodiment, since it is basically similar to the method embodiment, the description is simple, and for the relevant points, refer to the partial description of the method embodiment.
The embodiments in the present specification are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, apparatus, or computer program product. Accordingly, embodiments of the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, embodiments of the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
Embodiments of the present invention are described with reference to flowchart illustrations and/or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing terminal to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing terminal to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing terminal to cause a series of operational steps to be performed on the computer or other programmable terminal to produce a computer implemented process such that the instructions which execute on the computer or other programmable terminal provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present invention have been described, additional variations and modifications of these embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all such alterations and modifications as fall within the scope of the embodiments of the invention.
Finally, it should also be noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or terminal that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or terminal. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or terminal that comprises the element.
The above detailed description of the component frame system and the method for using the component frame system provided by the present invention, and the specific examples applied herein have been described to explain the principle and the embodiments of the present invention, and the above descriptions of the embodiments are only used to help understanding the method of the present invention and the core idea thereof; meanwhile, for a person skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.

Claims (8)

1. A method of using a component frame system,
the component frame system includes:
a business component layer comprising at least one business component, wherein the at least one business component is used for accessing to a plurality of host applications;
the interface component layer comprises a plurality of common service interfaces, wherein each common service interface is used for describing a service which can be provided by the host applications in common;
a platform component layer including a plurality of platform component modules, wherein the plurality of platform component modules respectively correspond to the plurality of host application programs, each platform component module includes a plurality of encapsulation methods and resources of the corresponding host application program, wherein the plurality of encapsulation methods include implementation methods of all common service interfaces that the corresponding host application program needs to use for the at least one business component, and the resources include all resources that the corresponding host application program needs to use when calling the at least one business component;
the different platform component modules comprise different configuration files, and the configuration files are used for describing calling relations among the service component layer, the interface component layer and the platform component layer;
each configuration file corresponds to the identifier of one platform component module;
the configuration file of each platform component module comprises the name of a business component, the name of a public service interface and the corresponding relation of the name of a method for realizing the encapsulation of the public service interface by the platform component module;
the method comprises the following steps:
accessing the component framework system to a target host application of the plurality of host applications;
a target public service interface receives a calling request of a target service component in the at least one service component to the target public service interface, wherein the calling request comprises an identification of a target platform component module of the target host application program, a name of the target service component and a name of the target public service interface;
the target public service interface determines a target configuration file of the target platform component module corresponding to the identifier of the target platform component module according to the calling request;
the target public service interface determines the name of a target packaging method corresponding to the name of the target business component and the name of the target public service interface according to the target configuration file;
the target public service interface acquires a target packaging method from the target platform component module according to the name of the target packaging method;
the target public service interface responds to the calling request and returns the target packaging method to the target business component;
the component framework system is applied to an IOS system.
2. The method of claim 1, wherein the target public service interface determines a name of a target encapsulation method corresponding to the name of the target business component and the name of the target public service interface according to the target configuration file, and wherein the determining comprises:
and the target public service interface searches the name of the target packaging method corresponding to the name of the target business component and the name of the target public service interface in the corresponding relation in the target configuration file.
3. The method of claim 1, wherein the component frame system further comprises:
a resource management component for managing resources in the plurality of platform component modules;
each configuration file also corresponds to a resource package name of a platform component module;
each configuration file comprises a corresponding relation between a resource identifier and a resource name associated with a host application program;
the method further comprises the following steps:
the resource management component receives a resource request of the target service component, wherein the resource request comprises a target resource identifier and a target resource packet name where the target resource is located;
the resource management component determines a target configuration file of a target platform component module corresponding to the target resource package name in the resource request;
the resource management component determines a target resource name corresponding to the target resource identifier according to the target configuration file;
the resource management component acquires target resources from the resources of the target platform component module according to the target resource name;
the resource management component returns the target resource to the target business component in response to the resource request.
4. The method of claim 1, wherein hopping between different service components in the service component layer is performed through a preset protocol.
5. An assembly frame system, comprising:
a business component layer comprising at least one business component, wherein the at least one business component is used for accessing to a plurality of host applications;
the interface component layer comprises a plurality of common service interfaces, wherein each common service interface is used for describing a service which can be provided by the host applications in common;
a platform component layer including a plurality of platform component modules, wherein the plurality of platform component modules respectively correspond to the plurality of host application programs, each platform component module includes a plurality of encapsulation methods and resources of the corresponding host application program, wherein the plurality of encapsulation methods include implementation methods of all common service interfaces that the corresponding host application program needs to use for the at least one business component, and the resources include all resources that the corresponding host application program needs to use when calling the at least one business component;
the different platform component modules comprise different configuration files, and the configuration files are used for describing calling relations among the service component layer, the interface component layer and the platform component layer;
each configuration file corresponds to the identifier of one platform component module;
the configuration file of each platform component module comprises a corresponding relation between the name of the public service interface and the name of a packaging method for realizing the public service interface by the platform component module;
a target public service interface, configured to receive a call request of a target service component in the at least one service component to the target public service interface if the component framework system is accessed to a target host application in the plurality of host applications, where the call request includes an identifier of a target platform component module of the target host application, a name of the target service component, and a name of the target public service interface;
the target public service interface is used for determining a target configuration file of the target platform component module corresponding to the identifier of the target platform component module according to the calling request;
the target public service interface is used for determining the name of a target packaging method corresponding to the name of the target business component and the name of the target public service interface according to the target configuration file;
the target public service interface is used for acquiring a target packaging method from the target platform component module according to the name of the target packaging method;
the target public service interface is used for responding to the calling request and returning the target packaging method to the target business component;
the component framework system is applied to an IOS system.
6. The system of claim 5,
the target public service interface is configured to search, in the correspondence in the target configuration file, names of target encapsulation methods corresponding to the name of the target service component and the name of the target public service interface.
7. The system of claim 5, wherein the component frame system further comprises:
a resource management component for managing resources in the plurality of platform component modules;
each configuration file also corresponds to a resource package name of a platform component module;
each configuration file comprises a corresponding relation between a resource identifier and a resource name associated with a host application program;
the resource management component is used for receiving a resource request of the target service component, wherein the resource request comprises a target resource identifier and a target resource packet name where the target resource is located;
the resource management component is used for determining a target configuration file of a target platform component module corresponding to the target resource package name in the resource request;
the resource management component is used for determining a target resource name corresponding to the target resource identifier according to the target configuration file;
the resource management component is used for acquiring target resources from the resources of the target platform component module according to the target resource name;
the resource management component is used for responding to the resource request and returning the target resource to the target business component.
8. The system of claim 5, wherein the hopping between different service components in the service component layer is performed through a preset protocol.
CN201810766348.XA 2018-07-12 2018-07-12 Component frame system and method of using the same Active CN109144478B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810766348.XA CN109144478B (en) 2018-07-12 2018-07-12 Component frame system and method of using the same

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810766348.XA CN109144478B (en) 2018-07-12 2018-07-12 Component frame system and method of using the same

Publications (2)

Publication Number Publication Date
CN109144478A CN109144478A (en) 2019-01-04
CN109144478B true CN109144478B (en) 2022-02-25

Family

ID=64800445

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810766348.XA Active CN109144478B (en) 2018-07-12 2018-07-12 Component frame system and method of using the same

Country Status (1)

Country Link
CN (1) CN109144478B (en)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109976922B (en) * 2019-03-04 2021-02-02 上海连尚网络科技有限公司 Discovery method, device and computer storage medium between small program platforms
CN112035122B (en) * 2019-06-04 2023-04-07 中移(苏州)软件技术有限公司 Interface deployment method, system and storage medium
CN110377367B (en) * 2019-07-24 2022-05-03 广州虎牙科技有限公司 Component configuration method and device, electronic terminal and computer readable storage medium
CN110688176A (en) * 2019-09-09 2020-01-14 平安普惠企业管理有限公司 Class library file calling method based on APP and related equipment
CN110750295B (en) * 2019-09-30 2021-05-18 联想(北京)有限公司 Information processing method, device, electronic equipment and storage medium
CN111443944B (en) * 2020-06-12 2020-09-08 支付宝(杭州)信息技术有限公司 Program construction method, device and equipment
CN113094085B (en) * 2021-04-13 2024-01-19 贝壳找房(北京)科技有限公司 Component integration method, device, computer readable storage medium and electronic equipment
CN114089975B (en) * 2022-01-20 2022-06-24 北京大学 Expansion method and device of computing software, nonvolatile storage medium and processor

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2011053729A1 (en) * 2009-10-28 2011-05-05 Advanced Business Link Corporation Role-based modernization of legacy applications
CN103093392A (en) * 2011-10-31 2013-05-08 河南省电力公司 Electrical power system three-dimensional digitalization operation platform
CN103440151A (en) * 2013-09-05 2013-12-11 北京京东尚科信息技术有限公司 Method and apparatus for dynamically loading Web page
CN106569900A (en) * 2016-10-28 2017-04-19 腾讯科技(深圳)有限公司 Application processing method and device
CN107515755A (en) * 2017-08-30 2017-12-26 四川长虹电器股份有限公司 The pluggable method of projects moduleization is realized based on dubbo issuing services

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CA2406089A1 (en) * 2002-09-30 2004-03-30 Ibm Canada Limited-Ibm Canada Limitee A common scheduler web service for distributed network environments
US7853925B2 (en) * 2006-12-13 2010-12-14 Sap Ag System and method for managing hierarchical software development
US8448132B2 (en) * 2009-05-07 2013-05-21 Sap Ag Systems and methods for modifying code generation templates
DE102010044346A1 (en) * 2010-09-03 2012-03-08 Rwe Rheinland Westfalen Netz Ag Measurement network interface device
CN105872094B (en) * 2016-05-31 2019-01-01 山东大学 A kind of service robot cloud platform interface system and method based on SOA
CN108228288A (en) * 2016-12-22 2018-06-29 航天信息股份有限公司 A kind of component system and its call method and device
CN108255545B (en) * 2016-12-28 2022-09-02 阿里巴巴集团控股有限公司 Function calling method and device between components and modular architecture system
CN106933570B (en) * 2017-02-16 2020-10-20 北京临近空间飞行器系统工程研究所 Aerospace test, launch and control software platform based on plug-in technology

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2011053729A1 (en) * 2009-10-28 2011-05-05 Advanced Business Link Corporation Role-based modernization of legacy applications
CN103093392A (en) * 2011-10-31 2013-05-08 河南省电力公司 Electrical power system three-dimensional digitalization operation platform
CN103440151A (en) * 2013-09-05 2013-12-11 北京京东尚科信息技术有限公司 Method and apparatus for dynamically loading Web page
CN106569900A (en) * 2016-10-28 2017-04-19 腾讯科技(深圳)有限公司 Application processing method and device
CN107515755A (en) * 2017-08-30 2017-12-26 四川长虹电器股份有限公司 The pluggable method of projects moduleization is realized based on dubbo issuing services

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
"美团猫眼电影android模块化实战--可能是最详细的模块化实战";陈文超happylion;《http://www.jianshu.com/p/d372cc6802e5》;20170912;第1-22页 *

Also Published As

Publication number Publication date
CN109144478A (en) 2019-01-04

Similar Documents

Publication Publication Date Title
CN109144478B (en) Component frame system and method of using the same
CN109547570B (en) Service registration method, device, registration center management equipment and storage medium
CN109194502B (en) Management method of multi-tenant container cloud computing system
US10440138B2 (en) Provisioning IaaS services
CN107203419B (en) Method, device and system for calling among modules in application program
CN108255497B (en) Application deployment method and device
CN107077388A (en) System and method for providing end-to-end life cycle in multi-tenant application server environment
CN108322490B (en) Method, device and server for configuring and deploying distributed cloud service system by virtual machine
CN107077389A (en) For using system and method during global operation in multi-tenant application server environment
CN110413288A (en) Using dispositions method, device, server and storage medium
CN106569880B (en) Method and system for dynamically sharing resources between Android applications
CN114077462A (en) Method, device, equipment and medium for calling Android HIDL interface by software operating system
CN111930382B (en) Application page access method, device and equipment
CN107273126B (en) Application development method and device
CN102375894B (en) Method for managing different types of file systems
CN104636122A (en) Sharing method and device of capacity component
CN113157339A (en) Application service expansion method, system, storage medium and device based on OSB
CN115048642B (en) Communication method between trusted applications in multi-trusted execution environment and electronic equipment
CN115086166A (en) Computing system, container network configuration method, and storage medium
WO2013170801A1 (en) Device management method and apparatus
CN109660575B (en) Method and device for realizing NFV service deployment
KR100554521B1 (en) storage medium for descriptor file architecture based on SCA system and file parsing method thereof
CN115525396A (en) Application management method and device based on cloud protogenesis
CN108804236B (en) AIDL file sharing method and system
CN113835827A (en) Application deployment method and device based on container Docker and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant