View processing method, device, electronic device and computer storage medium

By acquiring and overlaying the native view and web view WebView of the target client, the problem of high maintenance costs and poor user experience caused by frequent client updates is solved, and users can experience new features without re-downloading a new version of the client. Effect.

CN111045758BActive Publication Date: 2025-01-21BEIJING MINJING HEFENG TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN201811192075.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2018-10-12
Publication Date
2025-01-21
Estimated Expiration
2038-10-12

AI Technical Summary

Technical Problem

In the prior art, frequent client updates lead to high development and maintenance costs and long update cycles. Users need to download a new version of the client to experience the new functions, resulting in poor user experience and large traffic consumption.

Method used

By receiving the startup request of the target client, the views including the native view and the web view WebView are obtained, and overlay processing is performed to resolve the display conflict and realize resource and function sharing. Users can experience the new features without re-downloading the new version of the client.

Benefits of technology

It improves the user experience, reduces the traffic consumed by users due to client updates, and reduces development and maintenance costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111045758B_ABST
    Figure CN111045758B_ABST
Patent Text Reader

Abstract

The present application relates to the field of computer software technology, and discloses a view processing method, device, electronic device, and computer storage medium, wherein the view processing method includes: upon receiving a start request for a target client, obtaining the view of the target client, the view includes a native view and a web page view WebView corresponding to the target client obtained from a server, the native view being a view inherent in the target client; then loading the obtained view and displaying it. The method of the embodiment of the present application can implement the basic functions of the target client by obtaining the inherent view in the target client, and can also implement the new functions of the target client by obtaining the WebView corresponding to the target client from the server, so that the user can experience the new functions in the client without re-downloading the new version of the client, which greatly improves the user experience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer software technology, and in particular to a view processing method, device, electronic device and computer storage medium. Background Art

[0002] In the prior art, with the popularization of terminal devices, such as smart phones, tablet computers, mobile terminals and other devices, more and more clients are running on mobile terminals. The emergence of a large number of clients allows users to experience the convenience brought by different clients, but also brings certain troubles to users. For example, users need to constantly update the client version.

[0003] Moreover, with the continuous development and updating of technology, the functions of the client are becoming more and more powerful. R&D personnel will also expand some functions based on the existing client. For example, the existing version of the client (such as client version 1.0) supports 5 functions. When the R&D personnel have newly developed 3 functions and are preparing to integrate the newly developed 3 functions into the original client, this can only be achieved by upgrading the client version (such as upgrading client version 1.0 to client version 1.1), that is, the client version needs to be re-released. For example, first develop a 1.1 version Android client for the Android system and a 1.1 version IOS client for the IOS system, and then submit the 1.1 version IOS client to the Apple App Store for review. After the review is passed, users can download the 1.1 version IOS client in the Apple App Store, and also release the 1.1 version Android client to the corresponding application stores so that users can download the 1.1 version Android client.

[0004] However, this implementation method not only leads to extremely high development and maintenance costs, but also the uncertain launch time of the new version, resulting in a long update cycle. At the same time, users need to re-download the new version of the client to experience the new features in the client, which brings great inconvenience to users and leads to a poor user experience. In addition, the continuous update of the client also causes a huge consumption of user traffic. Summary of the invention

[0005] The purpose of this application is to solve at least one of the above technical defects, and the following technical solutions are proposed:

[0006] In a first aspect, a view processing method is provided, including:

[0007] When receiving a start request for a target client, obtaining a view of the target client, the view includes a native view and a web page view WebView of the target client obtained from a server, wherein the native view is a view inherent in the target client;

[0008] Load the obtained view and display it.

[0009] Specifically, before obtaining the view of the target client, the following steps are also included:

[0010] The view layer of the native view is overlaid with the view layer of the WebView obtained from the server, wherein the view layer of the WebView is overlaid on the view layer of the native view.

[0011] Furthermore, the view layer of the native view is overlaid with the view layer of the WebView obtained from the server, including:

[0012] Detect whether there is a display conflict between the native view and the view in WebView;

[0013] If a display conflict occurs, the display position of the native view is adjusted within the preset adjustment range through WebView to resolve the display conflict;

[0014] Display conflicts include any of the following situations: display positions overlap; the distance between display positions is less than the preset distance.

