CN110795094A - Page component quoting method and page component quoting device - Google Patents

Page component quoting method and page component quoting device Download PDF

Info

Publication number
CN110795094A
CN110795094A CN201910886924.9A CN201910886924A CN110795094A CN 110795094 A CN110795094 A CN 110795094A CN 201910886924 A CN201910886924 A CN 201910886924A CN 110795094 A CN110795094 A CN 110795094A
Authority
CN
China
Prior art keywords
component
page
application
dependency relationship
folder
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201910886924.9A
Other languages
Chinese (zh)
Other versions
CN110795094B (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.)
Wuba Co Ltd
Original Assignee
Wuba 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 Wuba Co Ltd filed Critical Wuba Co Ltd
Priority to CN201910886924.9A priority Critical patent/CN110795094B/en
Publication of CN110795094A publication Critical patent/CN110795094A/en
Application granted granted Critical
Publication of CN110795094B publication Critical patent/CN110795094B/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/30Creation or generation of source code
    • G06F8/38Creation or generation of source code for implementing user interfaces
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/16File or folder operations, e.g. details of user interfaces specifically adapted to file systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Computer Security & Cryptography (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Stored Programmes (AREA)

Abstract

The application provides a page component quoting method and a page component quoting device, and the method comprises the following steps: removing the dependency relationship between the page contained in the first application and the first component contained in the page to obtain a first component for removing the dependency relationship; under the condition of obtaining a first component with a de-dependency relationship, determining a target component folder in each page of at least one page included in a second application project to be introduced, wherein the second application project includes at least one second application, each second application includes at least one page, and the target component folder is a component folder corresponding to the first component with the de-dependency relationship; the target component folder is imported into at least one page contained in the second application project. In this way, in the case that the second application project comprises at least one second application, the component folder can be typed into the package of each second application according to the requirement, and the size of the package of each second application is reduced.

Description

Page component quoting method and page component quoting device
Technical Field
The present application relates to the field of communications technologies, and in particular, to a page component referencing method and a page component referencing apparatus.
Background
A terminal may contain a plurality of Applications (APPs), with different kinds of APPs having different functions. The shopping mall APP can facilitate shopping for the user; the news information APP can provide various news information; the social APP can facilitate the user to communicate with other users, and the like.
An APP may contain multiple pages, each of which may contain multiple components. Each component can correspond to a unique identifier, all the components can be printed into an App packet, and then the presentation of different components of an App page is controlled by using a protocol identifier issued by a background.
In the related art, when one APP project includes multiple APPs, each APP in the multiple APPs corresponds to the same set of codes because of the dependency relationship between the APP page and the component, that is, the size of the code corresponding to each APP is the same. Besides the unique functions of each APP, each APP also has the functions of all other APPs. That is, although a certain App does not need components included in other APPs, all components included in other APPs must be added into the App package, and then the behavior of different APPs is controlled to generate differences by using data issued by the background. This results in more APPs supported by an APP project, with larger packets per APP.
Disclosure of Invention
The application provides a page component quoting method and a page component quoting device, and aims to solve the problem that in the related art, the more APPs supported by one APP project, the larger a package of each APP is.
In a first aspect, the present application provides a page component referencing method, including:
removing the dependency relationship between a page contained in a first application and a first component contained in the page to obtain a first component with the dependency relationship removed, wherein the first application is an application contained in a first application project;
under the condition of obtaining a first component with a de-dependency relationship, determining a target component folder in each page of at least one page included in a second application project, wherein the second application project includes at least one second application, each second application includes at least one page, and the target component folder is a component folder corresponding to the first component with the de-dependency relationship;
and introducing the target component folder into at least one page contained in the second application project.
Optionally, the determining a target component folder to be introduced into each page of at least one page included in the second application project includes:
creating a component folder configuration file, wherein the component folder configuration file is configured with the name of a component folder required by each page in at least one page contained in the second application project;
and determining a target component folder to be introduced into each page in at least one page included in the second application project according to the component folder configuration file.
Optionally, after the step of releasing the dependency relationship between the page included in the first application and the first component included in the page, and before the step of creating the component folder configuration file, the method further includes:
and integrating the first component with the dependency relationship removed, the component data model corresponding to the first component with the dependency relationship removed and the picture resource file corresponding to the first component with the dependency relationship removed to obtain a component folder corresponding to the first component with the dependency relationship removed.
Optionally, the removing the dependency relationship between the page included in the first application and the first component included in the page includes:
establishing a component data model for a first component which is not subjected to dependency relationship release with a page contained by the first application, wherein the established component data model comprises data shown by the first component which is not subjected to dependency relationship release with the page contained by the first application and a class name of the first component which is not subjected to dependency relationship release with the page contained by the first application;
creating a registration center;
acquiring an identifier corresponding to the class name of the component data model;
and registering the component data model to the registry in a one-to-one correspondence mode of the class name and the identification of the component data model.
Optionally, after the step of registering the component data model to the registry in a one-to-one correspondence manner between the class name and the identifier of the component data model, the method further includes:
searching a class name of a target component data model corresponding to a target identifier according to the target identifier and the registration center;
generating a target component data model according to the class name of the target component data model;
acquiring a class name of a second component contained in the target component data model;
and acquiring the second component according to the class name of the second component.
In a second aspect, the present application further provides a page component referencing apparatus, including:
the removing module is used for removing the dependency relationship between the page contained in the first application and the first component contained in the page to obtain a first component with the dependency relationship removed, wherein the first application is the application contained in the first application project;
the determining module is configured to determine, under the condition that a first component with a dependency relationship removed is obtained, a target component folder in each page of at least one page included in a second application project to be introduced, where the second application project includes at least one second application, each second application includes at least one page, and the target component folder is a component folder corresponding to the first component with the dependency relationship removed;
and the importing module is used for importing the target component folder into at least one page contained in the second application project.
Optionally, the determining module includes:
the first creating submodule is used for creating a component folder configuration file, wherein the component folder configuration file is configured with the name of a component folder required by each page in at least one page contained in the second application project;
and the determining submodule is used for determining a target component folder to be introduced into each page in at least one page included in the second application project according to the component folder configuration file.
Optionally, the page component referencing apparatus further includes:
and the integration module is used for integrating the first component with the dependency relationship removed, the component data model corresponding to the first component with the dependency relationship removed and the picture resource file corresponding to the first component with the dependency relationship removed to obtain a component folder corresponding to the first component with the dependency relationship removed.
Optionally, the release module includes:
the establishing sub-module is used for establishing a component data model for a first component which is not subjected to the dependency relationship with the page contained in the first application, wherein the established component data model comprises data shown by the first component which is not subjected to the dependency relationship with the page contained in the first application and a class name of the first component which is not subjected to the dependency relationship with the page contained in the first application;
the second creating submodule is used for creating a registration center;
the acquisition submodule is used for acquiring an identifier corresponding to the class name of the component data model;
and the registration submodule is used for registering the component data model to the registration center in a one-to-one correspondence mode of the class name and the identification of the component data model.
Optionally, the page component referencing apparatus further includes:
the searching module is used for searching the class name of the target component data model corresponding to the target identifier according to the target identifier and the registration center;
the generation module is used for generating a target component data model according to the class name of the target component data model;
the first acquisition module is used for acquiring the class name of a second component contained in the target component data model;
and the second acquisition module is used for acquiring the second component according to the class name of the second component.
In a third aspect, the present invention further provides an electronic device, including:
a memory for storing program instructions;
and the processor is used for calling and executing the program instructions in the memory so as to realize the page component reference method.
In a fourth aspect, the present invention further provides a readable storage medium, in which a computer program is stored, and when at least one processor of the page component referencing apparatus executes the computer program, the page component referencing apparatus executes the page component referencing method according to the first aspect.
According to the technical scheme, the application provides a page component citation method and a page component citation device, and the method comprises the following steps: removing the dependency relationship between a page contained in a first application and a first component contained in the page to obtain a first component with the dependency relationship removed, wherein the first application is an application contained in a first application project; under the condition of obtaining a first component with a de-dependency relationship, determining a target component folder in each page of at least one page included in a second application project, wherein the second application project includes at least one second application, each second application includes at least one page, and the target component folder is a component folder corresponding to the first component with the de-dependency relationship; and introducing the target component folder into at least one page contained in the second application project. In this way, the dependency relationship between the page included in the first application and the first component included in the page can be firstly released, and the first component with the dependency relationship removed can be obtained. And then the component folder corresponding to the first component with the dependency relationship removed can be introduced into at least one page contained in the second application project. That is, in the case where the second application project includes at least one second application, it is possible to realize the on-demand typing of the component folder into the package of each second application, reducing the size of the package of each second application.
Drawings
In order to more clearly explain the technical solution of the present application, the drawings needed to be used in the embodiments will be briefly described below, and it is obvious to those skilled in the art that other drawings can be obtained according to the drawings without creative efforts.
FIG. 1 is a flow chart of a page component referencing method provided herein;
FIG. 2 is a flow chart of another page component referencing method provided herein;
FIG. 3 is a flow chart of another page component referencing method provided herein;
FIG. 4 is a block diagram of a page assembly referencing apparatus provided herein;
FIG. 5 is a block diagram of another page assembly referencing apparatus provided herein;
FIG. 6 is a block diagram of another page assembly referencing apparatus provided herein;
FIG. 7 is a block diagram of another page assembly referencing apparatus provided herein;
FIG. 8 is a block diagram of another page assembly referencing apparatus provided herein;
fig. 9 is a schematic diagram of a hardware structure of an electronic device provided in the present application.
Detailed Description
Reference will now be made in detail to embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following examples do not represent all embodiments consistent with the present application. But merely as exemplifications of systems and methods consistent with certain aspects of the application, as recited in the claims.
Referring to fig. 1, fig. 1 is a flowchart of a page component referencing method provided in the present application. As shown in fig. 1, the method comprises the following steps:
step 101, removing the dependency relationship between the page contained in the first application and the first component contained in the page to obtain a first component with the dependency relationship removed, wherein the first application is an application contained in the first application project.
In step 101, a dependency relationship between a page included in a first application and a first component included in the page may be removed to obtain a first component with a removed dependency relationship. Wherein the first application is an application included in the first application project.
For example, first, a component data model can be built for a first component that is not de-dependent from a page contained by a first application. The established component data model comprises data shown by a first component which is not released from the dependency relationship of the page contained by the first application and the class name of the first component which is not released from the dependency relationship of the page contained by the first application.
Next, a registry can be created. The registry accepts a registration in the form of a class name identifying a corresponding component data model. For example: { typeA: componentmodel a }. Wherein typeA is an identifier, and ComponentModelA is a class name of the component data model corresponding to the identifier typeA.
Then, an identifier corresponding to the class name of the component data model may be obtained, and the component data model may be registered in the registry in a one-to-one correspondence manner between the class name and the identifier of the component data model. At this time, the dependency relationship between the page included in the first application and the first component included in the page is released, and the first component with the dependency relationship removed is obtained.
Step 102, under the condition that a first component for removing dependency relationship is obtained, determining a target component folder in each page of at least one page included in a second application project to be introduced, wherein the second application project includes at least one second application, each second application includes at least one page, and the target component folder is a component folder corresponding to the first component for removing dependency relationship.
In step 102, in the case of obtaining a first component for de-dependency, a target component folder to be introduced into each of at least one page included in the second application project may be determined. The second application project may include at least one second application, and each second application may include at least one page. The target component folder is a component folder corresponding to the first component with the dependency relationship removed.
Step 103, introducing the target component folder into at least one page contained in the second application project.
In step 103, the target component folder can be introduced into at least one page included in the second application project.
It should be noted that, in the related art, as App pages and components have dependency relationships, the more APPs supported by an App project, the larger the package of each App.
In the application, the dependency relationship between the page included in the first application and the first component included in the page may be removed first, and the first component with the dependency relationship removed may be obtained. And then the component folder corresponding to the first component with the dependency relationship removed can be introduced into at least one page contained in the second application project. That is, in the case where the second application project includes at least one second application, it is possible to realize the on-demand typing of the component folder into the package of each second application, reducing the size of the package of each second application.
According to the page component citation method, the dependency relationship between a page contained by a first application and a first component contained by the page is removed, and the first component with the dependency relationship removed is obtained, wherein the first application is an application contained by a first application project; under the condition of obtaining a first component with a de-dependency relationship, determining a target component folder in each page of at least one page included in a second application project, wherein the second application project includes at least one second application, each second application includes at least one page, and the target component folder is a component folder corresponding to the first component with the de-dependency relationship; and introducing the target component folder into at least one page contained in the second application project. In this way, the dependency relationship between the page included in the first application and the first component included in the page can be firstly released, and the first component with the dependency relationship removed can be obtained. And then the component folder corresponding to the first component with the dependency relationship removed can be introduced into at least one page contained in the second application project. That is, in the case where the second application project includes at least one second application, it is possible to realize the on-demand typing of the component folder into the package of each second application, reducing the size of the package of each second application.
Referring to fig. 2, fig. 2 is a flowchart of another page component referencing method provided by the present application. As shown in fig. 2, the method comprises the following steps:
step 201, removing the dependency relationship between the page included in the first application and the first component included in the page to obtain the first component with the dependency relationship removed, where the first application is an application included in the first application project.
In step 201, a dependency relationship between a page included in a first application and a first component included in the page may be first released, and the first component with the dependency relationship removed may be obtained. Wherein the first application is an application included in the first application project.
Optionally, the removing the dependency relationship between the page included in the first application and the first component included in the page includes:
establishing a component data model for a first component which is not subjected to dependency relationship release with a page contained by the first application, wherein the established component data model comprises data shown by the first component which is not subjected to dependency relationship release with the page contained by the first application and a class name of the first component which is not subjected to dependency relationship release with the page contained by the first application;
creating a registration center;
acquiring an identifier corresponding to the class name of the component data model;
and registering the component data model to the registry in a one-to-one correspondence mode of the class name and the identification of the component data model.
For example, first, a component data model can be built for a first component that is not de-dependent from a page contained by a first application. The established component data model comprises data shown by a first component which is not released from the dependency relationship of the page contained by the first application and the class name of the first component which is not released from the dependency relationship of the page contained by the first application.
Next, a registry can be created. The registry accepts a registration in the form of a class name identifying a corresponding component data model. For example: { typeA: componentmodel a }. Wherein typeA is an identifier, and ComponentModelA is a class name of the component data model corresponding to the identifier typeA.
Then, an identifier corresponding to the class name of the component data model may be obtained, and the component data model may be registered in the registry in a one-to-one correspondence manner between the class name and the identifier of the component data model. At this time, the registry mechanism is used for solving the dependency relationship between the page contained in the first application and the first component contained in the page, and obtaining the first component with the dependency relationship removed. In this way, the method can support the on-demand introduction of the component folder corresponding to the first component with the dependency relationship being removed into the second application project.
Optionally, after the step of registering the component data model to the registry in a one-to-one correspondence manner between the class name and the identifier of the component data model, the method further includes:
searching a class name of a target component data model corresponding to a target identifier according to the target identifier and the registration center;
generating a target component data model according to the class name of the target component data model;
acquiring a class name of a second component contained in the target component data model;
and acquiring the second component according to the class name of the second component.
After the component data model is registered in the registry in a one-to-one correspondence manner according to the class name and the identifier of the component data model, the class name of the target component data model corresponding to the target identifier can be searched according to the target identifier and the registry. Next, the target component data model may be generated according to the class name of the found target component data model. Then, a class name of a second component contained by the target component data model may be obtained. Finally, the second component may be obtained according to the class name of the second component. At this time, the page can acquire the class name of the corresponding component data model only through the registry and the identifier, and then the component data model is generated. And the page acquires the class name of the component contained in the generated component data model according to the generated component data model, and further acquires the corresponding component according to the acquired class name of the component. It is convenient to find each component.
Optionally, after the step of releasing the dependency relationship between the page included in the first application and the first component included in the page, and before the step of creating the component folder configuration file, the method further includes:
and integrating the first component with the dependency relationship removed, the component data model corresponding to the first component with the dependency relationship removed and the picture resource file corresponding to the first component with the dependency relationship removed to obtain a component folder corresponding to the first component with the dependency relationship removed.
After the dependency relationship between the page included in the first application and the first component included in the page is released and the first component with the dependency relationship released is obtained, the first component with the dependency relationship released, the component data model corresponding to the first component with the dependency relationship released and the picture resource file corresponding to the first component with the dependency relationship released can be integrated under the directory of the page to obtain the component folder corresponding to the first component with the dependency relationship released. That is, each first component with a de-dependency relationship, the component data model corresponding to the first component with a de-dependency relationship, and the picture resource file corresponding to the first component with a de-dependency relationship can be manually moved to a separate folder as a subunit of a page. For example: for the first component a with an un-dependent relationship, the name of the corresponding component folder may be ComponentA.
Step 202, under the condition that a first component for removing dependency relationship is obtained, creating a component folder configuration file, wherein the component folder configuration file is configured with a name of a component folder required by each page in at least one page included in a second application project, the second application project includes at least one second application, and each second application includes at least one page.
In step 202, where a first component to be de-dependent is obtained, a component folder configuration file may be created. The component folder configuration file is configured with a name of a component folder required by each page in at least one page included in the second application project. The second application project may contain at least one second application, and each second application may contain at least one page. That is, the component folder configuration file may be configured with a name of a component folder required for each of at least one page included in each of at least one second application included in the second application project. For example, it may be in the form { pageA: [ ComponentA ] }.
Step 203, determining a target component folder in each page of at least one page included in the second application project to be introduced according to the component folder configuration file, wherein the target component folder is a component folder corresponding to the first component with the dependency relationship removed.
In step 203, a target component folder to be introduced into each page of the at least one page included in the second application project may be determined according to the created component folder configuration file. And the target component folder is a component folder corresponding to the first component for releasing the dependency relationship. For example, a script may be written to read the component folder configuration file, and the second application project may be reconstructed by using coco pods, so that only the component folders configured in the component folder configuration file are introduced into corresponding pages in at least one page included in at least one second application included in the second application project. For example, retrieving the page a included in a certain second application included in the second application project from the component folder configuration file in step 202 requires introducing the component folder ComponentA. The script may call the cocoaPods tool to introduce ComponentA into page a contained by some second application contained by the second application project. Therefore, part of the component folders are introduced into the second application project according to the component folder configuration file, and dynamic reference of the page components is realized. The realization process is simple, convenient and fast. And a component folder configuration file is created, so that various management platforms can be conveniently accessed, and the components used in each App page can be managed through the management of the component folder configuration file.
And 204, introducing the target component folder into at least one page contained in the second application project.
In step 204, the target component folder can be introduced into at least one page contained in the second application project. Therefore, the dependency relationship between the page contained in the first application and the first component contained in the page can be released by using the registry mechanism, and then the component folder corresponding to the first component with the partial dependency relationship released is introduced into a new application project as required by using the script and the component folder configuration file, so that the dynamic reference of the page component is realized. In the case that the second application project comprises at least one second application, the component folder can be typed into the package of each second application according to the requirement, and the size of the package of each second application is reduced.
According to the page component citation method, the dependency relationship between the page contained by the first application and the first component contained by the page can be firstly removed, and the first component with the dependency relationship removed can be obtained. And then the component folder corresponding to the first component with the dependency relationship removed can be introduced into at least one page contained in the second application project. Namely, under the condition that the second application project comprises at least one second application, the component folder can be typed into the package of each second application as required, the size of the package of each second application is reduced, and the dynamic reference of the page components is realized. And a component folder configuration file is created, so that various management platforms can be conveniently accessed, and the components used in each App page can be managed through the management of the component folder configuration file. The realization process is simple, convenient and fast.
Referring to fig. 3, fig. 3 is a flowchart of another page component referencing method provided by the present application. As shown in fig. 3, the method comprises the following steps:
step 301, building a component data model for a first component that is not de-dependent from a page included in a first application. The established component data model comprises data shown by a first component which does not release the dependency relationship with the page contained by the first application and the class name of the first component which does not release the dependency relationship with the page contained by the first application, and the first application is the application contained by the first application project.
Step 302, create a registry. The registry accepts a registration in the form of a class name identifying a corresponding component data model. For example: { typeA: componentmodel a }. Wherein typeA is an identifier, and ComponentModelA is a class name of the component data model corresponding to the identifier typeA.
And 303, registering each component data model to the registry according to the one-to-one correspondence mode of the class name and the identification of the component data model for each established component data model. At this time, the registry mechanism is used for solving the dependency relationship between the page contained in the first application and the first component contained in the page, and obtaining the first component with the dependency relationship removed.
And 304, integrating the first component with the dependency relationship removed, the component data model corresponding to the first component with the dependency relationship removed and the picture resource file corresponding to the first component with the dependency relationship removed under the directory of the page to obtain a component folder corresponding to the first component with the dependency relationship removed.
Step 305, create a component folder configuration file. And the created component folder configuration file is configured with the name of the component folder required by each page in at least one page contained in the second application project. For example, it may be in the form { pageA: [ ComponentA ] }.
Step 306, writing a script to read the component folder configuration file, and reconstructing the second application project by using the coco pods, so as to introduce only the component folder configured in the component folder configuration file into a corresponding page in at least one page included in at least one second application included in the second application project, wherein the at least one page is corresponding to the second application.
According to the page component citation method, the dependency relationship between the page contained by the first application and the first component contained by the page can be firstly removed, and the first component with the dependency relationship removed can be obtained. And then the component folder corresponding to the first component with the dependency relationship removed can be introduced into at least one page contained in the second application project. Namely, under the condition that the second application project comprises at least one second application, the component folder can be typed into the package of each second application as required, the size of the package of each second application is reduced, and the dynamic reference of the page components is realized. And a component folder configuration file is created, so that various management platforms can be conveniently accessed, and the components used in each App page can be managed through the management of the component folder configuration file. The realization process is simple, convenient and fast.
Referring to fig. 4, fig. 4 is a structural diagram of a page component referencing apparatus provided in the present application. As shown in fig. 4, the page component referencing apparatus 400 includes a dismissal module 401, a determination module 402, and an introduction module 403, wherein:
a removing module 401, configured to remove a dependency relationship between a page included in a first application and a first component included in the page, to obtain a first component with a removed dependency relationship, where the first application is an application included in a first application project;
a determining module 402, configured to determine, under a condition that a first component with a dependency relationship removed is obtained, a target component folder in each page of at least one page included in a second application project to be introduced, where the second application project includes at least one second application, each second application includes at least one page, and the target component folder is a component folder corresponding to the first component with the dependency relationship removed;
an importing module 403, configured to import the target component folder into at least one page included in the second application project.
Optionally, as shown in fig. 5, the determining module 402 includes:
the first creating sub-module 4021 is configured to create a component folder configuration file, where the component folder configuration file configures a name of a component folder required by each page in at least one page included in the second application project;
the determining sub-module 4022 is configured to determine, according to the component folder configuration file, a target component folder to be introduced into each page of at least one page included in the second application project.
Optionally, as shown in fig. 6, the page component referencing apparatus further includes:
an integrating module 404, configured to integrate the first component with the dependency relationship removed, the component data model corresponding to the first component with the dependency relationship removed, and the picture resource file corresponding to the first component with the dependency relationship removed, so as to obtain a component folder corresponding to the first component with the dependency relationship removed.
Optionally, as shown in fig. 7, the release module 401 includes:
the establishing sub-module 4011 is configured to establish a component data model for a first component whose dependency relationship with a page included in the first application is not released, where the established component data model includes data shown by the first component whose dependency relationship with the page included in the first application is not released and a class name of the first component whose dependency relationship with the page included in the first application is not released;
a second creating sub-module 4012 configured to create a registry;
the obtaining sub-module 4013 is configured to obtain an identifier corresponding to a class name of the component data model;
the registration submodule 4014 is configured to register the component data model to the registry in a one-to-one correspondence manner between the class name and the identifier of the component data model.
Optionally, as shown in fig. 8, the page component referencing apparatus further includes:
a searching module 405, configured to search, according to a target identifier and the registry, a class name of a target component data model corresponding to the target identifier;
a generating module 406, configured to generate a target component data model according to the class name of the target component data model;
a first obtaining module 407, configured to obtain a class name of a second component included in the target component data model;
the second obtaining module 408 is configured to obtain the second component according to the class name of the second component.
The page component referencing apparatus 400 can implement each process implemented by the page component referencing apparatus in the method embodiments of fig. 1 to fig. 3, and is not described herein again to avoid repetition. And the page component referencing apparatus 400 may first remove the dependency relationship between the page included in the first application and the first component included in the page, and obtain the first component with the removed dependency relationship. And then the component folder corresponding to the first component with the dependency relationship removed can be introduced into at least one page contained in the second application project. Namely, under the condition that the second application project comprises at least one second application, the component folder can be typed into the package of each second application as required, the size of the package of each second application is reduced, and the dynamic reference of the page components is realized. And a component folder configuration file is created, so that various management platforms can be conveniently accessed, and the components used in each App page can be managed through the management of the component folder configuration file. The realization process is simple, convenient and fast.
Fig. 9 is a schematic diagram of a hardware structure of an electronic device according to an embodiment of the present invention. As shown in fig. 9, the electronic device includes:
a memory 901 for storing program instructions;
a processor 902, configured to call and execute the program instructions in the memory to implement the page component referencing method in the foregoing embodiments. Reference may be made in particular to the description in relation to the preceding embodiments.
In this embodiment, the processor 902 and the memory 901 may be connected by a bus or other means. The processor may be a general-purpose processor, such as a central processing unit, a digital signal processor, an application specific integrated circuit, or one or more integrated circuits configured to implement embodiments of the present invention. The memory may include volatile memory, such as random access memory; the memory may also include non-volatile memory, such as read-only memory, flash memory, a hard disk, or a solid state disk.
An embodiment of the present invention further provides a readable storage medium, including: the readable storage medium stores therein a computer program, and when the computer program is executed by at least one processor of the page component referencing apparatus, the page component referencing apparatus executes the page component referencing method described in the above embodiments.
The readable storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM) or a Random Access Memory (RAM).
Those skilled in the art will readily appreciate that the techniques of the embodiments of the present invention may be implemented as software plus a required general purpose hardware platform. Based on such understanding, the technical solutions in the embodiments of the present invention may be essentially or partially implemented in the form of a software product, which may be stored in a storage medium, such as ROM/RAM, magnetic disk, optical disk, etc., and includes several instructions for enabling a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method according to the embodiments or some parts of the embodiments.
The same and similar parts in the various embodiments in this specification may be referred to each other. In particular, for the embodiments of the page component referencing apparatus, the electronic device, and the readable storage medium, since they are substantially similar to the embodiments of the method, the description is simple, and the relevant points can be referred to the description in the embodiments of the method.
The above-described embodiments of the present invention should not be construed as limiting the scope of the present invention.

