[go: up one dir, main page]

CN110795094B - Page component referencing method and page component referencing device - Google Patents

Page component referencing method and page component referencing device Download PDF

Info

Publication number
CN110795094B
CN110795094B CN201910886924.9A CN201910886924A CN110795094B CN 110795094 B CN110795094 B CN 110795094B CN 201910886924 A CN201910886924 A CN 201910886924A CN 110795094 B CN110795094 B CN 110795094B
Authority
CN
China
Prior art keywords
component
page
application
contained
data model
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
CN201910886924.9A
Other languages
Chinese (zh)
Other versions
CN110795094A (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

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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 OR CALCULATING; 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 OR CALCULATING; 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)
  • Stored Programmes (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application provides a page component quotation method and a page component quotation device, wherein the method comprises the following steps: releasing 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 released dependency relationship; under the condition that a first component which is independent is obtained, determining a target component folder in each page of at least one page contained in a second application project to be introduced, wherein the second application project contains at least one second application, each second application contains at least one page, and the target component folder is a component folder corresponding to the first component which is independent; the target component folder is imported into at least one page comprised by the second application project. In this way, in the case where the second application project includes at least one second application, the component folders may be driven into the packages of each second application as needed, reducing the size of the packages of each second application.

Description

Page component referencing method and page component referencing 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 device.
Background
A terminal may contain multiple Applications (APPs), different kinds of APPs having different functions. The mall APP can facilitate the user to make shopping; the news information APP can provide various news information; the social APP can facilitate communication between the user and 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 components can be formed into an App package, and then the protocol identifier issued by the background is utilized to control the presentation of different components of an App page.
In the related art, when one APP project includes a plurality of APPs, because there is a dependency relationship between APP pages and components, each APP in the plurality of APPs corresponds to the same set of codes, that is, the size of the code corresponding to each APP is the same. Each APP has the unique functions of the APP, and also has the functions of all other APPs. That is, although a certain App does not need components contained in other APPs, all components contained in other APPs must be driven into the App package, and then the behavior of different APPs is controlled by using data issued in the background to generate differences. This results in a larger package per APP the more APPs that an APP project supports.
Disclosure of Invention
The application provides a page component quotation method and a page component quotation device, which are used for solving the problem that in the related art, the more APPs are supported by one APP project, the larger the package of each APP is.
In a first aspect, the present application provides a page component referencing method, including:
releasing the dependency relationship between a page contained in a first application and a first component contained in the page to obtain the first component with the dependency relationship released, wherein the first application is an application contained in a first application project;
under the condition that a first component of the release dependency relationship is obtained, determining a target component folder in each page of at least one page contained in a second application project to be introduced, wherein the second application project contains at least one second application, each second application contains at least one page, and the target component folder is a component folder corresponding to the first component of the release dependency relationship;
and introducing the target component folder into at least one page contained in the second application engineering.
Optionally, the determining the target component folder to be introduced into each page of at least one page included in the second application engineering includes:
creating a component folder configuration file, wherein the component folder configuration file is configured with the names of component folders 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 of at least one page contained 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, before the step of creating the component folder configuration file, the method further includes:
and integrating the first component with the de-dependency, the component data model corresponding to the first component with the de-dependency and the picture resource file corresponding to the first component with the de-dependency to obtain the component folder corresponding to the first component with the de-dependency.
Optionally, the releasing 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 does not release the dependency relationship with the page contained in the first application, wherein the established component data model contains data shown by the first component which does not release the dependency relationship with the page contained in the first application and class names of the first component which does not release the dependency relationship with the page contained in the first application;
creating a registry;
acquiring an identifier corresponding to the class name of the component data model;
and registering the component data model to the registry according to the mode that the class names and the identifiers of the component data model are in one-to-one correspondence.
Optionally, after the step of registering the component data model to the registry in a one-to-one correspondence manner according to 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 the target identifier according to the target identifier and the registry;
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 obtaining 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 system comprises a release module, a first application engineering module and a second application engineering module, wherein the release module is used for releasing the dependency relationship between a page contained in a first application and a first component contained in the page to obtain the first component of which the dependency relationship is released;
the determining module is used for determining a target component folder in each page of at least one page contained in a second application project to be introduced under the condition that a first component of the de-dependency relationship is obtained, wherein the second application project contains at least one second application, each second application contains at least one page, and the target component folder is a component folder corresponding to the first component of the de-dependency relationship;
and the introduction module is used for introducing the target component folder into at least one page contained in the second application project.
Optionally, the determining module includes:
a first creating submodule, configured to create a component folder configuration file, where 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;
and the determining submodule is used for determining a target component folder in each page of at least one page contained in the second application project to be introduced 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 independent relation, the component data model corresponding to the first component with the independent relation and the picture resource file corresponding to the first component with the independent relation, and obtaining the component folder corresponding to the first component with the independent relation.
Optionally, the releasing module includes:
a sub-module is used for establishing a component data model for a first component which does not release the dependency relationship with the page contained in the first application, wherein the established component data model comprises data displayed by the first component which does not release the dependency relationship with the page contained in the first application and class names of the first component which does not release the dependency relationship with the page contained in the first application;
a second creation sub-module for creating a registry;
the acquisition sub-module is used for acquiring the identification corresponding to the class name of the component data model;
and the booklet annotating module is used for registering the component data model to the registration center in a one-to-one correspondence mode of class names and identifiers 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 registry;
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 the 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 application also 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 referencing method.
In a fourth aspect, the present application also provides a readable storage medium having stored therein a computer program, which when executed by at least one processor of a page component referencing apparatus, performs the page component referencing method according to the first aspect.
As can be seen from the above technical solution, the present application provides a page component referencing method and a page component referencing apparatus, where the method includes: releasing the dependency relationship between a page contained in a first application and a first component contained in the page to obtain the first component with the dependency relationship released, wherein the first application is an application contained in a first application project; under the condition that a first component of the release dependency relationship is obtained, determining a target component folder in each page of at least one page contained in a second application project to be introduced, wherein the second application project contains at least one second application, each second application contains at least one page, and the target component folder is a component folder corresponding to the first component of the release dependency relationship; and introducing the target component folder into at least one page contained in the second application engineering. In this way, the dependency relationship between the page included in the first application and the first component included in the page can be released first, and the first component with the dependency relationship released can be obtained. And further, the component folder corresponding to the first component which releases the dependency relationship can be introduced into at least one page contained in the second application engineering. That is, in the case that the second application engineering includes at least one second application, the component folders may be driven into the package of each second application as needed, reducing the size of the package of each second application.
Drawings
In order to more clearly illustrate the technical solution of the present application, the drawings that are needed in the embodiments will be briefly described below, and it will be obvious to those skilled in the art that other drawings can be obtained from these drawings without inventive effort.
FIG. 1 is a flow chart of a page component referencing method provided by the present application;
FIG. 2 is a flow chart of another page component referencing method provided by the present application;
FIG. 3 is a flow chart of another page component referencing method provided by the present application;
FIG. 4 is a block diagram of a page component referencing apparatus provided by the present application;
FIG. 5 is a block diagram of another page component referencing apparatus provided by the present application;
FIG. 6 is a block diagram of another page component referencing apparatus provided by the present application;
FIG. 7 is a block diagram of another page component referencing apparatus provided by the present application;
FIG. 8 is a block diagram of another page component referencing apparatus provided by the present application;
fig. 9 is a schematic diagram of a hardware structure of an electronic device according to the present application.
Detailed Description
Reference will now be made in detail to the embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, the same numbers in different drawings refer to the same or similar elements, unless otherwise indicated. The embodiments described in the examples below do not represent all embodiments consistent with the application. Merely exemplary of systems and methods consistent with aspects of the application as set forth in the claims.
Referring to fig. 1, fig. 1 is a flowchart of a page component referencing method provided by the present application. As shown in fig. 1, the method comprises the following steps:
and 101, releasing the dependency relationship between a page contained in a first application and a first component contained in the page to obtain the first component with the dependency relationship released, wherein the first application is an application contained in a first application project.
In step 101, the dependency relationship between the page included in the first application and the first component included in the page may be released first, so as to obtain the first component with the released dependency relationship. The first application is an application contained in the first application engineering.
For example, first, a component data model may be built for a first component that does not un-de-dependent pages contained by 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 in the first application and class names of the first component which does not release the dependency relationship with the page contained in the first application.
Next, a registry may be created. The registry accepts a registration in the form of a class name identifying a component data model. For example: { typeA: componentmodel a). Wherein typeA is the identification, componentModela is the class name of the component data model corresponding to the identification typeA.
Then, the identification corresponding to the class name of the component data model can be obtained, and then the component data model can be registered in the registry according to the mode that the class name and the identification of the component data model are in one-to-one correspondence. 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 from which the dependency relationship is released is obtained.
Step 102, under the condition that a first component of the de-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 of the de-dependency relationship.
In step 102, in the case of obtaining the first component that is de-dependent, a target component folder within each of at least one page included in the second application to be imported may be determined. Wherein the second application project may comprise at least one second application, each of which may comprise at least one page. The target component folder is a component folder corresponding to the first component which releases the dependency relationship.
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 may be introduced into at least one page included in the second application project.
It should be noted that, in the related art, because there is a dependency relationship between an App page and a component, the more APPs are supported by one App project, the larger the package of each App will be.
In the application, the dependency relationship between the page contained in the first application and the first component contained in the page can be released first, and the first component with the released dependency relationship can be obtained. And further, the component folder corresponding to the first component which releases the dependency relationship can be introduced into at least one page contained in the second application engineering. That is, in the case that the second application engineering includes at least one second application, the component folders may be driven into the package of each second application as needed, reducing the size of the package of each second application.
According to the page component referencing method provided by the application, the dependency relationship between the page contained in the first application and the first component contained in the page is relieved, and the first component with the dependency relationship relieved is obtained, wherein the first application is the application contained in the first application engineering; under the condition that a first component of the release dependency relationship is obtained, determining a target component folder in each page of at least one page contained in a second application project to be introduced, wherein the second application project contains at least one second application, each second application contains at least one page, and the target component folder is a component folder corresponding to the first component of the release dependency relationship; and introducing the target component folder into at least one page contained in the second application engineering. In this way, the dependency relationship between the page included in the first application and the first component included in the page can be released first, and the first component with the dependency relationship released can be obtained. And further, the component folder corresponding to the first component which releases the dependency relationship can be introduced into at least one page contained in the second application engineering. That is, in the case that the second application engineering includes at least one second application, the component folders may be driven into the package of each second application as needed, 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, releasing the dependency relationship between the page contained in the first application and the first component contained in the page, and obtaining the first component of which the dependency relationship is released, wherein the first application is an application contained in a first application project.
In step 201, the dependency relationship between the page included in the first application and the first component included in the page may be released first, so as to obtain the first component with the released dependency relationship. The first application is an application contained in the first application engineering.
Optionally, the releasing 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 does not release the dependency relationship with the page contained in the first application, wherein the established component data model contains data shown by the first component which does not release the dependency relationship with the page contained in the first application and class names of the first component which does not release the dependency relationship with the page contained in the first application;
creating a registry;
acquiring an identifier corresponding to the class name of the component data model;
and registering the component data model to the registry according to the mode that the class names and the identifiers of the component data model are in one-to-one correspondence.
For example, first, a component data model may be built for a first component that does not un-de-dependent pages contained by 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 in the first application and class names of the first component which does not release the dependency relationship with the page contained in the first application.
Next, a registry may be created. The registry accepts a registration in the form of a class name identifying a component data model. For example: { typeA: componentmodel a). Wherein typeA is the identification, componentModela is the class name of the component data model corresponding to the identification typeA.
Then, the identification corresponding to the class name of the component data model can be obtained, and then the component data model can be registered in the registry according to the mode that the class name and the identification of the component data model are in one-to-one correspondence. At this time, the dependency relationship between the page included in the first application and the first component included in the page is removed through the registry mechanism, and the first component with the dependency relationship removed is obtained. In this way, the method can realize that the component folders corresponding to the first component which is released from the dependency relationship are supported to be introduced into the second application engineering as required.
Optionally, after the step of registering the component data model to the registry in a one-to-one correspondence manner according to 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 the target identifier according to the target identifier and the registry;
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 obtaining the second component according to the class name of the second component.
After registering the component data model in the registry according to the one-to-one correspondence manner of the class names and the identifiers of the component data model, the class names of the target component data model corresponding to the target identifiers can be searched according to the target identifiers and the registry. Next, a target component data model may be generated from the class name of the found target component data model. The class name of the second component contained in the target component data model may then be obtained. Finally, the second component may be obtained based on the class name of the second component. At this time, the page can obtain the class name of the corresponding component data model only through the registry and the identifier, so as to generate the component data model. 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. Facilitating the searching of the various components.
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, before the step of creating the component folder configuration file, the method further includes:
and integrating the first component with the de-dependency, the component data model corresponding to the first component with the de-dependency and the picture resource file corresponding to the first component with the de-dependency to obtain the component folder corresponding to the first component with the de-dependency.
After the dependency relationship between the page included in the first application and the first component included in the page is released, the first component with the released dependency relationship is obtained, and then the first component with the released dependency relationship, the component data model corresponding to the first component with the released dependency relationship and the picture resource file corresponding to the first component with the released dependency relationship can be integrated under the catalog of the page to obtain the component folder corresponding to the first component with the released dependency relationship. The first component of each de-dependency, the component data model corresponding to the first component of the de-dependency and the picture resource file corresponding to the first component of the de-dependency can be manually moved into a single folder to be used as a subunit of the page. For example: for the first component a with the dependency removed, the name of the corresponding component folder may be ComponentA.
Step 202, under the condition that a first component of the de-dependency relationship is obtained, creating a component folder configuration file, wherein the component folder configuration file is configured with names of component folders required by each page in at least one page contained in second application engineering, the second application engineering contains at least one second application, and each second application contains at least one page.
In step 202, in the event that a first component is obtained that is de-dependent, a component folder configuration file may be created. Wherein the component folder configuration file is configured with names of component folders required for each of at least one page included in the second application project. The second application project may include at least one second application, and each of the second applications may include at least one page. That is, the component folder configuration file may be configured with a name of the 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 of { 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, where the target component folder is a component folder corresponding to the first component that releases the dependency relationship.
In step 203, a target component folder within each of at least one page included in the second application to be imported may be determined based on the created component folder configuration file. The target component folder is a component folder corresponding to the first component which releases 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 using the cocoaPods, so as to implement that only the component folder configured in the component folder configuration file is introduced into a corresponding page in at least one page included in a corresponding second application in at least one second application included in the second application project. For example, acquiring 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 component folder ComponentA. The script may call the cocoafos tool to introduce ComponentA into page a contained by a certain second application contained by the second application project. Therefore, the method and the device realize that part of the component folders are introduced into the second application project according to the component folder configuration file as required, and realize the dynamic reference of the page components. The implementation process is simple, convenient and quick. And a component folder configuration file is created, so that various management platforms can be conveniently accessed, and components used in each App page can be managed through managing the component folder configuration file.
Step 204, the target component folder is introduced into at least one page contained in the second application project.
In step 204, the target component folder may be imported into at least one page included in the second application project. In this way, the dependency relationship between the page contained in the first application and the first component contained in the page can be relieved by using the registry mechanism, and then the component folder corresponding to the first component with the partially relieved dependency relationship 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 engineering includes at least one second application, the component folders may be driven into the package of each second application as needed, reducing the size of the package of each second application.
The page component referencing method provided by the application can firstly remove the dependency relationship between the page contained in the first application and the first component contained in the page, and obtain the first component with the dependency relationship removed. And further, the component folder corresponding to the first component which releases the dependency relationship can be introduced into at least one page contained in the second application engineering. In other words, when the second application engineering includes at least one second application, the component folders can be driven into the packages of each second application as required, so that the package size of each second application is reduced, and 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 components used in each App page can be managed through managing the component folder configuration file. The implementation process is simple, convenient and quick.
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 does not release a dependency relationship with a page included in a first application. The built component data model comprises data displayed by a first component which does not release the dependency relationship with the page contained in the first application and class names of the first component which does not release the dependency relationship with the page contained in the first application, and the first application is an application contained in a first application engineering.
Step 302, creating a registry. The registry accepts a registration in the form of a class name identifying a component data model. For example: { typeA: componentmodel a). Wherein typeA is the identification, componentModela is the class name of the component data model corresponding to the identification typeA.
And 303, registering each component data model to the registry according to the mode of one-to-one correspondence of the class name and the identification of the component data model for each 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 removed through the registry mechanism, and the first component with the dependency relationship removed is obtained.
And 304, integrating the first component with the independent relation, the component data model corresponding to the first component with the independent relation and the picture resource file corresponding to the first component with the independent relation under the directory of the page to obtain the component folder corresponding to the first component with the independent relation.
Step 305, creating a component folder configuration file. Wherein the created component folder configuration file is configured with the names of the component folders required for each of at least one page contained in the second application project. For example, it may be in the form of { PageA: [ ComponentA ] }.
And 306, writing a script to read the configuration file of the component folder, and reconstructing the second application project by using the cocoaPods to realize that only the component folder configured in the configuration file of the component folder is introduced into a corresponding page in at least one page contained in a corresponding second application in at least one second application contained in the second application project.
The page component referencing method provided by the application can firstly remove the dependency relationship between the page contained in the first application and the first component contained in the page, and obtain the first component with the dependency relationship removed. And further, the component folder corresponding to the first component which releases the dependency relationship can be introduced into at least one page contained in the second application engineering. In other words, when the second application engineering includes at least one second application, the component folders can be driven into the packages of each second application as required, so that the package size of each second application is reduced, and 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 components used in each App page can be managed through managing the component folder configuration file. The implementation process is simple, convenient and quick.
Referring to fig. 4, fig. 4 is a structural diagram of a page component referencing apparatus provided by 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 import module 403, wherein:
a releasing module 401, configured to release a dependency relationship between a page included in a first application and a first component included in the page, to obtain a first component of which the dependency relationship is released, where the first application is an application included in a first application engineering;
a determining module 402, configured to determine, in a case where a first component that is not dependent is obtained, a target component folder in each page of at least one page included in a second application project, 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 that is not dependent;
an import module 403, configured to import the target component folder into at least one page included in the second application engineering.
Optionally, as shown in fig. 5, the determining module 402 includes:
a first creating submodule 4021, configured to create a component folder configuration file, where 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;
a determining submodule 4022, 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 engineering.
Optionally, as shown in fig. 6, the page component referencing apparatus further includes:
and the integration module 404 is configured to integrate the first component that is not dependent, the component data model corresponding to the first component that is not dependent, and the picture resource file corresponding to the first component that is not dependent, so as to obtain a component folder corresponding to the first component that is not dependent.
Optionally, as shown in fig. 7, the releasing module 401 includes:
a building sub-module 4011, configured to build a component data model for a first component that does not release a dependency relationship with a page included in the first application, where the built component data model includes data that is displayed by the first component that does not release a dependency relationship with a page included in the first application and a class name of the first component that does not release a dependency relationship with a page included in the first application;
a second creation submodule 4012 for creating a registry;
an obtaining submodule 4013, 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 manner that class names and identifiers of the component data model are in one-to-one correspondence.
Optionally, as shown in fig. 8, the page component referencing apparatus further includes:
the searching module 405 is 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;
and a second obtaining module 408, configured to obtain a second component according to the class name of the second component.
The page component referencing device 400 is capable of implementing each process implemented by the page component referencing device in the method embodiment of fig. 1-3, and is not described herein in detail to avoid repetition. And the page component referencing device 400 may implement first releasing 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 released dependency relationship. And further, the component folder corresponding to the first component which releases the dependency relationship can be introduced into at least one page contained in the second application engineering. In other words, when the second application engineering includes at least one second application, the component folders can be driven into the packages of each second application as required, so that the package size of each second application is reduced, and 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 components used in each App page can be managed through managing the component folder configuration file. The implementation process is simple, convenient and quick.
Fig. 9 is a schematic diagram of a hardware structure of an electronic device according to an embodiment of the present application. As shown in fig. 9, the electronic device includes:
a memory 901 for storing program instructions;
a processor 902, configured to call and execute program instructions in the memory, so as to implement the page component referencing method in the foregoing embodiment. Reference may be made in particular to the relevant description of the previous 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 application. 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.
The embodiment of the application also provides a readable storage medium, which comprises: the readable storage medium has stored therein a computer program which, when executed by at least one processor of the page component referencing means, performs 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), a random-access memory (random access memory, RAM), or the like.
It will be apparent to those skilled in the art that the techniques of embodiments of the present application may be implemented in software plus a necessary general purpose hardware platform. Based on such understanding, the technical solutions in the embodiments of the present application may be embodied in essence or what contributes to the prior art in the form of a software product, which may be stored in a storage medium, such as a ROM/RAM, a magnetic disk, an optical disk, etc., including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method described in the embodiments or some parts of the embodiments of the present application.
The same or similar parts between the various embodiments in this specification are referred to each other. In particular, for page component referencing apparatus, electronic device, and readable storage medium embodiments, since they are substantially similar to method embodiments, the description is relatively simple, as far as the description in the method embodiments is concerned.
The embodiments of the present application described above do not limit the scope of the present application.

Claims (10)

1. A method for referencing a page component, comprising:
releasing the dependency relationship between a page contained in a first application and a first component contained in the page to obtain the first component with the dependency relationship released, wherein the first application is an application contained in a first application project;
under the condition that a first component of the release dependency relationship is obtained, determining a target component folder in each page of at least one page contained in a second application project to be introduced, wherein the second application project contains at least one second application, each second application contains at least one page, and the target component folder is a component folder corresponding to the first component of the release dependency relationship;
introducing the target component folder into at least one page contained in the second application project;
the releasing the dependency relationship between the page contained in the first application and the first component contained in the page comprises the following steps:
establishing a component data model for a first component which does not release the dependency relationship with the page contained in the first application, wherein the established component data model contains data shown by the first component which does not release the dependency relationship with the page contained in the first application and class names of the first component which does not release the dependency relationship with the page contained in the first application;
creating a registry;
acquiring an identifier corresponding to the class name of the component data model;
and registering the component data model to the registry according to the mode that the class names and the identifiers of the component data model are in one-to-one correspondence.
2. The method of claim 1, wherein the determining the target component folder within each of at least one page included in the second application to be imported comprises:
creating a component folder configuration file, wherein the component folder configuration file is configured with the names of component folders 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 of at least one page contained in the second application project according to the component folder configuration file.
3. The method of claim 2, wherein after the step of releasing the dependency of the page contained in the first application from the first component contained in the page, the method further comprises, before the step of creating the component folder configuration file:
and integrating the first component with the de-dependency, the component data model corresponding to the first component with the de-dependency and the picture resource file corresponding to the first component with the de-dependency to obtain the component folder corresponding to the first component with the de-dependency.
4. The method of claim 1, wherein after the step of registering the component data model with the registry in a one-to-one correspondence with class names and identifications of the component data model, the method further comprises:
searching a class name of a target component data model corresponding to the target identifier according to the target identifier and the registry;
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 obtaining the second component according to the class name of the second component.
5. A page component referencing apparatus, comprising:
the system comprises a release module, a first application engineering module and a second application engineering module, wherein the release module is used for releasing the dependency relationship between a page contained in a first application and a first component contained in the page to obtain the first component of which the dependency relationship is released;
the determining module is used for determining a target component folder in each page of at least one page contained in a second application project to be introduced under the condition that a first component of the de-dependency relationship is obtained, wherein the second application project contains at least one second application, each second application contains at least one page, and the target component folder is a component folder corresponding to the first component of the de-dependency relationship;
the introduction module is used for introducing the target component folder into at least one page contained in the second application project;
the release module includes:
a sub-module is used for establishing a component data model for a first component which does not release the dependency relationship with the page contained in the first application, wherein the established component data model comprises data displayed by the first component which does not release the dependency relationship with the page contained in the first application and class names of the first component which does not release the dependency relationship with the page contained in the first application;
a second creation sub-module for creating a registry;
the acquisition sub-module is used for acquiring the identification corresponding to the class name of the component data model;
and the booklet annotating module is used for registering the component data model to the registration center in a one-to-one correspondence mode of class names and identifiers of the component data model.
6. The page component referencing apparatus recited in claim 5, wherein said determining module comprises:
a first creating submodule, configured to create a component folder configuration file, where 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;
and the determining submodule is used for determining a target component folder in each page of at least one page contained in the second application project to be introduced according to the component folder configuration file.
7. The page component referencing apparatus according to claim 6, wherein said page component referencing apparatus further comprises:
and the integration module is used for integrating the first component with the independent relation, the component data model corresponding to the first component with the independent relation and the picture resource file corresponding to the first component with the independent relation, and obtaining the component folder corresponding to the first component with the independent relation.
8. The page component referencing apparatus according to claim 5, 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 registry;
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 the 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.
9. An electronic device, comprising:
a memory for storing program instructions;
a processor for invoking and executing program instructions in said memory to implement the page component referencing method of any of claims 1-4.
10. A readable storage medium, wherein a computer program is stored in the readable storage medium, and when executed by at least one processor of a page component referencing apparatus, the page component referencing apparatus performs the page component referencing method of any of claims 1-4.
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 CN110795094A (en) 2020-02-14
CN110795094B true 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)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112363754A (en) * 2020-11-17 2021-02-12 北京五八信息技术有限公司 iOS component management method, device, electronic equipment and storage medium

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
诸葛本不亮.架构设计 - 如何解除依赖.《CSDN》.2018,全文. *