[0015] Furthermore, after displaying the loaded view, it also includes:

[0016] Receive a user's trigger operation on any view, and detect whether the trigger operation is a trigger operation within a hot zone;

[0017] If it is a trigger operation within the hot zone, it is determined that the trigger operation is an operation on the WebView;

[0018] If it is not a trigger operation within the hot zone, determine that the trigger operation is an operation on the native view;

[0019] Hotspots are clickable areas set in WebView through a preset application programming interface API between the target client and WebView.

[0020] Furthermore, before obtaining the view of the target client, the method further includes:

[0021] An API is established between the target client and WebView to enable resource and function sharing between the target client and WebView.

[0022] Further, after determining that the triggering operation is an operation on WebView, the method further includes:

[0023] Determine the target function object in WebView corresponding to the trigger operation;

[0024] Based on the preset function interface between WebView and the target function object, perform corresponding operations to provide corresponding functions of the target function object;

[0025] WebView includes at least one function object.

[0026] Furthermore, before providing the corresponding function to the user based on the preset function interface between the WebView and the target function object, it also includes:

[0027] Establish preset functional interfaces corresponding to WebView and various functional objects.

[0028] Furthermore, based on the preset functional interface between the WebView and the target functional object, corresponding operations are performed, including:

[0029] Load the child WebView corresponding to the preset function interface, and perform corresponding operations through the child WebView.

[0030] Furthermore, based on the preset function interface between the WebView and the target function object, after executing the corresponding operation, it also includes:

[0031] Close the preset function interface and release the resources occupied by the target function object.

[0032] In a second aspect, a view processing device is provided, including:

[0033] An acquisition module, configured to acquire a view of a target client upon receiving a start request for the target client, wherein the view includes a native view and a web page view WebView of the target client acquired from a server, wherein the native view is a view inherent in the target client;

[0034] The display module is used to load the acquired view and display it.

[0035] Specifically, it also includes a first processing module;

[0036] The first processing module is used to overlay the view layer of the native view with the view layer of the WebView obtained from the server, wherein the view layer of the WebView is overlaid on the view layer of the native view.

[0037] Further, the first processing module includes a detection submodule and an adjustment submodule;

[0038] The detection submodule is used to detect whether there is a display conflict between the native view and the view in WebView;

[0039] The adjustment submodule is used to adjust the display position of the native view within a preset adjustment range through WebView to resolve the display conflict when a display conflict occurs;

[0040] Display conflicts include any of the following situations: display positions overlap; the distance between display positions is less than the preset distance.

[0041] Furthermore, it also includes a second processing module and a first determining module;

[0042] The second processing module is used to receive a trigger operation of a user on any view, and detect whether the trigger operation is a trigger operation within a hot zone;

[0043] A first determination module is used to determine that the trigger operation is an operation on the WebView when the trigger operation is within the hot zone; and to determine that the trigger operation is an operation on the native view when the trigger operation is not within the hot zone;

[0044] Hotspots are clickable areas set in WebView through a preset application programming interface API between the target client and WebView.

[0045] Further, it also includes a first establishment module;

[0046] The first establishment module is used to establish an API between the target client and the WebView, so that resources and functions are shared between the target client and the WebView.

[0047] Furthermore, it also includes a second determination module and an execution module;

[0048] The second determination module is used to determine the target function object in the WebView corresponding to the trigger operation;

[0049] An execution module, used to perform corresponding operations based on a preset function interface between the WebView and the target function object to provide corresponding functions of the target function object;

[0050] WebView includes at least one function object.

[0051] Further, it also includes a second establishment module;

[0052] The second establishment module is used to establish preset functional interfaces corresponding to the WebView and each functional object.

[0053] Furthermore, the execution module is specifically used to load the sub-WebView corresponding to the preset functional interface, and perform corresponding operations through the sub-WebView.

[0054] Furthermore, it also includes a resource release module;

[0055] The resource release module is used to close the preset function interface and release the resources occupied by the target function object.

[0056] In a third aspect, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned view processing method when executing the program.

[0057] In a fourth aspect, a computer-readable storage medium is provided, on which a computer program is stored, and when the program is executed by a processor, the above-mentioned view processing method is implemented.