Claims (12)

1. A page component referencing method, comprising:
removing the dependency relationship between a page contained in a first application and a first component contained in the page to obtain a first component with the dependency relationship removed, wherein the first application is an application contained in a first application project;
under the condition of obtaining a first component with a de-dependency relationship, determining a target component folder in each page of at least one page included in a second application project, wherein the second application project includes at least one second application, each second application includes at least one page, and the target component folder is a component folder corresponding to the first component with the de-dependency relationship;
and introducing the target component folder into at least one page contained in the second application project.
2. The method of claim 1, wherein determining a target component folder to be introduced into each of at least one page included in the second application project comprises:
creating a component folder configuration file, wherein the component folder configuration file is configured with the name of a component folder required by each page in at least one page contained in the second application project;
and determining a target component folder to be introduced into each page in at least one page included in the second application project according to the component folder configuration file.
3. The method of claim 2, wherein after the step of de-relating the page contained by the first application from the first component contained by the page, and prior to the step of creating the component folder configuration file, the method further comprises:
and integrating the first component with the dependency relationship removed, the component data model corresponding to the first component with the dependency relationship removed and the picture resource file corresponding to the first component with the dependency relationship removed to obtain a component folder corresponding to the first component with the dependency relationship removed.
4. The method of any one of claims 1 to 3, wherein said de-relying pages included in a first application from a first component included in the page comprises:
establishing a component data model for a first component which is not subjected to dependency relationship release with a page contained by the first application, wherein the established component data model comprises data shown by the first component which is not subjected to dependency relationship release with the page contained by the first application and a class name of the first component which is not subjected to dependency relationship release with the page contained by the first application;
creating a registration center;
acquiring an identifier corresponding to the class name of the component data model;
and registering the component data model to the registry in a one-to-one correspondence mode of the class name and the identification of the component data model.
5. The method of claim 4, wherein after the step of registering the component data model to the registry in a one-to-one correspondence of class names and identities of component data models, the method further comprises:
searching a class name of a target component data model corresponding to a target identifier according to the target identifier and the registration center;
generating a target component data model according to the class name of the target component data model;
acquiring a class name of a second component contained in the target component data model;
and acquiring the second component according to the class name of the second component.
6. A page component referencing apparatus, comprising:
the removing module is used for removing the dependency relationship between the page contained in the first application and the first component contained in the page to obtain a first component with the dependency relationship removed, wherein the first application is the application contained in the first application project;
the determining module is configured to determine, under the condition that a first component with a dependency relationship removed is obtained, a target component folder in each page of at least one page included in a second application project to be introduced, where the second application project includes at least one second application, each second application includes at least one page, and the target component folder is a component folder corresponding to the first component with the dependency relationship removed;
and the importing module is used for importing the target component folder into at least one page contained in the second application project.
7. The page component referencing apparatus according to claim 6, wherein said determining module comprises:
the first creating submodule is used for creating a component folder configuration file, wherein the component folder configuration file is configured with the name of a component folder required by each page in at least one page contained in the second application project;
and the determining submodule is used for determining a target component folder to be introduced into each page in at least one page included in the second application project according to the component folder configuration file.
8. The page component referencing apparatus according to claim 7, wherein said page component referencing apparatus further comprises:
and the integration module is used for integrating the first component with the dependency relationship removed, the component data model corresponding to the first component with the dependency relationship removed and the picture resource file corresponding to the first component with the dependency relationship removed to obtain a component folder corresponding to the first component with the dependency relationship removed.
9. The page component referencing apparatus according to any one of claims 6 to 8, wherein said dismissal module comprises:
the establishing sub-module is used for establishing a component data model for a first component which is not subjected to the dependency relationship with the page contained in the first application, wherein the established component data model comprises data shown by the first component which is not subjected to the dependency relationship with the page contained in the first application and a class name of the first component which is not subjected to the dependency relationship with the page contained in the first application;
the second creating submodule is used for creating a registration center;
the acquisition submodule is used for acquiring an identifier corresponding to the class name of the component data model;
and the registration submodule is used for registering the component data model to the registration center in a one-to-one correspondence mode of the class name and the identification of the component data model.
10. The page component referencing apparatus according to claim 9, wherein said page component referencing apparatus further comprises:
the searching module is used for searching the class name of the target component data model corresponding to the target identifier according to the target identifier and the registration center;
the generation module is used for generating a target component data model according to the class name of the target component data model;
the first acquisition module is used for acquiring the class name of a second component contained in the target component data model;
and the second acquisition module is used for acquiring the second component according to the class name of the second component.
11. An electronic device, comprising:
a memory for storing program instructions;
a processor for calling and executing program instructions in the memory to implement the page component referencing method of any of claims 1 to 5.
12. A readable storage medium in which a computer program is stored, wherein when the computer program is executed by at least one processor of a page component referencing apparatus, the page component referencing apparatus performs the page component referencing method according to any one of claims 1 to 5.
CN201910886924.9A 2019-09-19 2019-09-19 Page component referencing method and page component referencing device Active CN110795094B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910886924.9A CN110795094B (en) 2019-09-19 2019-09-19 Page component referencing method and page component referencing device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910886924.9A CN110795094B (en) 2019-09-19 2019-09-19 Page component referencing method and page component referencing device

