Rendering method and device, medium and product
By using the rendering engine for rendering in the rendering service application and monitoring the thread to manage the rendering service, the problem that the stability of the rendering service on the Android platform is affected by the virtual screen and Activity status is solved, achieving higher stability and performance.
Patent Information
- Application Number
- CN202410832897.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-25
- Publication Date
- 2024-09-10
AI Technical Summary
The cross-process background rendering solution on the Android platform relies on the status of the virtual screen and Activity, which reduces the stability of the rendering service and requires the application of additional cover mechanisms to cope with various status changes.
By obtaining the application's business data, the rendering engine in the rendering service application is used to render in the application's canvas to avoid relying on the status of the virtual screen and Activity. The rendering engine monitoring thread is started for monitoring to ensure the stable operation of the rendering service.
It improves the stability of the rendering service, reduces the impact on the rendering service due to virtual screen and activity state changes, simplifies the life cycle management of the rendering service, and enhances the stability and performance of the application.
Smart Images

Figure CN118626196A
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a rendering method, device, medium and product. Background Art
[0002] Currently, the cross-process background rendering solution on the Android platform first creates a virtual screen, then starts an Activity on the virtual screen, and then starts the 3D rendering service in the Activity.
[0003] Since the life cycle of the 3D rendering service is heavily dependent on the status of the Activity and the virtual screen, and the virtual screen and the Activity are common system capabilities and cannot provide special support for 3D rendering, many states affect the rendering service, requiring the application to make many additional backup mechanisms, which greatly reduces the stability of the application.
[0004] The above contents are only used to assist in understanding the technical solution of the present application and do not constitute an admission that the above contents are prior art. Summary of the invention
[0005] The main purpose of this application is to provide a rendering method, device, medium and product, aiming to improve the stability of rendering services.
[0006] To achieve the above object, the present application provides a rendering method, the method comprising:
[0007] Obtaining business data corresponding to at least one application;
[0008] Based on a rendering engine in a rendering service application, the business data is rendered in a canvas corresponding to the at least one application to obtain a rendering screen.
[0009] In one embodiment, the rendering engine in the rendering service application renders the business data in the canvas corresponding to the at least one application to obtain the rendered screen, and before the step further includes:
[0010] In response to a preset condition being met, starting the rendering engine; and / or,
[0011] A rendering engine monitoring thread is started to monitor the rendering engine.
[0012] In one embodiment, in response to satisfying a preset condition, the step of starting the rendering engine comprises:
[0013] Initialize the rendering service application, create a monitor and start a monitoring thread;
[0014] Determining whether the rendering service application has been initialized by the monitor and guiding the monitoring thread;
[0015] If the rendering service application is initialized, the rendering engine is started.
[0016] In one embodiment, the steps of creating a monitor and starting a boot monitoring thread further include:
[0017] Monitoring a vehicle control signal through the monitor, wherein the vehicle control signal includes a power-off signal and / or a power-on signal;
[0018] If the power-off signal is detected, suspending the operation of the rendering engine;
[0019] If the power-on signal is detected, the rendering engine is resumed.
[0020] In one embodiment, the step of starting the rendering engine further includes at least one of the following:
[0021] Adding the main view of the rendering engine to the system floating layer;
[0022] Creating a primary surface for the rendering engine;
[0023] Initializing the rendering engine;
[0024] The rendering engine is monitored through the rendering engine monitoring thread.
[0025] In one embodiment, the step of monitoring the rendering engine through the rendering engine monitoring thread includes:
[0026] Identify whether the rendering engine has been started;
[0027] If the rendering engine has not been started, determining whether the detection mark has reached a first preset number of times, and if the detection mark has reached the first preset number of times, exiting the process; if the detection mark has not reached the first preset number of times, waiting for a first preset time and returning to execute the step of identifying whether the rendering engine has been started and subsequent steps;
[0028] If the rendering engine has been started, it is determined whether the main thread detection has been turned on. If the main thread detection has not been turned on, the process returns to execute the step of identifying whether the rendering engine has been started and subsequent steps after waiting for a first preset time; if the main thread detection has been turned on, it is determined whether to exit the process based on the number of detection marks.
[0029] In one embodiment, the step of determining whether to exit the process according to the number of detection marks includes:
[0030] Determine whether the number of detection marks reaches a second preset number;
[0031] If the number of times of detecting the mark reaches a second preset number, outputting or recording the tracking information, and returning to the step of identifying whether the rendering engine has been started and subsequent steps after waiting for a second preset time;
[0032] If the number of detection marks does not reach the second preset number, determine whether the number of detection marks reaches the third preset number. If the number of detection marks does not reach the third preset number, wait for the second preset time and then return to execute the step of identifying whether the rendering engine has been started and subsequent steps; if the number of detection marks reaches the third preset number, exit the process.
[0033] In addition, to achieve the above purpose, the present application also proposes a rendering device, the rendering device comprising:
[0034] An acquisition module, used to acquire business data corresponding to at least one application;
[0035] The rendering module is used to render the business data in a canvas corresponding to the at least one application based on a rendering engine in the rendering service application to obtain a rendering picture.
[0036] In addition, to achieve the above objectives, the present application also proposes a rendering device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the rendering method described above.
[0037] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the rendering method described above are implemented.
[0038] In addition, to achieve the above-mentioned purpose, the present application also provides a computer program product, wherein the computer program product includes a computer program, and when the computer program is executed by a processor, the steps of the rendering method described above are implemented.
[0039] One or more technical solutions proposed in this application have at least the following technical effects:
[0040] By obtaining business data corresponding to at least one application; based on the rendering engine in the rendering service application, rendering the business data in the canvas corresponding to the at least one application to obtain a rendering screen, and by deploying the rendering engine in the rendering service application, there is no need to deploy the rendering engine separately in each application that needs the rendering service, and there is no need to use a virtual screen and Activity. The business data corresponding to the at least one application is rendered by the rendering engine in the rendering service application, and the life cycle of the rendering service does not need to depend on the status of the Activity and the virtual screen, thereby avoiding the impact of the status changes of the Activity and the virtual screen on the rendering service, and improving the stability of the rendering service. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0042] 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, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0043] Figure 1 This is a flowchart of the first embodiment of the rendering method of the present application;
[0044] Figure 2 A schematic diagram of the overall architecture provided for an embodiment of the present application;
[0045] Figure 3 This is a flowchart of a second embodiment of the rendering method of the present application;
[0046] Figure 4 This is a schematic diagram of the monitoring process flow in an embodiment of the present application;
[0047] Figure 5 This is a flowchart of a third embodiment of the rendering method of the present application;
[0048] Figure 6 This is a schematic diagram of the module structure of the rendering device according to an embodiment of the present application;
[0049] Figure 7 Schematic diagram of the device structure of the hardware operating environment involved in the rendering method in the embodiment of the present application.
[0050] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0051] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.
[0052] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.
[0053] The main solution of the embodiment of the present application is: by obtaining business data corresponding to at least one application; based on the rendering engine in the rendering service application, the business data is rendered in the canvas corresponding to the at least one application to obtain a rendered screen, and by deploying the rendering engine in the rendering service application, there is no need to deploy the rendering engine separately in each application that requires the rendering service, and there is no need to use a virtual screen and an Activity. The business data corresponding to the at least one application is rendered by the rendering engine in the rendering service application, and the life cycle of the rendering service does not need to depend on the status of the Activity and the virtual screen, thereby avoiding the impact of the status changes of the Activity and the virtual screen on the rendering service, and improving the stability of the rendering service.
[0054] Technical terms involved in the embodiments of this application:
[0055] Activity: Activity is a key component of an Android application. Activity provides a window in which the application draws its interface. This window usually fills the screen, but it may be smaller than the screen and float on top of other windows. Usually, an Activity implements one screen in the application;
[0056] Surface: Surface is a key class in Android. Surface is an abstract canvas that provides a basic framework for drawing graphics. It can be regarded as an underlying image buffer on which drawing operations can be performed.
[0057] In this embodiment, for the convenience of description, the following description is made with the rendering device as the execution subject.
[0058] The existing cross-process background rendering solution on the Android platform first creates a virtual screen, then starts an Activity on the virtual screen, and then starts the 3D rendering service in the Activity. Therefore, the life cycle of the 3D rendering service is heavily dependent on the status of the Activity and the virtual screen. However, the virtual screen and Activity are common system capabilities and cannot provide special support for 3D rendering. As a result, many states affect the 3D rendering service, requiring the application to do a lot of additional backup mechanisms, which greatly reduces the stability and performance of the application.
[0059] This application provides a solution that no longer requires the creation of a virtual screen and Activity, and no longer requires attention to the status of the two. This allows the 3D rendering service to complete its functions more simply and clearly, without being affected by the status of the above two.
[0060] It should be noted that the execution subject of this embodiment may be a computing service device with data processing, network communication and program running functions, such as a vehicle-mounted terminal, a tablet computer, a personal computer, a mobile phone, etc., or an electronic device capable of realizing the above functions, a rendering device, etc. The following takes the rendering device as an example to illustrate this embodiment and the following embodiments.
[0061] Based on this, the present application embodiment provides a rendering method, referring to Figure 1 , Figure 1 This is a flowchart of the first embodiment of the rendering method of the present application.
[0062] In this embodiment, the rendering method includes steps S10 to S20:
[0063] Step S10, obtaining business data corresponding to at least one application;
[0064] Specifically, refer to Figure 2 , Figure 2 The overall architecture diagram provided for the embodiment of the present application is as follows: Figure 2 As shown, a rendering service application (Unity Service App) is created in an embodiment of the present application, wherein the Unity Service App includes a rendering layer, a business layer, an Android communication layer, and a network communication layer. The rendering engine is deployed in the rendering layer, and the rendering engine used in this embodiment is Unity.
[0065] Optionally, before or after the step of obtaining business data corresponding to at least one application, the step also includes: at least one application passes its own surface information to the rendering engine in the rendering service application, wherein the surface is the handle of the original buffer managed by the screen display content synthesizer, and the surface contains a Canvas member, and this Canvas is the canvas used to draw images.
[0066] Optionally, at least one application may transmit its own surface information to the rendering engine in the rendering service application through the service component, or may transmit its own surface information to the rendering engine in the rendering service application by broadcasting, wherein the speed of transmitting the surface information through the service component is faster.
[0067] Optionally, in an embodiment of the present application, a rendering service application can provide rendering services for multiple applications at the same time, wherein at least one application can be various types of applications that require rendering services, such as smart voice assistants, air conditioners, and music players. In this embodiment, smart voice assistants and air conditioners are used as examples for illustration.
[0068] Step S20: Based on the rendering engine in the rendering service application, the business data is rendered in the canvas corresponding to the at least one application to obtain a rendering picture.
[0069] Furthermore, after obtaining the business data corresponding to at least one application, the business data may be rendered in a canvas corresponding to the at least one application based on a rendering engine in a rendering service application to obtain a rendered image.
[0070] Optionally, the business data corresponding to at least one application may include relevant data such as a determined interface layout, icon style, text font, and dynamic effects. The designed interface elements may be rendered onto the canvas through a rendering engine, wherein the interface elements may include object images or icons. According to their shape, position, and orientation, their geometric information, such as vertex coordinates, normals, UV coordinates, etc., may be calculated in the screen space. According to the material properties of the object, the information obtained from geometric processing and lighting calculation is applied to each pixel to determine its final color and texture effect. Optionally, the interface elements may also include controls such as buttons, sliders, and text boxes. For controls that require dynamic interaction, such as button clicks, menu expansion, etc., animation effects may be used to enhance the user experience. The rendering engine may implement these animation effects through gradients, zooms, translations, and the like.
[0071] Optionally, for applications such as smart voice assistants, the system may provide some feedback, such as real-time feedback or animation prompts of voice recognition, and the rendering engine can display the corresponding feedback information on the screen to indicate the user's current operation status. According to the user's operation, such as touching the screen, knob control, etc., the system needs to respond and update the interface. The rendering engine is responsible for capturing user input events and updating the corresponding control status and interface display. For example, when a user uses a smart voice assistant for navigation in a car system, the user enters the destination by voice and sees the navigation route and intersection prompts on the screen. The rendering engine is responsible for rendering elements such as navigation maps, route lines, text prompts, etc. to the screen, and updating the navigation information in real time according to the vehicle's position. When the user approaches a turn or intersection, the system may provide voice prompts and display corresponding icons and text prompts on the screen to indicate how the user should drive.
[0072] This embodiment adopts the above scheme, specifically by obtaining business data corresponding to at least one application; based on the rendering engine in the rendering service application, the business data is rendered in the canvas corresponding to the at least one application to obtain a rendering screen, and by deploying the rendering engine in the rendering service application, there is no need to deploy the rendering engine separately in each application that requires the rendering service, and there is no need to use a virtual screen and an Activity. The business data corresponding to the at least one application is rendered by the rendering engine in the rendering service application, and the life cycle of the rendering service does not need to depend on the status of the Activity and the virtual screen, thereby avoiding the impact of the status changes of the Activity and the virtual screen on the rendering service, and improving the stability of the rendering service.
[0073] Based on the first embodiment of the present application, in the second embodiment of the present application, the same or similar contents as those in the above-mentioned embodiment 1 can refer to the above introduction, and will not be repeated later. Figure 3 Before step S20, the rendering method further includes step S01 and / or step S02:
[0074] Step S01: in response to satisfying a preset condition, starting the rendering engine;
[0075] Optionally, in response to satisfying a preset condition, the step of starting the rendering engine includes:
[0076] Initialize the rendering service application, create a monitor and start a monitoring thread;
[0077] Determining whether the rendering service application has been initialized by the monitor and guiding the monitoring thread;
[0078] If the rendering service application is initialized, the rendering engine is started.
[0079] Specifically, refer to Figure 4 , Figure 4 Schematic diagram of the monitoring process flow in the embodiment of the present application, such as Figure 4 As shown, in the embodiment of the present application, the APP is initialized first, that is, the rendering service application is initialized, and a monitor is created to monitor whether the process is in an abnormal state, for example, to capture Block information to determine whether the 3D rendering service needs to be restarted, and to identify whether the 3D rendering service is completed. The boot monitoring thread, that is, the Boot monitoring thread, is started, and then the system is determined to be booted according to whether boot_complete is completed.
[0080] Optionally, boot_complete is a broadcast event in the Android system, which is sent after the system boot is complete to notify the application that the system has been booted. This broadcast event is commonly used, and developers can perform some initialization operations in the broadcast event receiver, such as starting a service or sending a notification.
[0081] It should be noted that the reception of the boot_complete broadcast requires the corresponding permission, namely android.Manifest.permission#RECEIVE_BOOT_COMPLETED. At the same time, in order to receive the BOOT_COMPLETED broadcast, it is also necessary to declare the broadcast event receiver in the AndroidManifest.xml file.
[0082] Optionally, if it is determined that boot_complete is not completed, you can wait for a period of time (for example, 200 milliseconds) and then determine whether boot_complete is completed; if it is determined that boot_complete is completed, you can control Unity to start creating.
[0083] Optionally, after the step of creating a monitor and starting the boot monitoring thread, the step further includes:
[0084] Monitoring a vehicle control signal through the monitor, wherein the vehicle control signal includes a power-off signal and / or a power-on signal;
[0085] If the power-off signal is detected, suspending the operation of the rendering engine;
[0086] If the power-on signal is detected, the rendering engine is resumed.
[0087] Optionally, in the embodiment of the present application, it is also necessary to create a vehicle control service to monitor power on and off signals. When a power off signal is monitored, the rendering engine Unity suspends operation to save energy; when a power on signal is monitored, the rendering engine Unity resumes operation to provide users with a better user experience.
[0088] Step S02: starting a rendering engine monitoring thread to monitor the rendering engine.
[0089] Optionally, after the step of starting the rendering engine, at least one of the following items is further included:
[0090] Adding the main view of the rendering engine to the system floating layer;
[0091] Creating a primary surface for the rendering engine;
[0092] Initializing the rendering engine;
[0093] The rendering engine is monitored through the rendering engine monitoring thread.
[0094] Optionally, the virtual screen and Activity are removed in the embodiment of the present application, and the instantiation of Unity is placed in the Application (rendering service application), so that the life cycle of Unity is controlled by the application itself. The main view (View) of Unity is implemented through the system floating layer, and the important messages of the Activity are migrated to the Application (rendering service application).
[0095] This embodiment uses the above scheme, specifically by starting the rendering engine in response to meeting a preset condition; and / or, starting a rendering engine monitoring thread for monitoring the rendering engine. By placing the instantiation of the rendering engine in the rendering service application, the life cycle of Unity is controlled by the application itself, thereby improving application stability, reducing the probability of application blocking or crashing, and accelerating application startup speed and service recovery speed, so as to improve the user's visual experience. The structure and coding are simpler and clearer, and later maintenance and expansion are easier.
[0096] Based on any of the above embodiments of the present application, in the third embodiment of the present application, the same or similar contents as any of the above embodiments can refer to the above introduction, and will not be repeated later. Figure 5 The step of monitoring the rendering engine through the rendering engine monitoring thread includes steps A01 to A03:
[0097] Step A01: Identify whether the rendering engine has been started;
[0098] Step A02: if the rendering engine has not been started, determining whether the detection mark has reached a first preset number of times; if the detection mark has reached the first preset number of times, exiting the process; if the detection mark has not reached the first preset number of times, waiting for a first preset time and returning to execute the step of identifying whether the rendering engine has been started and subsequent steps;
[0099] Step A03: If the rendering engine has been started, determine whether the main thread detection has been turned on. If the main thread detection has not been turned on, wait for a first preset time and then return to execute the step of identifying whether the rendering engine has been started and subsequent steps; if the main thread detection has been turned on, determine whether to exit the process based on the number of detection marks.
[0100] Specifically, in Unity, the number of times the monitoring thread detects a mark usually refers to the number of times the main thread periodically checks the status of a specific mark. This mark may be a Boolean value, an integer value, or other types of variables, used to indicate a certain state or the completion of an operation. Its function is usually to implement a synchronization mechanism to ensure that in a multi-threaded environment, the main thread can obtain the status information or mark changes of other threads in a timely manner in order to make corresponding responses or processing. Specifically, the main thread periodically checks the mark status and can obtain the status information of other threads in a timely manner, thereby achieving real-time response.
[0101] For example, in a multi-threaded scenario, if there is a mark indicating that an operation has been completed, the main thread can execute subsequent operations or logic in a timely manner by regularly checking the mark status. By monitoring the number of times the thread detects the mark, the synchronization between the main thread and other worker threads can be ensured. The main thread can determine whether it needs to wait for the completion of an operation or perform other processing based on the state of the mark, thereby avoiding race conditions or data inconsistencies. The number of times the monitoring thread detects the mark is usually performed at a certain frequency, which can effectively control the running frequency of the main thread, reduce unnecessary resource consumption, and improve overall performance. The number of times the monitoring thread detects the mark can be adjusted according to specific needs, and the detection frequency can be flexibly selected according to actual conditions to balance the relationship between real-time and performance.
[0102] Reference Figure 4 As shown, in the embodiment of the present application, after Unity starts to be created, the Boot monitoring thread can be exited, and the Unity monitoring thread (i.e., the rendering engine monitoring thread) can be started to determine whether the Unity startup is complete. If Unity has not completed startup, the detection mark is 10 times (10 seconds), that is, the first preset number of times is 10 in this embodiment. If the detection mark is not 10 times (10 seconds), wait for the first preset time (for example, 1 second) and then re-determine whether the Unity startup is complete.
[0103] Optionally, if Unity startup is completed, it is further determined whether the UnityMain thread (main thread) detection is turned on. If the UnityMain thread detection is not turned on, wait for a first preset time (for example, 1 second) and then re-determine whether the Unity startup is completed; if the UnityMain thread detection is turned on, it is determined whether to exit the process based on the number of detection marks.
[0104] Optionally, the step of determining whether to exit the process according to the number of detection marks includes:
[0105] Determine whether the number of detection marks reaches a second preset number;
[0106] If the number of times of detecting the mark reaches a second preset number, outputting or recording the tracking information, and returning to the step of identifying whether the rendering engine has been started and subsequent steps after waiting for a second preset time;
[0107] If the number of detection marks does not reach the second preset number, determine whether the number of detection marks reaches the third preset number. If the number of detection marks does not reach the third preset number, wait for the second preset time and then return to execute the step of identifying whether the rendering engine has been started and subsequent steps; if the number of detection marks reaches the third preset number, exit the process.
[0108] Optionally, if UnityMain thread detection is turned on, determine whether the detection mark is 5 times (5 seconds). If the detection mark is 5 times (5 seconds), print the trace, and output or record the tracking information of program execution to better understand the program's running process, troubleshoot problems, or analyze performance bottlenecks. At the same time, re-determine whether Unity startup is completed after waiting for a second preset time (for example, 1 second).
[0109] Optionally, if Unity startup is completed and UnityMain thread detection is turned on, determine whether the detection mark is 10 times (10 seconds). If the detection mark is 10 times (10 seconds), print the trace and wait for a second preset time (for example, 1 second) before re-determining whether Unity startup is completed.
[0110] Optionally, if it is re-determined that Unity startup is complete and UnityMain thread detection has been turned on, and the detection mark is not 5 or 10 times (5 or 10 seconds), it is further determined whether the detection mark is 15 times (15 seconds), that is, the third preset number of times. If the detection mark is not 15 times (15 seconds), it is re-determined whether Unity startup is complete after waiting for the second preset time (for example, 1 second); if the detection mark is 15 times (15 seconds), the process is exited, and the App initialization can be re-executed.
[0111] This embodiment adopts the above scheme, specifically by identifying whether the rendering engine has been started; if the rendering engine has not been started, determining whether the detection mark has reached the first preset number of times, and if the detection mark has reached the first preset number of times, exiting the process; if the detection mark has not reached the first preset number of times, waiting for the first preset time and returning to execute the step of identifying whether the rendering engine has been started and subsequent steps; if the rendering engine has been started, determining whether the main thread detection has been turned on, if the main thread detection has not been turned on, waiting for the first preset time and returning to execute the step of identifying whether the rendering engine has been started and subsequent steps; if the main thread detection has been turned on, determining whether to exit the process according to the number of detection marks, providing a bottom-up trigger mechanism for the operation of the rendering engine, while narrowing the bottom-up range, thereby reducing the probability of the bottom-up trigger.
[0112] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the rendering method of the present application. More simple transformations based on this technical concept are all within the protection scope of the present application.
[0113] This application also provides a rendering device, please refer to Figure 6 , the rendering device comprises:
[0114] An acquisition module, used to acquire business data corresponding to at least one application;
[0115] The rendering module is used to render the business data in a canvas corresponding to the at least one application based on a rendering engine in the rendering service application to obtain a rendering picture.
[0116] The rendering device provided by the present application adopts the rendering method in the above embodiment to solve the technical problem of rendering. Compared with the prior art, the beneficial effects of the rendering device provided by the present application are the same as the beneficial effects of the rendering method provided by the above embodiment, and other technical features in the rendering device are the same as the features disclosed in the above embodiment method, which will not be repeated here.
[0117] The present application provides a rendering device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the rendering method in the above-mentioned embodiment 1.
[0118] Reference below Figure 7, which shows a schematic diagram of the structure of a rendering device suitable for implementing an embodiment of the present application. The rendering device in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 7 The rendering device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0119] like Figure 7 As shown, the rendering device may include a processing device 1001 (e.g., a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the rendering device are also stored. The processing device 1001, ROM1002, and RAM1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touch pad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 may allow the rendering device to communicate with other devices wirelessly or by wire to exchange data. Although the figure shows a rendering device with various systems, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems may be implemented or have alternatively.
[0120] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.
[0121] The rendering device provided by the present application adopts the rendering method in the above embodiment to solve the technical problem of rendering. Compared with the prior art, the beneficial effects of the rendering device provided by the present application are the same as the beneficial effects of the rendering method provided by the above embodiment, and the other technical features in the rendering device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.
[0122] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.
[0123] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which 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.
[0124] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, and the computer-readable program instructions are used to execute the rendering method in the above-mentioned embodiment.
[0125] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination of the above.
[0126] The computer-readable storage medium may be included in the rendering device; or may exist independently without being assembled into the rendering device.
[0127] The computer-readable storage medium carries one or more programs. When the one or more programs are executed by the rendering device, the rendering device: obtains business data corresponding to at least one application; based on the rendering engine in the rendering service application, renders the business data in the canvas corresponding to the at least one application to obtain a rendering screen.
[0128] Computer program code for performing the operations of the present application may be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0129] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0130] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.
[0131] The readable storage medium provided in the present application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned rendering method, and can solve the technical problems of rendering. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in the present application are the same as the beneficial effects of the rendering method provided in the above-mentioned embodiment, and will not be repeated here.
[0132] The present application also provides a computer program product, including a computer program, which implements the steps of the above-mentioned rendering method when executed by a processor.
[0133] The computer program product provided by the present application can solve the technical problem of rendering. Compared with the prior art, the beneficial effects of the computer program product provided by the present application are the same as the beneficial effects of the rendering method provided by the above embodiment, which will not be repeated here.
[0134] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.
Claims
1. A rendering method, characterized in that: The method includes: Obtaining business data corresponding to at least one application; Based on a rendering engine in a rendering service application, the business data is rendered in a canvas corresponding to the at least one application to obtain a rendering screen.
2. The method according to claim 1, characterized in that The rendering engine in the rendering service application renders the business data in the canvas corresponding to the at least one application to obtain a rendering screen, and the step further includes: In response to a preset condition being met, starting the rendering engine; and / or, A rendering engine monitoring thread is started to monitor the rendering engine.
3. The method according to claim 2, characterized in that In response to satisfying a preset condition, the step of starting the rendering engine comprises: Initialize the rendering service application, create a monitor and start a monitoring thread; Determining whether the rendering service application has been initialized by the monitor and guiding the monitoring thread; If the rendering service application is initialized, the rendering engine is started.
4. The method as claimed in claim 3, characterized in that The steps of creating a monitor and starting the boot monitoring thread also include: Monitoring a vehicle control signal through the monitor, wherein the vehicle control signal includes a power-off signal and / or a power-on signal; If the power-off signal is detected, suspending the operation of the rendering engine; If the power-on signal is detected, the rendering engine is resumed.
5. The method according to claim 2, characterized in that After the step of starting the rendering engine, at least one of the following steps may also be included: Adding the main view of the rendering engine to the system floating layer; Creating a primary surface for the rendering engine; Initializing the rendering engine; The rendering engine is monitored through the rendering engine monitoring thread.
6. The method according to claim 5, characterized in that The step of monitoring the rendering engine through the rendering engine monitoring thread includes: Identify whether the rendering engine has been started; If the rendering engine has not been started, determining whether the detection mark has reached a first preset number of times, and if the detection mark has reached the first preset number of times, exiting the process; if the detection mark has not reached the first preset number of times, waiting for a first preset time and returning to execute the step of identifying whether the rendering engine has been started and subsequent steps; If the rendering engine has been started, it is determined whether the main thread detection has been turned on. If the main thread detection has not been turned on, the process returns to execute the step of identifying whether the rendering engine has been started and subsequent steps after waiting for a first preset time; if the main thread detection has been turned on, it is determined whether to exit the process based on the number of detection marks.
7. The method according to claim 6, characterized in that The step of determining whether to exit the process according to the number of detection marks comprises: Determine whether the number of detection marks reaches a second preset number; If the number of times of detecting the mark reaches a second preset number, outputting or recording the tracking information, and returning to the step of identifying whether the rendering engine has been started and subsequent steps after waiting for a second preset time; If the number of detection marks does not reach the second preset number, determine whether the number of detection marks reaches the third preset number. If the number of detection marks does not reach the third preset number, wait for the second preset time and then return to execute the step of identifying whether the rendering engine has been started and subsequent steps; if the number of detection marks reaches the third preset number, exit the process.
8. A rendering device, characterized in that: The device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the rendering method according to any one of claims 1 to 7.
9. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the rendering method according to any one of claims 1 to 7 are implemented.
10. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the steps of the rendering method according to any one of claims 1 to 7 are implemented.