[0058] The view processing method provided in the implementation of the present application obtains the view of the target client when a start request for the target client is received. The view includes a native view and a web view WebView corresponding to the target client. The native view is a view inherent in the target client. The obtained view is then loaded and displayed. In this way, the basic functions of the target client can be realized by obtaining the view inherent in the target client, and the new functions of the target client can be realized by obtaining the WebView corresponding to the target client from the server. This allows users to experience the new functions in the client without re-downloading the new version of the client, greatly improving the user experience. At the same time, it also effectively avoids users from consuming unnecessary traffic due to continuous client updates.

[0059] Additional aspects and advantages of the present application will be partially given in the following description, which will become apparent from the following description, or will be understood through the practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0060] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:

[0061] Figure 1 This is a flowchart of a view processing method according to Embodiment 1 of the present application;

[0062] Figure 2 This is a schematic diagram of the process of processing a client view according to the first embodiment of the present application;

[0063] Figure 3 This is a basic structural diagram of a view processing device according to Embodiment 2 of the present application;

[0064] Figure 4 is a detailed structural diagram of a view processing device according to Embodiment 2 of the present application;

[0065] Figure 5 A schematic diagram of the structure of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION

[0066] The embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present application, and cannot be interpreted as limiting the present application.

[0067] It will be understood by those skilled in the art that, unless expressly stated, the singular forms "one", "said", and "the" used herein may also include plural forms. It should be further understood that the term "comprising" used in the specification of the present application refers to the presence of the features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or groups thereof. It should be understood that when we refer to an element as being "connected" or "coupled" to another element, it may be directly connected or coupled to the other element, or there may be an intermediate element. In addition, the "connection" or "coupling" used herein may include wireless connection or wireless coupling. The term "and / or" used herein includes all or any unit and all combinations of one or more associated listed items.

[0068] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.

[0069] The view processing method, device, electronic device and computer-readable storage medium provided in the present application are intended to solve the above technical problems in the prior art.

[0070] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.

[0071] Embodiment 1

[0072] The present application embodiment provides a view processing method, such as Figure 1 As shown, including:

[0073] Step S110, when a start request for a target client is received, a view of the target client is obtained, the view includes a native view and a web page view WebView of the target client obtained from a server, and the native view is a view inherent in the target client.

[0074] Specifically, a terminal device (such as a smart phone, tablet computer, etc.) can be installed with many clients that implement different functions. The user can directly start the corresponding target client in the terminal device as needed, or indirectly start the corresponding target client through other association methods, that is, the terminal device receives a start request for the target client.

[0075] Furthermore, when the terminal device receives a startup request for the target client, it can obtain the locally stored view of the target client, or it can obtain the view of the target client by sending a request to the server, wherein the view of the target client includes a native view and a web page view WebView of the target client obtained from the server, and the native view is a view inherent in the target client.

[0076] Step S120, loading the acquired view and displaying it.

[0077] Specifically, after the terminal device obtains the view of the target client, it loads the obtained view of the target client and displays it, that is, displays the loaded target client.

[0078] The view processing method provided in the embodiment of the present application obtains the view of the target client when a start request for the target client is received, and the view includes a native view and a web view WebView corresponding to the target client. The native view is a view inherent in the target client, and then the obtained view is loaded and displayed. In this way, the basic functions of the target client can be realized by obtaining the view inherent in the target client, and the new functions of the target client can be realized by obtaining the WebView corresponding to the target client from the server, so that the user can experience the new functions in the client without re-downloading the new version of the client, which greatly improves the user experience and effectively avoids the user from consuming unnecessary traffic due to continuous client updates.

[0079] The embodiment of the present application provides another possible implementation method, wherein step S100 (not marked in the figure) is included before step S110: superimposing the view layer of the native view and the view layer of the WebView, wherein the view layer of the WebView covers the view layer of the native view.

[0080] In addition, step S100 specifically includes step S1001 (not marked in the figure) and step S1002 (not marked in the figure), wherein:

[0081] Step S1001: Determine whether a display conflict occurs between the native view and the view in the WebView;

[0082] Step S1002: If a display conflict occurs, the display position of the native view is adjusted within a preset adjustment range by WebView to resolve the display conflict;