Publications (2)

Publication Number Publication Date
CN110795094A true CN110795094A (en) 2020-02-14
CN110795094B CN110795094B (en) 2023-10-27

Family

ID=69438571

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910886924.9A Active CN110795094B (en) 2019-09-19 2019-09-19 Page component referencing method and page component referencing device

Country Status (1)

Country Link
CN (1) CN110795094B (en)

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106302008A (en) * 2016-08-05 2017-01-04 腾讯科技(深圳)有限公司 Data-updating method and device
CN106648563A (en) * 2015-10-30 2017-05-10 阿里巴巴集团控股有限公司 Method and device for dependence decoupling processing of shared module in application program
CN106648555A (en) * 2015-10-28 2017-05-10 阿里巴巴集团控股有限公司 Page generation method and device
CN106681843A (en) * 2015-11-05 2017-05-17 中国科学院沈阳自动化研究所 Parameter transmission method among sub-modules on the basis of assembly-type development mode loose coupling
US10083030B1 (en) * 2017-05-04 2018-09-25 Amazon Technologies, Inc. Asynchronous dependency resolution
CN108958730A (en) * 2017-08-23 2018-12-07 北京五八信息技术有限公司 Application component sharing method and device, terminal device and readable storage medium storing program for executing
CN108984714A (en) * 2018-07-09 2018-12-11 北京三快在线科技有限公司 Page rendering method, apparatus, electronic equipment and computer-readable medium
CN109739604A (en) * 2018-12-28 2019-05-10 北京城市网邻信息技术有限公司 Page rendering method, apparatus, server and storage medium
CN110059277A (en) * 2019-03-12 2019-07-26 平安普惠企业管理有限公司 The loaded and optimized method of homepage, server and computer readable storage medium

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106648555A (en) * 2015-10-28 2017-05-10 阿里巴巴集团控股有限公司 Page generation method and device
CN106648563A (en) * 2015-10-30 2017-05-10 阿里巴巴集团控股有限公司 Method and device for dependence decoupling processing of shared module in application program
CN106681843A (en) * 2015-11-05 2017-05-17 中国科学院沈阳自动化研究所 Parameter transmission method among sub-modules on the basis of assembly-type development mode loose coupling
CN106302008A (en) * 2016-08-05 2017-01-04 腾讯科技(深圳)有限公司 Data-updating method and device
US10083030B1 (en) * 2017-05-04 2018-09-25 Amazon Technologies, Inc. Asynchronous dependency resolution
CN108958730A (en) * 2017-08-23 2018-12-07 北京五八信息技术有限公司 Application component sharing method and device, terminal device and readable storage medium storing program for executing
CN108984714A (en) * 2018-07-09 2018-12-11 北京三快在线科技有限公司 Page rendering method, apparatus, electronic equipment and computer-readable medium
CN109739604A (en) * 2018-12-28 2019-05-10 北京城市网邻信息技术有限公司 Page rendering method, apparatus, server and storage medium
CN110059277A (en) * 2019-03-12 2019-07-26 平安普惠企业管理有限公司 The loaded and optimized method of homepage, server and computer readable storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
诸葛本不亮: "架构设计 - 如何解除依赖" *