Also Published As

Publication number Publication date
CN110795094A (en) 2020-02-14

Similar Documents

Publication Publication Date Title
CN111859470B (en) Business data chaining method and device
CN110825448B (en) Method, device, electronic equipment and storage medium for realizing multi-service module mutual calling
CN106406844B (en) Method and device for realizing public number menu of communication interaction platform
CN113672224B (en) Method and device for generating applet page code and computer equipment
CN115113898B (en) Micro-application dynamic update method, device, computer equipment and storage medium
CN111225018A (en) Request message processing method and device and electronic equipment
CN112558973A (en) Front-end page generation method and device, storage medium and electronic device
CN114217845B (en) Application configuration method, device, equipment and storage medium
CN110795094B (en) Page component referencing method and page component referencing device
CN111930363B (en) Block interface code generation method and device
CN112733510A (en) Financial certificate generation method, device, equipment and computer readable storage medium
CN109062906A (en) The interpretation method and device of program language resource
CN117289906A (en) Low-code application development method, equipment and medium
CN111045698A (en) Redundant picture deleting method and device, electronic equipment and storage medium
CN111488286B (en) Method and device for independently developing Android modules
CN112579877A (en) Information source system control method, device, storage medium and equipment
CN113760435B (en) A method for processing plane works and related equipment
CN113239328B (en) Service function acquisition method and device, electronic equipment and storage medium
CN110580212B (en) Data export method and device of application program, electronic equipment and storage medium
CN109117122B (en) List view creating method and device
CN109086145B (en) Data generation method and device and computer storage medium
CN114072799A (en) JS component vulnerability detection method and system
CN111221992A (en) Useless picture determining method and device, electronic equipment and storage medium
CN104407846B (en) Information processing method and device
CN109918147B (en) Expansion method and device for drive under OpenStack 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