Disclosure of Invention
In view of this, embodiments of the present application provide a view interaction method, an apparatus, an electronic device, and a computer-readable medium, which can solve the problem that the interaction between a dynamic page view and an existing native page view on the same page cannot be implemented in the prior art.
To achieve the above object, according to an aspect of embodiments of the present application, there is provided a view interaction method including:
receiving a view interaction request, and determining a view mixed-editing layout according to the view interaction request;
calling a corresponding dynamic view code packet according to the view mixed layout so as to render the view and generate a dynamic view;
determining a page corresponding to the dynamic view, calling elements of the native view to generate the native view on the page based on the mixed view layout;
and determining an interface identifier corresponding to the view interaction request, determining a target interaction view from the dynamic view and the native view according to the interface identifier, calling an interface corresponding to the interface identifier to carry out interaction between the target interaction views, and further updating the dynamic view and the native view.
Optionally, before invoking the corresponding dynamic view code package, the method further includes:
determining a dynamic view position and a dynamic view element corresponding to the view mixed layout;
the dynamic view platform is invoked to generate a dynamic view code package based on the dynamic view elements.
Optionally, performing view rendering to generate a dynamic view, including:
calling a dynamic view container, loading a dynamic view code packet, further analyzing to obtain a dynamic view code command, executing the dynamic view code command, and further rendering a command execution result to generate a corresponding native view element;
corresponding native view elements are inserted into the dynamic view locations to generate the dynamic view.
Optionally, generating a native view comprises:
determining a native view position corresponding to the view mixed layout;
and loading the native view elements to the native view positions to generate the native view.
Optionally, determining the target interactive view from the dynamic view and the native view according to the interface identifier includes:
in response to determining that the interface identifier corresponds to the native interface, determining each native view corresponding to the native interface as a target interactive view;
in response to determining that the interface identifier corresponds to the native interface and the dynamic environment interface, determining a native view corresponding to the native interface and a dynamic view corresponding to the dynamic environment interface as target interactive views;
in response to the fact that the interface identification corresponds to the dynamic environment interface and the bridging interface, determining that a dynamic view corresponding to the dynamic environment interface is a target interactive view;
and responding to the determined interface identification corresponding to the routing interface, and determining the dynamic view corresponding to the routing interface as the target interactive view.
Optionally, invoking an interface corresponding to the interface identifier to perform interaction between the target interaction views, including:
and responding to the native interface and the dynamic environment interface corresponding to the interface identification, calling the dynamic environment interface to write the corresponding method of the target dynamic view into the dynamic environment, and further calling the dynamic view bridge to convert the method of the target dynamic view into a native method so that the native view corresponding to the native interface can be called through the native interface.
Optionally, invoking an interface corresponding to the interface identifier to perform interaction between the target interaction views, including:
and in response to the determination that the interface identification corresponds to the native interface and the dynamic environment interface, determining a target native view based on the native interface, and then calling the dynamic view bridge, and writing the method of the target native view into the dynamic environment for calling the target dynamic view corresponding to the dynamic environment interface.
Optionally, invoking an interface corresponding to the interface identifier to perform interaction between the target interaction views, including:
and in response to the fact that the interface identification corresponds to the dynamic environment interface and the bridge interface, writing the target dynamic view method corresponding to the dynamic environment interface into the dynamic environment, calling the dynamic view bridge to convert the dynamic view bridge into a native method, calling the dynamic view bridge again to write the native method into the dynamic environment for secondary bridging, and calling other target dynamic views corresponding to the dynamic environment interface.
Optionally, invoking an interface corresponding to the interface identifier to perform interaction between the target interaction views, including:
in response to the fact that the interface identification corresponds to the routing interface, adding a target dynamic view corresponding to the routing interface into the dynamic view container, and writing a routing method corresponding to the routing interface into the dynamic environment;
and calling a routing interface to acquire behaviors and parameters corresponding to the routing method, analyzing the behaviors and the parameters, and further executing interaction among the target dynamic views according to an analysis result.
In addition, the present application also provides a view interaction apparatus, including:
the receiving unit is configured to receive the view interaction request and determine the view mixed layout according to the view interaction request;
the dynamic view rendering unit is configured to call the corresponding dynamic view code packet according to the view mixed layout so as to perform view rendering and generate a dynamic view;
the native view generating unit is configured to determine a page corresponding to the dynamic view, and call native view elements to generate a native view on the page based on the view mixed layout;
and the view interaction unit is configured to determine an interface identifier corresponding to the view interaction request, determine a target interaction view from the dynamic view and the native view according to the interface identifier, call an interface corresponding to the interface identifier to perform interaction between the target interaction views, and further update the dynamic view and the native view.
Optionally, the dynamic view rendering unit is further configured to:
determining a dynamic view position and a dynamic view element corresponding to the view mixed layout;
the dynamic view platform is invoked to generate a dynamic view code package based on the dynamic view elements.
Optionally, the dynamic view rendering unit is further configured to:
calling a dynamic view container, loading a dynamic view code packet, further analyzing to obtain a dynamic view code command, executing the dynamic view code command, and further rendering a command execution result to generate a corresponding native view element;
corresponding native view elements are inserted into the dynamic view locations to generate the dynamic view.
Optionally, the native view generation unit is further configured to:
determining a native view position corresponding to the view mixed layout;
and loading the native view elements to the native view positions to generate the native view.
Optionally, the view interaction unit is further configured to:
in response to determining that the interface identifier corresponds to the native interface, determining each native view corresponding to the native interface as a target interactive view;
in response to determining that the interface identifier corresponds to the native interface and the dynamic environment interface, determining a native view corresponding to the native interface and a dynamic view corresponding to the dynamic environment interface as target interactive views;
in response to the fact that the interface identification corresponds to the dynamic environment interface and the bridging interface, determining that a dynamic view corresponding to the dynamic environment interface is a target interactive view;
and responding to the determined interface identification corresponding to the routing interface, and determining the dynamic view corresponding to the routing interface as the target interactive view.
Optionally, the view interaction unit is further configured to:
and responding to the native interface and the dynamic environment interface corresponding to the interface identification, calling the dynamic environment interface to write the corresponding method of the target dynamic view into the dynamic environment, and further calling the dynamic view bridge to convert the method of the target dynamic view into a native method so that the native view corresponding to the native interface can be called through the native interface.
Optionally, the view interaction unit is further configured to:
and in response to the determination that the interface identification corresponds to the native interface and the dynamic environment interface, determining a target native view based on the native interface, and then calling the dynamic view bridge, and writing the method of the target native view into the dynamic environment for calling the target dynamic view corresponding to the dynamic environment interface.
Optionally, the view interaction unit is further configured to:
and in response to the fact that the interface identification corresponds to the dynamic environment interface and the bridge interface, writing the target dynamic view method corresponding to the dynamic environment interface into the dynamic environment, calling the dynamic view bridge to convert the dynamic view bridge into a native method, calling the dynamic view bridge again to write the native method into the dynamic environment for secondary bridging, and calling other target dynamic views corresponding to the dynamic environment interface.
Optionally, the view interaction unit is further configured to:
in response to the fact that the interface identification corresponds to the routing interface, adding a target dynamic view corresponding to the routing interface into the dynamic view container, and writing a routing method corresponding to the routing interface into the dynamic environment;
and calling a routing interface to acquire behaviors and parameters corresponding to the routing method, analyzing the behaviors and the parameters, and further executing interaction among the target dynamic views according to an analysis result.
In addition, the present application also provides a view interaction electronic device, including: one or more processors; a storage device for storing one or more programs which, when executed by one or more processors, cause the one or more processors to implement the view interaction method as described above.
In addition, the present application also provides a computer readable medium, on which a computer program is stored, which when executed by a processor implements the view interaction method as described above.
One embodiment of the above invention has the following advantages or benefits: the method comprises the steps of receiving a view interaction request, and determining a view mixed-editing layout according to the view interaction request; calling a corresponding dynamic view code packet according to the view mixed layout so as to render the view and generate a dynamic view; determining a page corresponding to the dynamic view, calling elements of the native view to generate the native view on the page based on the mixed view layout; and determining an interface identifier corresponding to the view interaction request, determining a target interaction view from the dynamic view and the native view according to the interface identifier, calling an interface corresponding to the interface identifier to carry out interaction between the target interaction views, and further updating the dynamic view and the native view. The method realizes the interaction between the native views, between the dynamic views, between the native views and the dynamic views in the same page in a cross-end mode and the dynamic update after the interaction of the views in the same page.
Further effects of the above-mentioned non-conventional alternatives will be described below in connection with the embodiments.
Detailed Description
The following description of the exemplary embodiments of the present application, taken in conjunction with the accompanying drawings, includes various details of the embodiments of the application for the understanding of the same, which are to be considered exemplary only. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present application. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
Fig. 1 is a schematic diagram of a main flow of a view interaction method according to a first embodiment of the present application, and as shown in fig. 1, the view interaction method includes:
step S101, receiving a view interaction request, and determining a view mixed layout according to the view interaction request.
In this embodiment, an execution subject (for example, a server) of the view interaction method may receive, through a wired connection or a wireless connection, a view interaction request sent by a user through a terminal device. The view interaction request can be a request for interaction between the original view and the native view in the same page, or a request for interaction between the original view and the dynamic view in the same page, or a request for interaction between the dynamic view and the dynamic view in the same page. The embodiment of the present application does not specifically limit the type of the view interaction request.
After receiving the view interaction request, the execution subject may invoke the page configuration platform to perform configuration of the native view and the dynamic view in the page according to the configuration parameters carried in the view interaction request. Specifically, the execution body may obtain the configuration parameters carried in the view interaction request, and then determine, from the configuration parameters, the configuration position information of the native view and the configuration position information of the dynamic view in the page, and the page element information in the native view and the page element information in the dynamic view. The page element information may include the size of the page element, an acquisition address corresponding to the page element, and the like, and the specific content included in the page element information is not limited in the embodiment of the present application. And the page configuration platform determines the specific implementation part of the mixed page through the layout configuration of the native view and the dynamic view. And the generated configuration file provides the end side for obtaining and loading.
The execution body may specifically determine the view-blending layout of the dynamic view and the native view in the page according to the configuration position information of the dynamic view and the native view and the page element information in the configuration parameters carried in the view interaction request.
And step S102, calling a corresponding dynamic view code packet according to the view mixed layout so as to render the view and generate the dynamic view.
The execution body can preset the view container according to the view mixed layout. Specifically, the execution subject, when presetting the native view, may directly load native view elements to the native view layout location of the page. Native view elements such as a button, a list, etc. When the execution main body presets the dynamic view container, the dynamic view code packet which is developed, debugged, compiled, packaged and issued can be downloaded from the dynamic view platform to the local side (the local side refers to the ends of PC, Mac, iOS, Android and the like), if the local side has the dynamic view code packet with the same version, the execution main body can directly load the dynamic view code packet, and then view rendering is carried out at the layout position corresponding to the dynamic view to generate the final dynamic view. Specifically, the execution main body may start the dynamic view environment, load the dynamic view code package, perform analysis, code command execution, and rendering processing to convert the dynamic view code package into native view elements, and then the execution main body may insert the rendered native view elements into a preset layout position of the dynamic view container, so as to complete dynamic view presentation. In particular, the execution principal may invoke an end-side page layout configuration to preset native views and preset dynamic view containers. And (3) configuration of the end-side page layout, namely obtaining the configuration of the page configuration platform, analyzing to obtain the layout of the native view and the dynamic view, and presetting a loading dynamic view container. And the dynamic view container is loaded for analyzing and executing the dynamic view code packet, and finally the rendering of the view and the interaction of the page are realized. The end side refers to a terminal where the current page is located, such as a PC, Mac, iOS, and Android. And presetting, namely analyzing and identifying a dynamic view according to the configuration in the acquired page configuration platform, and adding a dynamic view container to a corresponding layout position.
Step S103, determining a page corresponding to the dynamic view, and calling the native view elements to generate a native view on the page based on the view mixed layout.
Specifically, a native view is generated, comprising: determining a native view position corresponding to the view mixed layout; and loading the native view elements to the native view positions to generate the native view. The native view element may be, for example, a button, a list, and the like, and the content included in the native view element is not particularly limited in the embodiment of the present application.
And step S104, determining an interface identifier corresponding to the view interaction request, determining a target interaction view from the dynamic view and the native view according to the interface identifier, calling an interface corresponding to the interface identifier to carry out interaction between the target interaction views, and further updating the dynamic view and the native view.
The view interaction can be divided into three interaction forms of native view and native view interaction, native view and dynamic view interaction and dynamic view interaction.
Specifically, the determining of the target interactive view from the dynamic view and the native view according to the interface identification comprises the following steps:
and in response to determining that the interface identification corresponds to the native interface, determining each native view corresponding to the native interface as a target interactive view.
Specifically, when the execution subject determines that the interface identifier corresponds to the native interface, for example, the interface identifier is YS, it may be determined that the interface identifier corresponds to the native interface, and the target interactive view may be two or more native views on the page. Fig. 3 is a schematic view of an application scenario according to an embodiment of the present application. Direct interaction between native views may be through a native interface provided on the end-side, as shown at 3071 in fig. 3. The native interface may have stored therein standard view methods or custom methods implemented by view controls provided by the system.
And in response to determining that the interface identification corresponds to the native interface and the dynamic environment interface, determining a native view corresponding to the native interface and a dynamic view corresponding to the dynamic environment interface as the target interactive view.
Specifically, when the execution main body determines that the interface identifier includes YS and HJ, it may be determined that the native interface and the dynamic environment interface correspond to the interface identifier, and then the execution main body may take the native view corresponding to the native interface and the dynamic view corresponding to the dynamic environment interface as the target interactive view according to a preset correspondence between the interface and the target interactive view. The present application does not limit the specific representation of the interface identifier corresponding to the native interface and the dynamic environment interface.
Specifically, invoking an interface corresponding to the interface identifier to perform interaction between target interaction views includes:
and responding to the native interface and the dynamic environment interface corresponding to the interface identification, calling the dynamic environment interface to write the corresponding method of the target dynamic view into the dynamic environment, and further calling the dynamic view bridge to convert the method of the target dynamic view into a native method so that the native view corresponding to the native interface can be called through the native interface. For example, as shown in 3072 in fig. 3, the method for the native view to invoke the dynamic view is: the dynamic view exports the method to the dynamic environment by calling the dynamic environment interface, and then the dynamic view bridge converts the method into a native method so that the native view can be called by calling the native interface. The dynamic view calls the method of the native view: the native view registers the method into the dynamic environment through the native interface and the dynamic view bridge, so that the dynamic view can be called in the dynamic environment.
Specifically, invoking an interface corresponding to the interface identifier to perform interaction between the target interaction views, further comprising:
and in response to the determination that the interface identification corresponds to the native interface and the dynamic environment interface, determining a target native view based on the native interface, and then calling the dynamic view bridge, and writing the method of the target native view into the dynamic environment for calling the target dynamic view corresponding to the dynamic environment interface.
And in response to determining that the interface identification corresponds to the dynamic environment interface and the bridge interface, determining that the dynamic view corresponding to the dynamic environment interface is the target interactive view.
Specifically, when the execution subject determines that the interface identifier includes HJ and QJ, it may be determined that the interface identifier corresponds to the dynamic environment interface and the bridge interface, and then the execution subject may determine two or more corresponding dynamic views according to the dynamic environment interface and use the two or more corresponding dynamic views as the target interactive view.
Specifically, invoking an interface corresponding to the interface identifier to perform interaction between target interaction views includes:
and in response to the fact that the interface identification corresponds to the dynamic environment interface and the bridge interface, writing the target dynamic view method corresponding to the dynamic environment interface into the dynamic environment, calling the dynamic view bridge to convert the dynamic view bridge into a native method, calling the dynamic view bridge again to write the native method into the dynamic environment for secondary bridging, and calling other target dynamic views corresponding to the dynamic environment interface. For example, the bridge interface may be an interface on a dynamic view bridge, as shown in 3073 in fig. 3, the execution subject may export a method corresponding to the dynamic view into the dynamic environment through the dynamic environment interface, and then the method is converted into a native method by the dynamic view bridge, and the native method registers the method name into the dynamic environment through the dynamic view bridge to perform secondary bridging, and provides another dynamic view for calling. And the calling process prevents self circulation calling through the unique registration mark of the API. The native methods may be methods stored in a native interface. The native method refers to a functional method provided by the current view or system or customized by a developer, such as an operation of acquiring the size of the view, adding the view, and the like.
And responding to the determined interface identification corresponding to the routing interface, and determining the dynamic view corresponding to the routing interface as the target interactive view.
Specifically, invoking an interface corresponding to the interface identifier to perform interaction between target interaction views includes:
in response to the fact that the interface identification corresponds to the routing interface, adding a target dynamic view corresponding to the routing interface into the dynamic view container, and writing a routing method corresponding to the routing interface into the dynamic environment; and calling a routing interface to acquire behaviors and parameters corresponding to the routing method, analyzing the behaviors and the parameters, and further executing interaction among the target dynamic views according to an analysis result. For example, the routing interface may be an interface on a dynamic view router, as shown in 3073 in fig. 3, when the dynamic view is added to the dynamic view container, a routing method provided externally is registered in the dynamic environment, the routing method is generally provided in the form of a URL, the dynamic view may directly call the URL in a page jump calling manner, the behavior and parameters of the URL are transferred to the specified dynamic view through the URL router, and then the specified dynamic view performs behavior parameter analysis and specific interaction behavior execution.
In the embodiment of the application, a functional method developed based on a dynamic view is stored in the dynamic environment interface, and a specific function corresponding to the functional method is provided. For example, whether a certain view element in the dynamic view is displayed or not, certain data in the dynamic view, and the like
In the embodiment, by receiving a view interaction request, a view mixed-editing layout is determined according to the view interaction request; calling a corresponding dynamic view code packet according to the view mixed layout so as to render the view and generate a dynamic view; determining a page corresponding to the dynamic view, calling elements of the native view to generate the native view on the page based on the mixed view layout; and determining an interface identifier corresponding to the view interaction request, determining a target interaction view from the dynamic view and the native view according to the interface identifier, calling an interface corresponding to the interface identifier to carry out interaction between the target interaction views, and further updating the dynamic view and the native view. The method realizes the interaction between the native views, between the dynamic views, between the native views and the dynamic views in the same page in a cross-end mode and the dynamic update after the interaction of the views in the same page.
Fig. 2 is a schematic main flow diagram of a view interaction method according to a second embodiment of the present application, and as shown in fig. 2, the view interaction method includes:
step S201, receiving a view interaction request, and determining a view mixed layout according to the view interaction request.
The principle of step S201 is similar to that of step S101, and is not described here.
Step S202, determining the dynamic view position and the dynamic view element corresponding to the view mixed layout.
The dynamic view position may be determined according to position information carried in the view interaction request, for example, the carried position information may include top, bottom, left, and right margins of a page where the dynamic view is located, and the dynamic view position may be determined according to the top, bottom, left, and right margins.
Step S203, calling the dynamic view platform to generate a dynamic view code package based on the dynamic view elements.
In particular, the dynamic view element may include different view modules that build the page. Such as a button, a list, etc. After determining the position of the dynamic view and the elements of the dynamic view, the execution main body can call a dynamic view platform to develop, debug, compile, pack and release the dynamic view based on the elements of the dynamic view and actual requirements, and further generate a dynamic view code package.
And the dynamic view platform is used for creating and generating a corresponding dynamic view code packet, issuing the dynamic view code packet, synchronizing the dynamic view code packet to the page configuration platform and issuing the dynamic view code packet to the terminal according to the requirement.
Step S204, calling the dynamic view container, loading the dynamic view code packet, further analyzing to obtain a dynamic view code command, executing the dynamic view code command, and further rendering the command execution result to generate a corresponding native view element.
Step S205, insert the corresponding native view element into the dynamic view position to generate a dynamic view.
Specifically, the end side starts a dynamic view environment, loads a dynamic package, and converts the dynamic package into a native view element through analysis, code command execution and rendering processing. And inserting the rendered native view elements into the preset layout position of the dynamic container, thereby finishing the view presentation. Therefore, the interaction between the views and the view updating in the same page can be realized in a cross-terminal mode.
The dynamic view container is used for integrating dynamic view rendering and interaction into a dynamic view aggregation device, inserts native pages through dynamic view rendering, supports native mixed rendering capability, and supports interaction between the native views and the dynamic views through a dynamic view bridge and a dynamic view router. As shown in fig. 4, the step of rendering the dynamic view may be: dynamic view download-launch dynamic view environment-dynamic view parsing-dynamic view execution-dynamic view rendering-insert native page. As shown in fig. 5 and the dynamic view interaction of fig. 4, when the dynamic view code is executed, the dynamic view code is loaded, the description of the dynamic view code is injected, then the dynamic native component is configured, and the dynamic code executor is installed, so that the dynamic native component is initialized, and finally the method corresponding to the native component is executed. For example, the steps of dynamic view interaction may be: and calling the dynamic view code through the dynamic view bridge, and further loading the dynamic view code into the dynamic environment. When the dynamic view code is executed, the description is analyzed, the native component is configured and loaded by injecting the corresponding dynamic code description, the native component is initialized when the code is executed, the method corresponding to the native component is called and executed, and the dynamic view and the native view are updated according to the execution result.
Dynamic code description:
for describing mapping relation and specific behavior between dynamic code method and native component method
As exemplified below
The dynamic view router provides the capabilities that the dynamic view registers the routing method to the routing scheduling center, analyzes and searches the corresponding dynamic view when other dynamic views are called, and executes the dynamic view method. As shown in fig. 6a, which is a schematic diagram of a registration method of a dynamic view router, an executing agent may invoke a dynamic view container 1 to register a routing method to a routing scheduling center. For example, at registration, the executive invokes the dynamic view container 1 to register modelconfig with the routing hub, which caches component IDs and corresponding method lists for calls, such as modelel ═ 1 and methods [ "jumuulr" ]. As shown in fig. 6b, which is a schematic diagram of a calling method of a dynamic view router, an executing entity may call a dynamic view container 2 to find a called routing method in a routing scheduling center, then analyze a routing address corresponding to the routing method, then call a dynamic view container 1 to analyze a routing landing behavior and parameters based on the routing address, and then execute a corresponding method. For example, when calling, the execution body calls the dynamic view container 2 to resolve to a specific component id (modelid) and method according to the modelconfig in the URL, to search in the cache data of the routing scheduling center, and then to call. Such as the following URLs: "dynamic":// openModulemoduleConfig { \\\ "modeleid \":1, \ "methods \" jumprl \ ": type \":1, \ "methodID \" 1, \ "param \": URL \ ", 1, \" param \ ", 1, \\\\ \ param \" URL \ ": https:// xxx.xx/jump/test. html \ } is
Step S206, determining a page corresponding to the dynamic view, and calling the native view elements to generate a native view on the page based on the view mixed layout.
Step S207, determining an interface identifier corresponding to the view interaction request, determining a target interaction view from the dynamic view and the native view according to the interface identifier, calling an interface corresponding to the interface identifier to perform interaction between the target interaction views, and further updating the dynamic view and the native view.
The principle of step S206 to step S207 is similar to that of step S103 to step S104, and is not described here again.
URL: a Uniform Resource Locator (URL) is a representation method for specifying the location of information on a web service on the internet.
In addition, as another implementation manner of the embodiment of the application, the interaction manner between the views may be other interaction manners, for example, by building a behavior server, the inside of the view control initiates a behavior request to the behavior server in a network manner, and then the server pushes the behavior into the designated view control for behavior processing. And the whole interaction process is transferred through the network server. The present application does not specifically limit the views and the interaction manner between the views.
Fig. 3 is a schematic view of an application scenario of a view interaction method according to a third embodiment of the present application. The view interaction method of the embodiment of the application can be applied to a scene of interaction among views in a cross-end mixed editing page. As shown in fig. 3, a server 302 (the server 302 is an execution subject of the embodiment of the present application) receives a view interaction request 301, determines a view-blending layout 303 according to the view interaction request 301, and specifically, may invoke a page configuration platform B to perform page configuration on a page a, specifically, configure a native view and configure a dynamic view in the page a, so as to obtain the view-blending layout 303 (the embodiment of the present application does not specifically limit the arrangement positions of the dynamic view and the native view in the view-blending layout). The server 302 calls a corresponding dynamic view code package 304 according to the view blending layout 303 (where the dynamic view code package may be obtained by the server 302 calling a dynamic view platform D and executing dynamic view development, dynamic view debugging, dynamic view compiling, dynamic view packaging, and dynamic view publishing to a dynamic view management background), so as to perform view rendering to generate dynamic views a and c. The server 302 determines the page a corresponding to the dynamic views a and c, and calls the native view element 305 to generate the native views b, d and e on the page a based on the view-blending layout 303. The server 302 determines the interface identifier 306 corresponding to the view interaction request 301, determines the target interaction view 307 from the dynamic view a, c and the native view b, d, e according to the interface identifier 306, invokes an interface corresponding to the interface identifier 306, such as a native interface 3061, a dynamic environment interface 3062, a dynamic view bridge 3063, or a dynamic view router 3064, for interaction between each target interaction view 307 (e.g., a native view b interacts with a native view e through a native interface 3061; a native view d interacts with a dynamic view c through a native interface 3061, a dynamic view bridge 3063, a dynamic environment interface 308; a dynamic view c may interact with a dynamic view a through a dynamic environment interface 308, a dynamic view bridge 3063, a native interface 3061; or a dynamic view c may interact with a dynamic view a through a dynamic view router 3064 based on a routing method 309), and further updating the dynamic views a and c and the native views b, d and e in the page A.
According to the method, through a fusion mode of cross-end mixed page editing, firstly through page configuration and view container preset layout, the dynamic view container is rendered into the native elements after dynamic updating and inserted into the corresponding layout to complete rendering, then interaction among native views, dynamic views and native views and dynamic views is realized through combination of a native interface, a dynamic view bridge and a dynamic view router, and cross-end (partial and all pages) dynamic updating in the same page is realized.
Fig. 7 is a schematic diagram of the main elements of a view interaction device according to an embodiment of the application. As shown in fig. 7, the view interaction apparatus includes a receiving unit 701, a dynamic view rendering unit 702, a native view generating unit 703, and a view interaction unit 704.
The receiving unit 701 is configured to receive a view interaction request, and determine a view blending layout according to the view interaction request.
The dynamic view rendering unit 702 is configured to invoke the corresponding dynamic view code package according to the view-blending layout, so as to perform view rendering and generate a dynamic view.
The native view generating unit 703 is configured to determine a page corresponding to the dynamic view, and invoke the native view element to generate a native view on the page based on the view-blending layout.
And the view interaction unit 704 is configured to determine an interface identifier corresponding to the view interaction request, to determine a target interaction view from the dynamic view and the native view according to the interface identifier, and to invoke an interface corresponding to the interface identifier to perform interaction between the target interaction views, thereby updating the dynamic view and the native view.
In some embodiments, the dynamic view rendering unit 702 is further configured to: determining a dynamic view position and a dynamic view element corresponding to the view mixed layout; the dynamic view platform is invoked to generate a dynamic view code package based on the dynamic view elements.
In some embodiments, the dynamic view rendering unit 702 is further configured to: calling a dynamic view container, loading a dynamic view code packet, further analyzing to obtain a dynamic view code command, executing the dynamic view code command, and further rendering a command execution result to generate a corresponding native view element; corresponding native view elements are inserted into the dynamic view locations to generate the dynamic view.
In some embodiments, the native view generation unit 703 is further configured to: determining a native view position corresponding to the view mixed layout; and loading the native view elements to the native view positions to generate the native view.
In some embodiments, the view interaction unit 704 is further configured to: in response to determining that the interface identifier corresponds to the native interface, determining each native view corresponding to the native interface as a target interactive view; in response to determining that the interface identifier corresponds to the native interface and the dynamic environment interface, determining a native view corresponding to the native interface and a dynamic view corresponding to the dynamic environment interface as target interactive views; in response to the fact that the interface identification corresponds to the dynamic environment interface and the bridging interface, determining that a dynamic view corresponding to the dynamic environment interface is a target interactive view; and responding to the determined interface identification corresponding to the routing interface, and determining the dynamic view corresponding to the routing interface as the target interactive view.
In some embodiments, the view interaction unit 704 is further configured to: and responding to the native interface and the dynamic environment interface corresponding to the interface identification, calling the dynamic environment interface to write the corresponding method of the target dynamic view into the dynamic environment, and further calling the dynamic view bridge to convert the method of the target dynamic view into a native method so that the native view corresponding to the native interface can be called through the native interface.
In some embodiments, the view interaction unit 704 is further configured to: and in response to the determination that the interface identification corresponds to the native interface and the dynamic environment interface, determining a target native view based on the native interface, and then calling the dynamic view bridge, and writing the method of the target native view into the dynamic environment for calling the target dynamic view corresponding to the dynamic environment interface.
In some embodiments, the view interaction unit 704 is further configured to: and in response to the fact that the interface identification corresponds to the dynamic environment interface and the bridge interface, writing the target dynamic view method corresponding to the dynamic environment interface into the dynamic environment, calling the dynamic view bridge to convert the dynamic view bridge into a native method, calling the dynamic view bridge again to write the native method into the dynamic environment for secondary bridging, and calling other target dynamic views corresponding to the dynamic environment interface.
In some embodiments, the view interaction unit 704 is further configured to: in response to the fact that the interface identification corresponds to the routing interface, adding a target dynamic view corresponding to the routing interface into the dynamic view container, and writing a routing method corresponding to the routing interface into the dynamic environment; and calling a routing interface to acquire behaviors and parameters corresponding to the routing method, analyzing the behaviors and the parameters, and further executing interaction among the target dynamic views according to an analysis result.
It should be noted that, in the present application, the view interaction method and the view interaction apparatus have corresponding relationships in implementation contents, so that repeated contents are not described again.
Fig. 8 shows an exemplary system architecture 800 to which a view interaction method or a view interaction apparatus of an embodiment of the present application may be applied.
As shown in fig. 8, the system architecture 800 may include terminal devices 801, 802, 803, a network 804, and a server 805. The network 804 serves to provide a medium for communication links between the terminal devices 801, 802, 803 and the server 805. Network 804 may include various types of connections, such as wire, wireless communication links, or fiber optic cables, to name a few.
A user may use the terminal devices 801, 802, 803 to interact with a server 805 over a network 804 to receive or send messages or the like. The terminal devices 801, 802, 803 may have installed thereon various communication client applications, such as shopping-like applications, web browser applications, search-like applications, instant messaging tools, mailbox clients, social platform software, etc. (by way of example only).
The terminal devices 801, 802, 803 may be various electronic devices having view interaction processing screens and supporting web browsing, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like.
The server 805 may be a server providing various services, such as a back-office management server (for example only) providing support for view interaction requests submitted by users using the terminal devices 801, 802, 803. The background management server can receive the view interaction request and determine the view mixed-editing layout according to the view interaction request; calling a corresponding dynamic view code packet according to the view mixed layout so as to render the view and generate a dynamic view; determining a page corresponding to the dynamic view, calling elements of the native view to generate the native view on the page based on the mixed view layout; and determining an interface identifier corresponding to the view interaction request, determining a target interaction view from the dynamic view and the native view according to the interface identifier, calling an interface corresponding to the interface identifier to carry out interaction between the target interaction views, and further updating the dynamic view and the native view. The method realizes the interaction between the native views, between the dynamic views, between the native views and the dynamic views in the same page in a cross-end mode and the dynamic update after the interaction of the views in the same page.
It should be noted that the view interaction method provided by the embodiment of the present application is generally executed by the server 805, and accordingly, the view interaction apparatus is generally disposed in the server 805.
It should be understood that the number of terminal devices, networks, and servers in fig. 8 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
Referring now to FIG. 9, shown is a block diagram of a computer system 900 suitable for use in implementing a terminal device of an embodiment of the present application. The terminal device shown in fig. 9 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present application.
As shown in fig. 9, the computer system 900 includes a Central Processing Unit (CPU)901 that can perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)902 or a program loaded from a storage section 908 into a Random Access Memory (RAM) 903. In the RAM903, various programs and data necessary for the operation of the computer system 900 are also stored. The CPU901, ROM902, and RAM903 are connected to each other via a bus 904. An input/output (I/O) interface 905 is also connected to bus 904.
The following components are connected to the I/O interface 905: an input portion 906 including a keyboard, a mouse, and the like; an output section 907 including a display such as a Cathode Ray Tube (CRT), a liquid crystal credit authorization query processor (LCD), and the like, and a speaker and the like; a storage portion 908 including a hard disk and the like; and a communication section 909 including a network interface card such as a LAN card, a modem, or the like. The communication section 909 performs communication processing via a network such as the internet. The drive 910 is also connected to the I/O interface 905 as necessary. A removable medium 911 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 910 as necessary, so that a computer program read out therefrom is mounted into the storage section 908 as necessary.
In particular, according to embodiments disclosed herein, the processes described above with reference to the flow diagrams may be implemented as computer software programs. For example, embodiments disclosed herein include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated by the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 909, and/or installed from the removable medium 911. The above-described functions defined in the system of the present application are executed when the computer program is executed by a Central Processing Unit (CPU) 901.
It should be noted that the computer readable medium shown in the present application may be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may include, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present application, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In this application, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present application may be implemented by software or hardware. The described units may also be provided in a processor, and may be described as: a processor includes a receiving unit, a dynamic view rendering unit, a native view generating unit, and a view interacting unit. Wherein the names of the elements do not in some way constitute a limitation on the elements themselves.
As another aspect, the present application also provides a computer-readable medium, which may be contained in the apparatus described in the above embodiments; or may be separate and not incorporated into the device. The computer readable medium carries one or more programs which, when executed by a device, cause the device to receive a view interaction request and determine a view blending layout according to the view interaction request; calling a corresponding dynamic view code packet according to the view mixed layout so as to render the view and generate a dynamic view; determining a page corresponding to the dynamic view, calling elements of the native view to generate the native view on the page based on the mixed view layout; and determining an interface identifier corresponding to the view interaction request, determining a target interaction view from the dynamic view and the native view according to the interface identifier, calling an interface corresponding to the interface identifier to carry out interaction between the target interaction views, and further updating the dynamic view and the native view.
According to the technical scheme of the embodiment of the application, the interaction between the native views, between the dynamic views, between the native views and the dynamic update after the interaction of the views in the same page are realized in the same page.
The above-described embodiments should not be construed as limiting the scope of the present application. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions can occur, depending on design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present application shall be included in the protection scope of the present application.