[0083] Display conflicts include any of the following situations: display positions overlap; the distance between display positions is less than the preset distance.

[0084] Specifically, in some view scenarios that must be developed with the client, the developer can only make necessary views and functions (i.e., the native views mentioned above) in the client to realize the basic functions of the client, and use the web view WebView to realize the remaining functions or views except the native view, or use WebView to realize the newly added functions or views, wherein the WebView is transparent, i.e., the framework structure of the WebView is transparent, but the view inside the WebView is not transparent and can be styled. After the development of the native view and WebView of the client is completed, the client with only the native view can be published for users to download and use, and the WebView that realizes the newly added functions or views can be stored on the server. When the terminal device receives a start request for the target client, it can send a request to the server to obtain the network view WebView of the target client, and receive the WebView of the target client returned by the server in response to the acquisition request.

[0085] Furthermore, after receiving the WebView of the target client returned by the server, the target client generates a view of the target client by overlaying the view layer of the native view with the view layer of the WebView obtained from the server. In the process of overlaying the client's native view and the WebView, the view layer of the WebView can be covered on the view layer of the native view, that is, the client's native view and the corresponding WebView view are overlaid together for user use, thereby ensuring the fusion of the client's native view and the WebView through the overlay of the view layer, so that the user can see both the client's native view and the newly added view implemented by the WebView.

[0086] Furthermore, when the terminal device receives a startup request for the target client, the view of the target client obtained includes the native view and the WebView corresponding to the target client, that is, the complete view of the entire target client is obtained. This allows the user to implement the basic functions of the target client by obtaining the view inherent in the target client, and to implement the new functions of the target client by obtaining the WebView corresponding to the target client. This allows the user to experience the new functions in the client without re-downloading the new version of the client, which greatly improves the user experience.

[0087] Furthermore, in the process of overlaying the view layer of the native view and the view layer of WebView, the client determines whether a display conflict occurs between the native view and the view in WebView, such as display position overlap, the distance between display positions being less than a preset distance, and other display conflicts. If a display conflict is determined to have occurred, the display position of the native view can be adjusted by WebView within a preset adjustment range to resolve the display conflict, that is, WebView can adjust the native view of the corresponding client within a certain range.

[0088] The embodiment of the present application provides another possible implementation method, wherein, after step S120, step S130 (not marked in the figure), step S140 (not marked in the figure) and step S150 (not marked in the figure) are also included, wherein:

[0089] Step S130: receiving a trigger operation of a user on any view, and detecting whether the trigger operation is a trigger operation within a hot zone.

[0090] Step S140: When the trigger operation is a trigger operation within the hot zone, determine that the trigger operation is an operation for WebView.

[0091] Step S150: When the trigger operation is not a trigger operation within the hot zone, determine that the trigger operation is an operation on the native view.

[0092] Among them, the hot zone is a clickable area set in the WebView through a preset application programming interface API between the target client and the WebView.

[0093] In addition, before step S110 , step S101 (not marked in the figure) is also included: establishing an API between the target client and the WebView so that resources and functions are shared between the target client and the WebView.

[0094] In addition, after step S140, step S160 (not marked in the figure) and step S170 (not marked in the figure) are also included, wherein:

[0095] Step S160: Determine the target function object in the WebView corresponding to the trigger operation.

[0096] Step S170: Based on the preset function interface between the WebView and the target function object, a corresponding operation is performed to provide the corresponding function of the target function object.

[0097] Wherein, WebView includes at least one functional object.

[0098] In addition, before step S170, step S161 (not marked in the figure) is also included: establishing preset functional interfaces corresponding to WebView and each functional object respectively.

[0099] In addition, based on the preset function interface between the WebView and the target function object, a corresponding operation is performed, including: loading an embedded frame corresponding to the preset function interface, and performing the corresponding operation through the preset embedded frame.

[0100] In addition, after step S170, step S150 (not marked in the figure) is also included: closing the preset function interface and releasing the resources occupied by the target function object.

