A rendering instruction processing method, device and equipment
By intercepting and parsing rendering instructions on non-GPU devices and dynamically adjusting rendering needs according to CPU load, the performance bottleneck of non-GPU devices in graphics rendering is solved, achieving efficient rendering performance and extended device service life.
Patent Information
- Application Number
- CN202411782307.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-05
- Publication Date
- 2025-04-04
AI Technical Summary
Traditional graphics rendering technology is difficult to directly adapt to non-GPU devices such as mobile devices and embedded systems, resulting in a decrease in the overall performance and service life of the device, affecting the user experience.
By determining whether the device has graphics card support, if it is a non-GPU device, the rendering instructions are intercepted and parsed through the management module, the CPU load is monitored in real time and the rendering needs are adjusted according to it, the second rendering instructions are generated, and finally sent to the rendering optimization engine for execution.
It realizes dynamic adjustment and optimization of rendering requirements, improves resource utilization and rendering performance, extends the service life of the device, and improves the user experience.
Smart Images

Figure CN119762324A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a rendering instruction processing method, device and equipment. Background Art
[0002] Graphics rendering instructions refer to the instructions used in computer graphics to control and instruct the computer on how to convert complex graphics data into pixel images that users can ultimately see on the screen. The generation of graphics rendering instructions usually starts with a graphics application. After completing the creation and property setting of the graphics object, the application uses the powerful functions of the graphics API (application programming interface) to convert these graphics description information into specific rendering instructions that can be understood and executed by computer hardware.
[0003] Traditionally, GPU (Graphics Processing Unit) is widely used in graphics rendering. Its parallel computing and specially optimized graphics rendering pipeline enable it to perform well in processing large-scale graphics data. In the actual execution of rendering instructions, GPU (Graphics Processing Unit) as a core hardware component processes these rendering instructions through a series of highly parallelized and specially optimized hardware architectures, as well as numerous computing units designed specifically for graphics computing. In the process of implementing the technical solution of the invention in the embodiments of the present application, the inventors of the present application found that the above technology has at least the following technical problems:
[0004] Traditional graphics rendering technology often cannot be directly adapted to non-GPU devices such as mobile devices and embedded systems, and requires customized optimization based on their characteristics. Summary of the invention
[0005] In order to solve the above problems, the present application discloses a rendering instruction processing method, device and equipment. The technical problem that the use of non-GPU devices to execute rendering instructions in the prior art weakens the overall performance and service life of the device and affects the user experience is solved, and the technical effects of ensuring rendering quality, improving the service life of the device, and improving the user experience are achieved.
[0006] In a first aspect, the present application discloses a rendering instruction processing method, comprising the following steps:
[0007] Receive a first rendering instruction sent by the application, and determine whether the device has graphics card support;
[0008] When the device is a non-GPU device, intercepting the first rendering instruction;
[0009] Sending the intercepted first rendering instruction to the management module of the device, parsing the first rendering instruction through the management module to determine the rendering requirement;
[0010] Real-time monitoring of CPU load;
[0011] At least according to the CPU load, adjusting the rendering requirement and generating a second rendering instruction;
[0012] The second rendering instruction is sent to the rendering optimization engine.
[0013] In some embodiments, real-time monitoring of CPU load includes the following steps:
[0014] Monitor the CPU occupancy, memory usage and rendering frame time of the device in real time;
[0015] At least according to the CPU load, adjusting the rendering requirement and generating a second rendering instruction includes:
[0016] According to the CPU occupancy rate of the device, the memory usage, the rendering frame time, and the CPU load, the rendering requirement is adjusted to generate the second rendering instruction.
[0017] In some embodiments, it also includes:
[0018] monitoring the temperature of the device in real time;
[0019] At least according to the CPU load, adjusting the rendering requirement and generating a second rendering instruction includes:
[0020] The rendering requirement is adjusted according to the temperature of the device and the CPU load, and the second rendering instruction is generated.
[0021] In some embodiments, it also includes:
[0022] Real-time monitoring of power consumption and battery life of the device;
[0023] At least according to the CPU load, adjusting the rendering requirement and generating a second rendering instruction includes:
[0024] The rendering requirement is adjusted according to the power consumption, the battery life, and the CPU load, and the second rendering instruction is generated.
[0025] In some embodiments, it also includes:
[0026] Monitor the performance indicators of the application in real time, including frame rate, response time and system occupancy rate;
[0027] At least according to the CPU load, adjusting the rendering requirement and generating a second rendering instruction includes:
[0028] The rendering requirement is adjusted according to the performance indicator and the CPU load, and the second rendering instruction is generated.
[0029] In some embodiments, adjusting the rendering requirement includes at least one of the following:
[0030] Reduce rendering resolution;
[0031] Reduce the rendering scale;
[0032] Reduce the number of objects to render;
[0033] Delete repeated and unnecessary instructions in the rendering requirements;
[0034] The related instructions in the rendering requirements are merged into a composite instruction, wherein the related instructions refer to instructions that are related to each other or act on the same rendering target together.
[0035] In some embodiments, when the device is a non-GPU device, intercepting the first rendering instruction comprises the following steps:
[0036] Determining an API or hook function based on the operating system on which the application is running;
[0037] The first rendering instruction sent by the application is intercepted by using the API or the hook function.
[0038] In some embodiments, it also includes:
[0039] In the case that the device has a graphics card support, the first rendering instruction is directly executed by the graphics card.
[0040] In a second aspect, the present application further discloses a rendering instruction processing device, comprising:
[0041] A receiving module, used for receiving a first rendering instruction sent by an application program, and determining whether the device has graphics card support;
[0042] An interception module, configured to intercept the first rendering instruction when the device is a non-GPU device;
[0043] A parsing module, used for sending the intercepted first rendering instruction to the management module of the device, and parsing the first rendering instruction by the management module to determine the rendering requirement;
[0044] Monitoring module, used to monitor CPU load in real time;
[0045] An adjustment module, configured to adjust the rendering requirement at least according to the CPU load, and generate a second rendering instruction;
[0046] A sending module is used to send the second rendering instruction to the rendering optimization engine.
[0047] In a third aspect, the present application further discloses an electronic device, comprising:
[0048] processor;
[0049] A memory, configured to store instructions executable by the processor;
[0050] The processor is configured to execute the instructions to implement any one of the rendering instruction processing methods.
[0051] Compared with the prior art, this application has the following advantages:
[0052] By judging whether there is graphics card support, and in the case of non-GPU devices, redirecting the rendering instructions sent by the application to the management module for parsing and processing, determining the rendering requirements, adjusting the rendering requirements according to the real-time monitored CPU load, realizing dynamic adjustment and optimization of rendering requirements, improving resource utilization and rendering performance, using the rendering optimization engine to execute the adjusted rendering requirements, converting rendering instructions into high-quality visual effects, and dynamically adjusting rendering parameters to avoid excessive system load, reduce system crashes, freezes and other problems, and improve the stability and reliability of non-GPU devices. The technical problem of using non-GPU devices to execute rendering instructions in the prior art that weakens the overall performance and service life of the device and affects the user experience is solved, and the technical effect of ensuring rendering quality, improving the service life of the device, and improving the user experience is achieved. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] Figure 1 is a flowchart of a rendering instruction processing method provided by at least one embodiment of the present application;
[0054] Figure 2 is a dynamic control rendering flow chart provided by at least one embodiment of the present application;
[0055] Figure 3 is an example flow chart of a rendering instruction processing method provided by at least one embodiment of the present application;
[0056] Figure 4 is a flow chart of a first method for adjusting rendering requirements provided by at least one embodiment of the present application;
[0057] Figure 5 is a flow chart of a second method for adjusting rendering requirements provided by at least one embodiment of the present application;
[0058] Figure 6 is a flowchart of a third method for adjusting rendering requirements provided by at least one embodiment of the present application;
[0059] Figure 7 is a flowchart of a fourth method for adjusting rendering requirements provided by at least one embodiment of the present application;
[0060] Figure 8is a flow chart of a method for intercepting a first rendering instruction provided by at least one embodiment of the present application;
[0061] Fig. 9 is a flow chart of a method for executing a first rendering instruction provided by at least one embodiment of the present application;
[0062] Fig.10 is a structural diagram of a rendering instruction processing device provided by at least one embodiment of the present application;
[0063] Fig.11 It is a schematic diagram of the structure of an electronic device provided by at least one embodiment of the present application. DETAILED DESCRIPTION
[0064] The embodiment of the present application determines whether there is graphics card support, and in the case of non-GPU devices, redirects the rendering instructions sent by the application to the management module for parsing and processing, determines the rendering requirements, adjusts the rendering requirements according to the real-time monitored CPU load, realizes dynamic adjustment and optimization of rendering requirements, improves resource utilization and rendering performance, uses the rendering optimization engine to execute the adjusted rendering requirements, converts the rendering instructions into high-quality visual effects, and avoids excessive system load by dynamically adjusting the rendering parameters, reduces system crashes, freezes and other problems, and improves the stability and reliability of non-GPU devices. The technical problem of using non-GPU devices to execute rendering instructions in the prior art, which weakens the overall performance and service life of the device and affects the user experience, is solved, and the technical effect of ensuring rendering quality, improving the service life of the device, and improving the user experience is achieved.
[0065] As a core hardware component, the GPU (Graphics Processing Unit) processes graphics rendering instructions through a series of highly parallelized and specially optimized hardware architectures, as well as numerous computing units designed specifically for graphics computing. When an application requires a rendering interface supported by a graphics card, and the device lacks a hardware graphics card, the system can only simulate these rendering instructions through the CPU. However, the CPU and graphics card each have their own responsibilities, with the CPU focusing on providing powerful general computing capabilities, while the graphics card specializes in efficient graphics processing. Therefore, when the system relies on the CPU to simulate the graphics card function, the CPU not only has to take on this task that is not its strong point, but also has to take into account the smooth operation of other system tasks. This leads to excessive CPU usage in the system, which not only increases the workload of the CPU, but may also have a negative impact on its stability and lifespan, thereby weakening the overall performance and lifespan of the device. In addition, due to the large amount of system resources being occupied, users may encounter the dilemma of slow application response, unsmooth operation, or even crashes, which will affect the user experience and device performance.
[0066] The technical fields involved in this application include cross-applications in multiple fields such as computer graphics processing, system resource management, and optimization of mobile smart devices. By redirecting and optimizing rendering instructions, it is intended to provide an innovative graphics processing solution for non-GPU devices. This not only involves the optimization of the graphics rendering engine, but also involves the intelligent management and scheduling of system resources, so as to maximize the performance and user experience of the device while ensuring the graphics effect. For non-GPU devices without hardware graphics cards, the performance bottleneck and insufficient resource utilization of the device in graphics processing are solved. By optimizing the processing flow of rendering instructions and dynamically adjusting rendering parameters, it is intended to improve the graphics rendering performance while minimizing the occupation of system CPU resources, thereby improving the user's graphics experience on non-GPU devices.
[0067] The advantage of this application is that it can optimize the rendering logic of the program without modifying the application code, and cooperate with the system imperceptibly, thereby saving overall performance power consumption and improving user experience. This seamless integration capability enables the technical solution of this application to be directly applied to existing applications and systems without tedious code modifications, while effectively improving the rendering efficiency and performance of the program. By reducing the power consumption of the device, it helps to extend the battery life of mobile devices, improve the stability and reliability of the device, and bring users a more lasting and high-quality user experience.
[0068] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, the present application is further described in detail below in conjunction with the accompanying drawings and specific implementation methods.
[0069] Embodiment 1
[0070] Reference Figure 1 The embodiment of the present application shows a rendering instruction processing method of the present application, including the following steps:
[0071] S10: Receive a first rendering instruction sent by the application, and determine whether the device has graphics card support.
[0072] Specifically, the first rendering instruction refers to the system instruction generated by the program application rendering screen. When the application is started or receives a user operation, the event processing mechanism inside the application is triggered. By capturing the application status and user operation events, it is converted into corresponding data or state changes. The application determines the content to be rendered and the rendering method through logical judgment and calculation. In this process, the application will call its built-in rendering engine or graphics library. The rendering engine provides a series of APIs and tools to enable the application to generate the first rendering instruction. The application will select the appropriate API to call and pass in the corresponding parameters based on the content to be rendered, which together define the specific details of the rendering. These parameters include color, shape, position, and size.
[0073] When judging whether the device has graphics card support, the task manager, device manager or DirectX diagnostic tool is called to search for GPU-related information or graphics card information. If no GPU-related information or graphics card information is found, it indicates that the device is a non-GPU device. If GPU-related information or graphics card information is found, it indicates that the device has graphics card support.
[0074] S20A: When the device is a non-GPU device, intercept a first rendering instruction.
[0075] Specifically, a non-GPU device refers to a device without a hardware graphics card. When a device is a non-GPU device, it means that the device does not have a dedicated graphics processing unit. Since non-GPU devices need to rely on the CPU (central processing unit) to simulate the execution of the first rendering instruction, the rendering efficiency is low and a large amount of system resources are occupied. Through the operating system-level API or hook technology, the rendering instructions issued by the application are intercepted at runtime. The intercepted rendering instructions are directed to a unified management module for processing. By intercepting the rendering instructions generated by the application, the rendering process is controlled.
[0076] S30A: Send the intercepted first rendering instruction to the management module of the device, and parse the first rendering instruction through the management module to determine the rendering requirement.
[0077] Specifically, instruction redirection refers to the re-direction of instruction execution or process modification. The first rendering instruction is intercepted through instruction redirection, and the first rendering requirement is redirected to the management module. The management module receives and parses the first rendering instruction from the application, and determines the specific requirements and parameters of the rendering task, including the type, position, size, color, texture and other attributes of the rendering object. By determining the rendering requirements, it is determined whether it is necessary to reduce the burden on the CPU by optimizing and simplifying the rendering process in the future, and provide the system with a preliminary assessment of the scale and complexity of the current rendering requirements. Adjust the rendering requirements based on the preliminary assessment to ensure that the first rendering instruction can be efficiently executed with limited computing resources without affecting the smooth operation of other tasks.
[0078] Exemplarily, when parsing the first rendering instruction, first determine the corresponding graphics programming interface based on the format and characteristics of the first rendering instruction; then, split each part of the first rendering instruction according to the structure of the function call, determine which part is the function name and which part is the function parameter, and generate a function and parameter list; then, use the official documentation corresponding to the graphics programming interface to identify each function name and each parameter type in the function and parameter list one by one, and determine the rendering requirements based on the identified function names and parameter types.
[0079] S40A, real-time monitoring of CPU load.
[0080] Specifically, CPU load, as one of the important indicators for measuring CPU performance, refers to the occupancy rate of tasks processed within a period of time, reflecting how busy the CPU is when processing tasks. When a device processes multiple tasks, the CPU load will increase as the number of tasks increases. High CPU load will cause system devices to slow down, freeze, or even crash. By monitoring the CPU load, performance problems can be discovered and resolved in a timely manner to ensure stable operation of the device.
[0081] More specifically, the CPU load includes at least one of CPU occupancy, memory usage, rendering frame time, average load, cache hit rate, and waiting queue length.
[0082] S50A: Adjust rendering requirements at least according to CPU load, and generate a second rendering instruction.
[0083] Specifically, when the CPU load is high, the rendering requirements are adjusted by reducing the resolution performance in the rendering requirements, reducing texture details, simplifying lighting and shadow calculations, reducing the number of rendering frames, and reducing the complexity of the scene. Dynamically adjusting the rendering frame rate and resolution according to system indicators can balance the system CPU usage and extend the service life of the device.
[0084] For example, the graphics rendering requirements on different devices are different, and adjusting the rendering requirements requires the use of various optimization and adaptation technologies, including optimization of the rendering pipeline, texture compression technology, multi-level detail level management technology, etc. The adjustment methods specifically include: according to the rendering requirements, a comprehensive analysis of the rendering instruction stream, including the type, number, order and mutual dependence of the rendering instructions, etc., can deeply understand the execution characteristics and bottlenecks of the entire rendering process; according to the actual performance and characteristics of the device, the rendering requirements are modified and optimized, which can improve the execution efficiency, reduce power consumption or improve the rendering quality, including adjusting the timing of instruction execution, merging redundant instructions, and adopting more efficient algorithms; by redirecting the execution frequency and order of instructions in the rendering requirements, the rendering frame rate can be controlled; in different scenarios, the rendering frame rate can be dynamically adjusted to balance the requirements of device performance and energy efficiency; for certain graphics processing operations, some instructions can be processed asynchronously to improve the utilization of system resources, while avoiding the impact of blocking of certain instructions on the overall rendering performance.
[0085] S60A: Send the second rendering instruction to the rendering optimization engine.
[0086] Specifically, the rendering optimization engine is used to convert the second rendering instruction into the final graphics output, and completes the execution of the second rendering instruction by receiving and parsing the second rendering instruction, performing rendering optimization, executing the rendering pipeline, applying post-processing effects, and real-time monitoring and adjustment.
[0087] For example, refer to Figure 2 . The rendering instruction capture module intercepts the rendering instructions sent by the application and sends the rendering instructions to the unified management module, which processes and schedules the rendering instructions. The unified management module parses the rendering instructions, determines the rendering requirements, and controls the rendering frame rate and resolution according to the received CPU occupancy, thereby dynamically adjusting the rendering process. Based on the received first rendering instruction, the management module passes the optimized second rendering instruction to the rendering optimization engine, and schedules the rendering optimization engine to process the second rendering instruction. By intercepting the rendering instructions issued by the application and redirecting them to the unified management module, the system indicators such as CPU occupancy are dynamically monitored in the module, and the rendering frame rate and resolution are dynamically controlled according to the real-time situation, thereby achieving the purpose of balancing the system CPU occupancy and improving the user experience.
[0088] For example, refer to Figure 3The application sends a first rendering instruction through a rendering interface such as D3D and OpenGL. The first rendering instruction includes a rendering command and rendering data. The rendering command refers to a rendering object, a rendering method, and a rendering target. The rendering data refers to graphics data related to the rendering command, including vertex data, texture data, and material parameters. These parameters are used to describe the geometry, appearance, and texture of the rendering object.
[0089] When the system does not have graphics card support, the CPU simulates the first rendering instruction, intercepts the first rendering instruction, and sends the first rendering instruction to the unified management module to determine the rendering requirements. When the monitored CPU occupancy is high, the rendering requirements are adjusted by reducing the rendering frame rate and resolution, and after the second rendering instruction is generated, it is executed and processed by the rendering optimization engine. When the system has graphics card support, the first rendering instruction is directly executed by the hardware graphics card.
[0090] The technical solutions in the above embodiments of the present application have at least the following technical effects or advantages:
[0091] By judging whether there is graphics card support, and in the case of non-GPU devices, redirecting the rendering instructions sent by the application to the management module for parsing and processing, determining the rendering requirements, adjusting the rendering requirements according to the real-time monitored CPU load, realizing dynamic adjustment and optimization of rendering requirements, improving resource utilization and rendering performance, using the rendering optimization engine to execute the adjusted rendering requirements, converting rendering instructions into high-quality visual effects, and dynamically adjusting rendering parameters to avoid excessive system load, reduce system crashes, freezes and other problems, and improve the stability and reliability of non-GPU devices. The technical problem of using non-GPU devices to execute rendering instructions in the prior art that weakens the overall performance and service life of the device and affects the user experience is solved, and the technical effect of ensuring rendering quality, improving the service life of the device, and improving the user experience is achieved.
[0092] Reference Figure 4 , S40A, real-time monitoring of CPU load, including the following steps:
[0093] S41a, real-time monitoring of the device's CPU usage, memory usage, and rendering frame time.
[0094] Specifically, CPU occupancy is used to indicate the utilization of CPU resources, which refers to the ratio of the time occupied by a process or a group of processes to the total time when the CPU is executing a task. Memory usage refers to the ratio of the occupied space to the total space in the device memory, as well as related indicators such as the memory read and write speed and cache hit rate. Rendering frame time refers to the time required by the CPU to render a frame of image, that is, the time interval from the start of rendering to the completion of rendering and preparation for displaying the next frame.
[0095] S50A, adjusting the rendering requirement at least according to the CPU load, and generating a second rendering instruction, including:
[0096] S51a, adjusting the rendering requirement according to the CPU occupancy rate, memory usage, rendering frame time, and CPU load of the device, and generating a second rendering instruction.
[0097] Exemplarily, when the CPU occupancy rate is lower than 60%, the rendering requirement is not adjusted; when the CPU occupancy rate is between 60% and 70%, the frame rate performance in the rendering requirement is reduced by 3 frames; when the CPU occupancy rate is higher than 70%, the corresponding operation is performed according to the specific situation of the CPU occupancy rate in the previous unit time and the upper situation of the CPU occupancy rate. Specifically, when the CPU occupancy rate in the previous unit time is lower than the current CPU occupancy rate, it is judged that the CPU occupancy rate is on an upward trend, and the frame rate performance in the rendering requirement is reduced according to the adjustment value corresponding to the current CPU occupancy rate. When the CPU occupancy rate in the previous unit time is not lower than the current CPU occupancy rate, the frame rate performance in the rendering requirement is reduced by 10 frames. When the memory usage exceeds 80% or the rendering frame time is higher than the target time, the rendering requirement is adjusted by reducing the resolution performance in the rendering requirement. According to the system indicators, the rendering frame rate and resolution are dynamically adjusted to reduce the system resource usage and ensure the stability of the overall system performance.
[0098] In this embodiment, by real-time monitoring of the device's CPU occupancy, memory usage, and rendering frame time, the rendering requirements are adjusted in a timely manner to ensure that the rendering instructions receive sufficient computing resources. By adjusting the rendering resources, the best rendering effect is ensured within the device performance range, avoiding the waste of rendering time due to insufficient resources. By adjusting the rendering requirements, the hardware load of the device is reduced, hardware loss is reduced, the service life of the device is extended, and the rendering quality and user experience are guaranteed.
[0099] Reference Figure 5 , further comprising: S41b, real-time monitoring of the temperature of the device.
[0100] S50A, adjusting the rendering requirement at least according to the CPU load, and generating a second rendering instruction, including:
[0101] S51b: Adjust rendering requirements according to the temperature and CPU load of the device, and generate a second rendering instruction.
[0102] In this embodiment, by monitoring the temperature of the device in real time and optimizing rendering parameters and adjusting rendering requirements when the device temperature rises abnormally, not only can the CPU load be reduced, but it also helps to reduce the heat generation of the device, improve the temperature management capability of the device, and extend the life of the hardware.
[0103] Reference Figure 6, also includes: S41c, real-time monitoring of device power consumption and battery life.
[0104] S50A, adjusting the rendering requirement at least according to the CPU load, and generating a second rendering instruction, including:
[0105] S51c: Adjust rendering requirements according to power consumption, battery life, and CPU load, and generate a second rendering instruction.
[0106] Specifically, when the device has low power consumption, long battery life, and moderate CPU load, the rendering requirements can be maintained or increased to obtain better rendering effects; when the power consumption is high, the battery life is short, and the CPU load is close to or reaches the limit, the device burden can be reduced by reducing the rendering accuracy, turning off unnecessary special effects, or optimizing the rendering process to ensure that rendering instructions are executed smoothly within the power and performance limits of the device, thereby extending the service life of the device, reducing the risk of task interruption due to power exhaustion during the rendering process, and improving the user experience. By reasonably controlling rendering parameters, adjusting rendering requirements, and reducing system CPU occupancy and power consumption, the device's battery life can be extended. For mobile devices, optimizing performance will reduce power consumption, extend usage time, and improve device efficiency.
[0107] Reference Figure 7 , also includes: S41d, real-time monitoring of application performance indicators, performance indicators including frame rate, response time and system occupancy.
[0108] S50A, adjusting the rendering requirement at least according to the CPU load, and generating a second rendering instruction, including:
[0109] S51d: Adjust rendering requirements according to performance indicators and CPU load, and generate a second rendering instruction.
[0110] Specifically, the frame rate refers to the number of frames rendered per second, the response time refers to the time interval from user operation to screen feedback, and the system occupancy rate reflects the degree of system resource consumption by the rendering process. When the frame rate is lower than expected, the response time is prolonged, or the system occupancy rate is too high, it means that the current rendering demand exceeds the processing capacity of the device. By adjusting the rendering demand in combination with the CPU load, it is ensured that the rendering demand is met within the range that the device can bear, thereby reducing the burden on the device, enhancing the stability and reliability of the application, ensuring the smoothness and stability of the rendering process, improving the user experience, and extending the service life of the device. By dynamically controlling the rendering frame rate and resolution, applications running on non-GPU devices can be smoother and more stable. When using these applications, users will not feel stuck or delayed due to performance issues, thereby improving the overall user experience.
[0111] In some embodiments, adjusting rendering requirements includes at least one of the following:
[0112] Reduce the rendering resolution.
[0113] Reduce the rendering scale.
[0114] Reduce the number of objects to render.
[0115] Delete duplicate and unnecessary instructions in rendering requirements.
[0116] The related instructions in the rendering requirements are merged into compound instructions. The related instructions refer to instructions that are related to each other or act on the same rendering target together.
[0117] Specifically, the purpose of lowering the rendering resolution and the rendering ratio is to reduce the amount of rendering. Reducing rendering objects means identifying and removing rendering objects that have little impact on the final effect in the rendering scene, thereby reducing the amount of data that the rendering engine needs to process. Duplicate and unnecessary instructions refer to instructions that are repeatedly executed or have no actual effect. By deleting duplicate and unnecessary instructions in rendering requirements, not only can the rendering time be reduced, but also potential rendering errors can be reduced.
[0118] Reference Figure 8 S20A: When the device is a non-GPU device, intercepting a first rendering instruction includes the following steps:
[0119] S21. Determine an API or hook function according to the operating system on which the application runs.
[0120] S22: Using an API or a hook function, intercept the first rendering instruction sent by the application.
[0121] Specifically, the API (application programming interface) or hook function to be used can be determined according to the type of operating system on which the application is running. Different operating systems provide different system interfaces and function libraries for monitoring and intercepting the operation of the application, including rendering instructions. After the API or hook function is determined, by calling the determined API or hook function and setting the corresponding callback function or time listener, it can be captured immediately when the application issues a rendering instruction.
[0122] Reference Fig. 9 , further comprising: S20B, when the device has graphics card support, directly executing the first rendering instruction through the graphics card.
[0123] Specifically, after the graphics card receives the first rendering instruction, it sends the first rendering instruction to the rendering pipeline for processing. The rendering pipeline is a group of processing units inside the graphics card, which is responsible for converting the first rendering instruction into a final image output.
[0124] At the beginning of the rendering pipeline, the graphics card will parse and preprocess the first rendering instruction, including identifying the various functions and parameters in the first rendering instruction, and verifying and normalizing the first rendering instruction according to the specifications of the graphics programming interface. Through this step, the graphics card can ensure the correctness and effectiveness of the first rendering instruction.
[0125] Next, the graphics card will enter the vertex processing stage. In this stage, the graphics card will perform a series of calculations and transformations based on the vertex data in the rendering instructions (such as the position, color, texture coordinates, etc. of the vertex). These calculations include the conversion of vertex coordinates, the simulation of lighting effects, the mapping of textures, etc., which together determine the position and attributes of each vertex in the final image.
[0126] After vertex processing is completed, the graphics card will enter the fragment processing stage. In this stage, the graphics card will convert the data after vertex processing into fragments (i.e. pixels in the image) and perform operations such as shading, depth testing, and blending on these fragments. These operations determine the color and transparency of each pixel in the final image.
[0127] Finally, after a series of processing in the rendering pipeline, the graphics card will output the final image data. This data will be sent to the video memory for storage and finally displayed on the screen. During this process, the graphics card will also perform anti-aliasing, post-processing and other operations as needed to improve the visual effect of the image.
[0128] In some embodiments, intelligent decision-making and adaptation algorithms are applied to automatically adjust rendering parameters based on machine learning or rule engines, combined with real-time data and user needs, to achieve optimal system performance and user experience. Intelligent rendering parameter optimization is adopted to achieve intelligent rendering parameter optimization based on the hardware capabilities of the device and user behavior patterns.
[0129] Embodiment 2
[0130] Reference Fig.10 , the embodiment of the present application further provides a rendering instruction processing device, comprising:
[0131] The receiving module 400 is used to receive a first rendering instruction sent by an application program and determine whether the device has graphics card support.
[0132] The interception module 500 is used to intercept the first rendering instruction when the device is a non-GPU device.
[0133] The parsing module 600 is used to send the intercepted first rendering instruction to the management module of the device, and the management module parses the first rendering instruction to determine the rendering requirement.
[0134] The monitoring module 700 is used to monitor the CPU load in real time.
[0135] The adjustment module 800 is used to adjust the rendering requirement at least according to the CPU load and generate a second rendering instruction.
[0136] The sending module 900 is used to send the second rendering instruction to the rendering optimization engine.
[0137] In some embodiments, the monitoring module 700 specifically includes:
[0138] The first monitoring unit is used to monitor the CPU occupancy, memory usage and rendering frame time of the device in real time.
[0139] The adjustment module 800 specifically includes:
[0140] The first adjustment unit is used to adjust the rendering demand and generate a second rendering instruction according to the CPU occupancy rate, memory usage, rendering frame time, and CPU load of the device.
[0141] In some embodiments, the monitoring module 700 further includes:
[0142] The second monitoring unit is used to monitor the temperature of the device in real time.
[0143] The adjustment module 800 further includes:
[0144] The second adjustment unit is used to adjust the rendering requirement according to the temperature and CPU load of the device and generate a second rendering instruction.
[0145] In some embodiments, the monitoring module 700 further includes:
[0146] The third monitoring unit is used to monitor the power consumption and battery life of the device in real time.
[0147] The adjustment module 800 further includes:
[0148] The third adjustment unit is used to adjust the rendering demand according to the power consumption and the battery life, as well as the CPU load, and generate a second rendering instruction.
[0149] In some embodiments, the monitoring module 700 further includes:
[0150] The fourth monitoring unit is used to monitor the performance indicators of the application program in real time, and the performance indicators include frame rate, response time and system occupancy rate.
[0151] The adjustment module 800 further includes:
[0152] The fourth adjustment unit is used to adjust the rendering requirement according to the performance index and the CPU load, and generate a second rendering instruction.
[0153] In some embodiments, the adjustment module 800 further includes at least one of the following:
[0154] The first reducing unit is used to reduce the rendering resolution.
[0155] The second reducing unit is used to reduce the rendering ratio.
[0156] Reduction unit, used to reduce rendering objects.
[0157] The deletion unit is used to delete repeated and unnecessary instructions in rendering requirements.
[0158] The fusion unit is used to fuse related instructions in the rendering requirements into composite instructions, where related instructions refer to instructions that are related to each other or act on the same rendering target together.
[0159] In some embodiments, the interception module 500 specifically includes:
[0160] A determination unit is used to determine an API or a hook function according to the operating system on which the application runs.
[0161] The interception unit is used to intercept the first rendering instruction sent by the application program by using an API or a hook function.
[0162] In some embodiments, it also includes:
[0163] The execution module is used to directly execute the first rendering instruction through the graphics card when the device has graphics card support.
[0164] As for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0165] Embodiment 3
[0166] Reference Fig.11 , the embodiment of the present application further provides an electronic device, including:
[0167] processor.
[0168] A memory is used to store processor executable instructions.
[0169] The processor is configured to execute instructions to implement any one of the rendering instruction processing methods.
[0170] In this embodiment, the computer device includes a processor, a memory, and a network interface connected via a system bus.
[0171] The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data samples. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, any rendering instruction processing method is implemented.
[0172] Those skilled in the art will understand that Fig.11 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0173] Embodiment 4
[0174] The embodiment of the present application also provides a computer-readable storage medium. When the instructions in the computer-readable storage medium are executed by the processor of the terminal, the terminal can execute any rendering instruction processing method.
[0175] The computer-readable storage medium mentioned above can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory, electrically erasable programmable read-only memory, erasable programmable read-only memory, programmable read-only memory, read-only memory, magnetic memory, flash memory, magnetic disk or optical disk. The readable storage medium can be any available medium that can be accessed by a general or special-purpose computer.
[0176] Optionally, a readable storage medium is coupled to a processor so that the processor can read information from the readable storage medium and write information to the readable storage medium. Of course, the readable storage medium can also be a component of the processor. The processor and the readable storage medium can be located in an application specific integrated circuit (ASIC). Of course, the processor and the readable storage medium can also exist in the device as discrete components.
[0177] Embodiment 5
[0178] An embodiment of the present application also provides a computer program product, which includes a computer program. When the computer program is executed by a processor, any rendering instruction processing method is implemented.
[0179] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0180] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0181] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0182] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0183] Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention.
[0184] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.
[0185] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0186] The rendering instruction processing method, device and equipment provided by the present application are introduced in detail above. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for general technical personnel in this field, according to the idea of the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. A rendering instruction processing method, characterized in that: The steps include: Receive a first rendering instruction sent by the application, and determine whether the device has graphics card support; When the device is a non-GPU device, intercepting the first rendering instruction; Sending the intercepted first rendering instruction to the management module of the device, parsing the first rendering instruction by the management module to determine the rendering requirement; Real-time monitoring of CPU load; At least according to the CPU load, adjusting the rendering requirement and generating a second rendering instruction; The second rendering instruction is sent to the rendering optimization engine.
2. The method according to claim 1, characterized in that Real-time monitoring of CPU load includes the following steps: Monitor the CPU occupancy, memory usage and rendering frame time of the device in real time; At least according to the CPU load, adjusting the rendering requirement and generating a second rendering instruction includes: According to the CPU occupancy rate of the device, the memory usage, the rendering frame time, and the CPU load, the rendering requirement is adjusted to generate the second rendering instruction.
3. The method according to claim 1, characterized in that Also includes: monitoring the temperature of the device in real time; At least according to the CPU load, adjusting the rendering requirement and generating a second rendering instruction includes: The rendering requirement is adjusted according to the temperature of the device and the CPU load, and the second rendering instruction is generated.
4. The method according to claim 1, characterized in that Also includes: Real-time monitoring of power consumption and battery life of the device; At least according to the CPU load, adjusting the rendering requirement and generating a second rendering instruction includes: The rendering requirement is adjusted according to the power consumption, the battery life, and the CPU load, and the second rendering instruction is generated.
5. The method according to claim 1, characterized in that Also includes: Monitor the performance indicators of the application in real time, including frame rate, response time and system occupancy rate; At least according to the CPU load, adjusting the rendering requirement and generating a second rendering instruction includes: The rendering requirement is adjusted according to the performance indicator and the CPU load, and the second rendering instruction is generated.
6. The method according to any one of claims 1 to 5, characterized in that: Adjusting the rendering requirement includes at least one of the following: Reduce rendering resolution; Reduce the rendering scale; Reduce the number of objects to render; Delete repeated and unnecessary instructions in the rendering requirements; The related instructions in the rendering requirements are merged into a composite instruction, wherein the related instructions refer to instructions that are related to each other or act on the same rendering target together.
7. The method according to any one of claims 1 to 5, characterized in that: In the case where the device is a non-GPU device, intercepting the first rendering instruction comprises the following steps: Determining an API or hook function based on the operating system on which the application is running; The first rendering instruction sent by the application is intercepted by using the API or the hook function.
8. The method according to any one of claims 1 to 5, characterized in that: Also includes: In the case that the device has a graphics card support, the first rendering instruction is directly executed by the graphics card.
9. A rendering instruction processing device, characterized in that: include: A receiving module, used for receiving a first rendering instruction sent by an application program, and determining whether the device has graphics card support; An interception module, configured to intercept the first rendering instruction when the device is a non-GPU device; A parsing module, used for sending the intercepted first rendering instruction to the management module of the device, and parsing the first rendering instruction by the management module to determine the rendering requirement; Monitoring module, used to monitor CPU load in real time; An adjustment module, configured to adjust the rendering requirement at least according to the CPU load, and generate a second rendering instruction; A sending module is used to send the second rendering instruction to the rendering optimization engine.
10. An electronic device, characterized in that: include: processor; A memory, configured to store instructions executable by the processor; The processor is configured to execute the instruction to implement the rendering instruction processing method according to any one of claims 1 to 8.