View interaction method, device, electronic device and computer-readable medium
By receiving view interaction requests, determining the view mixed layout and generating dynamic views and native views, and using interface identifiers to achieve interaction between views, the problem of dynamic page views and native page views being unable to interact is solved, and cross-end view interaction and dynamic updates are achieved.
Patent Information
- Application Number
- CN202111335618.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-11
- Publication Date
- 2025-09-12
- Estimated Expiration
- 2041-11-11
AI Technical Summary
The existing technology cannot realize the interaction between the dynamic page view and the existing native page view on the same page.
By receiving view interaction requests, determining the view mixed layout, calling the dynamic view code package for rendering to generate a dynamic view, and calling the native view element to generate a native view, the interface identifier is used to determine the target interactive view for interaction between views.
It realizes cross-end interaction and dynamic update between native views and dynamic views on the same page, supports interaction between native views and dynamic views, and enhances the interactive capabilities of the page.
Smart Images

Figure CN114064176B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a view interaction method, device, electronic device, and computer-readable medium. Background Art
[0002] Currently, during page development, dynamic view pages cannot coexist with existing native page elements, making it impossible to implement interaction between dynamic page views and existing native page views on the same page.
[0003] During the implementation of this application, the inventors discovered that the prior art has at least the following problems:
[0004] It is not possible to implement interaction between dynamic page views and existing native page views on the same page. Summary of the Invention
[0005] In view of this, embodiments of the present application provide a view interaction method, device, electronic device and computer-readable medium, which can solve the existing problem of being unable to achieve interaction between a dynamic page view and an existing native page view on the same page.
[0006] To achieve the above objectives, according to one aspect of an embodiment of the present application, a view interaction method is provided, including:
[0007] Receive a view interaction request, and determine a view mixed layout according to the view interaction request;
[0008] According to the view mixed layout, call the corresponding dynamic view code package to render the view and generate a dynamic view;
[0009] Determine the page corresponding to the dynamic view, call the native view element, and generate the native view on the page based on the view mixin layout;
[0010] Determine the interface identifier corresponding to the view interaction request, determine the target interaction view from the dynamic view and the native view according to the interface identifier, call the interface corresponding to the interface identifier to interact between the target interaction views, and then update the dynamic view and the native view.
[0011] Optionally, before calling the corresponding dynamic view code package, the method further includes:
[0012] Determine the dynamic view position and dynamic view elements corresponding to the view mix layout;
[0013] The dynamic view platform is called to generate a dynamic view code package based on the dynamic view element.
[0014] Optionally, perform view rendering to generate a dynamic view, including:
[0015] Call the dynamic view container, load the dynamic view code package, parse the dynamic view code command, execute the dynamic view code command, and then render the command execution result to generate the corresponding native view element;
[0016] Insert the corresponding native view element into the dynamic view position to generate a dynamic view.
[0017] Optionally, generate a native view, including:
[0018] Determine the native view position corresponding to the view mixed layout;
[0019] Load native view elements to the native view position to generate a native view.
[0020] Optionally, determining a target interactive view from the dynamic view and the native view according to the interface identifier includes:
[0021] In response to determining that the interface identifier corresponds to a native interface, determining each native view corresponding to the native interface as a target interaction view;
[0022] 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 interaction views;
[0023] In response to determining that the interface identifier corresponds to the dynamic environment interface and the bridge interface, determining the dynamic view corresponding to the dynamic environment interface as the target interaction view;
[0024] In response to determining that the interface identifier corresponds to the routing interface, the dynamic view corresponding to the routing interface is determined as the target interaction view.
[0025] Optionally, calling the interface corresponding to the interface identifier to interact between target interaction views includes:
[0026] In response to determining that the interface identifier corresponds to the native interface and the dynamic environment interface, the dynamic environment interface is called to write the corresponding target dynamic view method into the dynamic environment, and then the dynamic view bridge is called to convert the target dynamic view method into a native method, so that the native view corresponding to the native interface can call it through the native interface.
[0027] Optionally, calling the interface corresponding to the interface identifier to interact between target interaction views includes:
[0028] In response to determining that the interface identifier corresponds to the native interface and the dynamic environment interface, the target native view is determined based on the native interface, and then the dynamic view bridge is called to write the method of the target native view into the dynamic environment for calling by the target dynamic view corresponding to the dynamic environment interface.
[0029] Optionally, calling the interface corresponding to the interface identifier to interact between target interaction views includes:
[0030] In response to determining that the interface identifier corresponds to the dynamic environment interface and the bridge interface, the method of the target dynamic view corresponding to the dynamic environment interface is written into the dynamic environment, and then the dynamic view bridge is called to convert it into a native method, and then the dynamic view bridge is called again to write the native method into the dynamic environment for secondary bridging, so that it can be called by other target dynamic views corresponding to the dynamic environment interface.
[0031] Optionally, calling the interface corresponding to the interface identifier to interact between target interaction views includes:
[0032] In response to determining that the interface identifier corresponds to the routing interface, adding the target dynamic view corresponding to the routing interface to the dynamic view container, and writing the routing method corresponding to the routing interface in the dynamic environment;
[0033] Call the routing interface to obtain the behavior and parameters corresponding to the routing method, parse the behavior and parameters, and then execute the interaction between the target dynamic views based on the parsing results.
[0034] In addition, the present application also provides a view interaction device, including:
[0035] a receiving unit configured to receive a view interaction request and determine a view mixing layout according to the view interaction request;
[0036] The dynamic view rendering unit is configured to call the corresponding dynamic view code package according to the view mix layout to perform view rendering and generate a dynamic view;
[0037] a native view generation unit configured to determine a page corresponding to the dynamic view, call native view elements, and generate a native view on the page based on the view mixin layout;
[0038] The view interaction unit is configured to determine the interface identifier corresponding to the view interaction request, determine the target interaction view from the dynamic view and the native view according to the interface identifier, call the interface corresponding to the interface identifier to interact between the target interaction views, and then update the dynamic view and the native view.
[0039] Optionally, the dynamic view rendering unit is further configured to:
[0040] Determine the dynamic view position and dynamic view elements corresponding to the view mix layout;
[0041] The dynamic view platform is called to generate a dynamic view code package based on the dynamic view element.
[0042] Optionally, the dynamic view rendering unit is further configured to:
[0043] Call the dynamic view container, load the dynamic view code package, parse the dynamic view code command, execute the dynamic view code command, and then render the command execution result to generate the corresponding native view element;
[0044] Insert the corresponding native view element into the dynamic view position to generate a dynamic view.
[0045] Optionally, the native view generation unit is further configured to:
[0046] Determine the native view position corresponding to the view mixed layout;
[0047] Load native view elements to the native view position to generate a native view.
[0048] Optionally, the view interaction unit is further configured to:
[0049] In response to determining that the interface identifier corresponds to a native interface, determining each native view corresponding to the native interface as a target interaction view;
[0050] 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 interaction views;
[0051] In response to determining that the interface identifier corresponds to the dynamic environment interface and the bridge interface, determining the dynamic view corresponding to the dynamic environment interface as the target interaction view;
[0052] In response to determining that the interface identifier corresponds to the routing interface, the dynamic view corresponding to the routing interface is determined as the target interaction view.
[0053] Optionally, the view interaction unit is further configured to:
[0054] In response to determining that the interface identifier corresponds to the native interface and the dynamic environment interface, the dynamic environment interface is called to write the corresponding target dynamic view method into the dynamic environment, and then the dynamic view bridge is called to convert the target dynamic view method into a native method, so that the native view corresponding to the native interface can call it through the native interface.
[0055] Optionally, the view interaction unit is further configured to:
[0056] In response to determining that the interface identifier corresponds to the native interface and the dynamic environment interface, the target native view is determined based on the native interface, and then the dynamic view bridge is called to write the method of the target native view into the dynamic environment for calling by the target dynamic view corresponding to the dynamic environment interface.
[0057] Optionally, the view interaction unit is further configured to:
[0058] In response to determining that the interface identifier corresponds to the dynamic environment interface and the bridge interface, the method of the target dynamic view corresponding to the dynamic environment interface is written into the dynamic environment, and then the dynamic view bridge is called to convert it into a native method, and then the dynamic view bridge is called again to write the native method into the dynamic environment for secondary bridging, so that it can be called by other target dynamic views corresponding to the dynamic environment interface.
[0059] Optionally, the view interaction unit is further configured to:
[0060] In response to determining that the interface identifier corresponds to the routing interface, adding the target dynamic view corresponding to the routing interface to the dynamic view container, and writing the routing method corresponding to the routing interface in the dynamic environment;
[0061] Call the routing interface to obtain the behavior and parameters corresponding to the routing method, parse the behavior and parameters, and then execute the interaction between the target dynamic views based on the parsing results.
[0062] 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, when the one or more programs are executed by one or more processors, the one or more processors implement the view interaction method as described above.
[0063] In addition, the present application also provides a computer-readable medium on which a computer program is stored, and when the program is executed by a processor, the view interaction method as described above is implemented.
[0064] One embodiment of the above invention has the following advantages or beneficial effects: the present application receives a view interaction request, determines a view mixed layout according to the view interaction request; calls the corresponding dynamic view code package according to the view mixed layout to render the view and generate a dynamic view; determines the page corresponding to the dynamic view, calls the native view element, and generates a native view on the page based on the view mixed layout; determines the interface identifier corresponding to the view interaction request, determines the target interaction view from the dynamic view and the native view according to the interface identifier, calls the interface corresponding to the interface identifier to interact between the target interaction views, and then updates the dynamic view and the native view. This realizes the cross-end interaction between native views, between dynamic views, between native views and dynamic views in the same page, and the dynamic update after view interaction in the same page.
[0065] The further effects of the above-mentioned non-conventional optional manner will be described below in conjunction with specific embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0066] The accompanying drawings are provided to facilitate a better understanding of the present application and do not constitute an undue limitation on the present application.
[0067] Figure 1 is a schematic diagram of the main process of the view interaction method according to the first embodiment of the present application;
[0068] Figure 2 is a schematic diagram of the main process of the view interaction method according to the second embodiment of the present application;
[0069] Figure 3 is a schematic diagram of an application scenario of the view interaction method according to the third embodiment of the present application;
[0070] Figure 4 is a schematic diagram of execution logic in a dynamic view container in an embodiment of the present application;
[0071] Figure 5 This is a schematic diagram of the execution logic of the dynamic view container in an embodiment of the present application;
[0072] Figure 6a 、 Figure 6b They are respectively a schematic diagram of the registration and calling logic of the dynamic view router in an embodiment of the present application;
[0073] Figure 7 is a schematic diagram of the main units of the view interaction device according to an embodiment of the present application;
[0074] Figure 8 is an exemplary system architecture diagram to which embodiments of the present application may be applied;
[0075] Figure 9 It is a structural diagram of a computer system of a terminal device or server suitable for implementing an embodiment of the present application. DETAILED DESCRIPTION
[0076] The following description of exemplary embodiments of the present application is made in conjunction with the accompanying drawings, including various details of the embodiments of the present application to facilitate understanding. These details should be considered as merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present application. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.
[0077] Figure 1 is a schematic diagram of the main process of the view interaction method according to the first embodiment of the present application, such as Figure 1 As shown, the view interaction methods include:
[0078] Step S101: receiving a view interaction request, and determining a view mixing layout according to the view interaction request.
[0079] In this embodiment, the execution entity of the view interaction method (for example, a server) can receive a view interaction request sent by a user through a terminal device via a wired connection or a wireless connection. The view interaction request can be a request for interaction between native views on the same page, a request for interaction between a native view and a dynamic view on the same page, or a request for interaction between dynamic views on the same page. This embodiment of the application does not specifically limit the type of view interaction request.
[0080] After receiving the view interaction request, the execution entity can call the page configuration platform to configure the native view and dynamic view in the page according to the configuration parameters carried in the view interaction request. Specifically, the execution entity can obtain the configuration parameters carried in the view interaction request, and then determine the configuration position information of the native view and the configuration position information of the dynamic view in the page, as well as the page element information in the native view and the page element information in the dynamic view from the configuration parameters. The page element information may include the size of the page element and the acquisition address corresponding to the page element, etc. The embodiment of the present application does not limit the specific content contained in the page element information. 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. The generated configuration file is provided to the end side for acquisition and loading.
[0081] The execution entity may determine the mixed view 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.
[0082] Step S102: According to the view mixed layout, the corresponding dynamic view code package is called to perform view rendering to generate a dynamic view.
[0083] The execution entity can preset the view container based on the view mix layout. Specifically, when presetting the native view, the execution entity can directly load the native view elements into the native view layout position of the page. Native view elements, such as a button, a list, etc. When presetting the dynamic view container, the execution entity can download the dynamic view code package that has been developed, debugged, compiled, packaged, and released from the dynamic view platform to the local end-side (end-side refers to PC, Mac, iOS, Android, etc.). If the local end-side already has the same version of the dynamic view code package, the execution entity can directly load the dynamic view code package and then render the view at the layout position corresponding to the dynamic view to generate the final dynamic view. Specifically, the execution entity can start the dynamic view environment, load the dynamic view code package, and perform analysis, code command execution, and rendering processing to convert it into native view elements. The execution entity can then insert the rendered native view elements into the preset layout position of the dynamic view container to complete the dynamic view presentation. Specifically, the execution entity can call the end-side page layout configuration to preset the native view and preset the dynamic view container. The client-side page layout configuration retrieves the configuration from the page configuration platform, parses the layout of native and dynamic views, and pre-loads the dynamic view container. The dynamic view container loads, parses, and executes the dynamic view code package, ultimately rendering the view and implementing page interaction. The client-side refers to the terminal where the current page is located, such as PC, Mac, iOS, and Android. Pre-loading involves retrieving the configuration from the page configuration platform, parsing, and identifying the dynamic view, and then adding the dynamic view container to the corresponding layout location.
[0084] Step S103 : determining the page corresponding to the dynamic view, calling the native view element, and generating the native view on the page based on the view mixed layout.
[0085] Specifically, generating a native view includes: determining a native view position corresponding to the view mix layout; loading native view elements into the native view position to generate the native view. A native view element can be, for example, a button or a list. The present embodiment does not specifically limit the content of the native view element.
[0086] Step S104: determine the interface identifier corresponding to the view interaction request, determine the target interaction view from the dynamic view and the native view according to the interface identifier, call the interface corresponding to the interface identifier to interact between the target interaction views, and then update the dynamic view and the native view.
[0087] View interaction can be divided into three forms: interaction between native views, interaction between native views and dynamic views, and interaction between dynamic views.
[0088] Specifically, the target interactive view is determined from the dynamic view and the native view according to the interface identifier, including:
[0089] In response to determining that the interface identifier corresponds to the native interface, each native view corresponding to the native interface is determined as a target interaction view.
[0090] Specifically, when the execution subject determines that the interface identifier corresponds to the native interface, for example, the interface identifier is YS, it can be determined that the interface identifier corresponds to the native interface, and the target interactive view can be two or more native views on the page. Figure 3 This is a schematic diagram of the application scenario of the embodiment of the present application. Figure 3 As shown in 3071, direct interaction between native views can be performed through the native interface provided by the terminal side. The native interface can store standard view methods provided by the system or custom methods implemented by view controls.
[0091] In response to determining that the interface identifier corresponds to the native interface and the dynamic environment interface, a native view corresponding to the native interface and a dynamic view corresponding to the dynamic environment interface are determined as target interaction views.
[0092] Specifically, when the executing entity determines that the interface identifier includes YS and HJ, it can be determined that the interface identifier corresponds to the native interface and the dynamic environment interface. Then, the executing entity can use the native view corresponding to the native interface and the dynamic view corresponding to the dynamic environment interface as the target interaction view based on the pre-set correspondence between the interface and the target interaction view. This application does not limit the specific representation of the interface identifier corresponding to the native interface and the dynamic environment interface.
[0093] Specifically, calling the interface corresponding to the interface identifier to interact with each target interaction view includes:
[0094] In response to determining that the interface identifier corresponds to the native interface and the dynamic environment interface, the dynamic environment interface is called to write the corresponding target dynamic view method into the dynamic environment, and then the dynamic view bridge is called to convert the target dynamic view method into a native method, so that the native view corresponding to the native interface can call it through the native interface. For example, Figure 3 As shown in 3072, the method for a native view to call a dynamic view is as follows: the dynamic view exports the method to the dynamic environment by calling the dynamic environment interface. The dynamic view bridge then converts the method into a native method, which the native view can then call by calling the native interface. The dynamic view calls the method of the native view: the native view registers the method with the dynamic environment through the native interface and the dynamic view bridge, which the dynamic view can then call.
[0095] Specifically, calling the interface corresponding to the interface identifier to interact between target interaction views also includes:
[0096] In response to determining that the interface identifier corresponds to the native interface and the dynamic environment interface, the target native view is determined based on the native interface, and then the dynamic view bridge is called to write the method of the target native view into the dynamic environment for calling by the target dynamic view corresponding to the dynamic environment interface.
[0097] In response to determining that the interface identifier corresponds to the dynamic environment interface and the bridge interface, the dynamic view corresponding to the dynamic environment interface is determined as the target interaction view.
[0098] Specifically, when the execution subject determines that the interface identifier includes HJ and QJ, it can be determined that the interface identifier corresponds to the dynamic environment interface and the bridge interface, and then the execution subject can determine the corresponding two or more dynamic views according to the dynamic environment interface and use them as target interaction views.
[0099] Specifically, calling the interface corresponding to the interface identifier to interact with each target interaction view includes:
[0100] In response to determining that the interface identifier corresponds to the dynamic environment interface and the bridge interface, the method of the target dynamic view corresponding to the dynamic environment interface is written into the dynamic environment, and then the dynamic view bridge is called to convert it into a native method, and then the dynamic view bridge is called again to write the native method into the dynamic environment for secondary bridging, so that it can be called by other target dynamic views corresponding to the dynamic environment interface. For example, the bridge interface can be an interface on the dynamic view bridge, such as Figure 3 As shown in 3073, the execution subject can export the method corresponding to the dynamic view to the dynamic environment through the dynamic environment interface, and then convert it into a native method by the dynamic view bridge. The native method then registers the method by name in the dynamic environment through the dynamic view bridge for secondary bridging, and provides it to another dynamic view for calling. During the calling process, the API unique registration mark is used to prevent self-loop calling. The native method can be a method stored in the native interface. The native method refers to the functional method provided by the current view or system or customized by the R&D personnel, such as obtaining the size of the view, adding a view, etc.
[0101] In response to determining that the interface identifier corresponds to the routing interface, the dynamic view corresponding to the routing interface is determined as the target interaction view.
[0102] Specifically, calling the interface corresponding to the interface identifier to interact with each target interaction view includes:
[0103] In response to determining that the interface identifier corresponds to the routing interface, the target dynamic view corresponding to the routing interface is added to the dynamic view container, and the routing method corresponding to the routing interface is written in the dynamic environment; the routing interface is called to obtain the behavior and parameters corresponding to the routing method, the behavior and parameters are parsed, and then the interaction between the target dynamic views is executed according to the parsing results. For example, the routing interface can be an interface on the dynamic view router, such as Figure 3 As shown in 3073, when a dynamic view is added to a dynamic view container, a routing method provided to the outside is registered in the dynamic environment. The routing method is generally provided in the form of a URL. The dynamic view can directly call the URL by calling the page jump, and pass the URL behavior and parameters to the specified dynamic view through the URL router. The specified dynamic view then parses the behavior parameters and executes the specific interactive behavior.
[0104] In the embodiment of the present application, the dynamic environment interface stores the functional method developed based on the dynamic view, and provides the specific functions corresponding to the functional method. For example, whether a certain view element in the dynamic view is displayed, obtaining a certain data in the dynamic view, etc.
[0105] This embodiment receives a view interaction request, determines a view hybrid layout based on the view interaction request; calls the corresponding dynamic view code package based on the view hybrid layout to perform view rendering and generate a dynamic view; determines the page corresponding to the dynamic view, calls the native view element, and generates a native view on the page based on the view hybrid layout; determines the interface identifier corresponding to the view interaction request, determines the target interaction view from the dynamic view and the native view based on the interface identifier, calls the interface corresponding to the interface identifier to interact between the target interaction views, and then updates the dynamic view and the native view. This realizes cross-end interaction between native views, between dynamic views, between native views and dynamic views on the same page, and dynamic updates after view interaction on the same page.
[0106] Figure 2 This is a schematic diagram of the main flow of the view interaction method according to the second embodiment of the present application. Figure 2 As shown, the view interaction methods include:
[0107] Step S201: receiving a view interaction request, and determining a view mixing layout according to the view interaction request.
[0108] The principle of step S201 is similar to that of step S101 and will not be described again here.
[0109] Step S202 : determining the dynamic view position and dynamic view element corresponding to the view mixing layout.
[0110] The dynamic view position can be determined based on the position information carried in the view interaction request. For example, the carried position information can include the top, bottom, left, and right margins of the page where the dynamic view is located, and the dynamic view position is determined based on the top, bottom, left, and right margins.
[0111] Step S203: calling the dynamic view platform to generate a dynamic view code package based on the dynamic view element.
[0112] Specifically, dynamic view elements can include different view modules for building a page, such as a button or a list. After determining the dynamic view location and elements, the execution entity can call the dynamic view platform to develop, debug, compile, package, and publish the dynamic view based on the dynamic view elements and actual needs, thereby generating a dynamic view code package.
[0113] The dynamic view platform creates and generates the corresponding dynamic view code package and publishes it for synchronization to the page configuration platform and distribution to the terminal as needed.
[0114] Step S204 , calling the dynamic view container, loading the dynamic view code package, parsing to obtain the dynamic view code command, executing the dynamic view code command, and rendering the command execution result to generate the corresponding native view element.
[0115] Step S205: insert the corresponding native view element into the dynamic view position to generate a dynamic view.
[0116] Specifically, the client initiates the dynamic view environment, loads the dynamic package, parses it, executes code commands, and renders it into native view elements. The rendered native view elements are inserted into the preset layout position of the dynamic container, completing the view presentation. This enables cross-client interaction and view updates within the same page.
[0117] Specifically, the dynamic view container is a dynamic view collection device that integrates dynamic view rendering and interaction. It inserts dynamic view rendering into native pages, supports native hybrid rendering capabilities, and supports interaction between native views and dynamic views through dynamic view bridges and dynamic view routers. Figure 4 As shown, the steps of dynamic view rendering can be: dynamic view download - start dynamic view environment - dynamic view parsing - dynamic view execution - dynamic view rendering - insert native page. Figure 4 Dynamic view interaction and Figure 5As shown, when executing the dynamic view code, the dynamic view code is loaded, the dynamic view code description is injected, and then the dynamic native component is configured and the dynamic code executor is installed, and then the dynamic native component is initialized, and finally the corresponding method of the native component is executed. For example, the steps of dynamic view interaction can be: calling the dynamic view code through the dynamic view bridge, and then loading it into the dynamic environment. When executing the dynamic view code, the corresponding dynamic code description is injected, the description is parsed, the native component is configured and loaded, and the native component is initialized when the code is executed, and the corresponding method of the native component is called and executed, and then the dynamic view and native view are updated according to the execution result.
[0118] Dynamic code description:
[0119] Used to describe the mapping relationship and specific behavior between dynamic code methods and native component methods
[0120] The following example illustrates
[0121]
[0122] The dynamic view router provides the ability for dynamic views to register routing methods with the routing dispatch center, and to resolve and find the corresponding dynamic view when other dynamic views call it, and to execute the dynamic view method. Figure 6a As shown in the figure, it is a schematic diagram of the registration method of the dynamic view router. The execution subject can call the dynamic view container 1 to register the routing method to the routing scheduling center. For example, when registering, the execution subject calls the dynamic view container 1 to register the moduleConfig to the routing scheduling center. The routing scheduling center caches the component ID and the corresponding method list for calling, such as moduleI=1 and methods=["jumpUlr"]. Figure 6bThe figure below shows a schematic diagram of the dynamic view router's calling method. The executing entity can call dynamic view container 2 to find the called routing method in the routing dispatch center, then parse the routing address corresponding to the routing method. Then, it calls dynamic view container 1 to resolve the routing implementation behavior and parameters based on the routing address and execute the corresponding method. For example, when calling, the executing entity calls dynamic view container 2 to parse the specific component ID (moduleID) and method methods based on the moduleConfig in the URL, search the cached data in the routing dispatch center, and then call. For example, the following URL: open.dynamic: / / openModule? moduleConfig = {\"moduleID\":1,\"methods\":{\"jumpURL\":{\"type\":1,\"methodID\":1,\"param\":{\"URL\":\"https: / / xxx.xx / jump / test.html\"}}}}
[0123] Step S206 , determining the page corresponding to the dynamic view, calling the native view element, and generating a native view on the page based on the view mixed layout.
[0124] Step S207 , determining the interface identifier corresponding to the view interaction request, determining the target interaction view from the dynamic view and the native view according to the interface identifier, calling the interface corresponding to the interface identifier to interact between the target interaction views, and then updating the dynamic view and the native view.
[0125] The principles of steps S206 to S207 are similar to those of steps S103 to S104 and are not described in detail here.
[0126] URL: Uniform Resource Locator (URL) is a method used to specify the location of information on the World Wide Web service program of the Internet.
[0127] In addition, as another implementation of the embodiments of this application, the interaction between views can be other interaction methods, such as by establishing a behavior server, initiating behavior requests to the behavior server via the network within the view control, and then the server pushes the behavior to the specified view control for behavior processing. The entire interaction process is relayed through the network server. This application does not specifically limit the interaction method between views.
[0128] Figure 3: is a schematic diagram of an application scenario of the view interaction method according to the third embodiment of the present application. The view interaction method of the embodiment of the present application can be applied to the scene of interaction between views in a cross-end mixed page. Figure 3 As shown, server 302 (server 302 is the executive body of the embodiment of the present application) receives a view interaction request 301, determines a view mixed layout 303 according to the view interaction request 301, and specifically calls page configuration platform B to configure page A, specifically to configure native views and dynamic views in page A, thereby obtaining a view mixed layout 303 (the embodiment of the present application does not specifically limit the arrangement positions of dynamic views and native views in the view mixed layout). Server 302 calls the corresponding dynamic view code package 304 according to the view mixed layout 303 (wherein the dynamic view code package can be obtained by server 302 calling dynamic view platform D, performing dynamic view development, dynamic view debugging, dynamic view compilation, dynamic view packaging, and publishing dynamic views to the dynamic view management background) to perform view rendering and generate dynamic views a and c. Server 302 determines page A corresponding to dynamic views a and c, and calls native view element 305 to generate native views b, d, and e on page A based on the view mixed layout 303. The server 302 determines the interface identifier 306 corresponding to the view interaction request 301, and determines the target interaction view 307 from the dynamic views a, c and the native views b, d, and e according to the interface identifier 306, and calls the interface corresponding to the interface identifier 306, such as the native interface 3061, the dynamic environment interface 3062, the dynamic view bridge 3063, or the dynamic view router 3064 to interact between the target interaction views 307 (for example, the native view b interacts with the native view e through the native interface 3061; the native view d interacts with the dynamic view c through the native interface 3061, the dynamic view bridge 3063, and the dynamic environment interface 308; the dynamic view c can interact with the dynamic view a through the dynamic environment interface 308, the dynamic view bridge 3063, and the native interface 3061, or the dynamic view c can interact with the dynamic view a through the dynamic view router 3064 based on the routing method 309), thereby updating the dynamic views a, c and the native views b, d, and e in page A.
[0129] The embodiment of the present application adopts a cross-end mixed page fusion method. First, the page configuration and view container preset layout are used. The dynamic view container is dynamically updated and rendered into a native element and inserted into the corresponding layout to complete the rendering. Then, a combination of three methods, native interface, dynamic view bridge, and dynamic view router is used to realize the interaction between native views, between dynamic views, and between native views and dynamic views, so as to realize cross-end dynamic update (partial or full page) in the same page.
[0130] Figure 7Schematic diagram of the main units of the view interaction device according to an embodiment of the present application. Figure 7 As shown, 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 .
[0131] The receiving unit 701 is configured to receive a view interaction request and determine a view mixing layout according to the view interaction request.
[0132] The dynamic view rendering unit 702 is configured to call the corresponding dynamic view code package according to the view mix layout to perform view rendering to generate a dynamic view.
[0133] The native view generating unit 703 is configured to determine a page corresponding to the dynamic view, call the native view element, and generate a native view on the page based on the view mixin layout.
[0134] The view interaction unit 704 is configured to determine the interface identifier corresponding to the view interaction request, determine the target interaction view from the dynamic view and the native view according to the interface identifier, call the interface corresponding to the interface identifier to interact between the target interaction views, and then update the dynamic view and the native view.
[0135] In some embodiments, the dynamic view rendering unit 702 is further configured to: determine a dynamic view position and a dynamic view element corresponding to the view mixin layout; and call a dynamic view platform to generate a dynamic view code package based on the dynamic view element.
[0136] In some embodiments, the dynamic view rendering unit 702 is further configured to: call the dynamic view container, load the dynamic view code package, and then parse to obtain the dynamic view code command, execute the dynamic view code command, and then render the command execution result to generate the corresponding native view element; insert the corresponding native view element into the dynamic view position to generate a dynamic view.
[0137] In some embodiments, the native view generation unit 703 is further configured to: determine a native view position corresponding to the view mixing layout; load native view elements to the native view position, and generate a native view.
[0138] 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, determine the native views corresponding to the native interface as the target interaction views; in response to determining that the interface identifier corresponds to the native interface and the dynamic environment interface, determine the native view corresponding to the native interface and the dynamic view corresponding to the dynamic environment interface as the target interaction views; in response to determining that the interface identifier corresponds to the dynamic environment interface and the bridging interface, determine the dynamic view corresponding to the dynamic environment interface as the target interaction view; in response to determining that the interface identifier corresponds to the routing interface, determine the dynamic view corresponding to the routing interface as the target interaction view.
[0139] 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 and the dynamic environment interface, call the dynamic environment interface to write the corresponding target dynamic view method into the dynamic environment, and then call the dynamic view bridge to convert the target dynamic view method into a native method, so that the native view corresponding to the native interface can call it through the native interface.
[0140] 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 and the dynamic environment interface, determine the target native view based on the native interface, and then call the dynamic view bridge to write the method of the target native view into the dynamic environment for the target dynamic view corresponding to the dynamic environment interface to call.
[0141] In some embodiments, the view interaction unit 704 is further configured to: in response to determining that the interface identifier corresponds to the dynamic environment interface and the bridge interface, write the method of the target dynamic view corresponding to the dynamic environment interface into the dynamic environment, and then call the dynamic view bridge to convert it into a native method, and then call the dynamic view bridge again to write the native method into the dynamic environment for secondary bridging, so that other target dynamic views corresponding to the dynamic environment interface can call it.
[0142] In some embodiments, the view interaction unit 704 is further configured to: in response to determining that the interface identifier corresponds to the routing interface, add the target dynamic view corresponding to the routing interface to the dynamic view container, and write the routing method corresponding to the routing interface in the dynamic environment; call the routing interface to obtain the behavior and parameters corresponding to the routing method, parse the behavior and parameters, and then execute the interaction between the target dynamic views according to the parsing results.
[0143] It should be noted that the view interaction method and the view interaction device of the present application have a corresponding relationship in terms of specific implementation content, so the repeated content will not be described again.
[0144] Figure 8 An exemplary system architecture 800 is shown to which the view interaction method or view interaction apparatus according to the embodiments of the present application can be applied.
[0145] like Figure 8 As shown, system architecture 800 may include terminal devices 801, 802, 803, a network 804, and a server 805. Network 804 is used to provide a medium for communication links between terminal devices 801, 802, 803 and server 805. Network 804 may include various connection types, such as wired or wireless communication links or fiber optic cables.
[0146] Users can use terminal devices 801, 802, and 803 to interact with server 805 via network 804 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 801, 802, and 803, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc. (only as examples).
[0147] The terminal devices 801 , 802 , and 803 may be various electronic devices that have a view interaction processing screen and support web browsing, including but not limited to smart phones, tablet computers, laptop computers, desktop computers, and the like.
[0148] Server 805 can be a server that provides various services, such as a background management server that provides support for view interaction requests submitted by users using terminal devices 801, 802, and 803 (only as an example). The background management server can receive view interaction requests, determine the view mixed layout according to the view interaction request; call the corresponding dynamic view code package according to the view mixed layout to perform view rendering and generate a dynamic view; determine the page corresponding to the dynamic view, call the native view element, and generate a native view on the page based on the view mixed layout; determine the interface identifier corresponding to the view interaction request, and determine the target interaction view from the dynamic view and the native view according to the interface identifier, call the interface corresponding to the interface identifier to interact between each target interaction view, and then update the dynamic view and the native view. Realize the cross-end interaction between native views, between dynamic views, between native views and dynamic views in the same page, and the dynamic update after view interaction in the same page.
[0149] It should be noted that the view interaction method provided in the embodiment of the present application is generally executed by the server 805 , and accordingly, the view interaction device is generally set in the server 805 .
[0150] It should be understood that Figure 8 The number of terminal devices, networks and servers in the embodiment is merely illustrative. Any number of terminal devices, networks and servers may be provided as required.
[0151] Reference below Figure 9, which shows a structural diagram of a computer system 900 of a terminal device suitable for implementing an embodiment of the present application. Figure 9 The terminal device shown is merely an example and should not limit the functions and scope of use of the embodiments of the present application.
[0152] like Figure 9 As shown, the computer system 900 includes a central processing unit (CPU) 901, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 902 or a program loaded from a storage unit 908 into a random access memory (RAM) 903. Various programs and data required for the operation of the computer system 900 are also stored in the RAM 903. The CPU 901, ROM 902, and RAM 903 are connected to each other via a bus 904. An input / output (I / O) interface 905 is also connected to the bus 904.
[0153] The following components are connected to the I / O interface 905: an input section 906 including a keyboard, a mouse, and the like; an output section 907 including displays such as a cathode ray tube (CRT), a liquid crystal display (LCD), and a speaker; a storage section 908 including a hard disk and the like; and a communication section 909 including a network interface card such as a LAN card or a modem. The communication section 909 performs communication processing via a network such as the Internet. A drive 910 is also connected to the I / O interface 905 as needed. Removable media 911, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, and the like, are installed in the drive 910 as needed, so that computer programs read therefrom can be installed into the storage section 908 as needed.
[0154] In particular, according to the embodiments disclosed in the present application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, the embodiments disclosed in the present application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program comprising program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network via the communication section 909, and / or installed from a removable medium 911. When the computer program is executed by the central processing unit (CPU) 901, the above-mentioned functions defined in the system of the present application are executed.
[0155] It should be noted that the computer-readable medium described in this application can be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two. Computer-readable storage media can include, for example, but are not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or devices, or any combination of the above. More specific examples of computer-readable storage media can include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, 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 disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this application, a computer-readable storage medium can be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, device, or device. In this application, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, which carries computer-readable program code. This propagated data signal can take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in conjunction with an instruction execution system, apparatus, or device. Program code embodied on a computer-readable medium may be transmitted using any suitable medium, including but not limited to wireless, wireline, optical fiber cable, RF, or any suitable combination thereof.
[0156] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, program segment, or a part of code, and the above-mentioned module, program segment, or a part of code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in an order different from that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of the boxes in the block diagram or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0157] The units involved in the embodiments described in this application can be implemented by software or hardware. The units described can also be set in a processor. For example, it can be described as: a processor includes a receiving unit, a dynamic view rendering unit, a native view generation unit, and a view interaction unit. In some cases, the names of these units do not constitute limitations on the units themselves.
[0158] As another aspect, the present application also provides a computer-readable medium, which may be included in the device described in the above embodiment; or it may exist independently and not be assembled into the device. The above-mentioned computer-readable medium carries one or more programs. When the above-mentioned one or more programs are executed by a device, the device receives a view interaction request, determines a view mixed layout according to the view interaction request; calls the corresponding dynamic view code package according to the view mixed layout to perform view rendering and generate a dynamic view; determines the page corresponding to the dynamic view, calls the native view element, and generates a native view on the page based on the view mixed layout; determines the interface identifier corresponding to the view interaction request, determines the target interactive view from the dynamic view and the native view according to the interface identifier, calls the interface corresponding to the interface identifier to interact between the target interactive views, and then updates the dynamic view and the native view.
[0159] According to the technical solution of the embodiment of the present application, cross-end interaction between native views, dynamic views, and native views and dynamic views is achieved on the same page, as well as dynamic update after view interaction on the same page.
[0160] The above specific embodiments do not constitute a limitation on the scope of protection of this application. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions may occur depending on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this application shall be included within the scope of protection of this application.
Claims
1. A view interaction method, characterized in that: include: Receive a view interaction request, and determine a view mixed layout according to the view interaction request, wherein the view interaction request includes a request for interaction between a native view and a dynamic view in the same page; According to the view mixed layout, calling the corresponding dynamic view code package to perform view rendering to generate a dynamic view; Determine a page corresponding to the dynamic view, call a native view element, and generate a native view on the page based on the view mix layout; 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 thereby updating the dynamic view and the native view; The determining of 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 and the dynamic environment interface, determining the target native view corresponding to the native interface and the target dynamic view corresponding to the dynamic environment interface as the target interactive view; and calling the interface corresponding to the interface identifier to interact between the target interactive views, including: calling the dynamic environment interface to write the method of the corresponding target dynamic view into the dynamic environment, and then calling the dynamic view bridge to convert the method of the target dynamic view into a native method, so that the target native view corresponding to the native interface can call it through the native interface; determining the target native view based on the native interface, and then calling the dynamic view bridge to write the method of the target native view into the dynamic environment, so that the target dynamic view corresponding to the dynamic environment interface can call it.
2. The method according to claim 1, characterized in that Before calling the corresponding dynamic view code package, the method further includes: Determining a dynamic view position and a dynamic view element corresponding to the view mix layout; The dynamic view platform is called to generate a dynamic view code package based on the dynamic view element.
3. The method according to claim 2, characterized in that The rendering of the view to generate a dynamic view includes: Calling the dynamic view container, loading the dynamic view code package, parsing to obtain a dynamic view code command, executing the dynamic view code command, and rendering the command execution result to generate a corresponding native view element; Inserting the corresponding native view element into the dynamic view position to generate a dynamic view.
4. The method according to claim 1, wherein Generating the native view includes: Determine the native view position corresponding to the view mixed layout; Load the native view element to the native view position to generate a native view.
5. The method according to claim 1, wherein The determining a 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 a native interface, determining each target native view corresponding to the native interface as a target interaction view; In response to determining that the interface identifier corresponds to a dynamic environment interface and a bridge interface, determining that a target dynamic view corresponding to the dynamic environment interface is a target interaction view; In response to determining that the interface identifier corresponds to a routing interface, the target dynamic view corresponding to the routing interface is determined to be a target interactive view.
6. The method according to claim 5, characterized in that The calling of the interface corresponding to the interface identifier to perform interaction between the target interaction views includes: In response to determining that the interface identifier corresponds to a dynamic environment interface and a bridge interface, the method of the target dynamic view corresponding to the dynamic environment interface is written into the dynamic environment, and then the dynamic view bridge is called to convert it into a native method, and then the dynamic view bridge is called again to write the native method into the dynamic environment for secondary bridging, so that it can be called by other target dynamic views corresponding to the dynamic environment interface.
7. The method according to claim 5, characterized in that The calling of the interface corresponding to the interface identifier to perform interaction between the target interaction views includes: In response to determining that the interface identifier corresponds to a routing interface, adding a target dynamic view corresponding to the routing interface to a dynamic view container, and writing a routing method corresponding to the routing interface into a dynamic environment; The routing interface is called to obtain the behavior and parameters corresponding to the routing method, the behavior and parameters are parsed, and then the interaction between the target dynamic views is executed according to the parsing result.
8. A view interaction device, characterized in that: include: a receiving unit configured to receive a view interaction request and determine a view mixed layout according to the view interaction request, wherein the view interaction request includes a request for interaction between a native view and a dynamic view in the same page; A dynamic view rendering unit is configured to call a corresponding dynamic view code package according to the view mix layout to perform view rendering and generate a dynamic view; a native view generating unit configured to determine a page corresponding to the dynamic view, call a native view element, and generate a native view on the page based on the view mixin layout; a view interaction unit 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 thereby update the dynamic view and the native view; The determining of 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 and the dynamic environment interface, determining the target native view corresponding to the native interface and the target dynamic view corresponding to the dynamic environment interface as the target interactive view; and calling the interface corresponding to the interface identifier to interact between the target interactive views, including: calling the dynamic environment interface to write the method of the corresponding target dynamic view into the dynamic environment, and then calling the dynamic view bridge to convert the method of the target dynamic view into a native method, so that the target native view corresponding to the native interface can call it through the native interface; determining the target native view based on the native interface, and then calling the dynamic view bridge to write the method of the target native view into the dynamic environment, so that the target dynamic view corresponding to the dynamic environment interface can call it.
9. A view interactive electronic device, characterized in that: include: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 7.
10. A computer-readable medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Page rendering method and device, electronic equipment and computer readable storage medium
CN111273985A