[0101] Specifically, the complete view of the client can be completed by the client and WebView together. However, if the client and WebView act independently and do not communicate with each other, it will cause a waste of resources and limit the product functions. Therefore, the client needs to provide the underlying API to WebView, that is, establish an API between the client and WebView, so that WebView can use the API provided by the client to share resources between the client and WebView, such as sharing long link channels. In addition, some functions that WebView does not have can be realized, that is, functions are shared between the client and WebView, such as setting hot zones, controlling the display or hiding of webview, obtaining terminal device (such as mobile phone) information, notifying webview when the terminal device (such as mobile phone) screen is flipped, and webview calls the vibration function of the terminal device (such as mobile phone) through the client, etc. By establishing an API between the client and WebView, the business logic is implemented by WebView, avoiding various defects in versioning and cross-platform caused by frequent changes in business logic, so that the client and WebView can complement each other.

[0102] Furthermore, after the overall view of the client is generated based on the native view of the client and the corresponding WebView, in order to allow the user to perform corresponding operations on both the native view and the WebView of the client, a hot zone is set for the WebView in advance through the API between the client and the WebView, wherein the WebView accepts user operation events in the hot zone area, and user operation events outside the hot zone area are handed over to the native view of the client for acceptance. Thus, through the setting of the hot zone, the problem of accepting user operations of events at different view layers is cleverly solved, allowing the user to operate the functions of the native view of the client and the WebView at the same time in one view window.

[0103] Furthermore, after the terminal device displays the loaded view of the target client, the user can touch the corresponding view as needed, that is, the user can touch any view of the target client, that is, the terminal device receives the user's trigger operation on any view, wherein, after receiving the user's trigger operation on any view, the terminal device detects whether the trigger operation is a trigger operation within the hot zone, and when it is detected that it is a trigger operation within the hot zone, the terminal device determines that the trigger operation is an operation on the WebView, and at this time, the WebView responds to the user's trigger operation; when it is detected that it is not a trigger operation within the hot zone, the terminal device determines that the trigger operation is an operation on the native view, and at this time, the native view of the target client responds to the user's trigger operation.

[0104] Furthermore, with the continuous development and updating of technology, the view window product functions in a WebView are increasing. For example, multiple independent and complex activities in a view (that is, multiple functional objects that implement different functions) all need to be undertaken by WebView, that is, a WebView includes at least one functional object. Therefore, after the terminal device determines that the user's trigger operation is an operation on the WebView, it can further determine the target functional object in the WebView corresponding to the trigger operation, that is, determine which functional object in the WebView the user's trigger operation is a trigger operation for.

[0105] Furthermore, after determining the target function object triggered by the user, the terminal device can perform corresponding operations through the preset function interface between WebView and the target function object, such as loading the function object to provide the corresponding function of the target function object, that is, through the preset function interface between WebView and the target function object, the corresponding function of the target function object is realized, so that it can be loaded on demand according to the user's triggering needs, effectively avoiding the problems of slow page loading, poor performance, and difficult client maintenance caused by the synchronous loading of all function objects in WebView. Among them, before providing the corresponding function to the user through the preset function interface between WebView and the target function object, the preset function interface corresponding to each WebView and each function object is pre-established.

[0106] Furthermore, in the process of performing corresponding operations based on the preset function interface between WebView and the target function object, the terminal device can perform the corresponding operations by loading the iframe corresponding to the preset function interface, wherein the frame is equivalent to a child WebView, which is a built-in function of WebView. The use of iframe technology here can avoid the problem of too many resources when loading multiple functions at the same time, that is, WebView loads the corresponding preset function interface according to the target function object triggered by the user, calls the corresponding iframe through the preset function interface, and displays the relevant functions to the user through the iframe.

[0107] Furthermore, after performing the corresponding operation based on the preset function interface between WebView and the target function object, the preset function interface can also be closed and the resources occupied by the target function object can be released. That is, after the user has completed operating (or using) the target function object, the terminal device can close the corresponding embedded frame, that is, close the preset function interface between WebView and the target function object, and at the same time release the new resource occupied by the target function object, thereby realizing the timely destruction and recycling of useless resources, effectively avoiding the problem of WebView occupying too much memory due to too many functions, and thus avoiding the problem of memory overflow.

