CN108804120B - Page construction method, device, equipment and storage medium - Google Patents

Page construction method, device, equipment and storage medium Download PDF

Info

Publication number
CN108804120B
CN108804120B CN201810504138.3A CN201810504138A CN108804120B CN 108804120 B CN108804120 B CN 108804120B CN 201810504138 A CN201810504138 A CN 201810504138A CN 108804120 B CN108804120 B CN 108804120B
Authority
CN
China
Prior art keywords
script
conversion
component
page
service
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
CN201810504138.3A
Other languages
Chinese (zh)
Other versions
CN108804120A (en
Inventor
智瑞斌
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing 58 Information Technology Co Ltd
Original Assignee
Beijing 58 Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing 58 Information Technology Co Ltd filed Critical Beijing 58 Information Technology Co Ltd
Priority to CN201810504138.3A priority Critical patent/CN108804120B/en
Publication of CN108804120A publication Critical patent/CN108804120A/en
Application granted granted Critical
Publication of CN108804120B publication Critical patent/CN108804120B/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/60Software deployment
    • G06F8/65Updates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/52Binary to binary

Abstract

The invention discloses a page construction method, a device, equipment and a storage medium, wherein the method comprises the following steps: acquiring page construction resources from a server; based on a first script language component, sending a page construction resource to a service conversion module, wherein the first script language is a non-native language; performing script language conversion on the page construction resources through a service conversion module to obtain a script language conversion result, and constructing a target page according to the script language conversion result; according to the method, the device, the equipment and the storage medium, the page construction resources are issued to the application program through the server, and then the page construction resources are executed through the service conversion module of the application program to complete the construction of the target page, so that the hot updating of the application program can be realized without re-publishing the application program, and the development cost is reduced.

Description

Page construction method, device, equipment and storage medium
Technical Field
The invention relates to the field of mobile application development, in particular to a page construction method, a device, equipment and a storage medium.
Background
With the development of internet technology and smart terminal technology, various applications have been popularized in various aspects of mass life, such as viewing, shopping, payment, social contact, providing various information, and the like. At present, the applications of these intelligent terminals are often implemented by Native apps (Native apps), and the Native apps are implemented by using an API (Application Programming Interface) provided by a Native operating system, so that high performance and good interactive experience of the applications can be ensured.
However, the interactive behavior (such as interactive skip) of the page in the existing local application is solidified in the intelligent terminal, and if the interactive behavior of the application is to be changed, the intelligent terminal needs to rely on the modification of the version issued by the operator on different platforms (an android system or an ios system, etc.), and then reinstall the application. The application requires a long audit period and a new version coverage period before installation, which results in a high time cost.
Disclosure of Invention
The invention mainly aims to provide a page construction method, a page construction device, page construction equipment and a page construction storage medium, which solve the problems that in the prior art, updating of terminal application can only be completed through re-edition, and the time cost is high.
According to a first aspect of the present invention, there is provided a page building method, the method comprising: acquiring page construction resources from a server; based on a first script language component, sending the page construction resource to a service conversion module, wherein the first script language is a non-native language; and performing script language conversion on the page construction resources through the service conversion module to obtain a script language conversion result, and constructing a target page according to the script language conversion result.
Optionally, after the obtaining of the page construction resource from the server and before the sending of the page construction resource to the service conversion module based on the first script language component, the method further includes: checking whether the page construction resources are legal or not; and under the condition that the verification is passed, storing the page construction resource to a local preset position so that the first script language component can send the page construction resource to a service conversion module from the local preset position.
Optionally, the service conversion module includes: a first conversion script component written in the first script language;
the sending the page construction resource to a service conversion module based on the first script language component comprises: generating an index file of the page construction resource according to the acquired page construction resource; based on the index file, searching the page construction resource through a first script language system, wherein the first script language component is registered in the first script language system; and sending the page construction resource to a first conversion script component based on the first script language component.
Optionally, the service conversion module further includes: a second transformation script component registered with the native system;
the performing script language conversion on the page construction resource through the service conversion module to obtain a script language conversion result, and constructing a target page according to the script language conversion result, including: packaging the page construction resource through the first conversion script component to obtain a packaging result which can be executed by the second conversion script component; sending the packaging result to a second conversion script component through the first conversion script component, and analyzing the packaging result through the second conversion script component to obtain a service logic code executable by the second conversion script component and service layout data executable by the second conversion script component; and according to the service layout data which can be executed by the second conversion script component, executing the service logic code which can be executed by the second conversion script component through the second conversion script component to obtain a target page.
Optionally, the second conversion script component further includes: and the plug-in interface is used for receiving resource information which can be executed by the second conversion script component.
Optionally, before the sending the page building resource to the service conversion module based on the first script language component, the method further includes:
and sending a calling instruction to the first script language component through the service resource conversion module, wherein the calling instruction is used for acquiring the page construction resource from the first script language component through the service resource conversion module.
Optionally, after the preset processing is performed on the page construction resource through the service conversion module to obtain a processing result, and a target page is constructed according to the processing result, the method further includes: and sending the target page to a second script language component, and displaying the target page through the second script language component, wherein the second script language component is registered in a native system.
According to a second aspect of the present invention, there is provided a page building apparatus, the apparatus comprising: the acquisition module is used for acquiring page construction resources from a server; the sending module is used for sending the page construction resource to the service conversion module based on the first script language component, wherein the first script language is a non-native language; and the construction module is used for performing script language conversion on the page construction resources through the service conversion module to obtain a script language conversion result and constructing a target page according to the script language conversion result.
Optionally, the apparatus further comprises: the verification module is used for verifying whether the page construction resource is legal or not after the page construction resource from the server is obtained and before the page construction resource is sent to the service conversion module based on the first script language component; and the downloading module is used for storing the page construction resource to a local preset position under the condition that the verification is passed, so that the first script language component can send the page construction resource to the service conversion module from the local preset position.
Optionally, the service conversion module includes: a first conversion script component written in the first script language;
the sending module comprises: the index generating unit is used for generating an index file of the page construction resource according to the acquired page construction resource; the searching unit is used for searching the page construction resource through a first script language system based on the index file, and the first script language component is registered in the first script language system; and the sending unit is used for sending the page construction resource to the first conversion script component based on the first script language component.
Optionally, the service conversion module further includes: a second transformation script component registered with the native system;
the building module comprises: the packaging unit is used for packaging the page construction resource through the first conversion script component to obtain a packaging result which can be executed by the second conversion script component; the analysis unit is used for sending the packaging result to a second conversion script component through the first conversion script component and analyzing the packaging result through the second conversion script component to obtain a service logic code executable by the second conversion script component and service layout data executable by the second conversion script component; and the construction unit is used for executing the service logic code which can be executed by the second conversion script component through the second conversion script component according to the service layout data which can be executed by the second conversion script component to obtain the target page.
Optionally, the second conversion script component further includes: and the plug-in interface is used for receiving resource information which can be executed by the second conversion script component.
Optionally, the apparatus further comprises: the instruction module is used for sending a calling instruction to the first script language component through the service resource conversion module before the page construction resource is sent to the service conversion module based on the first script language component, and the calling instruction is used for acquiring the page construction resource from the first script language component through the service resource conversion module.
Optionally, the apparatus further comprises: and the display module is used for presetting the page construction resources through the service conversion module to obtain a processing result, transmitting the target page to a second script language component after constructing the target page according to the processing result, and displaying the target page through the second script language component, wherein the second script language component is registered in a native system.
According to a third aspect of the present invention, there is provided an electronic device comprising a processor and a memory;
the memory is used for storing computer instructions, and the processor is used for executing the computer instructions stored by the memory to realize the page building method.
According to a fourth aspect of the present invention, there is provided a computer-readable storage medium, wherein the computer-readable storage medium stores one or more components, and the one or more components are executable by one or more processors to implement a page construction method as described above.
The invention has the following beneficial effects: the page construction resources are issued to the application program through the server, the script language conversion is carried out on the page construction resources through the service conversion module of the application program, and the converted script language conversion result is executed through the service conversion module to complete the construction of the target page, so that the hot updating of the application program can be realized without redeploying the application program, and the development cost is favorably reduced. In addition, in the above manner, the hot update can be realized while the user experience is ensured, and in this embodiment, the first script language for writing the service logic data may be different from the native language of the application program, so that the service logic data is written by using the first script language different from the native language of the application program, which is convenient for expansion and popularization.
Drawings
FIG. 1 is a flowchart illustrating a page construction method according to a first embodiment of the present invention;
FIG. 2 is a block diagram illustrating a page construction method according to a second embodiment of the present invention;
FIG. 3 is a flowchart illustrating a page construction method according to a third embodiment of the present invention;
FIG. 4 is a flowchart illustrating a page construction method according to a fourth embodiment of the present invention;
FIG. 5 is a flowchart illustrating a page construction method according to a fifth embodiment of the present invention;
FIG. 6 is a flowchart illustrating a page construction method according to a sixth embodiment of the present invention;
FIG. 7 is a simplified flowchart of a page structuring method according to a seventh embodiment of the present invention;
FIG. 8 is a schematic diagram of the interaction between the JS side and the Native side in the seventh embodiment of the present invention;
FIG. 9 is a diagram illustrating a seventh embodiment of the present invention that calls a native ViewController lifecycle method to call a corresponding JSFView Controller lifecycle method
FIG. 10 is a schematic diagram illustrating an operation principle of a plug-in interface according to a seventh embodiment of the present invention;
fig. 11 is a schematic structural diagram of a page building apparatus according to an eighth embodiment of the present invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
In the following description, suffixes such as "module", "component", or "unit" used to denote elements are used only for facilitating the explanation of the present invention, and have no specific meaning in itself. Thus, "module", "component" or "unit" may be used mixedly.
Furthermore, although the terms "first," "second," etc. may be used herein to describe various elements, these elements should not be limited by these terms. These terms are only used to distinguish one element from another. For example, a first element may be termed a second element, and, similarly, a second element may be termed a first element, without departing from the scope of example embodiments. As used herein, the term "and/or" includes any and all combinations of one or more of the associated listed items.
In order to facilitate understanding of the embodiments of the present invention, the following detailed description of the embodiments of the present invention is provided.
A first embodiment of the present invention provides a page construction method, including: acquiring page construction resources from a server, wherein the page construction resources comprise: the system comprises a service logic code and service layout data, wherein the service logic code and the service layout data are written by a first script language; based on a first script language component, sending the page construction resource to a service conversion module, wherein the first script language is a non-native language; and performing script language conversion on the page construction resources through the service conversion module to obtain a script language conversion result, and constructing a target page according to the script language conversion result.
Therefore, the page construction resources are issued to the application program through the server, the script language conversion is carried out on the page construction resources through the service conversion module of the application program, and the converted script language conversion result is executed through the service conversion module to complete the construction of the target page, so that the hot updating of the application program can be realized without re-publishing the application program, and the development cost is favorably reduced. In addition, in the above manner, the hot update can be realized while the user experience is ensured, and in this embodiment, the first script language for writing the service logic data may be different from the native language of the application program, so that the service logic data is written by using the first script language different from the native language of the application program, which is convenient for expansion and popularization.
Fig. 1 is a flowchart of a page construction method according to a first embodiment of the present invention. As shown in fig. 1, a first embodiment of the present invention provides a page building method applied to an application program, where the method includes:
s11: acquiring page construction resources from a server;
when the application program detects that the page building resource exists at the server, the application program sends a data request to the server, and the server feeds back the page building resource to the application program after acquiring the data request.
In addition, the page building resource includes: the system comprises a business logic code and business layout data, wherein the business logic code and the business layout data are written by a first script language.
Wherein the service layout data includes, but is not limited to, one or more of the following: page style data, component elements that make up a page, and color components of page elements.
The data format of the service layout data may be extensible markup language XML.
Moreover, the first script language may be a non-native language, such as: the first script language is an transliterated script language JavaScript, and the native language of the application program is JAVA. Of course, the first script language may also be a native language, such as: the first script language and the native language are JAVA.
In this embodiment, the language type of the first script language is not limited, and only needs to satisfy the requirement of this embodiment.
S21: based on a first script language component, sending the page construction resource to a service conversion module, wherein the first script language is a non-native language;
s31: and performing script language conversion on the page construction resources through the service conversion module to obtain a script language conversion result, and constructing a target page according to the script language conversion result.
And after the application program obtains the page construction resource, the page construction resource is sent to the service conversion module through the first script language component. And after the service conversion module obtains the page construction resource, performing script language conversion on the page construction resource to obtain a script language conversion result which can be executed by the service conversion module, and constructing a target page according to the script language conversion result.
For the script language conversion, in this embodiment, the specific content of the preset processing is not limited, and only needs to meet the requirements of the present invention. Such as: and converting the page construction resource into a script language format which can be identified and executed by the service construction module by performing script language conversion on the page construction resource.
Therefore, the page construction resources are issued to the application program through the server, and then the page construction resources are executed through the service conversion module of the application program to complete the construction of the target page, so that the hot update of the application program can be realized without re-publishing the application program, and the development cost is reduced. In addition, in the above manner, the hot update can be realized while the user experience is ensured, and in this embodiment, the first script language for writing the service logic data may be different from the native language of the application program, so that the service logic data is written by using the first script language different from the native language of the application program, which is convenient for expansion and popularization.
Fig. 2 is a flowchart of a page construction method according to a second embodiment of the present invention. As shown in fig. 2, a second embodiment of the present invention provides a page building method applied to an application program, where the method includes:
s11: acquiring page construction resources from a server;
s21: based on a first script language component, sending the page construction resource to a service conversion module, wherein the first script language is a non-native language;
s31: and performing script language conversion on the page construction resources through the service conversion module to obtain a script language conversion result, and constructing a target page according to the script language conversion result.
Optionally, the steps S11 and S21 include the following steps:
s111: checking whether the page construction resources are legal or not; and under the condition that the verification is passed, storing the page construction resource to a local preset position so that the first script language component can send the page construction resource to a service conversion module from the local preset position.
When the page construction resource is obtained, the page construction resource to be downloaded is verified, and the verification content comprises the following steps: the safety, integrity and accuracy of the page construction resources are verified, so that the application program can obtain the correct page construction resources, and the obtained page construction resources are ensured to have good safety and integrity. In addition, in this embodiment, the verification content is not limited, and only the verification step may satisfy the requirement of this embodiment.
After the verification is passed, the page building resource is downloaded to the local, and the page building resource is saved to a local preset position.
Fig. 3 is a flowchart of a page construction method according to a third embodiment of the present invention. As shown in fig. 3, a third embodiment of the present invention provides a page building method applied to an application program, where the method includes:
s11: acquiring page construction resources from a server;
s21: based on a first script language component, sending the page construction resource to a service conversion module, wherein the first script language is a non-native language;
s31: and performing script language conversion on the page construction resources through the service conversion module to obtain a script language conversion result, and constructing a target page according to the script language conversion result.
Optionally, the steps S11 and S21 include the following steps:
s111: checking whether the page construction resources are legal or not; and under the condition that the verification is passed, storing the page construction resource to a local preset position so that the first script language component can send the page construction resource to a service conversion module from the local preset position.
The service conversion module comprises a first conversion script component, and the first conversion script component is written by the first script language;
optionally, an implementation manner of the foregoing S21 includes:
s211: generating an index file of the page construction resource according to the acquired page construction resource; based on the index file, searching the page construction resource through a first script language system, wherein the first script language component is registered in the first script language system; and sending the page construction resource to a first conversion script component based on the first script language component.
In this embodiment, the application program needs to search the page construction resource through a first scripting language system based on the index file, and of course, the first scripting language component is registered in the first scripting language system;
and then, the page construction resource is sent to the first conversion script component through the first script language component, so that the first conversion script component can carry out subsequent packaging operation.
Specifically, in this embodiment, the index file may be unified index information, that is: the service logic code and the service layout data stored in the local disk can be found through the index information. Of course, in the present embodiment, the following setting may be made: the index file includes: the service layout data can be searched by the layout index file, and the service logic code can be searched by the logic index file. In this way, quick search and call of the page construction data in the page construction process are facilitated.
Fig. 4 is a flowchart of a page construction method according to a fourth embodiment of the present invention. As shown in fig. 4, a fourth embodiment of the present invention provides a page building method applied to an application program, where the method includes:
s11: acquiring page construction resources from a server;
s21: based on a first script language component, sending the page construction resource to a service conversion module, wherein the first script language is a non-native language;
s31: and performing script language conversion on the page construction resources through the service conversion module to obtain a script language conversion result, and constructing a target page according to the script language conversion result.
Optionally, the steps S11 and S21 include the following steps:
s111: checking whether the page construction resources are legal or not; and under the condition that the verification is passed, storing the page construction resource to a local preset position so that the first script language component can send the page construction resource to a service conversion module from the local preset position.
The service conversion module comprises a first conversion script component, and the first conversion script component is written by the first script language;
optionally, an implementation manner of the foregoing S21 includes:
s211: generating an index file of the page construction resource according to the acquired page construction resource; based on the index file, searching the page construction resource through a first script language system, wherein the first script language component is registered in the first script language system; and sending the page construction resource to a first conversion script component based on the first script language component.
Wherein, the service conversion module further comprises: a second transformation script component registered with the native system;
optionally, one implementation manner of the step S31 includes:
s311: packaging the page construction resource through the first conversion script component to obtain a packaging result which can be executed by the second conversion script component;
in this embodiment, the page building resource is encapsulated by the first conversion script component, and the obtained encapsulation result can be executed by the second conversion script component. Such as: in this embodiment, the page build resource is encapsulated into a data format that the second transformation script component can execute. In this embodiment, specific content of the packaging operation is not limited, and only needs to meet the requirements of the embodiments of the present invention.
S312: sending the packaging result to a second conversion script component through the first conversion script component, and analyzing the packaging result through the second conversion script component to obtain a service logic code executable by the second conversion script component and service layout data executable by the second conversion script component;
after the first conversion script component carries out packaging operation to obtain a packaging result, the packaging result is sent to the second conversion script component through the first conversion script component. After the second conversion script component obtains the encapsulation result, the second conversion script component analyzes the encapsulation result to obtain the service logic code executable by the second conversion script component and the service layout data executable by the second conversion script component.
S313: and according to the service layout data which can be executed by the second conversion script component, executing the service logic code which can be executed by the second conversion script component through the second conversion script component to obtain a target page.
Specifically, based on the service layout data executable by the second conversion script component and the service logic code executable by the second conversion script component, the construction of the target page can be completed by the second conversion script component.
Thereby, it is achieved that the page building resource is converted into a format that can be executed by the second conversion script component. Also, based on the page build resource after the conversion, a target page can be generated by the second conversion script component.
Optionally, the second conversion script component further includes: and the plug-in interface is used for receiving resource information which can be executed by the second conversion script component. Therefore, the access design of general functions can be completed through the second conversion script component, such as: network request, prompt popup, page jump management, etc.
Fig. 5 is a flowchart of a page construction method according to a fifth embodiment of the present invention. According to fig. 5, a fifth embodiment of the present invention provides a page building method applied to an application program, including:
s11: acquiring page construction resources from a server;
s21: based on the first script language component, sending the page construction resource to a service conversion module;
s31: and performing script language conversion on the page construction resources through the service conversion module to obtain a script language conversion result, and constructing a target page according to the script language conversion result.
Optionally, the steps S11 and S21 include the following steps:
s111: checking whether the page construction resources are legal or not; and under the condition that the verification is passed, storing the page construction resource to a local preset position so that the first script language component can send the page construction resource to a service conversion module from the local preset position.
The service conversion module comprises a first conversion script component, and the first conversion script component is written by the first script language;
therefore, one implementation of S21 described above includes:
s211: generating an index file of the page construction resource according to the acquired page construction resource; based on the index file, searching the page construction resource through a first script language system, wherein the first script language component is registered in the first script language system; and sending the page construction resource to a first conversion script component based on the first script language component.
Wherein, the service conversion module further comprises: a second transformation script component registered with the native system;
optionally, one implementation manner of the step S31 includes:
s311: packaging the page construction resource through the first conversion script component to obtain a packaging result which can be executed by the second conversion script component;
in this embodiment, the page building resource is encapsulated by the first conversion script component, and the obtained encapsulation result can be executed by the second conversion script component. Such as: in this embodiment, the page build resource is encapsulated into a data format that the second transformation script component can execute. In this embodiment, specific content of the packaging operation is not limited, and only needs to meet the requirements of the embodiments of the present invention.
S312: sending the packaging result to a second conversion script component through the first conversion script component, and analyzing the packaging result through the second conversion script component to obtain a service logic code executable by the second conversion script component and service layout data executable by the second conversion script component;
after the first conversion script component carries out packaging operation to obtain a packaging result, the packaging result is sent to the second conversion script component through the first conversion script component. After the second conversion script component obtains the encapsulation result, the second conversion script component analyzes the encapsulation result to obtain the service logic code executable by the second conversion script component and the service layout data executable by the second conversion script component.
S313: and according to the service layout data which can be executed by the second conversion script component, executing the service logic code which can be executed by the second conversion script component through the second conversion script component to obtain a target page.
Specifically, based on the service layout data executable by the second conversion script component and the service logic code executable by the second conversion script component, the construction of the target page can be completed by the second conversion script component.
Thereby, it is achieved that the page building resource is converted into a format that can be executed by the second conversion script component. Also, based on the page build resource after the conversion, a target page can be generated by the second conversion script component.
Optionally, the second conversion script component further includes: and the plug-in interface is used for receiving resource information which can be executed by the second conversion script component. Therefore, the access design of general functions can be completed through the second conversion script component, such as: network request, prompt popup, page jump management, etc.
Optionally, before the step S21, the present embodiment further includes the following step S20, that is: the present embodiment further includes step S20 before step S211.
Wherein, S20: and sending a calling instruction to the first script language component through the service resource conversion module, wherein the calling instruction is used for acquiring the page construction resource from the first script language component through the service resource conversion module.
The invention provides a direct calling mode and also provides a mode for acquiring page construction resources by sending a calling instruction.
Fig. 6 is a flowchart of a page construction method according to a sixth embodiment of the present invention. As shown in fig. 6, a sixth embodiment of the present invention provides a page building method applied to an application program, where the method includes:
s11: acquiring page construction resources from a server;
s21: based on the first script language component, sending the page construction resource to a service conversion module;
s31: and performing script language conversion on the page construction resources through the service conversion module to obtain a script language conversion result, and constructing a target page according to the script language conversion result.
Optionally, the steps S11 and S21 include the following steps:
s111: checking whether the page construction resources are legal or not; and under the condition that the verification is passed, storing the page construction resource to a local preset position so that the first script language component can send the page construction resource to a service conversion module from the local preset position.
The service conversion module comprises a first conversion script component, and the first conversion script component is written by the first script language;
therefore, one implementation of S21 described above includes:
s211: generating an index file of the page construction resource according to the acquired page construction resource; based on the index file, searching the page construction resource through a first script language system, wherein the first script language component is registered in the first script language system; and sending the page construction resource to a first conversion script component based on the first script language component.
Wherein, the service conversion module further comprises: a second transformation script component registered with the native system;
optionally, one implementation manner of the step S31 includes:
s311: packaging the page construction resource through the first conversion script component to obtain a packaging result which can be executed by the second conversion script component;
in this embodiment, the page building resource is encapsulated by the first conversion script component, and the obtained encapsulation result can be executed by the second conversion script component. Such as: in this embodiment, the page build resource is encapsulated into a data format that the second transformation script component can execute. In this embodiment, specific content of the packaging operation is not limited, and only needs to meet the requirements of the embodiments of the present invention.
S312: sending the packaging result to a second conversion script component through the first conversion script component, and analyzing the packaging result through the second conversion script component to obtain a service logic code executable by the second conversion script component and service layout data executable by the second conversion script component;
after the first conversion script component carries out packaging operation to obtain a packaging result, the packaging result is sent to the second conversion script component through the first conversion script component. After the second conversion script component obtains the encapsulation result, the second conversion script component analyzes the encapsulation result to obtain the service logic code executable by the second conversion script component and the service layout data executable by the second conversion script component.
S313: and according to the service layout data which can be executed by the second conversion script component, executing the service logic code which can be executed by the second conversion script component through the second conversion script component to obtain a target page.
Specifically, based on the service layout data executable by the second conversion script component and the service logic code executable by the second conversion script component, the construction of the target page can be completed by the second conversion script component.
Thereby, it is achieved that the page building resource is converted into a format that can be executed by the second conversion script component. Also, based on the page build resource after the conversion, a target page can be generated by the second conversion script component.
Optionally, the second conversion script component further includes: and the plug-in interface is used for receiving resource information which can be executed by the second conversion script component. Therefore, the access design of general functions can be completed through the second conversion script component, such as: network request, prompt popup, page jump management, etc.
Optionally, this embodiment further includes step S20 before step S211.
Wherein, S20: and sending a calling instruction to the first script language component through the service resource conversion module, wherein the calling instruction is used for acquiring the page construction resource from the first script language component through the service resource conversion module.
Optionally, after the step S31, the present embodiment further includes the following step S32, that is: the present embodiment further includes step S32 after step S313.
Wherein, S32: and sending the target page to a second script language component, and displaying the target page through the second script language component, wherein the second script language component is registered in a native system.
Therefore, the constructed target resources can be displayed for the user to check.
In order to better explain the implementation process of the method in this embodiment, the method in this embodiment is explained below with reference to a specific application example.
Fig. 7 is a flowchart of a page construction method according to a seventh embodiment of the present invention. Referring to fig. 7, a seventh embodiment of the present invention provides a page construction method, where the method involves a JS business layer, a JS core layer, a Native core layer, and a Native display layer of a page construction system. The JS service layer corresponds to the first script language component in the first to fifth embodiments; the JS core layer corresponds to the first conversion script component of the fourth to sixth embodiments; the Native core layer corresponds to the second script conversion component of the fifth embodiment; the Native presentation layer corresponds to the second script language component of the sixth embodiment.
Moreover, fig. 8 is a schematic diagram of interaction between JS side and Native side in a seventh embodiment of the present invention; fig. 9 is a schematic diagram of invoking a corresponding JSViewController lifecycle method by invoking a native viewcontroller lifecycle method in the seventh embodiment of the present invention.
As shown in fig. 9 through 7, when a Native view controller page is created at the Native end, a jsview controller page corresponding to the Native view controller page is created in the JS environment. Furthermore, when the application program calls the NativeViewController lifecycle method, the application program calls the same lifecycle method in the corresponding JSViewController. Therefore, the life cycle method logic of the ViewController can be dynamically realized on the Native side, and the construction and the updating of the target page can be dynamically realized.
Specifically, as shown in fig. 7, the Native core layer sends a call instruction, the call instruction passes through the JS core layer and reaches the JS service layer, and after receiving the call instruction, the JS service layer sends a page construction resource to the JS core layer in response to the call instruction. The page construction resource comprises all service logics and user operation monitoring data, wherein the service logics are equivalent to the service logic codes and the service layout data. Moreover, the page building resource is dynamically acquired from the server.
And after receiving the page construction resources, the JS core layer encapsulates the received data and transmits the encapsulated encapsulation result to the Native core layer. And then, after receiving the encapsulation result, the Native core layer analyzes the encapsulation result to obtain the service logic code and the service layout data which can be executed by the Native core layer, thereby realizing script language conversion. In this regard, the Native core layer may run corresponding business logic codes according to different business layout data to generate the target page.
Optionally, in this embodiment, the target page may be displayed to the user through a Native display layer.
In addition, the Native core layer is further provided with a plug-in interface, and the plug-in interface is used for receiving resource information which can be executed by the Native core layer.
Specifically, fig. 10 is a schematic diagram of a working principle of the plug-in interface in the seventh embodiment of the present invention. As shown in fig. 10, the plug-in interface can receive access design parameters of general functions, such as: network request, popup prompt, page jump management and other general functions, and the bottom layer of the plug-in interface is accessed in a JSEXport mode. Furthermore, in this embodiment, there are two protocols, one implemented in JSExport, implemented by the application; and the other is realized by the access party defined by the application program. Since different items have the same general functions and these same functions may have different implementations, the structure that the application provides to the access party can be unified through the dual protocols.
Fig. 11 is a schematic structural diagram of a page constructing apparatus according to an eighth embodiment of the present invention. According to fig. 11, an eighth embodiment of the present invention provides a page building apparatus, which is included in an application program, and includes:
an obtaining module 110, configured to obtain a page construction resource from a server; a sending module 120, configured to send the page building resource to a service conversion module based on the first scripting language component; the building module 130 is configured to perform script language conversion on the page building resource through the service conversion module to obtain a script language conversion result, and build a target page according to the script language conversion result.
Optionally, the apparatus further comprises: the verification module is used for verifying whether the page construction resource is legal or not after the page construction resource from the server is obtained and before the page construction resource is sent to the service conversion module based on the first script language component; and the downloading module is used for storing the page construction resource to a local preset position under the condition that the verification is passed, so that the first script language component can send the page construction resource to the service conversion module from the local preset position.
Optionally, the service conversion module includes: a first conversion script component written in the first script language;
the sending module 120 includes: the index generating unit is used for generating an index file of the page construction resource according to the acquired page construction resource; the searching unit is used for searching the page construction resource through a first script language system based on the index file, and the first script language component is registered in the first script language system; and the sending unit is used for sending the page construction resource to the first conversion script component based on the first script language component.
Optionally, the service conversion module further includes: a second transformation script component registered with the native system;
the building block 130 includes: the packaging unit is used for packaging the page construction resource through the first conversion script component to obtain a packaging result which can be executed by the second conversion script component; the analysis unit is used for sending the packaging result to a second conversion script component through the first conversion script component and analyzing the packaging result through the second conversion script component to obtain a service logic code executable by the second conversion script component and service layout data executable by the second conversion script component; and the construction unit is used for executing the service logic code which can be executed by the second conversion script component through the second conversion script component according to the service layout data which can be executed by the second conversion script component to obtain the target page.
Optionally, the second conversion script component further includes: and the plug-in interface is used for receiving resource information which can be executed by the second conversion script component.
Optionally, the apparatus further comprises: the instruction module is used for sending a calling instruction to the first script language component through the service resource conversion module before the page construction resource is sent to the service conversion module based on the first script language component, and the calling instruction is used for acquiring the page construction resource from the first script language component through the service resource conversion module.
Optionally, the apparatus further comprises: and the display module is used for presetting the page construction resources through the service conversion module to obtain a processing result, transmitting the target page to a second script language component after constructing the target page according to the processing result, and displaying the target page through the second script language component, wherein the second script language component is registered in a native system.
A ninth embodiment of the present invention provides an electronic device, comprising a processor and a memory; the memory is used for storing computer instructions, and the processor is used for executing the computer instructions stored by the memory to realize the page building method.
The terms and implementation principles related to the electronic device in the ninth embodiment of the present invention may specifically refer to a page construction method in the first to seventh embodiments of the present invention, and are not described herein again.
A tenth embodiment of the present invention provides a computer-readable storage medium storing one or more modules executable by one or more processors to implement a page building method as described above.
The terms and implementation principles related to a computer-readable storage medium in the fourth embodiment of the present invention may specifically refer to a page construction method in the first to third embodiments of the present invention, and are not described herein again.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal (such as a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present invention.
While the present invention has been described with reference to the embodiments shown in the drawings, the present invention is not limited to the embodiments, which are illustrative and not restrictive, and it will be apparent to those skilled in the art that various changes and modifications can be made therein without departing from the spirit and scope of the invention as defined in the appended claims.

Claims (16)

1. A page construction method, characterized in that the method comprises:
acquiring page construction resources from a server;
based on a first script language component, sending the page construction resource to a service conversion module, wherein the first script language is a non-native language;
performing script language conversion on the page construction resources through the service conversion module to obtain a script language conversion result, and constructing a target page according to the script language conversion result;
the service conversion module comprises: first conversion script subassembly and second conversion script subassembly, first conversion script subassembly by first script language is compiled and is accomplished, second conversion script subassembly registers in Native system, first conversion script subassembly includes the JS core layer, second conversion script subassembly includes Native core layer.
2. The method of claim 1, wherein after the obtaining the page construction resource from the server and before the sending the page construction resource to the business conversion module based on the first scripting language component, the method further comprises:
checking whether the page construction resources are legal or not;
and under the condition that the verification is passed, storing the page construction resource to a local preset position so that the first script language component can send the page construction resource to a service conversion module from the local preset position.
3. The method of claim 1,
the sending the page construction resource to a service conversion module based on the first script language component comprises:
generating an index file of the page construction resource according to the acquired page construction resource;
based on the index file, searching the page construction resource through a first script language system, wherein the first script language component is registered in the first script language system;
and sending the page construction resource to a first conversion script component based on the first script language component.
4. The method according to claim 3, wherein the performing script language conversion on the page construction resource through the service conversion module to obtain a script language conversion result, and constructing the target page according to the script language conversion result comprises:
packaging the page construction resource through the first conversion script component to obtain a packaging result which can be executed by the second conversion script component;
sending the packaging result to a second conversion script component through the first conversion script component, and analyzing the packaging result through the second conversion script component to obtain a service logic code executable by the second conversion script component and service layout data executable by the second conversion script component;
and according to the service layout data which can be executed by the second conversion script component, executing the service logic code which can be executed by the second conversion script component through the second conversion script component to obtain a target page.
5. The method of claim 4, wherein the second transformation script component further comprises: and the plug-in interface is used for receiving resource information which can be executed by the second conversion script component.
6. The method of claim 1, wherein before the sending the page building resource to a business transformation module based on the first scripting language component, the method further comprises:
and sending a calling instruction to the first script language component through the service conversion module, wherein the calling instruction is used for acquiring the page construction resource from the first script language component through the service conversion module.
7. The method according to any one of claims 1 to 6, wherein after the page construction resource is subjected to the preset processing by the service conversion module to obtain a processing result, and a target page is constructed according to the processing result, the method further comprises:
and sending the target page to a second script language component, and displaying the target page through the second script language component, wherein the second script language component is registered in a native system.
8. A page building apparatus, characterized in that the apparatus comprises:
the acquisition module is used for acquiring page construction resources from a server;
the sending module is used for sending the page construction resource to the service conversion module based on the first script language component, wherein the first script language is a non-native language;
the construction module is used for performing script language conversion on the page construction resources through the service conversion module to obtain a script language conversion result and constructing a target page according to the script language conversion result;
the service conversion module comprises: first conversion script subassembly and second conversion script subassembly, first conversion script subassembly by first script language is compiled and is accomplished, second conversion script subassembly registers in Native system, first conversion script subassembly includes the JS core layer, second conversion script subassembly includes Native core layer.
9. The apparatus of claim 8, further comprising:
the verification module is used for verifying whether the page construction resource is legal or not after the page construction resource from the server is obtained and before the page construction resource is sent to the service conversion module based on the first script language component;
and the downloading module is used for storing the page construction resource to a local preset position under the condition that the verification is passed, so that the first script language component can send the page construction resource to the service conversion module from the local preset position.
10. The apparatus of claim 8, wherein the sending module comprises:
the index generating unit is used for generating an index file of the page construction resource according to the acquired page construction resource;
the searching unit is used for searching the page construction resource through a first script language system based on the index file, and the first script language component is registered in the first script language system;
and the sending unit is used for sending the page construction resource to the first conversion script component based on the first script language component.
11. The apparatus of claim 10, wherein the building module comprises:
the packaging unit is used for packaging the page construction resource through the first conversion script component to obtain a packaging result which can be executed by the second conversion script component;
the analysis unit is used for sending the packaging result to a second conversion script component through the first conversion script component and analyzing the packaging result through the second conversion script component to obtain a service logic code executable by the second conversion script component and service layout data executable by the second conversion script component;
and the construction unit is used for executing the service logic code which can be executed by the second conversion script component through the second conversion script component according to the service layout data which can be executed by the second conversion script component to obtain the target page.
12. The apparatus of claim 11, wherein the second transformation script component further comprises: and the plug-in interface is used for receiving resource information which can be executed by the second conversion script component.
13. The apparatus of claim 8, further comprising:
the instruction module is used for sending a calling instruction to the first script language component through the service conversion module before the page construction resource is sent to the service conversion module based on the first script language component, and the calling instruction is used for acquiring the page construction resource from the first script language component through the service conversion module.
14. The apparatus of any one of claims 8-13, further comprising:
and the display module is used for presetting the page construction resources through the service conversion module to obtain a processing result, transmitting the target page to a second script language component after constructing the target page according to the processing result, and displaying the target page through the second script language component, wherein the second script language component is registered in a native system.
15. An electronic device comprising a processor and a memory;
the memory is used for storing computer instructions, and the processor is used for executing the computer instructions stored by the memory to realize a page construction method of any one of claims 1 to 7.
16. A computer-readable storage medium having stored thereon one or more components executable by one or more processors to implement a page construction method as claimed in any one of claims 1 to 7.
CN201810504138.3A 2018-05-23 2018-05-23 Page construction method, device, equipment and storage medium Active CN108804120B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810504138.3A CN108804120B (en) 2018-05-23 2018-05-23 Page construction method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810504138.3A CN108804120B (en) 2018-05-23 2018-05-23 Page construction method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN108804120A CN108804120A (en) 2018-11-13
CN108804120B true CN108804120B (en) 2022-04-05

Family

ID=64092920

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810504138.3A Active CN108804120B (en) 2018-05-23 2018-05-23 Page construction method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN108804120B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110389754B (en) * 2019-06-18 2023-12-15 北京奇艺世纪科技有限公司 Service processing method, system, server, terminal, electronic equipment and storage medium
CN111026396B (en) * 2019-12-13 2023-11-14 北京小米移动软件有限公司 Page rendering method and device, electronic equipment and storage medium
CN117130692B (en) * 2023-10-23 2024-01-23 成都赛力斯科技有限公司 Application management method, device, electronic equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20160012030A (en) * 2014-07-23 2016-02-02 엘지전자 주식회사 Video displ110y device 110nd oper110ting method thereof
CN105354014A (en) * 2014-08-18 2016-02-24 阿里巴巴集团控股有限公司 Application interface rendering display method and apparatus
CN106569794A (en) * 2016-09-23 2017-04-19 北京五八信息技术有限公司 Application developing device
CN107391169A (en) * 2017-06-09 2017-11-24 口碑控股有限公司 The dynamic updating method and device of the Android page
CN107608691A (en) * 2017-08-18 2018-01-19 阿里巴巴集团控股有限公司 A kind of method for updating pages and device

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10382583B2 (en) * 2013-04-24 2019-08-13 Microsoft Technology Licensing, Llc Method and system to update a front end client
CN103942055A (en) * 2014-04-30 2014-07-23 北京邮电大学 Development system and method for fusion network mixing service process programming language
CN105022806B (en) * 2015-07-03 2018-08-10 厦门二五八集团有限公司 The method and system of the internet web page construction movement page based on translation template
CN107291506B (en) * 2017-06-28 2020-12-15 北京五八信息技术有限公司 Method and device for updating APP interface

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20160012030A (en) * 2014-07-23 2016-02-02 엘지전자 주식회사 Video displ110y device 110nd oper110ting method thereof
CN105354014A (en) * 2014-08-18 2016-02-24 阿里巴巴集团控股有限公司 Application interface rendering display method and apparatus
CN106569794A (en) * 2016-09-23 2017-04-19 北京五八信息技术有限公司 Application developing device
CN107391169A (en) * 2017-06-09 2017-11-24 口碑控股有限公司 The dynamic updating method and device of the Android page
CN107608691A (en) * 2017-08-18 2018-01-19 阿里巴巴集团控股有限公司 A kind of method for updating pages and device

Also Published As

Publication number Publication date
CN108804120A (en) 2018-11-13

Similar Documents

Publication Publication Date Title
CN107368487B (en) Dynamic layout method, device and client for page components
CN108776592B (en) Page construction method, device, equipment and storage medium
CN106406844B (en) Method and device for realizing public number menu of communication interaction platform
CN107688529B (en) Component debugging method and device
CN108804120B (en) Page construction method, device, equipment and storage medium
CN109240697B (en) Call processing method and device and storage medium
CN107133064B (en) Page hot updating method and device for native application
CN107729014B (en) Page jump method and structure based on Android
CN105718313A (en) Application operation method and device
CN104821954A (en) Cross-platform remote procedure call method
CN108762767B (en) Application publishing method, device and computer readable storage medium
CN108845810B (en) Method and device for dynamically updating application, electronic equipment and storage medium
CN111090431A (en) Data processing method and device
CN105515887B (en) application testing method, server and system
CN112416458A (en) Preloading method and device based on ReactNative, computer equipment and storage medium
CN108021445B (en) Memory optimization method, device and system and computer readable storage medium
CN108733370B (en) Stylized display method, device, terminal and storage medium of native APP
CN105786476B (en) Data processing method and system between mobile client and server
CN107193565B (en) Method for developing native APP (application) across mobile terminals
CN107861765B (en) Product configuration method, apparatus, and computer-readable storage medium
CN108319474B (en) Page information generation method, device and equipment
CN108845800B (en) Method, device, equipment and storage medium for realizing component extension function
CN109766123B (en) Application program packaging method and device
CN114547569A (en) Account login processing method and device
CN108509228B (en) Page loading method, terminal equipment and computer readable 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