Graph element sharing method, electronic device, chip and computer readable storage medium
Patent Information
- Application Number
- CN202110970453.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-08-23
- Publication Date
- 2026-10-27
- Estimated Expiration
- 2041-08-23
AI Technical Summary
[0004]有鉴于此,有必要提供一种图元共享方法,可以解决副芯片无法绘制复杂精细界面的缺陷
[0034]第六方面,本申请实施例提供一种装置(如芯片),该装置具有实现上述第一方面或第二方面所提供的方法中副芯片行为的功能。功能可以通过硬件实现,也可以通过硬件执行相应的软件实现。硬件或软件包括一个或多个与上述功能相对应的模块。
Smart Images

Figure CN115713452B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of terminal technology, and in particular to a primitive sharing method, electronic device, chip, and computer-readable storage medium. Background Technology
[0002] Currently, there are already terminal devices on the market equipped with dual chips and dual operating systems (such as smartwatches). One operating system is relatively simple and is installed on a secondary chip with low power consumption and low computing power, while the other operating system is relatively complex and is installed on a main chip with high power consumption and high computing power. The main and secondary chips work together to balance device performance and battery life.
[0003] Due to the inferior hardware performance of the secondary chip, the rendering of complex and detailed interfaces is poor. Furthermore, the limited computing power of the secondary chip prevents the integration of anti-aliasing algorithms, resulting in jagged edges in the rendered graphics and text. Current solutions typically involve pre-rendering complex interfaces on the main chip and storing them on the terminal device. However, if the terminal device needs to support multiple languages, multiple versions of the interface must be pre-rendered and stored, leading to excessive memory consumption on the terminal device. Summary of the Invention
[0004] In view of this, it is necessary to provide a primitive sharing method to solve the defect that the secondary chip cannot draw complex and detailed interfaces.
[0005] The first aspect of this application discloses a primitive sharing method applied to an electronic device, which includes a main chip, a secondary chip, and a display screen. The main chip runs a first operating system, and the secondary chip runs a second operating system. The primitive sharing method includes: when the secondary chip draws interface content, the secondary chip obtains a control set corresponding to the interface content, the control set including at least one control; the secondary chip identifies a first type of control that does not meet preset conditions based on the drawing instructions corresponding to each control in the control set; the secondary chip sends the drawing instructions corresponding to the first type of control to the main chip for drawing; the secondary chip obtains the primitive drawing result of the main chip; the secondary chip combines the local primitive drawing result with the primitive drawing result of the main chip, and sends the combined result to the display screen, wherein the local primitive drawing result is obtained by the secondary chip executing the drawing instructions corresponding to each control.
[0006] By adopting this technical solution, when the secondary chip is drawing interface content, it can request the main chip to assist in drawing controls with poor drawing effects, thus making up for the deficiency that the secondary chip cannot draw complex and detailed interfaces due to insufficient hardware capabilities.
[0007] In one possible implementation, the primitive sharing method also includes: the secondary chip calls the UI drawing framework to obtain the drawing instructions corresponding to each control in the control set.
[0008] By adopting this technical solution, the secondary chip can call a UI drawing framework, such as the UIkit framework, to obtain the drawing instructions corresponding to each control, and then identify the first type of control that does not meet the preset conditions.
[0009] In one possible implementation, the secondary chip sends the drawing instructions corresponding to the first type of control to the main chip for drawing, including: the secondary chip marking controls that do not meet the preset conditions to obtain the first type of control; and the secondary chip sending the drawing instructions corresponding to the first type of control to the main chip for drawing.
[0010] By adopting this technical solution, the secondary chip can mark controls that do not meet the preset conditions, and then delegate the drawing of the marked controls to the main chip.
[0011] In one possible implementation, the electronic device further includes a memory for storing the primitive drawing results of the main chip, and the sub-chip obtains the primitive drawing results of the main chip by reading the primitive drawing results of the main chip from the memory.
[0012] By adopting this technical solution, the main chip's primitive drawing results are stored in a memory, allowing the secondary chip to read the main chip's primitive drawing results from the memory. After completing the drawing of the delegated controls, the main chip can enter a sleep state.
[0013] In one possible implementation, the secondary chip identifies a first type of control that does not meet the preset conditions based on the drawing instructions corresponding to each control in the control set, including: when the drawing instructions corresponding to the control contain preset instructions, the secondary chip identifies the control as the first type of control.
[0014] By adopting this technical solution, preset instructions are predefined based on the primitive drawing performance of the secondary chip. If the drawing instructions of a certain control include the preset instructions, the control can be identified as a control whose drawing effect is not good on the secondary chip side.
[0015] In one possible implementation, the sub-chip combines the local primitive drawing result with the primitive drawing result of the main chip, including: the sub-chip overlays and combines the primitive drawing result of the main chip with the local primitive drawing result; or the sub-chip replaces the part of the local primitive drawing result corresponding to the first type of control with the primitive drawing result of the main chip.
[0016] By adopting this technical solution, the local primitives drawn by the secondary chip can be combined with the primitives drawn by the main chip, so that the interface content displayed on the screen is free of defects such as jagged edges. This can make up for the deficiency that the secondary chip cannot draw complex and detailed interfaces due to insufficient hardware capabilities.
[0017] Secondly, embodiments of this application provide a primitive sharing method applied to an electronic device, the electronic device including a main chip, a secondary chip, a memory, and a display screen. The main chip is used to run a first operating system, and the secondary chip is used to run a second operating system. The primitive sharing method includes: when the secondary chip draws interface content, the secondary chip obtains a control set corresponding to the interface content, the control set including at least one control; the secondary chip identifies a first type of control that does not meet preset conditions according to the drawing instructions corresponding to each control in the control set; the secondary chip reads the primitive drawing result corresponding to the first type of control from the memory; the secondary chip combines the local primitive drawing result with the primitive drawing result read from the memory, and sends the combined result to the display screen, wherein the local primitive drawing result is obtained by the secondary chip executing the drawing instructions corresponding to each control.
[0018] By adopting this technical solution, when the secondary chip is drawing interface content, for controls with poor drawing effects, the secondary chip can try to read the corresponding primitives from the memory, thus making up for the deficiency of the secondary chip in drawing complex and detailed interfaces due to insufficient hardware capabilities.
[0019] In one possible implementation, the second operating system includes at least one pre-installed application, and the primitive sharing method further includes: the main chip acquiring a set of controls required by the sub-chip to draw the interface content of the pre-installed application; the main chip identifying controls in the set that do not meet preset conditions; the main chip executing the drawing instructions corresponding to the controls in the set that do not meet the preset conditions to draw multiple shared primitives; and the main chip storing the multiple shared primitives in a memory.
[0020] By adopting this technical solution, the main chip pre-identifies controls that are poorly drawn on the secondary chip side, and pre-renders these poorly drawn controls as shared primitives and saves them to memory. This allows the secondary chip to attempt to read the primitives corresponding to these poorly drawn controls from memory when drawing interface content.
[0021] In one possible implementation, the primitive sharing method further includes: when the secondary chip fails to read the primitive drawing result corresponding to the first type of control from the memory, the secondary chip sends the drawing instruction corresponding to the control in the first type of control that does not have a primitive drawing result to the main chip for drawing; the main chip executes the drawing instruction sent by the secondary chip and stores the primitive drawing result corresponding to the drawing instruction into the memory.
[0022] By adopting this technical solution, when the secondary chip is drawing interface content, if the memory does not contain the shared primitives required by the secondary chip for controls with poor drawing effect, the secondary chip can request the main chip to assist in drawing, thus making up for the deficiency that the secondary chip cannot draw complex and detailed interfaces due to insufficient hardware capabilities.
[0023] In one possible implementation, the secondary chip identifies the first type of control that does not meet the preset conditions based on the drawing instructions corresponding to each control in the control set, including: when the drawing instructions corresponding to the control contain preset instructions, the secondary chip identifies the control as the first type of control.
[0024] By adopting this technical solution, preset instructions are predefined based on the primitive drawing performance of the sub-chip. If the drawing instructions of a certain control include the preset instructions, the control can be identified as a control with poor drawing effect on the sub-chip side (first type of control).
[0025] In one possible implementation, the sub-chip combines the local primitive drawing result with the primitive drawing result read from the memory, including: the sub-chip overlays the primitive drawing result read from the memory with the local primitive drawing result; or the sub-chip replaces the part of the local primitive drawing result corresponding to the first type of control with the primitive drawing result read from the memory.
[0026] By adopting this technical solution, the local primitives drawn by the secondary chip can be combined with the primitives read from the memory, so that the interface content displayed on the screen is free of defects such as jagged edges. This can make up for the deficiency that the secondary chip cannot draw complex and detailed interfaces due to insufficient hardware capabilities.
[0027] Thirdly, embodiments of this application provide an electronic device, including a main chip, a secondary chip, a memory, and a display screen. The main chip runs a first operating system, and the secondary chip runs a second operating system. The first operating system includes a first primitive sharing service program and a primitive drawing program, and the second operating system includes a second primitive sharing service program and a first application program. When the first application program draws interface content, the first application program obtains shared primitives contained in the interface content, wherein the shared primitives are primitives whose drawing effect on the secondary chip side does not meet preset requirements; the first application program sends the drawing request of the shared primitives to the primitive drawing program through the second primitive sharing service program and the first primitive sharing service program; the primitive drawing program responds to the drawing request of the shared primitives and performs primitive drawing; the main chip stores the primitive drawing result of the primitive drawing program in the memory; the secondary chip combines the local primitive drawing result with the primitive drawing result read from the memory, and sends the combined result to the display screen, wherein the local primitive drawing result is drawn by the first application program.
[0028] By adopting this technical solution, when the secondary chip is drawing interface content, it can request the main chip to assist in drawing controls with poor drawing effects, thus making up for the deficiency that the secondary chip cannot draw complex and detailed interfaces due to insufficient hardware capabilities.
[0029] In one possible implementation, the memory is a first video memory, and the secondary chip includes a second video memory, which is used to store the local primitive drawing results.
[0030] In one possible implementation, the secondary chip overlays and synthesizes the local primitive drawing result with the primitive drawing result read from memory, or the secondary chip replaces the part of the local primitive drawing result corresponding to the shared primitive with the primitive drawing result read from memory.
[0031] By adopting this technical solution, the local primitives drawn by the secondary chip can be combined with the primitives read from the memory, so that the interface content displayed on the screen is free of defects such as jagged edges. This can make up for the deficiency that the secondary chip cannot draw complex and detailed interfaces due to insufficient hardware capabilities.
[0032] Fourthly, embodiments of this application provide a computer-readable storage medium including computer instructions that, when executed on an electronic device, cause the electronic device to perform the primitive sharing method as described in the first or second aspect.
[0033] Fifthly, embodiments of this application provide a computer program product that, when run on a computer, causes the computer to execute the primitive sharing method as described in the first or second aspect.
[0034] Sixthly, embodiments of this application provide an apparatus (such as a chip) that has the function of implementing the sub-chip behavior in the methods provided in the first or second aspects described above. The function can be implemented in hardware or by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the above-described functions.
[0035] Understandably, the computer-readable storage medium described in the fourth aspect, the computer program product described in the fifth aspect, and the apparatus described in the fifth aspect all correspond to the methods described in the first or second aspects above. Therefore, the beneficial effects they can achieve can be referred to the beneficial effects in the corresponding methods provided above, and will not be repeated here. Attached Figure Description
[0036] Figure 1 This is a schematic diagram illustrating an application scenario of the primitive sharing method provided in an embodiment of this application;
[0037] Figure 2 A schematic diagram of a hardware module for implementing element sharing in an electronic device according to an embodiment of this application;
[0038] Figure 3 A schematic diagram of the software architecture for implementing primitive sharing in an electronic device according to an embodiment of this application;
[0039] Figure 4 A schematic diagram illustrating the dial interface of an electronic device provided in an embodiment of this application;
[0040] Figure 5 This is a schematic diagram illustrating the internal data interaction of an electronic device implementing primitive sharing according to an embodiment of this application;
[0041] Figure 6 A schematic flowchart illustrating a primitive sharing method provided in an embodiment of this application;
[0042] Figure 7 A schematic flowchart illustrating a primitive sharing method provided in another embodiment of this application;
[0043] Figure 8 This is a schematic diagram of the structure of a possible electronic device provided in an embodiment of this application. Detailed Implementation
[0044] It should be noted that in this application, "at least one" means one or more, and "more than one" means two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone, where A and B can be singular or plural. The terms "first," "second," "third," "fourth," etc. (if present) in the specification, claims, and drawings of this application are used to distinguish similar objects, not to describe a specific order or sequence.
[0045] In the embodiments of this application, the terms "exemplary" or "for example" are used to indicate that something is an example, illustration, or description. Any embodiment or design that is described as "exemplary" or "for example" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or design. Specifically, the use of the terms "exemplary" or "for example" is intended to present the relevant concepts in a specific manner.
[0046] For ease of understanding, the examples provide some conceptual explanations related to the embodiments of this application for reference.
[0047] An application (APP), often shortened to app, is a software program that performs one or more specific functions. Typically, multiple applications can be installed on an electronic device, such as instant messaging applications, video applications, audio applications, image capture applications, cloud desktop applications, and so on. Instant messaging applications may include SMS applications, WeChat, WhatsApp Messenger, Line, Instagram, Kakao Talk, DingTalk, etc. Image capture applications may include camera applications (system camera or third-party camera applications). Video applications may include YouTube, Twitter, TikTok, iQiyi, Tencent Video, etc. Audio applications may include Kugou Music, Xiami Music, QQ Music, etc. The applications mentioned in the following examples can be system applications pre-installed on the electronic device or third-party applications downloaded by the user from the network or obtained from other electronic devices during use.
[0048] The following is combined with Figure 1 An exemplary application scenario diagram of the primitive sharing method provided in the embodiments of the present invention is shown.
[0049] This embodiment can be applied to electronic device 100. Electronic device 100 can refer to a device with a display screen, such as a smartwatch, mobile phone, tablet computer, smart home device, etc. Electronic device 100 can communicate with other electronic devices or servers through a communication network. The communication network can be a local area network (LAN), a wide area network (WAN) relayed through a relay device, or a combination of LAN and WAN. When the communication network is a LAN, for example, it can be a Wi-Fi hotspot network, a Wi-Fi P2P network, a Bluetooth network, a Zigbee network, or a near-field communication (NFC) network, etc. When the communication network is a WAN, for example, it can be a 3rd generation wireless telephone technology (3G) network, a 4th generation mobile communication technology (4G) network, a 5th generation mobile communication technology (5G) network, a future public land mobile network (PLMN), or the Internet, etc.
[0050] Electronic device 100 can carry two operating systems, which can be Or HarmonyOS, etc. In Figure 1 Taking a smartwatch as an example, the electronic device 100 includes a display screen 10. The display screen 10 is used to display the application's interface. The display screen 10 can be a liquid crystal display (LCD), an organic light-emitting diode (OLED) display, an active-matrix organic light-emitting diode (AMOLED) display, a flexible light-emitting diode (FLED) display, a quantum dot light-emitting diode (QLED) display, etc.
[0051] like Figure 2 As shown, the electronic device 100 includes a display screen 10, a main chip 12, and a secondary chip 14. The main chip 12 is used to run a first operating system, and the secondary chip 14 is used to run a second operating system. The performance of the secondary chip 14 is lower than that of the main chip 12, and the power consumption of the secondary chip 14 is lower than that of the main chip 12. Through the collaborative work of the main chip 12 and the secondary chip 14, the electronic device 100 can simultaneously achieve high performance and long battery life.
[0052] In some embodiments, since the performance of the secondary chip 14 is lower than that of the main chip 12, the second operating system running on the secondary chip 14 can be a lightweight version of the first operating system. The lightweight operating system does not require high hardware configuration and can run on low-power chips, but compared to the first operating system, it has weaker system processing power and provides relatively fewer system functions.
[0053] In some embodiments, the main chip 12 can be a high-power, high-computing-power processing chip such as a central processing unit (CPU), a system-on-chip (SoC), or an application processor (AP). The secondary chip 14 can be a low-power, low-computing-power processing chip such as a microcontroller unit (MCU) or a single-chip microcomputer (SCM).
[0054] For example, electronic device 100 is a smartwatch, which includes a first working mode and a second working mode. In the first working mode, all functions of the smartwatch are enabled, and the power consumption of the smartwatch is relatively high. The main chip 12 can draw the interface content, and the drawing result can be displayed on the display screen 10. In the second working mode, the smartwatch can only enable some routine functions (such as heart rate monitoring, notification viewing, simple watch face display, etc.), and the power consumption of the smartwatch is relatively low. In the second working mode, the main chip 12 is in a sleep state, and the second operating system running on the secondary chip 14 implements these routine functions. In the second working mode, due to the limited computing power of the secondary chip 14, there may be some controls with poor drawing effects when the secondary chip 14 draws the interface content. The secondary chip 14 can delegate the drawing of these poorly drawn controls to the main chip 12. The secondary chip 14 then combines its own drawing result with the drawing result of the main chip 12, and the combined result is displayed on the display screen 10. This can avoid the jagged edges and other distortion defects in the drawing due to the poor hardware performance of the secondary chip 14. The main chip 12 can continue to enter the sleep state after completing the delegated drawing of the controls.
[0055] like Figure 3 The diagram shown is a schematic diagram of the architecture for implementing element sharing in an electronic device according to an embodiment of this application.
[0056] Electronic device 100 includes a display screen 10, a main chip 12, a secondary chip 14, and a first video memory 16. The main chip 12 runs a first operating system, and the secondary chip 14 runs a second operating system. Both the main chip 12 and the secondary chip 14 have read and write permissions to the first video memory 16. The first video memory 16 stores graphics elements shared with the secondary chip 14. For example, when the main chip 12 receives a graphics drawing request from the secondary chip 14, the main chip 12 can respond to the request, draw the graphics elements, and store the drawn graphics elements in the first video memory 16. The secondary chip 14 can then read the graphics elements it entrusted to the main chip 12 to draw from the first video memory 16. The secondary chip 14 may also include a second video memory 140, which stores graphics elements drawn by the secondary chip 14 itself. Both the first video memory 16 and the second video memory 140 can be any one of Static Random-Access Memory (SRAM), Synchronous Dynamic Random-Access Memory (SDRAM), Double Data Rate SDRAM (DDR), etc. In some embodiments, the first video memory 16 and the second video memory 140 can also be other types of memory, which are not limited here.
[0057] The first operating system may include a first graphic element sharing service program 121 and a graphic element drawing program 122, and the second operating system may include a second graphic element sharing service program 141, a first application program 142, and a drawing service program 143. The first application program 142 may be an application pre-installed at the factory of the electronic device 100, or a third-party application downloaded from the network or obtained from other electronic devices by the user during the use of the electronic device 100. The following example illustrates the first application program 142 as a dial application.
[0058] When the first application 142 is displayed on the front end, the first application 142 draws the dial interface. The first application 142 can obtain the shared graphic elements contained in the dial interface. Shared graphic elements may refer to graphic elements whose drawing effect on the secondary chip side does not meet the preset requirements. The preset conditions can be defined according to actual needs. For example, the preset conditions may refer to the graphic elements drawn on the secondary chip side having jagged edges or insufficient clarity.
[0059] In some embodiments, the first application 142 may invoke a drawing service program 143 to draw the dial interface. The drawing service program 143 may include a UI drawing framework, such as the UIkit framework. The dial interface may be divided into multiple graphic elements, and each graphic element may correspond to a control. The drawing service program 143 may store the drawn graphic elements into the second video memory 140.
[0060] In some embodiments, the UI drawing framework can identify the drawing instructions corresponding to controls. When the drawing instructions corresponding to a control include preset instructions, the graphic element corresponding to that control can be considered a shared graphic element. It is believed that the drawing effect of the graphic element corresponding to that control is not good when drawn on the secondary chip side, and the main chip 12 needs to assist in the drawing. The preset instructions can be predefined according to the graphic element drawing performance of the secondary chip 14. For example, if the secondary chip 14 produces jagged edges when drawing curved text, the preset instructions can be set to include drawing instructions for curved text.
[0061] After analyzing the drawing instructions corresponding to each control on the dial interface, the first application 142 can obtain the shared graphic elements contained in the dial interface. The first application 142 sends the drawing request of the shared graphic elements to the second graphic element sharing service program 141. The second graphic element sharing service program 141 then forwards the drawing request of the shared graphic elements to the first graphic element sharing service program 121, so that the main chip 12 receives the drawing request of the shared graphic elements sent by the secondary chip 14.
[0062] The first primitive sharing service program 121 can send a drawing request for a shared primitive to the primitive drawing program 122. The primitive drawing program 122 responds to the received drawing request and draws the shared primitive. Due to the high performance of the main chip 12, the shared primitive drawn by the primitive drawing program 122 is free of jagged edges. The main chip 12 can store the shared primitive drawn by the primitive drawing program 122 in the first video memory 16. The secondary chip 14 can read the shared primitive drawn by the main chip 12 from the first video memory 16.
[0063] In some embodiments, the drawing request for a shared element may include a drawing instruction corresponding to the shared element, and then the element drawing program 122 may execute the drawing instruction corresponding to the shared element to draw the shared element.
[0064] The secondary chip 14 can combine multiple graphics elements stored in the second video memory 140 with shared graphics elements read from the first video memory 16, and send the combined result to the display screen 10 for decoding and display. For example, the secondary chip 14 can combine local graphics elements (graphic elements drawn by the drawing service program 143) with shared graphics elements in the second video memory 140.
[0065] In some embodiments, when the main chip 12 stores the shared primitives drawn by the primitive drawing program 122 into the first video memory 16, the main chip 12 can send a drawing completion message to the secondary chip 14 to indicate that the shared primitives have been drawn.
[0066] In some embodiments, the multiple graphic elements drawn by the drawing service program 143 can constitute a complete dial interface, but some of the graphic elements drawn by the drawing service program 143 have jagged edges. The sub-chip 14 can superimpose and synthesize the multiple graphic elements stored in the second video memory 140 with the shared graphic elements read from the first video memory 16, so that the final synthesized dial interface does not have jagged edges.
[0067] In some embodiments, the secondary chip 14 may also replace jagged primitives in the plurality of primitives stored in the second video memory 140 with shared primitives read from the first video memory 16, so that the final synthesized dial interface is free of jagged edges.
[0068] In some embodiments, for a pre-installed application installed on a second operating system, the main chip 12 can pre-identify controls on the secondary chip side that are poorly drawn in the interface of the pre-installed application. These poorly drawn controls can be marked by the main chip 12, which can then pre-render them as shared primitives and save them to the first video memory 16. When the secondary chip 14 is drawing interface content, it can attempt to replace the poorly drawn primitives with the shared primitives stored in the first video memory 16. If the shared primitives required by the secondary chip 14 are not present in the first video memory 16, the secondary chip 14 can then delegate the primitive drawing to the main chip 12.
[0069] like Figure 4 As shown, taking the dial interface I1 as an example, the dial interface I1 is the interface of the pre-installed dial application of the second operating system. The dial interface I1 can be divided into multiple graphic elements, and each graphic element can correspond to a control. The main chip 16 can obtain the control set required to draw the dial interface I1. For example, the drawing of the dial interface I1 involves the first control c1, the second control c2, the third control c3, the fourth control c4, the fifth control c5, and the sixth control c6. The main chip 12 can identify whether there are controls among the first to sixth controls c1 to c6 that have poor drawing effects on the sub-chip 14 side. Assuming that the first control c1 and the sixth control c6 are controls that have poor drawing effects on the sub-chip 14 side, the main chip 12 can pre-execute the drawing instructions corresponding to the first control c1 and the sixth control c6 to obtain shared graphic elements I11 and I12. The main chip 16 can store the drawn shared graphic elements I11 and I12 into the first video memory 16.
[0070] When the secondary chip 14 is drawing the dial interface I1, it can obtain the control set required for drawing the dial interface I1. The secondary chip 14 can identify controls in the control set that have poor drawing quality. The secondary chip 14 can execute the drawing instructions corresponding to the first to sixth controls c1 to c6 to obtain multiple local primitives, which can be stored in the second video memory 140. The secondary chip 14 can attempt to read the shared primitives corresponding to the poorly drawn controls from the first video memory 16, and then overlay and synthesize the local primitives and shared primitives. The synthesized result is then sent to the display screen 10.
[0071] In some embodiments, if there is no shared primitive corresponding to a control with poor drawing effect in the first video memory 16, the secondary chip 14 may request the main chip 12 to draw the shared primitive.
[0072] Reference Figure 5 The diagram shown is a data interaction schematic of various functional modules of an electronic device provided in an embodiment of this application.
[0073] For ease of description below, in the application scenarios described below, the electronic device 100 includes a display screen 10, a main chip 12, a secondary chip 14, and a first video memory 16. The main chip 12 is used to run a first operating system, and the secondary chip 14 is used to run a second operating system. The secondary chip 14 includes a second video memory 140. The first operating system includes a first primitive sharing service program 121 and a primitive drawing program 122, and the second operating system includes a second primitive sharing service program 141, a first application program 142, and a drawing service program 143.
[0074] 501. When the first application 142 draws the interface content, the first application 142 sends an interface drawing request to the drawing service program 143.
[0075] 502. The drawing service program 143 draws the interface content and stores the drawn local primitives into the second display memory 140.
[0076] In some embodiments, the drawing service program 143 may include a UI drawing framework, such as the UIkit framework. The drawing service program 143 may obtain the set of controls required to draw the interface content. The drawing service program 143 then executes the drawing instructions corresponding to each control in the control set to draw multiple primitives (local primitives). These multiple local primitives are stored in the second video memory 140.
[0077] 503. The first application 142 obtains the shared graphic elements contained in the interface content and sends the drawing request of the shared graphic elements to the second graphic element sharing service program 141.
[0078] In some embodiments, the UI drawing framework can identify the drawing instructions corresponding to controls. When the drawing instructions corresponding to a control include preset instructions, the graphic element corresponding to that control can be considered a shared graphic element. After analyzing the drawing instructions corresponding to each control in the control set, the first application 142 can obtain the shared graphic elements contained in the interface content.
[0079] In some embodiments, a shared primitive can be considered as a primitive whose drawing effect is poor when drawn on the secondary chip side, requiring the assistance of the main chip 12 for drawing. Preset instructions can be predefined based on the primitive drawing performance of the secondary chip 14. For example, if the secondary chip 14 produces jagged edges when drawing curved text, the preset instructions can be set to include drawing instructions for curved text.
[0080] 504. The second element sharing service program 141 sends the drawing request of the shared element to the first element sharing service program 121.
[0081] 505. The first element sharing service program 121 sends the drawing request of the shared element to the element drawing program 122.
[0082] 506. The primitive drawing program 122 responds to the drawing request of the shared primitive and performs the drawing of the shared primitive.
[0083] 507. The primitive drawing program 122 stores the drawn shared primitives into the first video memory 16.
[0084] 508. The primitive drawing program 122 sends a message that the drawing of the shared primitive is complete to the first primitive sharing service program 121.
[0085] 509. The first element sharing service program 121 sends a message that the shared element drawing is complete to the second element sharing service program 141.
[0086] 510. The second element sharing service program 141 sends a message that the shared element drawing is complete to the drawing service program 143.
[0087] 511. The drawing service program 143 overlays and synthesizes the local primitives stored in the second video memory 140 with the shared primitives stored in the first video memory 16.
[0088] 512. The drawing service program 143 sends the composite result to the display screen 10 for decoding and display.
[0089] Reference Figure 6 As shown in the illustration, this application provides a method for sharing graphical elements, applied to an electronic device 100. The electronic device 100 includes a display screen 10, a main chip 12, and a secondary chip 14. The main chip 12 is used to run a first operating system, and the secondary chip 14 is used to run a second operating system. In this embodiment, the graphical element sharing method may include:
[0090] 61. When the secondary chip 14 draws the interface content, the secondary chip 14 obtains the control set corresponding to the interface content.
[0091] In some embodiments, the control set may include at least one control. The second operating system may include a UI drawing framework, which can generate the control set required to draw the interface content based on the interface content. That is, the secondary chip 14 can obtain the control set corresponding to the interface content through the UI drawing framework.
[0092] 62. Sub-chip 14 identifies the first type of control that does not meet the preset conditions based on the drawing instructions corresponding to each control in the control set.
[0093] In some embodiments, preset conditions can be defined according to actual needs. For example, preset conditions could refer to defects such as jagged edges or insufficient clarity in the graphics drawn on the secondary chip side. The UI drawing framework can identify the drawing instructions corresponding to each control in the control set. When the drawing instructions corresponding to a certain control include preset instructions, it can be considered that the drawing effect of the graphics corresponding to that control on the secondary chip side is poor, and the main chip 12 needs to assist in the drawing. This control is considered a first-type control. Preset instructions can be predefined according to the graphics drawing performance of the secondary chip 14. For example, if the secondary chip 14 produces jagged edges when drawing curved text, the preset instructions can be set to include drawing instructions for curved text. When the UI drawing framework identifies that the drawing instructions of a certain control include drawing instructions for curved text, this control is considered a first-type control that does not meet the preset conditions.
[0094] In some embodiments, the secondary chip 14 can also mark controls that do not meet preset conditions. The marked controls are the first type of controls, which facilitates sending the drawing instructions corresponding to the first type of controls to the main chip 12.
[0095] 63. The secondary chip 14 sends the drawing instructions corresponding to the first type of control to the main chip 12 for drawing.
[0096] In some embodiments, the main chip 12 can be a high-power, high-computing-power processing chip such as a CPU, SoC, or AP. The secondary chip 14 can be a low-power, low-computing-power processing chip such as an MCU or SCM. Since the performance of the main chip 12 is stronger than that of the secondary chip 14, the secondary chip 14 sends the drawing instructions corresponding to the first type of control to the main chip 12 for drawing, which can avoid defects such as jagged edges.
[0097] 64. The secondary chip 14 obtains the primitive drawing results of the main chip 12.
[0098] In some embodiments, the electronic device 100 may further include a first video memory 16, and both the main chip 12 and the secondary chip 14 have read access to the first video memory 16. The main chip 12 can store the primitive drawing results in the first video memory 16, and the secondary chip 14 can read the primitive drawing results from the main chip 12 from the first video memory 16. In other embodiments, the main chip 12 may also send the primitive drawing results to the secondary chip 14.
[0099] 65. The sub-chip 14 combines the local primitive drawing result with the primitive drawing result of the main chip 12, and sends the combined result to the display screen 10.
[0100] In some embodiments, the local primitive drawing result may refer to the primitives drawn by the drawing instructions corresponding to each control in the control set executed by the sub-chip 14.
[0101] In some embodiments, the local primitive drawing result of the secondary chip 14 can constitute a complete interface content, but the synthesized interface content has jagged edges. The secondary chip 14 can superimpose and synthesize the local primitive drawing result with the primitive drawing result of the main chip 12, so that the final synthesized interface content does not have jagged edges.
[0102] In some embodiments, the secondary chip 14 can also replace the jagged primitives in the local primitive drawing result with the primitive drawing result of the main chip 12, so that the final synthesized interface content does not have jagged edges.
[0103] The above-mentioned primitive sharing method allows the secondary chip to request the primary chip to assist in drawing controls with poor drawing quality when drawing interface content. This compensates for the secondary chip's inability to draw complex and detailed interfaces due to insufficient hardware capabilities.
[0104] Reference Figure 7 As shown in the illustration, this application provides a method for sharing graphical elements, applied to an electronic device 100. The electronic device 100 includes a display screen 10, a main chip 12, a secondary chip 14, and a first video memory 16. The main chip 12 is used to run a first operating system, and the secondary chip 14 is used to run a second operating system. In this embodiment, the graphical element sharing method may include:
[0105] 71. When the secondary chip 14 draws the interface content, the secondary chip 14 obtains the control set corresponding to the interface content.
[0106] In some embodiments, the control set may include at least one control. The second operating system may include a UI drawing framework, which can generate the control set required to draw the interface content based on the interface content. That is, the secondary chip 14 can obtain the control set corresponding to the interface content through the UI drawing framework.
[0107] 72. Sub-chip 14 identifies the first type of control that does not meet the preset conditions based on the drawing instructions corresponding to each control in the control set.
[0108] In some embodiments, preset conditions can be defined according to actual needs. For example, preset conditions may refer to defects such as jagged edges or insufficient clarity in the primitives drawn on the secondary chip side. When the drawing instruction corresponding to a certain control includes a preset instruction, the control can be considered as a first-type control. The preset instruction can be predefined according to the primitive drawing performance of the secondary chip 14. For example, if the secondary chip 14 produces jagged edges when drawing curved text, the preset instruction can be set to include the drawing instruction for curved text.
[0109] 73. The secondary chip 14 reads the drawing result of the primitive corresponding to the first type of control from the first video memory 16.
[0110] In some embodiments, the first video memory 16 can be any one of SRAM, SDRAM, DDR, etc. The first video memory 16 can also be selected from other types of memory depending on the actual application scenario. After the electronic device 100 is powered on, the main chip 12 can identify controls with poor drawing quality on the secondary chip side. These poorly drawn controls can be marked by the main chip 12, which can pre-draw these marked controls and store the drawing results in the first video memory 16. Then, the secondary chip 14 can attempt to read the primitive drawing results corresponding to the first type of control from the first video memory 16.
[0111] In some embodiments, for a pre-installed application installed on a second operating system, the main chip 12 can pre-identify controls on the secondary chip side that are poorly drawn in the interface of the pre-installed application. These poorly drawn controls can be marked by the main chip 12, which can then pre-render them as shared primitives and save them to the first video memory 16. When the secondary chip 14 is drawing interface content, it can attempt to replace the poorly drawn primitives with the shared primitives stored in the first video memory 16. If the shared primitives required by the secondary chip 14 are not present in the first video memory 16, the secondary chip 14 can delegate the primitive drawing to the main chip 12. Subsequently, the secondary chip 14 will read the primitive drawing results corresponding to the first type of control from the first video memory 16.
[0112] 74. The sub-chip 14 combines the local primitive drawing result with the primitive drawing result read from the first video memory 16, and sends the combined result to the display screen 10.
[0113] In some embodiments, the local primitive drawing result may refer to the primitives drawn by the drawing instructions corresponding to each control in the control set executed by the sub-chip 14. The local primitive drawing result of the sub-chip 14 can constitute a complete interface content, but the synthesized interface content has jagged edges. The sub-chip 14 can superimpose the local primitive drawing result with the primitive drawing result read from the first video memory 16 to synthesize the final synthesized interface content without jagged edges.
[0114] In some embodiments, the sub-chip 14 may also replace jagged primitives in the local primitive drawing result with primitive drawing results read from the first video memory 16, so that the final synthesized interface content does not have jagged edges.
[0115] In the above-described primitive sharing method, when the secondary chip is drawing interface content, for controls with poor drawing effects, the secondary chip can try to read primitives pre-drawn by the main chip from the first video memory. If the primary video memory does not contain the primitives required by the secondary chip, the secondary chip can request the main chip to assist in drawing, thereby making up for the deficiency that the secondary chip cannot draw complex and detailed interfaces due to insufficient hardware capabilities.
[0116] refer to Figure 8 This is a schematic diagram of the hardware structure of an electronic device 100 provided in an embodiment of this application. Figure 8 As shown, the electronic device 100 may include a screen 1001, a first processor 1002, a second processor 1003, a memory 1004, and a communication bus 1005. The memory 1004 stores one or more computer programs 1006. The one or more computer programs 1006 are configured to be executed by the second processor 1003. The one or more computer programs 1006 include instructions, and the second processor 1003 executing these instructions can implement the aforementioned primitive sharing method within the electronic device 100.
[0117] It is understood that the structure illustrated in this embodiment does not constitute a specific limitation on the electronic device 100. In other embodiments, the electronic device 100 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements.
[0118] Both the first processor 1002 and the second processor 1003 may include one or more processing units, such as a modem, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural network processing unit (NPU). These different processing units may be independent devices or integrated into one or more processors.
[0119] Both the first processor 1002 and the second processor 1003 may also be provided with memory for storing instructions and data. In some embodiments, the memory in the first processor 1002 and the second processor 1003 is a cache memory. This memory can store instructions or data that the first processor 1002 or the second processor 1003 has just used or is used repeatedly. If the first processor 1002 or the second processor 1003 needs to use the instruction or data again, it can be directly retrieved from this memory. This avoids repeated access, reduces the waiting time of the first processor 1002 and the second processor 1003, and thus improves the efficiency of the system.
[0120] In some embodiments, both the first processor 1002 and the second processor 1003 may include one or more interfaces. Interfaces may include inter-integrated circuit (I2C) interfaces, inter-integrated circuit sound (I2S) interfaces, pulse code modulation (PCM) interfaces, universal asynchronous receiver / transmitter (UART) interfaces, mobile industry processor interfaces (MIPI), general-purpose input / output (GPIO) interfaces, SIM interfaces, and / or USB interfaces, etc.
[0121] In some embodiments, memory 1004 may include high-speed random access memory, and may also include non-volatile memory, such as hard disk, memory, plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, at least one disk storage device, flash memory device, or other non-volatile solid-state storage device.
[0122] This embodiment also provides a computer storage medium storing computer instructions. When the computer instructions are executed on an electronic device, the electronic device performs the aforementioned method steps to implement the primitive sharing method in the above embodiment.
[0123] This embodiment also provides a computer program product that, when run on a computer, causes the computer to perform the aforementioned steps to implement the primitive sharing method in the above embodiment.
[0124] In addition, embodiments of this application also provide an apparatus, which may specifically be a chip, component or module. The apparatus may include a connected processor and a memory; wherein the memory is used to store computer execution instructions, and when the apparatus is running, the processor may execute the computer execution instructions stored in the memory to cause the chip to execute the primitive sharing method in the above method embodiments.
[0125] In this embodiment, the electronic device, computer storage medium, computer program product or chip are all used to execute the corresponding method provided above. Therefore, the beneficial effects that can be achieved can be referred to the beneficial effects of the corresponding method provided above, and will not be repeated here.
[0126] Through the above description of the embodiments, those skilled in the art can clearly understand that, for the sake of convenience and brevity, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0127] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another device, or some features may be ignored or not executed. Furthermore, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.
[0128] The unit described as a separate component may or may not be physically separate. The component shown as a unit can be one physical unit or multiple physical units, that is, it can be located in one place or distributed in multiple different places. Some or all of the units can be selected to achieve the purpose of the solution in this embodiment according to actual needs.
[0129] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0130] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solutions of the embodiments of this application, essentially or in other words, the parts that contribute to the prior art, or all or part of the technical solutions, can be embodied in the form of a software product. This software product is stored in a storage medium and includes several instructions to cause a device (which may be a microcontroller, chip, etc.) or processor to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0131] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions within the technical scope disclosed in this application should be covered within the scope of protection of this application.
Claims
1. A primitive sharing method applied to an electronic device, the electronic device comprising a main chip, a secondary chip, a memory, and a display screen, characterized in that, The main chip is used to run a first operating system, the secondary chip is used to run a second operating system, and the primitive sharing method includes: When the sub-chip draws interface content, the sub-chip obtains a control set corresponding to the interface content, and the control set includes at least one control. The secondary chip identifies the first type of control that does not meet the preset conditions based on the drawing instructions corresponding to each control in the control set; The secondary chip sends the drawing instructions corresponding to the first type of control to the main chip for drawing; The secondary chip reads the primitive drawing results of the main chip from the memory, and the primitive drawing results of the main chip are written into the memory by the main chip. The sub-chip combines the local primitive drawing result with the primitive drawing result of the main chip, and sends the combined result to the display screen. The local primitive drawing result is drawn by the sub-chip executing the drawing instructions corresponding to each control.
2. The primitive sharing method as described in claim 1, characterized in that, The primitive sharing method also includes: The secondary chip calls the UI drawing framework to obtain the drawing instructions corresponding to each control in the control set.
3. The primitive sharing method as described in claim 1 or 2, characterized in that, The secondary chip sends the drawing instructions corresponding to the first type of control to the main chip for drawing, including: The sub-chip marks controls that do not meet the preset conditions to obtain the first type of control; The secondary chip sends the drawing instructions corresponding to the first type of control to the main chip for drawing.
4. The primitive sharing method as described in any one of claims 1 to 3, characterized in that, The sub-chip identifies a first type of control that does not meet preset conditions based on the drawing instructions corresponding to each control in the control set, including: When the drawing instruction corresponding to the control contains a preset instruction, the sub-chip identifies the control as the first type of control.
5. The primitive sharing method as described in any one of claims 1 to 3, characterized in that, The sub-chip combines the local primitive drawing results with the primitive drawing results of the main chip, including: The secondary chip superimposes and synthesizes the primitive drawing results of the main chip with the local primitive drawing results; or The secondary chip replaces the portion of the local primitive drawing result corresponding to the first type of control with the primitive drawing result of the main chip.
6. A primitive sharing method applied to an electronic device, the electronic device comprising a main chip, a secondary chip, a memory, and a display screen, characterized in that, The main chip is used to run a first operating system, the secondary chip is used to run a second operating system, and the primitive sharing method includes: When the sub-chip draws interface content, the sub-chip obtains a control set corresponding to the interface content, and the control set includes at least one control. The secondary chip identifies the first type of control that does not meet the preset conditions based on the drawing instructions corresponding to each control in the control set; The secondary chip reads the drawing result of the primitive corresponding to the first type of control from the memory; The sub-chip combines the local primitive drawing result with the primitive drawing result read from the memory, and sends the combined result to the display screen. The local primitive drawing result is drawn by the sub-chip executing the drawing instructions corresponding to each control. The second operating system includes at least one pre-installed application, and the primitive sharing method further includes: The main chip acquires the set of controls required by the sub-chip to draw the interface content of the preset application; The main chip identifies controls in the set that do not meet the preset conditions; The main chip executes the drawing instructions corresponding to the controls in the set that do not meet the preset conditions, and draws multiple shared primitives; The main chip stores the multiple shared primitives into the memory.
7. The primitive sharing method as described in claim 6, characterized in that, The primitive sharing method also includes: When the secondary chip fails to read the drawing result of the primitive corresponding to the first type of control from the memory, the secondary chip sends the drawing instruction corresponding to the control in the first type of control that does not have a primitive drawing result to the main chip for drawing; The main chip executes the drawing instructions sent by the secondary chip and stores the drawing results of the primitives corresponding to the drawing instructions into the memory.
8. The primitive sharing method as described in claim 6 or 7, characterized in that, The sub-chip identifies a first type of control that does not meet preset conditions based on the drawing instructions corresponding to each control in the control set, including: When the drawing instruction corresponding to the control contains a preset instruction, the sub-chip identifies the control as the first type of control.
9. The primitive sharing method as described in claim 6 or 7, characterized in that, The sub-chip combines the local primitive drawing results with the primitive drawing results read from the memory, including: The sub-chip overlays and synthesizes the primitive drawing results read from the memory with the local primitive drawing results; or The secondary chip replaces the portion of the local primitive drawing result corresponding to the first type of control with the primitive drawing result read from the memory.
10. An electronic device comprising a main chip, a secondary chip, a memory, and a display screen, characterized in that, The main chip is used to run a first operating system, and the secondary chip is used to run a second operating system. The first operating system includes a first primitive sharing service program and a primitive drawing program, and the second operating system includes a second primitive sharing service program and a first application program. When the first application draws interface content, the first application obtains the shared primitives contained in the interface content, wherein the shared primitives are primitives whose drawing effect on the sub-chip side does not meet the preset requirements; The first application sends the drawing request of the shared graphic element to the graphic element drawing program through the second graphic element sharing service program and the first graphic element sharing service program; The primitive drawing program responds to the drawing request of the shared primitive and performs primitive drawing; The main chip stores the primitive drawing results of the primitive drawing program into the memory; The sub-chip combines the local primitive drawing result with the primitive drawing result read from the memory, and sends the combined result to the display screen, wherein the local primitive drawing result is drawn by the first application.
11. The electronic device as claimed in claim 10, characterized in that, The memory is a first video memory, and the sub-chip includes a second video memory, which is used to store the local primitive drawing results.
12. The electronic device as claimed in claim 10 or 11, characterized in that, The sub-chip can either overlay the local primitive drawing result with the primitive drawing result read from the memory, or replace the part of the local primitive drawing result corresponding to the shared primitive with the primitive drawing result read from the memory.
13. A computer-readable storage medium, characterized in that, The method includes computer instructions that, when executed on an electronic device, cause the electronic device to perform the primitive sharing method as described in any one of claims 1 to 5, or to perform the primitive sharing method as described in any one of claims 6 to 9.
14. A chip coupled to a memory in an electronic device, characterized in that, The chip is used to control the electronic device to perform the primitive sharing method as described in any one of claims 1 to 5, or to perform the primitive sharing method as described in any one of claims 6 to 9.
Citation Information
Patent Citations
Video processing system and processing chip
CN110166720A