[0108] In other words, as a view window product has more and more functions, for example, multiple independent and complex activities (i.e., functional objects) in a view all need to be undertaken by WebView. If these functional objects are loaded in a WebView at the same time, it will not only cause slow page loading, affect the performance of the client, but also be detrimental to the maintenance of the client. Now, by opening a child WebView (i.e., iframe), the above problem is solved. First, the preset functional interface of each independent functional object is loaded through WebView. When the user clicks the corresponding preset functional interface, the corresponding iframe will be started, and the code of the relevant functional object will also be displayed to the user through the iframe. At the same time, when the user completes the operation of a functional object, the corresponding iframe will be closed, and the occupied resources will be released. Through the preset functional interface and embedded framework, not only the on-demand loading according to the user-triggered operation is realized, but also the timely destruction and recycling of useless resources are realized, which effectively avoids the problem of WebView occupying too much memory due to too many functions, and thus avoids the problem of memory overflow.

[0109] Further, Figure 3 A schematic diagram of the process of view processing in which the client, front end and server work together is given. Figure 3In the example, the registration information channel function registerMessageChannel provided by the client and the server-side service provided by the push system (i.e., the push system) can allow the front-end and the client to share the long-link channel and reduce resource consumption; in addition, the hot zone setting function setHotRegions provided by the client can be used to set the hot zone of WebView to solve the problem that the client native view and the view in WebView are in the same view window; in addition, the server-side solves the problem of configuring the preset function interface of the multi-function object in WebView. Through the configuration of the server-side, the page can load different static resources such as css, js, img, etc., and the preset function interfaces of multiple function objects can be displayed in one page. Through different preset function interfaces, the embedded frames (i.e., iframes) of different pages can be started, which solves the problems of high maintenance cost and performance bottleneck when multiple function objects exist in one WebView.

[0110] Through the above solution, only one development of the client is required to provide the corresponding basic services, and the product functions can be realized by WebView and the server. Compared with the previous reliance on client development alone, it is more efficient and has lower costs. Moreover, by developing business logic through WebView, there is no need for client release, and the product can be put online as soon as the function test is completed. Users can see the updates of related functions without downloading new installation packages. The product development efficiency and user experience have been greatly improved, and the functions developed by WebView can be applied to different terminal devices.

[0111] Embodiment 2

[0112] Figure 3 A schematic diagram of the structure of a view processing device provided in an embodiment of the present application is shown in FIG. Figure 3 As shown, the device 30 may include an acquisition module 31 and a display module 32, wherein:

[0113] The acquisition module 31 is used to acquire the view of the target client when receiving the start request for the target client, the view including the native view and the web page view WebView of the target client acquired from the server, the native view being the inherent view in the target client;

[0114] The display module 32 is used to load the acquired view and display it.

[0115] Specifically, it also includes a first processing module 33, such as Figure 4 As shown, the first processing module 33 is used to overlay the view layer of the native view with the view layer of the WebView obtained from the server, wherein the view layer of the WebView is covered on the view layer of the native view.

[0116] Furthermore, the first processing module 33 includes a detection submodule 331 and an adjustment submodule 332. Figure 4 As shown,

[0117] The detection submodule 331 is used to detect whether a display conflict occurs between the native view and the view in the WebView;

[0118] The adjustment submodule 332 is used to adjust the display position of the native view within a preset adjustment range through WebView to resolve the display conflict when a display conflict occurs;

[0119] Display conflicts include any of the following situations: display positions overlap; the distance between display positions is less than the preset distance.

[0120] Furthermore, it also includes a second processing module 34 and a first determining module 35, such as Figure 4 As shown,

[0121] The second processing module 34 is used to receive a trigger operation of a user on any view, and detect whether the trigger operation is a trigger operation within a hot zone;

[0122] The first determination module 35 is used to determine that the trigger operation is an operation on the WebView when the trigger operation is within the hot zone; and to determine that the trigger operation is an operation on the native view when the trigger operation is not within the hot zone;

[0123] Hotspots are clickable areas set in WebView through a preset application programming interface API between the target client and WebView.

[0124] Furthermore, it also includes a first establishing module 36, such as Figure 4 As shown, the first establishing module 36 is used to establish an API between the target client and the WebView, so that resources and functions are shared between the target client and the WebView.

[0125] Furthermore, it also includes a second determining module 37 and an executing module 38, such as Figure 4 As shown,