Also Published As

Publication number Publication date
CN110795094B (en) 2023-10-27

Similar Documents

Publication Publication Date Title
CN108460115B (en) Message pushing method and device, computer equipment and storage medium
CN111176976B (en) Test data generation method and device, storage medium and electronic device
CN110825448B (en) Method, device, electronic equipment and storage medium for realizing multi-service module mutual calling
CN109462601B (en) Multi-platform access method and device based on eSIM
CN110716783A (en) Front-end page generation and deployment method and device, storage medium and equipment
CN109558525B (en) Test data set generation method, device, equipment and storage medium
CN112887451B (en) Domain name resolution method and device and computer equipment
CN100511140C (en) Method for script language calling multiple output parameter interface by component software system
CN111225018A (en) Request message processing method and device and electronic equipment
CN109902027B (en) TPC-DS testing method and system convenient to implement
CN111045698A (en) Redundant picture deleting method and device, electronic equipment and storage medium
CN111290996A (en) Document format conversion method, device, equipment and readable storage medium
CN111443920B (en) Frame migration method and device
CN110580212B (en) Data export method and device of application program, electronic equipment and storage medium
CN111930363B (en) Block interface code generation method and device
CN110830492B (en) Method and system for mutually scheduling edge applications based on CoreDNS registration service
CN109669678A (en) Template engine integration method, device, electronic equipment and storage medium
CN110795094B (en) Page component referencing method and page component referencing device
CN111225032A (en) Method, system, device and medium for separating application service and file service
CN115967604A (en) Message transmission method and device, electronic equipment and computer readable storage medium
CN114860238A (en) Page generation method and device and electronic equipment
CN111581578B (en) Interface request processing method and device
CN111694596A (en) Packing method and packing device for entry paths in webpack environment
CN110782389B (en) Image data byte alignment method and terminal
CN109086145B (en) Data generation method and device and computer storage medium

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