A method and device for creating a page view component
By replacing the rendering engine of the intelligent terminal system with a target rendering engine with better performance, the problem of insufficient performance of the rendering engine of the intelligent terminal system is solved, and more efficient page view component rendering is achieved, which is suitable for more development needs.
Patent Information
- Application Number
- CN201910517014.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-06-14
- Publication Date
- 2024-10-22
- Estimated Expiration
- 2039-06-14
AI Technical Summary
The rendering engine provided by the intelligent terminal system has weak performance and is difficult to meet the current object development needs, especially when displaying complex web page view components.
By replacing the rendering engine of the intelligent terminal system with a target rendering engine that has better performance than the system rendering engine, the running environment of the target rendering engine is initialized, and the target rendering engine is called when creating the page view component to achieve higher performance rendering.
It improves the rendering performance of page view components, is suitable for more development needs, and reduces the impact of system rendering engine performance limitations on development.
Smart Images

Figure CN112083981B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing, and in particular to a method and device for creating a page view component. Background Art
[0002] With the development of technology in the field of smart terminals, objects deployed on smart terminals, such as programs, applets, and applications (APP), can display web pages through WebView (page view) components to provide users with richer services.
[0003] The page view component is a system component provided by an intelligent terminal system, such as the Android system, for displaying Web pages. It implements functions such as displaying and rendering Web pages by calling the rendering engine of the intelligent terminal system.
[0004] However, the rendering engine provided by the intelligent terminal system has weak performance and cannot meet the current object development needs. Summary of the invention
[0005] In order to solve the above technical problems, the present application provides a method and device for creating a page view component, which creates a page view component corresponding to the target object by calling the target rendering engine. Since the performance of the target rendering engine is better than the system rendering engine, it can be applied to more development needs.
[0006] The embodiments of the present application disclose the following technical solutions:
[0007] In a first aspect, an embodiment of the present application provides a method for creating a page view component, the method comprising:
[0008] Before creating a page view component corresponding to a target object, by initializing the operating environment of a target rendering engine, a system rendering engine of a smart terminal where the target object is deployed is replaced with the target rendering engine; the performance of the target rendering engine is better than that of the system rendering engine;
[0009] If a request for creating a page view component corresponding to the target object is obtained, the page view component corresponding to the target object is created according to the target rendering engine.
[0010] Optionally, before creating a page view component corresponding to the target object, the step includes:
[0011] When the smart terminal starts the target object, or when a request for a page view component corresponding to the target object is generated.
[0012] Optionally, the target rendering engine includes a difference parameter, and the difference parameter is used to identify the difference between the system rendering engine in different versions.
[0013] Optionally, creating a page view component corresponding to the target object according to the target rendering engine includes:
[0014] Determine target version information of the system rendering engine of the smart terminal;
[0015] According to the target version information and the difference parameters, a create page view component corresponding to the target object is created by the target rendering engine.
[0016] Optionally, the initializing the operating environment of the target rendering engine includes:
[0017] Obtaining a software development kit for the target rendering engine;
[0018] The target rendering engine is initialized in its operating environment according to the software development kit.
[0019] Optionally, replacing the system rendering engine of the smart terminal with the target rendering engine includes:
[0020] By creating an instance of the target rendering engine, the system rendering engine of the smart terminal is replaced with the target rendering engine.
[0021] Optionally, the method further includes:
[0022] Sending a version detection request to a server, wherein the version detection request includes version information of the target rendering engine;
[0023] Obtaining updated content of version information for the target rendering engine from the server;
[0024] The target rendering engine is updated according to the update content.
[0025] In a second aspect, an embodiment of the present application provides a device for creating a page view component, the device comprising a replacement unit and a creation unit:
[0026] The replacement unit is used to replace the system rendering engine of the smart terminal where the target object is deployed with the target rendering engine by initializing the operating environment of the target rendering engine before creating the page view component corresponding to the target object; the performance of the target rendering engine is better than that of the system rendering engine;
[0027] The creation unit is used to create the page view component corresponding to the target object according to the target rendering engine if a request for creating the page view component corresponding to the target object is obtained.
[0028] Optionally, before creating the page view component corresponding to the target object, it includes: when the smart terminal starts the target object, or when generating a request for the page view component corresponding to the target object.
[0029] Optionally, the target rendering engine includes a difference parameter, and the difference parameter is used to identify the difference between the system rendering engine in different versions.
[0030] Optionally, the creation unit is specifically used to:
[0031] Determine target version information of the system rendering engine of the smart terminal;
[0032] According to the target version information and the difference parameters, a create page view component corresponding to the target object is created by the target rendering engine.
[0033] Optionally, the replacement unit is specifically used to:
[0034] Obtaining a software development kit for the target rendering engine;
[0035] The target rendering engine is initialized in its operating environment according to the software development kit.
[0036] Optionally, the replacement unit is further specifically used for:
[0037] By creating an instance of the target rendering engine, the system rendering engine of the smart terminal is replaced with the target rendering engine.
[0038] Optionally, the creation unit is further specifically used for:
[0039] Sending a version detection request to a server, wherein the version detection request includes version information of the target rendering engine;
[0040] Obtaining updated content of version information for the target rendering engine from the server;
[0041] The target rendering engine is updated according to the update content.
[0042] In a third aspect, an embodiment of the present application provides a device for creating a page view component, comprising a memory and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by one or more processors, wherein the one or more programs include instructions for performing the following operations:
[0043] Before creating a page view component corresponding to a target object, by initializing the operating environment of a target rendering engine, a system rendering engine of a smart terminal where the target object is deployed is replaced with the target rendering engine; the performance of the target rendering engine is better than that of the system rendering engine;
[0044] If a request for creating a page view component corresponding to the target object is obtained, the page view component corresponding to the target object is created according to the target rendering engine.
[0045] Optionally, before creating the page view component corresponding to the target object, it includes: when the smart terminal starts the target object, or when generating a request for the page view component corresponding to the target object.
[0046] Optionally, the target rendering engine includes a difference parameter, and the difference parameter is used to identify the difference between the system rendering engine in different versions.
[0047] Optionally, the processor executes the one or more programs including instructions for performing the following operations:
[0048] Determine target version information of the system rendering engine of the smart terminal;
[0049] According to the target version information and the difference parameters, a create page view component corresponding to the target object is created by the target rendering engine.
[0050] Optionally, the processor executes the one or more programs including instructions for performing the following operations:
[0051] Obtaining a software development kit for the target rendering engine;
[0052] The target rendering engine is initialized in its operating environment according to the software development kit.
[0053] Optionally, the processor executes the one or more programs including instructions for performing the following operations:
[0054] By creating an instance of the target rendering engine, the system rendering engine of the smart terminal is replaced with the target rendering engine.
[0055] Optionally, the processor executes the one or more programs including instructions for performing the following operations:
[0056] Sending a version detection request to a server, wherein the version detection request includes version information of the target rendering engine;
[0057] Obtaining updated content of version information for the target rendering engine from the server;
[0058] The target rendering engine is updated according to the update content.
[0059] In a fourth aspect, an embodiment of the present application provides a machine-readable medium having instructions stored thereon, which, when executed by one or more processors, enables the device to execute the method for creating a page view component as described above.
[0060] It can be seen from the above technical solution that before creating the page view component corresponding to the target object, the target rendering engine can be initialized in the operating environment. By initializing the operating environment, the target rendering engine can replace the original system rendering engine of the system deployed by the smart terminal. Therefore, when it is necessary to create the page view component corresponding to the target object, it will be implemented by calling the target rendering engine instead of the system rendering engine. Since the performance of the target rendering engine is better than that of the system rendering engine, it can be applied to more development needs. BRIEF DESCRIPTION OF THE DRAWINGS
[0061] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0062] Figure 1 A flow chart of a method for creating a page view component provided in an embodiment of the present application;
[0063] Figure 2 A schematic diagram of an Android system architecture involved in a process of creating a page view component provided in an embodiment of the present application;
[0064] Figure 3 A structural diagram of a device for creating a page view component provided in an embodiment of the present application;
[0065] Figure 4 A block diagram of a terminal device 400 provided in an embodiment of the present application;
[0066] Figure 5 A structural diagram of a server provided in an embodiment of the present application. DETAILED DESCRIPTION
[0067] The embodiments of the present application are described below in conjunction with the accompanying drawings.
[0068] When an object deployed in a smart terminal provides services to users through a web view component, it is necessary to implement the service by calling the system rendering engine. However, the performance of the system rendering engine provided by smart terminal systems such as the Android system is relatively weak and it is difficult to support some complex functions that can be implemented through web view components. For objects developed based on the system rendering engine, if developers have the development needs to develop the above complex functions, it will be difficult to carry out work for the above development needs due to the functional limitations of the system rendering engine.
[0069] Based on this, the embodiment of the present application provides a method for creating a page view component. By replacing the rendering engine mechanism, when a page view component for any object needs to be created, the replaced target rendering engine with better performance can be called to create the page view component and provide subsequent services. This provides developers with the possibility of development based on the target rendering engine, reducing the impact of the performance limitations of the original system rendering engine on development needs.
[0070] Next, the application scenario of the embodiment of the present application is introduced. The application scenario of the present application may include a smart terminal, and the smart terminal executes the method for creating a page view component provided in the embodiment of the present application. The smart terminal may specifically be a smart phone, a computer, a personal digital assistant (PDA), a tablet computer, etc. For the sake of ease of introduction, the method for creating a page view component provided in the embodiment of the present application will be introduced later by taking the smart terminal as the execution subject as an example.
[0071] For the target object deployed in the smart terminal, that is, any object deployed in the smart terminal and with the function of displaying web pages, before creating the page view component corresponding to the target object, the operating environment of the target rendering engine can be initialized so that the operating environment is suitable for the target rendering engine, thereby providing an implementation basis for replacing the system rendering engine with the target rendering engine.
[0072] In the embodiment of the present application, replacing the target rendering engine with the system rendering engine can be understood as replacing the system rendering engine that should have provided the web page view component function for the target object with the target rendering engine, and the target rendering engine provides the processing logic of the web page view component function for the target object. That is to say, the operation of replacing the rendering engine in the embodiment of the present application is for the target object, and should not be understood as for the entire smart terminal system.
[0073] When it is necessary to create a page view component corresponding to the target object, the page view component corresponding to the target object can be created according to the target rendering engine with better performance, instead of calling the system rendering engine with weaker performance to achieve it. For example, a mobile phone is used as a smart terminal, and a game APP with a web page display function deployed on the mobile phone is used as the target object, and the smart phone includes the original system rendering engine A and a target rendering engine B with better performance than the system rendering engine A. Before creating the page view component corresponding to the game APP, the operating environment of the target rendering engine B is initialized so that the system rendering engine A in the mobile phone is replaced with the target rendering engine B in an environment suitable for the operation of the target rendering engine B. In this way, when it is necessary to create a page view component corresponding to the game APP, the page view component corresponding to the game APP can be created according to the target rendering engine B with better performance, instead of calling the system rendering engine A with weaker performance to achieve it.
[0074] It can be seen that through the mechanism of replacing the rendering engine provided in the embodiment of the present application, the web view component function of the target object will be implemented by calling the target rendering engine instead of calling the system rendering engine. Since the performance of the target rendering engine is better than that of the system rendering engine, it can be applied to more development needs. When developing the target object, the developer can develop based on the target rendering engine with better performance, making development needs that were originally impossible to implement possible.
[0075] Next, we will combine Figure 1 A method for creating a page view component provided in an embodiment of the present application is introduced, see Figure 1 , which shows a flow chart of a method for creating a page view component provided in an embodiment of the present application, the method comprising:
[0076] S101: Before creating a page view component corresponding to a target object, the system rendering engine of the smart terminal where the target object is deployed is replaced with the target rendering engine by initializing the operating environment of the target rendering engine.
[0077] In an embodiment of the present application, any object deployed on a smart terminal and having a web page display function can be used as a target object. And for the system rendering engine in the smart terminal, a rendering engine with better performance than the system rendering engine can be developed in advance, which is recorded as the target rendering engine. Then, before creating the page view component corresponding to the target object, the operating environment of the target rendering engine can be initialized to make the current environment suitable for the operation of the target rendering engine, and meet the basic conditions for replacing the rendering engine for the target object, so that the system rendering engine of the smart terminal where the target object is deployed can be replaced with a target rendering engine with better performance.
[0078] In a specific implementation, the target rendering engine may be the Sogou browser kernel, which is a powerful and feature-rich browsing kernel deeply developed based on Google Chromium. The performance of the Sogou browser kernel is much better than the system rendering engine under different versions of the Android system, and can improve the performance of the page view component in the Android system. In addition, the Sogou browser kernel can be saved in the installation package of the Sogou browser APP in the smart terminal, or in the installation package of the Sogou input method APP, or in the APP of other Sogou products.
[0079] It is understandable that the step of replacing the rendering engine in the embodiment of the present application is performed before creating the page view component corresponding to the target object. In this way, when it is necessary to create a page view component for the target object, the replaced target rendering engine with better performance can be called to create the page view component and provide subsequent services. As for the time point corresponding to the page view component corresponding to the target object in step S101, in a possible implementation, it can be, for example, when the target object is started on the smart terminal, or when a request for the page view component corresponding to the target object is generated.
[0080] Among them, the time point corresponding to the page view component corresponding to the target object is created before the target object is started by the smart terminal. That is to say, for the target object of the smart terminal, when the target object is started by the smart terminal, for example, in a specific implementation, when the target object is started, the onCreate() function for the target object will be executed. During this period, the operating environment of the target rendering engine is initialized, and the system rendering engine is replaced with a target rendering engine with better performance. For example: a mobile phone is used as a smart terminal, and a game APP with a web page display function deployed on the mobile phone is used as the target object, and the smart phone includes the original system rendering engine A, and also includes a target rendering engine B with better performance than the system rendering engine A. When the mobile phone starts the game APP, the operating environment of the target rendering engine B is initialized, and the system rendering engine A of the mobile phone is replaced with the target rendering engine B with better performance.
[0081] When the rendering engine is not replaced in time, the system rendering engine will be used as the background logic for creating page view components. To avoid this situation, the rendering engine replacement step can be performed when the target object is started by the smart terminal, thereby ensuring that during the entire operation of the target object, the page view component creation and other functions can be implemented according to the target rendering engine with better performance, avoiding calling the system rendering engine with poor performance to achieve this.
[0082] In addition, the time point corresponding to before the page view component corresponding to the target object is created can also be when the request for the page view component corresponding to the target object is generated. It should be noted that for the target object of the smart terminal, when it is necessary to create the page view component corresponding to the target object, it is usually necessary to first generate a request for the page view component corresponding to the target object. When the request for the page view component corresponding to the target object is obtained, the step of creating the page view component is performed.
[0083] Then, for the target object of the smart terminal, when generating a request for the page view component corresponding to the target object, the operating environment of the target rendering engine can be initialized, and the system rendering engine can be replaced with a target rendering engine with better performance. For example: a mobile phone is used as a smart terminal, and a game APP with a web page display function deployed on the mobile phone is used as the target object, and the smart phone includes the original system rendering engine A and also includes a target rendering engine B with better performance than the system rendering engine A. When generating a request for the page view component corresponding to the game APP, the operating environment of the target rendering engine B is initialized, and the system rendering engine A of the mobile phone is replaced with the target rendering engine B with better performance.
[0084] Since the target object may appear in a display scenario that does not involve a web page during the entire running process, in order to avoid wasting system resources by performing the rendering engine replacement step in this scenario, the rendering engine replacement step can be performed when a request for a page view component corresponding to the target object is generated, that is, when the page view component corresponding to the target object needs to be created, thereby reducing unnecessary waste of system resources and improving the efficiency of system operation.
[0085] S102: If a request for creating a page view component corresponding to the target object is obtained, the page view component corresponding to the target object is created according to the target rendering engine.
[0086] In an embodiment of the present application, when it is necessary to create a page view component corresponding to a target object, a request for the page view component corresponding to the target object will be generated accordingly. If the requirement to create the page view component corresponding to the target object is obtained, since the rendering engine has been replaced for the target object, the page view component corresponding to the target object can be created according to a target rendering engine with better performance.
[0087] For example, a mobile phone is used as a smart terminal, and a game APP with a web page display function deployed on the mobile phone is used as a target object, and the smart phone includes the original system rendering engine A and also includes a target rendering engine B with better performance than the system rendering engine A. After completing step S101, that is, after the system rendering engine A in the mobile phone is replaced with the target rendering engine B, when it is necessary to create a page view component corresponding to the game APP, a request for the page view component corresponding to the target object can be generated accordingly. If the requirement for creating the page view component corresponding to the target object is obtained, the page view component corresponding to the game APP can be created according to the target rendering engine B with better performance.
[0088] After the page view component corresponding to the target object is created according to the target rendering engine, the web page of the target object can be downloaded, parsed, and rendered through the target rendering engine.
[0089] It can be seen that in the embodiment of the present application, before creating the page view component corresponding to the target object, the target rendering engine can be initialized in the operating environment. By initializing the operating environment, the target rendering engine can replace the original system rendering engine of the system deployed by the smart terminal. Therefore, when it is necessary to create the page view component corresponding to the target object, it will be implemented by calling the target rendering engine instead of the system rendering engine. Since the performance of the target rendering engine is better than that of the system rendering engine, it can be applied to more development needs.
[0090] It should be noted that the embodiments of the present application do not limit the specific method for initializing the operating environment of the target rendering engine, and an adaptive determination method can be selected and set according to different determination requirements. With respect to S101, in a possible implementation, the method for initializing the operating environment of the target rendering engine may include:
[0091] S201: Obtain a software development kit of the target rendering engine.
[0092] In the embodiment of the present application, a software development kit (SDK) of the target rendering engine may be developed in advance for the target rendering engine. The SDK of the target rendering engine may be a collection of documents, examples, and tools related to the specific implementation of replacing the system rendering engine with the target rendering engine. When the operating environment of the target rendering engine needs to be initialized, the SDK of the target rendering engine may be obtained.
[0093] S202: Initializing the operating environment of the target rendering engine according to the software development kit.
[0094] In the embodiment of the present application, the target rendering engine's operating environment can be initialized by initializing the target rendering engine's SDK according to the acquired target rendering engine's SDK. For example, the target rendering engine's SDK may include information such as parameters related to the target rendering engine's operating environment, and the target rendering engine's SDK can be initialized to quickly reset the parameters related to the target rendering engine's operating environment.
[0095] In this way, by only initializing a software development kit, that is, the SDK of the target rendering engine, the current operating environment can be made suitable for the operation of the target rendering engine, thereby improving the initialization efficiency.
[0096] In addition, the embodiments of the present application do not limit the specific method of replacing the system rendering engine of the smart terminal with the target rendering engine, and an adaptive determination method can be selected and set according to different determination requirements. With respect to S101, in a possible implementation method, the method may include: replacing the system rendering engine of the smart terminal with the target rendering engine by creating an instance of the target rendering engine. The instance described here may be a process, and the instance of the target rendering engine may be a process related to the target rendering engine, such as the instance of the target rendering engine may be a process that calls the interface of the target rendering engine. In other words, the system rendering engine of the smart terminal can be replaced with the target rendering engine by creating an instance of the target rendering engine.
[0097] The following is a specific example: Figure 2 , which shows a schematic diagram of the Android system architecture involved in the process of creating a page view component provided by an embodiment of the present application. Figure 2 As shown, Figure 2 The architecture diagram connected by solid lines shown in the figure may correspond to the method involved in the background technology, that is, by calling an instance of the system rendering engine, the system rendering engine is used as the background logic for creating a page view component corresponding to the target object, thereby creating a page view component corresponding to the target object according to the system rendering engine; and Figure 2 The architecture diagram connected by dotted lines shown in the figure may correspond to the method provided in the embodiment of the present application, that is, when the operating environment of the target rendering engine is initialized so that the current operating environment is suitable for the target rendering engine, an instance of the target rendering engine may be created, wherein the instance may be a process for calling an interface of the target rendering engine. Through the process, the target rendering engine may be used as the background logic of the page view software corresponding to the target object, rather than the system rendering engine, thereby replacing the system rendering engine with the target rendering engine.
[0098] In a specific implementation, for an Android smart terminal, when initializing the SDK of the target rendering engine so that the current operating environment is suitable for the operation of the target rendering engine, the application framework layer (Frameworks) in the Android system is used as a starting point to create an instance of the mProvider interface that calls the target rendering engine, thereby replacing the system rendering engine with the target rendering engine. Among them, the application framework layer can be used to provide API methods and services for objects in the smart terminal.
[0099] Therefore, this method can replace the system rendering engine of the smart terminal with the target rendering engine only by creating an instance of the target rendering engine, thereby improving the efficiency of replacing the rendering engine.
[0100] As the smart terminal system is upgraded, the version of the rendering engine called by the page view component will also be updated. The working mechanisms of different versions of the rendering engine may be different. For example, the application programming interface (API) required to be accessed will be updated, deleted, modified, etc. as the version changes.
[0101] However, the smart terminals currently circulating in the market have different styles, models, and manufacturers, and the system versions deployed in smart terminals are not unified, that is, multiple versions of rendering engines are circulating in the market at the same time. This results in the developers of the above objects needing to adapt to different versions of rendering engines in order to enable the objects to use page view components when developing objects, which greatly increases the development cost.
[0102] In order to solve the above-mentioned problem caused by too many versions of the system rendering engine, in a possible implementation method, the target rendering engine provided in the embodiment of the present application may include a difference parameter, and the difference parameter described here can be used to identify the difference between the system rendering engine under different versions.
[0103] Among them, there are usually multiple different versions of smart terminal systems circulating in the current market, and different versions of smart terminal systems correspond to different versions of system rendering engines, that is, different versions of system rendering engines are also circulating in the current market. For example, suppose there are three versions of Android systems currently circulating in the market, namely version 1, version 2 and version 3, and for these three versions of Android systems, there may be three different versions of system rendering engines corresponding to them, namely the first version of the system rendering engine, the second version of the system rendering engine and the third version of the system rendering engine. For different versions of system rendering engines, there may also be differences between them. The following is a specific example to illustrate: For the aforementioned three different versions of system rendering engines, they may include similarities, such as: when function A needs to be implemented, these three versions of system rendering engines need to implement the function by calling interface a. And for these three system rendering engines under different versions, there may also be differences, such as: when function B needs to be implemented, the first version of the system rendering engine needs to implement the function by calling interface a; the second version of the system rendering engine needs to implement the function by calling interface b; the third version of the system rendering engine needs to implement the function by calling interface c.
[0104] It can be seen that when implementing function B, the three system rendering engines have differences, and the differences of the three system rendering engines can be identified by the difference parameters. It can be understood that the above example is only one possible scenario. In actual scenarios, the difference parameters included in the target rendering engine include all the differences of the system rendering engines under different versions.
[0105] In the embodiment of the present application, the difference parameter may identify the difference between the system rendering engines in all different versions currently in circulation, or may identify the difference between the system rendering engines in at least two different versions.
[0106] In this way, since the target rendering engine includes a difference parameter, and the difference parameter is used to identify the difference of the system rendering engine under different versions, the target rendering engine can realize the corresponding functions that can be realized by the system rendering engine based on the difference parameter for each version of the system rendering engine under different versions through the same working mechanism as the system rendering engine. For example: the difference parameter of the target rendering engine includes the information that the first version of the Android system rendering engine needs to call the interface a when implementing function B, then the target rendering engine can also call interface a according to the difference parameter to implement function B. Therefore, for each version of the system rendering engine of different versions, it can be replaced by the target rendering engine, and the functions that can be realized by the system rendering engine can be realized by the same working mechanism as the system rendering engine, so that the impact on the system where the replaced system rendering engine is located is relatively small. In other words, the target rendering engine has high compatibility for different versions of systems (such as Android systems) and can be adapted to smart terminals under different versions of systems.
[0107] In the specific implementation, the target rendering engine, Sogou Browser Kernel, can support at least Android version 4.1. Moreover, in all systems of Android version 4.1 and above, the behavior of Sogou Browser Kernel can be consistent with the behavior of the system rendering engine in the corresponding version of the Android system. In other words, Sogou Browser Kernel has high compatibility.
[0108] In the embodiment of the present application, after the replacement of the rendering engine is completed, the target rendering engine can implement the functions that the system rendering engine can implement based on the difference parameters with the same working mechanism as the system rendering engine. Then, in a possible implementation, the method for creating a page view component corresponding to the target object according to the target rendering engine in step S102 may include:
[0109] S301: Determine target version information of the system rendering engine of the smart terminal.
[0110] Different versions of the system rendering engine may have corresponding version information. The version information of the system rendering engine may be used to indicate the system version to which the system rendering engine belongs. For example, for the first version of the system rendering engine, the corresponding system version information may be "1.0". Then, in the embodiment of the present application, the version information of the system rendering engine in the current smart terminal may be recorded as the target version information, and for the smart terminal, the target version information of the system rendering engine therein may be determined.
[0111] For example: assuming that the system rendering engines currently circulating in the market include a first version system rendering engine, a second version system rendering engine, and a third version system rendering engine, and taking a mobile phone as the current smart terminal, the mobile phone includes the first version of the system rendering engine, and the version information of the first version of the system rendering engine is "1.0", then, for the current mobile phone, the target version information of the system rendering engine in the mobile phone is determined to be "1.0".
[0112] S302: Creating a page view component corresponding to the target object through the target rendering engine according to the target version information and the difference parameter.
[0113] In an embodiment of the present application, the working mechanism of the system rendering engine of the current smart terminal when creating a page view component corresponding to the target object can be determined based on the version information of the system rendering engine in the current smart terminal, that is, the target version information, and the difference parameters included in the target rendering engine, and based on the working mechanism, the target rendering engine implements the creation of the page view component corresponding to the target object.
[0114] The following is a specific example: Assume that there are three versions of Android systems currently circulating on the market, namely version 1, version 2 and version 3, and under these three versions of Android systems, there may be three different versions of system rendering engines, namely the first version of the system rendering engine, the second version of the system rendering engine and the third version of the system rendering engine. Then, for these three system rendering engines under different versions, there may be differences in the function of implementing the page view component corresponding to the target object, for example: the first version of the system rendering engine needs to implement the function by calling interface a; the second version of the system rendering engine needs to implement the function by calling interface b; the third version of the system rendering engine needs to implement the function by calling interface c. Since the difference parameter of the target rendering engine includes the difference corresponding to the page view component corresponding to the target object, then, according to the target version information of the system rendering engine in the mobile phone determined to be "1.0", the corresponding rendering engine is the first version of the system rendering engine, then according to the difference parameter, it can be determined that the first version of the system rendering engine needs to implement the function of the page view component corresponding to the target object by calling interface a, so the target rendering engine can also implement the function of the page view component corresponding to the target object by calling interface a.
[0115] From this, we can see that based on the advantage that the target rendering engine has high compatibility with different versions of systems (such as Android systems) and can adapt to smart terminals under different versions of systems, different versions of system rendering engines can be replaced with the target rendering engine, and the target rendering engine can be used to implement functions such as creating page view components corresponding to the target object. In this way, developers can develop objects only based on the target system engine, without having to pay attention to the differences between system rendering engines under different versions.
[0116] In the embodiment of the present application, the function of updating the target rendering engine may be provided, that is, for the target rendering engine in the smart terminal, if the latest version of the target rendering engine is released, the target rendering engine in the smart terminal may be updated to the latest version of the target rendering engine. Figure 1 The step of replacing the rendering engine shown is to replace the system rendering engine of the smart terminal where the target object is deployed with the target rendering engine before updating the target rendering engine. The method of updating the target rendering engine may include:
[0117] S401: Send a version detection request to a server, where the version detection request includes version information of the target rendering engine.
[0118] In an embodiment of the present application, the server may be a publishing platform for the latest version of the target rendering engine, then a version detection request may be sent to the server, wherein the version detection request may include the version information of the target rendering engine in the smart terminal, and the version information of the target rendering engine described here may be used to indicate the system version to which the target rendering engine belongs, such as the version information of the target rendering engine may be "1.0", to indicate that the target rendering engine is the first version. In other words, a version detection request including the version information of the target rendering engine in the smart terminal may be sent to the server. For example: a target rendering engine A is deployed in a smart terminal such as a mobile phone, and the target rendering engine A is the first version, and the corresponding version information is "1.0", then a version detection request may be sent to the server, and the version detection request may include the version information "1.0" of the target rendering engine.
[0119] S402: Obtain updated content of version information for the target rendering engine from the server.
[0120] S403: Update the target rendering engine according to the update content.
[0121] In an embodiment of the present application, after receiving the version detection request, the server can determine the update content of the version information of the target rendering engine according to the version information of the target rendering engine in the version detection request, and send the update content of the version information of the target rendering engine to the smart terminal. Wherein, the update content described here can be the content of updating the target rendering engine in the smart terminal to the latest version of the target rendering engine. It can be understood that the update content may include the content in the target rendering engine installation package in the smart terminal, or may not include the content in the target rendering engine installation package in the smart terminal. For example: assuming that the installation package of the target rendering engine in the current smart terminal is A, and the update content is A+B, the situation is that the update content includes the content in the target rendering engine installation package in the smart terminal; correspondingly, assuming that the installation package of the target rendering engine in the current smart terminal is A, and the update content is B, then the situation is that the update content does not include the content of the target rendering engine packaging package in the smart terminal; the smart terminal obtains the update content of the version information of the target rendering engine from the server, and updates the target rendering engine in the smart terminal to the latest version of the target rendering engine according to the update content.
[0122] For example: Assuming that the latest version of the target rendering engine currently announced by the server is the third version of the target rendering engine, and its version information is "3.0", then, after receiving the version detection request including the version information of the target rendering engine, i.e. "1.0", the server can determine the update content "W" corresponding to the version information of the target rendering engine according to the version information "1.0" of the target rendering engine in the version detection request, and send the update content "W" of the version information of the target rendering engine to the mobile phone. The mobile phone obtains the update content "W" for the version information of the target rendering engine from the server, and updates the first version of the target rendering engine in the mobile phone to the latest version, i.e. the third version of the target rendering engine according to the update content "W".
[0123] In addition, if the server determines that the target rendering engine is already the latest version of the target rendering engine based on the version information of the target rendering engine in the version detection request, the server can send information to the smart terminal indicating that no version update is required. After receiving the information, the smart terminal ends the update step.
[0124] It can be seen that in the Figure 1Before the rendering engine replacement step shown, i.e., "replacing the system rendering engine of the smart terminal that deploys the target object with the target rendering engine", the target rendering engine in the smart terminal is updated, so that in the next step, the replaced, latest version of the target rendering engine can be called to implement functions such as creating page view components, thereby providing developers with the possibility of development based on the latest version of the target rendering engine with better performance. Moreover, for all smart terminals that include a target rendering engine circulating on the market, the above steps can be performed to update the target rendering engine, so that the target rendering engine currently on the market can be quickly updated to the latest version of the target rendering engine. In addition, since only the smaller system rendering engine needs to be updated, the corresponding update time is also shorter, which facilitates the user's update operation, thereby achieving the unification of the target rendering engine versions on the current market, avoiding the problem of too many target rendering engine versions on the current market, i.e., the fragmentation of the target rendering engine.
[0125] based on Figure 1 The corresponding embodiment provides a method for creating a page view component. The embodiment of the present application provides a device for creating a page view component. Figure 3 , which shows a structure diagram of a device for creating a page view component provided in an embodiment of the present application, such as Figure 3 As shown, the device includes a replacement unit 301 and a creation unit 302:
[0126] The replacement unit 301 is used to replace the system rendering engine of the smart terminal where the target object is deployed with the target rendering engine by initializing the operating environment of the target rendering engine before creating the page view component corresponding to the target object; the performance of the target rendering engine is better than that of the system rendering engine;
[0127] The creation unit 302 is used to create the page view component corresponding to the target object according to the target rendering engine if a request to create the page view component corresponding to the target object is obtained.
[0128] Optionally, before creating the page view component corresponding to the target object, it includes: when the smart terminal starts the target object, or when generating a request for the page view component corresponding to the target object.
[0129] Optionally, the target rendering engine includes a difference parameter, and the difference parameter is used to identify the difference between the system rendering engine in different versions.
[0130] Optionally, the creating unit 302 is specifically configured to:
[0131] Determine target version information of the system rendering engine of the smart terminal;
[0132] According to the target version information and the difference parameters, a create page view component corresponding to the target object is created by the target rendering engine.
[0133] Optionally, the replacement unit 301 is specifically configured to:
[0134] Obtaining a software development kit for the target rendering engine;
[0135] The target rendering engine is initialized in its operating environment according to the software development kit.
[0136] Optionally, the replacement unit 301 is further specifically configured to:
[0137] By creating an instance of the target rendering engine, the system rendering engine of the smart terminal is replaced with the target rendering engine.
[0138] Optionally, the creating unit 302 is further specifically configured to:
[0139] Sending a version detection request to a server, wherein the version detection request includes version information of the target rendering engine;
[0140] Obtaining updated content of version information for the target rendering engine from the server;
[0141] The target rendering engine is updated according to the update content.
[0142] It can be seen from the above technical solution that before creating the page view component corresponding to the target object, the target rendering engine can be initialized in the operating environment. By initializing the operating environment, the target rendering engine can replace the original system rendering engine of the system deployed by the smart terminal. Therefore, when it is necessary to create the page view component corresponding to the target object, it will be implemented by calling the target rendering engine instead of the system rendering engine. Since the performance of the target rendering engine is better than that of the system rendering engine, it can be applied to more development needs.
[0143] Based on the aforementioned method and apparatus for creating a page view component, this embodiment provides a device for creating a page view component. The device for creating a page view component may be a terminal device. Figure 4 4 is a block diagram of a terminal device 400 according to an exemplary embodiment. For example, the terminal device 400 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.
[0144] Reference Figure 4The terminal device 400 may include one or more of the following components: a processing component 402 , a memory 404 , a power component 406 , a multimedia component 408 , an audio component 410 , an input / output (I / O) interface 412 , a sensor component 414 , and a communication component 416 .
[0145] The processing component 402 generally controls the overall operation of the terminal device 400, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 402 may include one or more processors 420 to execute instructions to complete all or part of the steps of the above-mentioned method. In addition, the processing component 402 may include one or more modules to facilitate the interaction between the processing component 402 and other components. For example, the processing component 402 may include a multimedia module to facilitate the interaction between the multimedia component 308 and the processing component 402.
[0146] The memory 404 is configured to store various types of data to support operations on the terminal device 400. Examples of such data include instructions for any application or method operating on the terminal device 400, contact data, phone book data, messages, pictures, videos, etc. The memory 404 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.
[0147] The power supply component 406 provides power to various components of the terminal device 400. The power supply component 406 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the terminal device 400.
[0148] The multimedia component 408 includes a screen that provides an output interface between the terminal device 400 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 408 includes a front camera and / or a rear camera. When the terminal device 400 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and the rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
[0149] The audio component 410 is configured to output and / or input audio signals. For example, the audio component 410 includes a microphone (MIC), and when the terminal device 400 is in an operation mode, such as a call mode, a recording mode, and a speech recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 404 or sent via the communication component 416. In some embodiments, the audio component 410 also includes a speaker for outputting audio signals.
[0150] I / O interface 412 provides an interface between processing component 402 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: a home button, a volume button, a start button, and a lock button.
[0151] The sensor assembly 414 includes one or more sensors for providing various aspects of status assessment for the terminal device 400. For example, the sensor assembly 414 can detect the open / closed state of the terminal device 400, the relative positioning of the components, such as the display and keypad of the terminal device 400, and the sensor assembly 414 can also detect the position change of the terminal device 400 or a component of the terminal device 400, the presence or absence of contact between the user and the terminal device 400, the orientation or acceleration / deceleration of the terminal device 400, and the temperature change of the terminal device 400. The sensor assembly 414 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 414 may also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 414 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
[0152] The communication component 416 is configured to facilitate wired or wireless communication between the terminal device 400 and other devices. The terminal device 400 can access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 416 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 416 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
[0153] In an exemplary embodiment, the terminal device 400 can be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors or other electronic components to perform the above method.
[0154] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 404 including instructions, and the instructions can be executed by a processor 420 of a terminal device 400 to complete the above method. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.
[0155] A non-transitory computer-readable storage medium, when instructions in the storage medium are executed by a processor of a mobile terminal, enables the mobile terminal to execute a method for creating a page view component, the method comprising:
[0156] Before creating a page view component corresponding to a target object, by initializing the operating environment of a target rendering engine, a system rendering engine of a smart terminal where the target object is deployed is replaced with the target rendering engine; the performance of the target rendering engine is better than that of the system rendering engine;
[0157] If a request for creating a page view component corresponding to the target object is obtained, the page view component corresponding to the target object is created according to the target rendering engine.
[0158] Figure 5: is a schematic diagram of the structure of the server in an embodiment of the present invention. The server 500 may have relatively large differences due to different configurations or performances, and may include one or more central processing units (CPU) 522 (for example, one or more processors) and a memory 532, and one or more storage media 530 (for example, one or more mass storage devices) storing application programs 542 or data 544. Among them, the memory 532 and the storage medium 530 can be temporary storage or permanent storage. The program stored in the storage medium 530 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations in the server. Furthermore, the central processing unit 522 can be configured to communicate with the storage medium 530 to execute a series of instruction operations in the storage medium 530 on the server 500.
[0159] The server 500 may also include one or more power supplies 526, one or more wired or wireless network interfaces 550, one or more input and output interfaces 558, one or more keyboards 556, and / or one or more operating systems 541, such as Windows ServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, etc.
[0160] A person of ordinary skill in the art can understand that all or part of the steps of implementing the above-mentioned method embodiment can be completed by hardware related to program instructions, and the above-mentioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above-mentioned method embodiment; and the above-mentioned storage medium can be at least one of the following media: read-only memory (English: read-only memory, abbreviated: ROM), RAM, magnetic disk or optical disk, etc. Various media that can store program codes.
[0161] It should be noted that each embodiment in this specification is described in a progressive manner, and the same and similar parts between the embodiments can refer to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device and system embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can refer to the partial description of the method embodiments. The device and system embodiments described above are merely schematic, in which the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative work.
[0162] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A method for creating a page view component, characterized in that: The method comprises: Before creating a page view component corresponding to a target object, by initializing a running environment of a target rendering engine, a system rendering engine of a smart terminal where the target object is deployed is replaced with the target rendering engine; the performance of the target rendering engine is better than that of the system rendering engine, and the target rendering engine includes a difference parameter, and the difference parameter is used to identify the difference of the system rendering engine under different versions; If a request for creating a page view component corresponding to the target object is obtained, the page view component corresponding to the target object is created according to the target rendering engine.
2. The method according to claim 1, characterized in that: Before creating the page view component corresponding to the target object, the method includes: When the smart terminal starts the target object, or when a request for a page view component corresponding to the target object is generated.
3. The method according to claim 1, characterized in that The step of creating a page view component corresponding to the target object according to the target rendering engine includes: Determine target version information of the system rendering engine of the smart terminal; According to the target version information and the difference parameters, a create page view component corresponding to the target object is created by the target rendering engine.
4. The method according to any one of claims 1 to 3, characterized in that: The initialization of the operating environment of the target rendering engine includes: Obtaining a software development kit for the target rendering engine; The target rendering engine is initialized in its operating environment according to the software development kit.
5. The method according to any one of claims 1 to 3, characterized in that: The step of replacing the system rendering engine of the smart terminal with the target rendering engine includes: By creating an instance of the target rendering engine, the system rendering engine of the smart terminal is replaced with the target rendering engine.
6. The method according to any one of claims 1 to 3, characterized in that: The method further comprises: Sending a version detection request to a server, wherein the version detection request includes version information of the target rendering engine; Obtaining updated content of version information for the target rendering engine from the server; The target rendering engine is updated according to the update content.
7. A device for creating a page view component, characterized in that: The device comprises a replacement unit and a creation unit: The replacement unit is used to replace the system rendering engine of the smart terminal where the target object is deployed with the target rendering engine by initializing the operating environment of the target rendering engine before creating the page view component corresponding to the target object; the performance of the target rendering engine is better than that of the system rendering engine, and the target rendering engine includes a difference parameter, and the difference parameter is used to identify the difference of the system rendering engine under different versions; The creation unit is used to create the page view component corresponding to the target object according to the target rendering engine if a request for creating the page view component corresponding to the target object is obtained.
8. The device according to claim 7, characterized in that Before creating the page view component corresponding to the target object, it includes: when the smart terminal starts the target object, or when generating a request for the page view component corresponding to the target object.
9. The device according to claim 7, characterized in that The creation unit is specifically used for: Determine target version information of the system rendering engine of the smart terminal; According to the target version information and the difference parameters, a create page view component corresponding to the target object is created by the target rendering engine.
10. The device according to any one of claims 7 to 9, characterized in that: The replacement unit is specifically used for: Obtaining a software development kit for the target rendering engine; The target rendering engine is initialized in its operating environment according to the software development kit.
11. The device according to any one of claims 7 to 9, characterized in that: The replacement unit is further specifically used for: By creating an instance of the target rendering engine, the system rendering engine of the smart terminal is replaced with the target rendering engine.
12. The device according to any one of claims 7 to 9, characterized in that: The creation unit is further specifically used for: Sending a version detection request to a server, wherein the version detection request includes version information of the target rendering engine; Obtaining updated content of version information for the target rendering engine from the server; The target rendering engine is updated according to the update content.
13. A device for creating a page view component, characterized in that: The system comprises a memory and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by one or more processors, wherein the one or more programs include instructions for performing the following operations: Before creating a page view component corresponding to a target object, by initializing a running environment of a target rendering engine, a system rendering engine of a smart terminal where the target object is deployed is replaced with the target rendering engine; the performance of the target rendering engine is better than that of the system rendering engine, and the target rendering engine includes a difference parameter, and the difference parameter is used to identify the difference of the system rendering engine under different versions; If a request for creating a page view component corresponding to the target object is obtained, the page view component corresponding to the target object is created according to the target rendering engine.
14. The device according to claim 13, characterized in that Before creating the page view component corresponding to the target object, it includes: when the smart terminal starts the target object, or when generating a request for the page view component corresponding to the target object.
15. The device according to claim 13, characterized in that The processor executes the one or more programs including instructions for performing the following operations: Determine target version information of the system rendering engine of the smart terminal; According to the target version information and the difference parameters, a create page view component corresponding to the target object is created by the target rendering engine.
16. The device according to any one of claims 13 to 15, characterized in that: The processor executes the one or more programs including instructions for performing the following operations: Obtaining a software development kit for the target rendering engine; The target rendering engine is initialized in its operating environment according to the software development kit.
17. The device according to any one of claims 13 to 15, characterized in that: The processor executes the one or more programs including instructions for performing the following operations: By creating an instance of the target rendering engine, the system rendering engine of the smart terminal is replaced with the target rendering engine.
18. The device according to any one of claims 13 to 15, characterized in that: The processor executes the one or more programs including instructions for performing the following operations: Sending a version detection request to a server, wherein the version detection request includes version information of the target rendering engine; Obtaining updated content of version information for the target rendering engine from the server; The target rendering engine is updated according to the update content.
19. A machine-readable medium having instructions stored thereon, which, when executed by one or more processors, enables the device to execute the method for creating a page view component as described in any one of claims 1 to 6.