[0126] The second determination module 37 is used to determine the target function object in the WebView corresponding to the trigger operation;

[0127] The execution module 38 is used to perform corresponding operations based on the preset function interface between the WebView and the target function object to provide the corresponding function of the target function object;

[0128] WebView includes at least one function object.

[0129] Furthermore, it also includes a second establishing module 39, such as Figure 4 As shown, the second establishing module 39 is used to establish preset functional interfaces corresponding to the WebView and each functional object.

[0130] Furthermore, the execution module 38 is specifically used to load the sub-WebView corresponding to the preset functional interface, and perform corresponding operations through the sub-WebView.

[0131] Furthermore, it also includes a resource release module 310, such as Figure 4 As shown, the resource release module 310 is used to close the preset function interface and release the resources occupied by the target function object.

[0132] Compared with the prior art, the device provided in the embodiment of the present application obtains the view of the target client when receiving a startup request for the target client, and the view includes a native view and a web view WebView corresponding to the target client. The native view is a view inherent in the target client, and then the obtained view is loaded and displayed. Therefore, the basic services or basic functions of the target client can be realized by obtaining the view inherent in the target client, and the new services or new functions of the target client can be realized by obtaining the WebView corresponding to the target client from the server, so that the user can experience the new functions in the client without re-downloading the new version of the client, which greatly improves the user experience and effectively avoids the user from consuming unnecessary traffic due to continuous client updates.

[0133] Embodiment 3

[0134] The present application embodiment provides an electronic device, such as Figure 5 As shown, Figure 5 The electronic device 500 shown includes: a processor 501 and a memory 503. The processor 501 and the memory 503 are connected, such as through a bus 502. Further, the electronic device 500 may also include a transceiver 504. It should be noted that in actual applications, the transceiver 504 is not limited to one, and the structure of the electronic device 500 does not constitute a limitation on the embodiments of the present application.

[0135] The processor 501 is used in the embodiment of the present application to implement Figure 3 or Figure 4 The functions of the acquisition module and the display module shown in FIG. Figure 4 The functions of the first processing module, the first establishing module, the second processing module, the first determining module, the second determining module, the second establishing module, the executing module and the resource releasing module are shown.

[0136] Processor 501 may be a CPU, a general processor, a DSP, an ASIC, an FPGA or other programmable logic device, a transistor logic device, a hardware component or any combination thereof. It may implement or execute various exemplary logic blocks, modules and circuits described in conjunction with the disclosure of this application. Processor 501 may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, etc.

[0137] The bus 502 may include a path to transmit information between the above components. The bus 502 may be a PCI bus or an EISA bus, etc. The bus 502 may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 5 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0138] The memory 503 may be a ROM or other type of static storage device that can store static information and instructions, a RAM or other type of dynamic storage device that can store information and instructions, or an EEPROM, a CD-ROM or other optical disk storage, an optical disk storage (including a compressed optical disk, a laser disk, an optical disk, a digital versatile disk, a Blu-ray disk, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto.

[0139] The memory 503 is used to store the application code for executing the solution of the present application, and the execution is controlled by the processor 501. The processor 501 is used to execute the application code stored in the memory 503 to implement Figure 3 or Figure 4 The illustrated embodiment provides actions of the view processing device.

[0140] The electronic device provided in the embodiment of the present application includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, compared with the prior art, it can achieve: when a startup request for a target client is received, a view of the target client is obtained, the view includes a native view and a web view WebView corresponding to the target client, the native view is a view inherent in the target client, and then the obtained view is loaded and displayed, so that the basic services or basic functions of the target client can be realized by obtaining the view inherent in the target client, and the new services or new functions of the target client can be realized by obtaining the WebView corresponding to the target client from the server, so that the user can experience the new functions in the client without re-downloading the new version of the client, which greatly improves the user experience and also effectively avoids the user from consuming unnecessary traffic due to continuous client updates.

[0141] An embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored. When the program is executed by a processor, the view processing method in Embodiment 1 is implemented. Compared with the prior art, when a startup request for a target client is received, a view of the target client is obtained, and the view includes a native view and a web view WebView corresponding to the target client. The native view is a view inherent in the target client. The obtained view is then loaded and displayed, so that the basic services or basic functions of the target client can be implemented by obtaining the view inherent in the target client, and the new services or new functions of the target client can be implemented by obtaining the WebView corresponding to the target client from the server, so that the user can experience the new functions in the client without re-downloading the new version of the client, which greatly improves the user experience and effectively avoids the user from consuming unnecessary traffic due to continuous client updates.

[0142] The computer-readable storage medium provided in the embodiments of the present application is applicable to any embodiment of the above method, which will not be described in detail here.

[0143] It should be understood that, although the steps in the flowchart of the accompanying drawings are displayed in sequence as indicated by the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least a part of the steps in the flowchart of the accompanying drawings may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be executed in turn or alternately with other steps or at least a part of the sub-steps or stages of other steps.

[0144] The above description is only a partial implementation method of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. A view processing method, characterized in that: include: When receiving a start request for a target client, sending a request to the server to obtain a view of the target client, wherein the view includes a native view and a web page view WebView of the target client obtained from the server, wherein the native view is a view inherent in the target client; Load the obtained view and display it; Among them, after displaying the loaded view, it also includes: Receive a trigger operation of a user on any view, and detect whether the trigger operation is a trigger operation within a hot zone; If it is a trigger operation in the hot zone, determining that the trigger operation is an operation on the WebView; If it is not a trigger operation within the hot zone, determining that the trigger operation is an operation on the native view; The hot zone is a clickable area set in the WebView through a preset application programming interface API between the target client and the WebView.

2. The method according to claim 1, characterized in that Before getting the target client's view, also include: The view layer of the native view is overlaid with the view layer of the WebView obtained from the server, wherein the view layer of the WebView is overlaid on the view layer of the native view.

3. The method according to claim 2, characterized in that Overlay the view layer of the native view with the view layer of the WebView obtained from the server, including: Detect whether there is a display conflict between the native view and the view in WebView; If a display conflict occurs, the display position of the native view is adjusted within the preset adjustment range through WebView to resolve the display conflict; The display conflict includes any of the following situations: display positions overlap; the distance between display positions is less than a preset distance.

4. The method according to claim 1, characterized in that Before getting the target client's view, also include: The API is established between the target client and the WebView so that resources and functions are shared between the target client and the WebView.

5. The method according to claim 1, characterized in that After determining that the trigger operation is an operation for WebView, the method further includes: Determine the target function object in WebView corresponding to the trigger operation; Based on a preset function interface between the WebView and the target function object, a corresponding operation is performed to provide a corresponding function of the target function object; The WebView includes at least one function object.

6. The method according to claim 5, characterized in that Based on the preset function interface between WebView and the target function object, a corresponding operation is performed, which includes: Establish preset functional interfaces corresponding to WebView and various functional objects.

7. The method according to claim 5, characterized in that Based on the preset function interface between the WebView and the target function object, a corresponding operation is performed, including: The sub-WebView corresponding to the preset functional interface is loaded, and the corresponding operation is performed through the sub-WebView.

8. The method according to claim 5, characterized in that Based on the preset function interface between WebView and the target function object, a corresponding operation is performed, which includes: Close the preset function interface and release the resources occupied by the target function object.

9. A view processing device, characterized in that: include: An acquisition module, configured to, upon receiving a start request for a target client, send an acquisition request to a server to acquire a view of the target client, wherein the view includes a native view and a web page view WebView of the target client acquired from the server, wherein the native view is a view inherent in the target client; The display module is used to load the acquired view and display it; Among them, after displaying the loaded view, it also includes: Receive a trigger operation of a user on any view, and detect whether the trigger operation is a trigger operation within a hot zone; If it is a trigger operation in the hot zone, determining that the trigger operation is an operation on the WebView; If it is not a trigger operation within the hot zone, determining that the trigger operation is an operation on the native view; The hot zone is a clickable area set in the WebView through a preset application programming interface API between the target client and the WebView.

10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the view processing method according to any one of claims 1 to 8 is implemented.

11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, which, when executed by a processor, implements the view processing method according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • Application top view processing method, device and component

    CN107045438A

  • LBS implementing method based on ReactNative

    CN107347179A

  • Updating method and device of activity function playing method in live broadcast application

    CN108174302A