Processing method, related device, electronic equipment and computer readable storage medium
By introducing asynchronous threads into single-core wearable devices of the real-time operating system for resource preloading, the problem of time-consuming reading of user interface thread data is solved and the display frame rate of the device is improved.
Patent Information
- Application Number
- CN202410089302.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-22
- Publication Date
- 2025-01-03
- Estimated Expiration
- 2044-01-22
AI Technical Summary
When a single-core wearable device based on a real-time operating system reads pictures and font resources, the data reading process of the user interface thread takes a long time, resulting in a decrease in the display frame rate.
In electronic devices that adopt real-time operating systems, asynchronous threads are introduced to preload resources, and when the user interface thread is idle, the asynchronous thread reads from the file and saves the resources to the cache, reducing the time the user interface thread reads data.
By processing resource preloading by asynchronous threads, the data reading time of user interface threads is reduced and the display frame rate of electronic devices is improved.
Smart Images

Figure CN119248430A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of electronic equipment, and in particular to a processing method, a related device, an electronic device and a computer-readable storage medium. Background Art
[0002] Single-core wearable devices such as watches and bracelets based on real-time operating systems (RTOS) have only one central processing unit (CPU) and only one thread is scheduled at the same time.
[0003] When receiving a message to update the content of the display interface, the user interface (UI) thread reads the image data and font data from the image resource file and the font resource file into the cache, and the process of reading the file takes a long time. This causes the entire process of reading the file, loading the image and text, and calling the graphics processing unit (GPU) for rendering to take a long time, affecting the display frame rate of the electronic device. Summary of the invention
[0004] The present application provides a processing method, a related device, an electronic device and a computer-readable storage medium, which can reduce the time it takes for a UI thread to read data, thereby helping to improve the display frame rate of the electronic device.
[0005] In a first aspect, the present application provides a processing method for an electronic device using a real-time operating system, wherein after the electronic device is turned on, a user interface thread and an asynchronous thread are run, and the priority of the user interface thread is higher than that of the asynchronous thread; the electronic device includes a display screen; and the method includes:
[0006] The user interface thread obtains a first message, where the first message is used to trigger the display screen to update display content, and the content to be displayed corresponds to multiple frames;
[0007] triggering the user interface thread to respond to the first message and determine an identifier of a resource that needs to be preloaded;
[0008] Triggering the user interface thread to send a second message to the asynchronous thread, where the second message carries the identifier;
[0009] When the user interface thread is idle, triggering the asynchronous thread to read the preloaded resources from the relevant file according to the identifier, and saving the read preloaded resources into the first cache;
[0010] When the first cache includes resources of the frame to be displayed, triggering the user interface thread to read the resources corresponding to the frame to be displayed in the first cache;
[0011] The graphics processor is triggered to render the resource corresponding to the frame to be displayed and read from the first cache to obtain the frame to be displayed.
[0012] When the technical solution provided by this embodiment is adopted, the user interface thread sends the identifier of the resource to be preloaded to the asynchronous thread. When the user interface thread is idle, the asynchronous thread reads the preloaded resources from the relevant files and saves the preloaded resources that have been read into the first cache. When the first cache includes the resources of the frame to be displayed, the interface thread reads the resources corresponding to the frame to be displayed in the first cache. The graphics processor renders the resources corresponding to the frame to be displayed read from the first cache to obtain the frame to be displayed. The present application uses the asynchronous thread to save the resources of the frame to be displayed into the first cache, which can avoid the user interface thread directly reading the relevant resources from the file corresponding to the frame to be displayed. Since the asynchronous thread is the relevant operation performed when the graphical user interface thread is idle, the adoption of this solution can reduce the time it takes for the graphical user interface thread to read data, which is beneficial to improving the display frame rate of the electronic device.
[0013] In some possible implementations, when the user interface thread is idle, it includes: when the graphics processor renders the resources corresponding to the to-be-displayed frame read from the first cache.
[0014] In some possible implementations, after obtaining the frame to be displayed, the method further includes:
[0015] Saving the frame to be displayed in a second buffer;
[0016] The frame to be displayed is read from the second buffer, and the frame to be displayed is displayed on the display screen.
[0017] In some possible implementations, the resources that need to be preloaded include: picture resources and character resources.
[0018] In some possible implementations, the identifier of the resource that needs to be preloaded includes: an identification code of a picture corresponding to the picture resource, and an identification code of a character corresponding to the character resource.
[0019] In some possible implementations, the first cache includes: a third cache and a fourth cache, the third cache is used to store picture information corresponding to the identification code of the picture; the fourth cache is used to store character information corresponding to the identification code of the character.
[0020] In some possible implementations, the method further includes:
[0021] When the first cache does not include the resource of the frame to be displayed, the user interface thread is triggered to read the resource of the frame to be displayed from the relevant file into the first cache.
[0022] In a second aspect, the present application provides a processing device for an electronic device using a real-time operating system, wherein after the electronic device is turned on, a user interface thread and an asynchronous thread are run, and the priority of the user interface thread is higher than that of the asynchronous thread; the electronic device includes a display screen; and the device includes:
[0023] An acquisition unit, configured to acquire a first message through the user interface thread, wherein the first message is used to trigger the display screen to update display content, and the content to be displayed corresponds to multiple frames;
[0024] A determination unit, configured to trigger the user interface thread to respond to the first message and determine an identifier of a resource that needs to be preloaded;
[0025] A sending unit, used for triggering the user interface thread to send a second message to the asynchronous thread, wherein the second message carries the identifier;
[0026] a processing unit, configured to trigger the asynchronous thread to read the preloaded resources from the relevant file according to the identifier and save the preloaded resources read into the first cache when the user interface thread is idle;
[0027] a reading unit, configured to trigger the user interface thread to read the resources corresponding to the frame to be displayed in the first cache when the first cache includes the resources of the frame to be displayed;
[0028] The rendering unit is used to trigger the graphics processor to render the resources corresponding to the frame to be displayed and read from the first cache to obtain the frame to be displayed.
[0029] In some possible implementations, when the user interface thread is idle, it includes: when the graphics processor renders the resources corresponding to the to-be-displayed frame read from the first cache.
[0030] In some possible implementations, the processing unit is further used to, after the rendering unit obtains the frame to be displayed, save the frame to be displayed in a second cache, and read the frame to be displayed from the second cache, and display the frame to be displayed through the display screen.
[0031] In some possible implementations, the resources that need to be preloaded include: picture resources and character resources.
[0032] In some possible implementations, the identifier of the resource that needs to be preloaded includes: an identification code of a picture corresponding to the picture resource, and an identification code of a character corresponding to the character resource.
[0033] In some possible implementations, the first cache includes: a third cache and a fourth cache, the third cache is used to store picture information corresponding to the identification code of the picture; the fourth cache is used to store character information corresponding to the identification code of the character.
[0034] In some possible implementations, when the first cache does not include the resource of the frame to be displayed, the processing unit is further configured to trigger the user interface thread to read the resource of the frame to be displayed from the relevant file into the first cache.
[0035] In a third aspect, the present application provides an electronic device, comprising: a processor, and a memory; the memory is coupled to the processor, the memory is used to store computer program code, the computer program code comprises computer instructions, and the processor calls the computer instructions to enable the electronic device to execute any one of the methods in the technical solution described in the first aspect.
[0036] In a fourth aspect, the present application provides a computer-readable storage medium, wherein the computer-readable storage medium includes instructions, and when the instructions are executed on an electronic device, the electronic device executes any one of the methods in the technical solution described in the first aspect.
[0037] It should be understood that the technical solutions provided in the second to fourth aspects above and their technical features can all correspond to the communication methods provided in the first aspect and its possible implementation methods, so the beneficial effects that can be achieved are similar and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] Figure 1A This is a schematic diagram of an application scenario to which the processing method provided in an embodiment of the present application is applicable;
[0039] Figure 1B This is a schematic diagram of an application scenario to which the processing method provided in an embodiment of the present application is applicable;
[0040] Figure 2A It is a flowchart of a processing method provided by an embodiment of the present application;
[0041] Figure 2B This is a schematic diagram of the interaction process between the user interface thread and the asynchronous thread in one embodiment of the present application;
[0042] Figure 3Ais a schematic diagram of a rendering and display process of image frame data shown in an embodiment of the present application;
[0043] Figure 3B It is a flowchart of a processing method provided by an embodiment of the present application;
[0044] Figure 4 It is a flowchart of a processing method provided by an embodiment of the present application;
[0045] Figure 5 is a schematic diagram of the structure of an electronic device shown in an embodiment of the present application;
[0046] Figure 6 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0047] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application. In the description of the embodiments of the present application, unless otherwise specified, " / " means or, for example, A / B can mean A or B; "and / or" in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiments of the present application, "multiple" means two or more than two.
[0048] In the following, the terms "first", "second", and "third" are used for descriptive purposes only and are not to be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first", "second", and "third" may explicitly or implicitly include one or more of the features.
[0049] Figure 1A and Figure 1B Schematic diagram of an application scenario in which the processing method provided in the embodiment of the present application is applicable. Figure 1A As shown, the user operates the electronic device by touching the display screen of the smart watch; Figure 1B As shown, the user operates the electronic device by touching the display screen of the smart watch. In addition, the smart watch communicates with the mobile phone, for example, the smart watch can communicate with the mobile phone via Bluetooth.
[0050] The processing method, related apparatus, electronic device and computer-readable storage medium provided in the embodiments of the present application can be applied to wearable devices such as smart watches and wrist bands. The embodiments of the present application do not impose any restrictions on the specific type of electronic device. For simplicity, the electronic device in the embodiments of the present application is described using a smart watch as an example.
[0051] The processing method provided by the present application is described below in conjunction with a specific embodiment. The method is used for an electronic device using a real-time operating system. After the electronic device is turned on, a user interface thread and an asynchronous thread are run, and the priority of the user interface thread is higher than that of the asynchronous thread. The electronic device includes a display screen; see Figure 2A , Figure 2A It is a flowchart of a processing method provided in an embodiment of the present application, which may include steps 201 to 206.
[0052] 201. The user interface thread obtains a first message, where the first message is used to trigger the display screen to update display content, and the content to be displayed corresponds to multiple frames.
[0053] For example, when the electronic device is a smart watch, the first message may be to check the contact information in the smart watch, and the contact information may include: image information and text information. The image information may include a contact icon; the text information may include information such as the contact name and phone number, and different contact information may be browsed by sliding operations.
[0054] In some possible embodiments, the first message may also be checking chat information in an APP such as WeChat.
[0055] It should be noted that the content of the first message triggering the display screen to update can be information stored in the relevant file in the smart watch, corresponding to the scene such as Figure 1A In some possible embodiments, the content of the display screen updated by the first message triggering the display screen to be updated may also be information obtained from relevant files in the smart phone, and the smart phone may communicate with the smart watch via Bluetooth or other means. Figure 1B shown.
[0056] 202. Trigger the user interface thread to respond to the first message and determine the identifier of the resource that needs to be preloaded.
[0057] The resources that need to be preloaded include: picture resources and character resources. The identification of the resources that need to be preloaded includes: the identification code of the picture corresponding to the picture resource, and the identification code of the character corresponding to the character resource.
[0058] 203. Trigger the user interface thread to send a second message to the asynchronous thread, where the second message carries the identifier.
[0059] 204. When the user interface thread is idle, trigger the asynchronous thread to read the preloaded resources from the relevant file according to the identifier, and save the read preloaded resources into the first cache.
[0060] like Figure 2B As shown, it can be determined whether the user interface thread is idle. If so, execute Figure 2AIf not, step 204 is not executed until the user interface thread is idle. It is understood that if the user interface thread is not idle, the user interface thread is scheduled first because the priority of the user interface thread is higher than that of the asynchronous thread. When the user interface thread is idle, the asynchronous thread is scheduled. Since the content to be displayed corresponds to multiple frames, the asynchronous thread may read the preloaded resources once or multiple times.
[0061] In some possible embodiments, when the user interface thread is idle, it includes: when the graphics processor renders the resources corresponding to the frame to be displayed that are read from the first cache.
[0062] In some possible embodiments, the first cache includes: a third cache and a fourth cache, the third cache is used to store picture information corresponding to the identification code of the picture; the fourth cache is used to store character information corresponding to the identification code of the character.
[0063] 205. When the first cache includes resources of the frame to be displayed, trigger the user interface thread to read the resources corresponding to the frame to be displayed in the first cache.
[0064] 206. Trigger the graphics processor to render the resource corresponding to the frame to be displayed read from the first cache to obtain the frame to be displayed.
[0065] When the technical solution provided by this embodiment is adopted, the user interface thread sends the identifier of the resource to be preloaded to the asynchronous thread. When the user interface thread is idle, the asynchronous thread reads the preloaded resources from the relevant files and saves the preloaded resources that have been read into the first cache. When the first cache includes the resources of the frame to be displayed, the interface thread reads the resources corresponding to the frame to be displayed in the first cache. The graphics processor renders the resources corresponding to the frame to be displayed read from the first cache to obtain the frame to be displayed. The present application uses the asynchronous thread to save the resources of the frame to be displayed into the first cache, which can avoid the user interface thread directly reading the relevant resources from the file corresponding to the frame to be displayed. Since the asynchronous thread is the relevant operation performed when the graphical user interface thread is idle, the adoption of this solution can reduce the time it takes for the graphical user interface thread to read data, which is beneficial to improving the display frame rate of the electronic device.
[0066] See also Figure 3A , Figure 3AThis is a schematic diagram of the rendering and display process of image frame data shown in an embodiment of the present application. In order to improve the refresh smoothness of the UI interface, the relevant embodiment provides a dual frame buffer technology, that is, two frame buffers are provided. During the image frame data rendering and display process, one frame buffer is used to render the image frame data, and the other frame buffer is used to send the image. One frame buffer corresponds to one image frame, or one frame of image frame data, see Figure 3A , the electronic device provides a frame buffer buffer1 and a frame buffer buffer2, wherein the frame buffer buffer1 is used to render image frame data, and the frame buffer buffer2 is used to send images. That is, after the graphics processor renders the UI interface, the obtained image frame data is stored in the frame buffer buffer1, and then the electronic device copies the data in the frame buffer buffer1 to the frame buffer buffer2, and then the user interface thread sends the image frame data in the frame buffer buffer2 to the display screen for display, so that the frame buffer buffer1 can continue to be used for the next image frame data rendering.
[0067] See also Figure 3B , Figure 3B It is a flowchart of a processing method provided in an embodiment of the present application, which may include steps 301 to 308.
[0068] 301. The user interface thread obtains a first message, where the first message is used to trigger the display screen to update display content, and the content to be displayed corresponds to multiple frames.
[0069] For example, when the electronic device is a smart watch, the first message may be to check the contact information in the smart watch, and the contact information may include: image information and text information. The image information may include a contact icon; the text information may include information such as the contact name and phone number, and different contact information may be browsed by sliding operations.
[0070] In some possible embodiments, the first message may also be checking chat information in an APP such as WeChat.
[0071] It should be noted that the content of the first message triggering the display screen to update can be information stored in the relevant file in the smart watch, corresponding to the scene such as Figure 1A In some possible embodiments, the content of the display screen updated by the first message triggering the display screen to be updated may also be information obtained from relevant files in the smart phone, and the smart phone may communicate with the smart watch via Bluetooth or other means. Figure 1B shown.
[0072] 302. Trigger the user interface thread to respond to the first message and determine the identifier of the resource that needs to be preloaded.
[0073] The resources that need to be preloaded include: picture resources and character resources. The identification of the resources that need to be preloaded includes: the identification code of the picture corresponding to the picture resource, and the identification code of the character corresponding to the character resource.
[0074] 303. Trigger the user interface thread to send a second message to the asynchronous thread, where the second message carries the identifier.
[0075] 304. When the user interface thread is idle, trigger the asynchronous thread to read the preloaded resources from the relevant file according to the identifier, and save the read preloaded resources into the first cache.
[0076] In some possible embodiments, when the user interface thread is idle, it includes: when the graphics processor renders the resources corresponding to the frame to be displayed that are read from the first cache.
[0077] In some possible embodiments, the first cache includes: a third cache and a fourth cache, the third cache is used to store picture information corresponding to the identification code of the picture; the fourth cache is used to store character information corresponding to the identification code of the character.
[0078] 305. When the first cache includes resources of the frame to be displayed, trigger the user interface thread to read the resources corresponding to the frame to be displayed in the first cache.
[0079] 306. Trigger the graphics processor to render the resource corresponding to the frame to be displayed read from the first cache to obtain the frame to be displayed.
[0080] 307. Save the frame to be displayed in the second cache.
[0081] 308. Read the frame to be displayed from the second cache, and display the frame to be displayed on the display screen.
[0082] See also Figure 4 , Figure 4 It is a flowchart of a processing method provided in an embodiment of the present application, which may include steps 401 to 410.
[0083] 401. The user interface thread obtains a first message, where the first message is used to trigger the display screen to update display content, and the content to be displayed corresponds to multiple frames.
[0084] For example, when the electronic device is a smart watch, the first message may be to check the contact information in the smart watch, and the contact information may include: image information and text information. The image information may include a contact icon; the text information may include information such as the contact name and phone number, and different contact information may be browsed by sliding operations.
[0085] In some possible embodiments, the first message may also be checking chat information in an APP such as WeChat.
[0086] It should be noted that the content of the first message triggering the display screen to update can be information stored in the relevant file in the smart watch, corresponding to the scene such as Figure 1A In some possible embodiments, the content of the display screen updated by the first message triggering the display screen to be updated may also be information obtained from relevant files in the smart phone, and the smart phone may communicate with the smart watch via Bluetooth or other means. Figure 1B shown.
[0087] 402. Trigger the user interface thread to respond to the first message and determine the identifier of the resource that needs to be preloaded.
[0088] The resources that need to be preloaded include: picture resources and character resources. The identification of the resources that need to be preloaded includes: the identification code of the picture corresponding to the picture resource, and the identification code of the character corresponding to the character resource.
[0089] 403. Trigger the user interface thread to send a second message to the asynchronous thread, where the second message carries the identifier.
[0090] 404. When the user interface thread is idle, trigger the asynchronous thread to read the preloaded resources from the relevant file according to the identifier, and save the read preloaded resources into the first cache.
[0091] In some possible embodiments, when the user interface thread is idle, it includes: when the graphics processor renders the resources corresponding to the frame to be displayed that are read from the first cache.
[0092] In some possible embodiments, the first cache includes: a third cache and a fourth cache, the third cache is used to store picture information corresponding to the identification code of the picture; the fourth cache is used to store character information corresponding to the identification code of the character.
[0093] 405. Determine whether the first cache includes resources of the frame to be displayed.
[0094] If the first buffer contains the resource of the frame to be displayed, then step 407 is executed. If the first buffer does not contain the resource of the frame to be displayed, then step 406 is executed.
[0095] 406. Trigger the user interface thread to read the resources of the frame to be displayed from the relevant file into the first cache.
[0096] 407. Trigger the user interface thread to read the resources corresponding to the frame to be displayed in the first cache.
[0097] 408. Trigger the graphics processor to render the resources corresponding to the frame to be displayed read from the first cache to obtain the frame to be displayed.
[0098] 409. Save the frame to be displayed into the second cache.
[0099] 410. Read the frame to be displayed from the second cache, and display the frame to be displayed through the display screen.
[0100] When the technical solution provided by this embodiment is adopted, the user interface thread sends the identifier of the resource to be preloaded to the asynchronous thread. When the user interface thread is idle, the asynchronous thread reads the preloaded resources from the relevant files and saves the preloaded resources that have been read into the first cache. When the first cache includes the resources of the frame to be displayed, the interface thread reads the resources corresponding to the frame to be displayed in the first cache. The graphics processor renders the resources corresponding to the frame to be displayed read from the first cache to obtain the frame to be displayed. The present application uses the asynchronous thread to save the resources of the frame to be displayed into the first cache, which can avoid the user interface thread directly reading the relevant resources from the file corresponding to the frame to be displayed. Since the asynchronous thread is the relevant operation performed when the graphical user interface thread is idle, the adoption of this solution can reduce the time it takes for the graphical user interface thread to read data, which is beneficial to improving the display frame rate of the electronic device.
[0101] The embodiment of the present application also provides a processing device for an electronic device using a real-time operating system, wherein after the electronic device is turned on, a user interface thread and an asynchronous thread are run, and the priority of the user interface thread is higher than that of the asynchronous thread; the electronic device includes a display screen; the processing device includes: an acquisition unit, a determination unit, a sending unit, a processing unit, a reading unit, and a rendering unit. Among them, the acquisition unit is used to acquire a first message through the user interface thread, and the first message is used to trigger the display screen to update the display content, and the content to be displayed corresponds to multiple frames; the determination unit is used to trigger the user interface thread to respond to the first message and determine the identifier of the resource to be preloaded; the sending unit is used to trigger the user interface thread to send a second message to the asynchronous thread, and the second message carries the identifier; the processing unit is used to trigger the asynchronous thread to read the preloaded resource from the relevant file according to the identifier when the user interface thread is idle, and save the preloaded resource that has been read to the first cache; the reading unit is used to trigger the user interface thread to read the resource corresponding to the frame to be displayed in the first cache when the resource of the frame to be displayed is included in the first cache; the rendering unit is used to trigger the graphics processor to render the resource corresponding to the frame to be displayed read from the first cache to obtain the frame to be displayed.
[0102] In some possible implementations, when the user interface thread is idle, it includes when the graphics processor renders resources corresponding to the to-be-displayed frame read from the first cache.
[0103] In some possible implementations, the processing unit is further configured to, after the rendering unit obtains the frame to be displayed, save the frame to be displayed in the second cache, and read the frame to be displayed from the second cache, and display the frame to be displayed through the display screen.
[0104] In some possible implementations, the resources that need to be preloaded include: picture resources and character resources.
[0105] In some possible implementations, the identification of the resources that need to be preloaded includes: an identification code of a picture corresponding to the picture resource, and an identification code of a character corresponding to the character resource.
[0106] In some possible implementations, the first cache includes: a third cache and a fourth cache, the third cache is used to store picture information corresponding to the identification code of the picture; the fourth cache is used to store character information corresponding to the identification code of the character.
[0107] In some possible implementations, when the first cache does not include resources of the frame to be displayed, the processing unit is further configured to trigger the user interface thread to read the resources of the frame to be displayed from the relevant file into the first cache.
[0108] It should be noted that the specific implementation of each unit can refer to the description of the previous method embodiment, and for the sake of brevity, it will not be repeated here.
[0109] like Figure 5 As shown, Figure 5 A schematic diagram of the structure of an electronic device 500 provided in an embodiment of the present application, the electronic device 500 may be the above-mentioned smart watch, or may be a smart bracelet, etc. The wearable device may specifically include: a processor 501 and a memory 502, wherein a computer program 503 is stored in the memory 502. The electronic device 500 may also include a touch screen, wherein the touch screen includes a sensor and a display screen. The above-mentioned devices may be coupled via a communication bus 504. The computer program 503 is stored in the above-mentioned memory 502, and the computer program includes computer instructions. The processor 501 calls the computer instructions to enable the electronic device to perform the relevant steps in the above-mentioned method embodiment.
[0110] Figure 6 It is a structural diagram of an electronic device provided in an embodiment of the present application, which may specifically be a wearable terminal device such as a smart watch or a smart bracelet that uses a real-time operating system. The embodiment of the present application does not impose any restrictions on the specific type of the electronic device 600.
[0111] See also Figure 6The electronic device 600 may include a processor 610, an external memory interface 620, an internal memory 621, a universal serial bus (USB) interface 630, a charging management module 640, a power management module 641, a battery 642, an antenna 1, an antenna 2, a mobile communication module 650, a wireless communication module 660, an audio module 670, a speaker 670A, a receiver 670B, a microphone 670C, an earphone interface 670D, a sensor module 680, a button 690, a motor 691, an indicator 692, a camera 693, a screen 694, and a subscriber identification module (SIM) card interface 695, etc. Among them, the sensor module 680 may include a pressure sensor 680A, a gyroscope sensor 680B, an air pressure sensor 680C, a magnetic sensor 680D, an acceleration sensor 680E, a distance sensor 680F, a proximity light sensor 680G, a fingerprint sensor 680H, a temperature sensor 680J, a touch sensor 680K, an ambient light sensor 680L, a bone conduction sensor 680M, etc.
[0112] The processor 610 may include a processing unit, for example, the processor 610 may include an AP, a CP, a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one processor. Only one thread of the electronic device is scheduled at the same time.
[0113] The controller may be the nerve center and command center of the electronic device 600. The controller may generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions.
[0114] The processor 610 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 610 is a cache memory. The memory may store instructions or data that the processor 610 has just used or circulated. If the processor 610 needs to use the instruction or data again, it may be directly called from the memory. Repeated access is avoided, the waiting time of the processor 610 is reduced, and the efficiency of the system is improved. The processor may also be provided with a low-power memory (e.g., Island low power consumption, etc.) to reduce power consumption.
[0115] The electronic device 600 implements the display function through a GPU, a screen 694, and an application processor. The GPU is a microprocessor for image processing, which connects the screen 694 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 610 may include one or more GPUs, which execute program instructions to generate or change display information.
[0116] The screen 694 is used to display images, characters, videos, etc. In some embodiments, the electronic device 600 may include 1 or N screens 694, where N is an integer greater than 1.
[0117] The electronic device 600 can realize the shooting function through ISP, camera 693, video codec, GPU, screen 694 and application processor.
[0118] ISP is used to process the data fed back by camera 693. For example, when taking a photo, the shutter is opened, and the light is transmitted to the camera photosensitive element through the lens. The light signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to ISP for processing and converts it into an image visible to the naked eye. ISP can also perform algorithm optimization on the noise, brightness, and skin color of the image. ISP can also optimize the exposure, color temperature and other parameters of the shooting scene. In some embodiments, ISP can be set in camera 693.
[0119] The camera 693 is used to capture still images or videos. The object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, and then passes the electrical signal to the ISP to be converted into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV or other format. In some embodiments, the electronic device 600 may include 1 or N cameras 693, where N is an integer greater than 1.
[0120] The external memory interface 620 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 600. The external memory card communicates with the processor 610 through the external memory interface 620 to implement a data storage function, such as storing music, video and other files in the external memory card.
[0121] The internal memory 621 can be used to store computer executable program codes, which include instructions. The processor 610 executes various functional applications and data processing of the electronic device 600 by running the instructions stored in the internal memory 621. The internal memory 621 may include a program storage area and a data storage area. Among them, the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area may store data (such as audio data, a phone book, etc.) created by the electronic device 600 during use. In addition, the internal memory 621 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc.
[0122] The acceleration sensor 680E can detect the magnitude of the acceleration of the electronic device 600 in various directions (generally three axes). When the electronic device 600 is stationary, the magnitude and direction of gravity can be detected. The acceleration sensor 680E can also be used to identify the posture of the electronic device 600. Of course, the acceleration sensor 680E can also be combined with the gyroscope sensor 680B to identify the posture of the electronic device 600.
[0123] The gyroscope sensor 680B can be used to determine the motion posture of the electronic device 400. In some embodiments, the angular velocity of the electronic device 600 around three axes (i.e., x, y, and z axes) can be determined by the gyroscope sensor 680B. The gyroscope sensor 680B can be used for anti-shake shooting. Exemplarily, when the shutter is pressed, the gyroscope sensor 680B detects the angle of the electronic device 600 shaking, calculates the distance that the lens module needs to compensate based on the angle, and allows the lens to offset the shaking of the electronic device 600 through reverse movement to achieve anti-shake. The gyroscope sensor 680B can also be used for horizontal and vertical screen switching, navigation, and somatosensory game scenes.
[0124] It is to be understood that the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the electronic device 600. In other embodiments of the present application, the electronic device 600 may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0125] The electronic device provided in the embodiment of the present application may be a user equipment (UE), such as a smart watch, a smart bracelet, or other device.
[0126] In addition, an operating system runs on the above components, such as a real-time operating system.
[0127] Above Figure 6 This is only an example of the composition of an electronic device. In practical applications, the electronic device may include all or part of the modules and devices of the above technical architecture, as well as other modules and devices not mentioned in the above technical architecture. Of course, it may also include only the modules and devices of the above technical architecture, which is not limited in this embodiment.
[0128] An embodiment of the present application further provides a computer-readable storage medium, which stores instructions. When the instructions are executed on an electronic device, the electronic device executes the steps in the above-mentioned method embodiments.
[0129] An embodiment of the present application provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments can be implemented.
[0130] The present application implements all or part of the processes in the above-mentioned embodiment method, which can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a computer-readable storage medium. When the computer program is executed by the processor, the steps of each of the above-mentioned method embodiments can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may at least include: any entity or device capable of carrying the computer program code to the camera device / terminal device, recording medium, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signal, telecommunication signal and software distribution medium.
[0131] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0132] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0133] In the embodiments provided in the present application, it should be understood that the disclosed methods and electronic devices can be implemented in other ways. For example, the method / device embodiments described above are merely schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0134] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0135] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or combinations thereof.
[0136] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0137] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.
[0138] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.
Claims
1. A processing method, characterized in that: An electronic device using a real-time operating system, wherein after the electronic device is turned on, a user interface thread and an asynchronous thread are run, and the priority of the user interface thread is higher than that of the asynchronous thread; The electronic device includes a display screen; the method includes: The user interface thread obtains a first message, where the first message is used to trigger the display screen to update display content, and the content to be displayed corresponds to multiple frames; triggering the user interface thread to respond to the first message and determine an identifier of a resource that needs to be preloaded; Triggering the user interface thread to send a second message to the asynchronous thread, where the second message carries the identifier; When the user interface thread is idle, triggering the asynchronous thread to read the preloaded resources from the relevant file according to the identifier, and saving the read preloaded resources into the first cache; When the first cache includes resources of the frame to be displayed, triggering the user interface thread to read the resources corresponding to the frame to be displayed in the first cache; The graphics processor is triggered to render the resource corresponding to the frame to be displayed and read from the first cache to obtain the frame to be displayed.
2. The method according to claim 1, characterized in that When the user interface thread is idle, it includes: when the graphics processor renders the resources corresponding to the frame to be displayed and read from the first cache.
3. The method according to claim 1, characterized in that After obtaining the frame to be displayed, the method further includes: Saving the frame to be displayed in a second buffer; The frame to be displayed is read from the second buffer, and the frame to be displayed is displayed on the display screen.
4. The method according to claim 1, characterized in that: The resources that need to be preloaded include: picture resources and character resources.
5. The method according to claim 4, characterized in that The identification of the resource that needs to be preloaded includes: an identification code of the picture corresponding to the picture resource, and an identification code of the character corresponding to the character resource.
6. The method according to claim 5, characterized in that The first cache includes: a third cache and a fourth cache, the third cache is used to store picture information corresponding to the identification code of the picture; the fourth cache is used to store character information corresponding to the identification code of the character.
7. The method according to any one of claims 1 to 6, characterized in that: The method further comprises: When the first cache does not include the resource of the frame to be displayed, the user interface thread is triggered to read the resource of the frame to be displayed from the relevant file into the first cache.
8. A processing device, characterized in that: An electronic device using a real-time operating system, wherein after the electronic device is turned on, a user interface thread and an asynchronous thread are run, and the priority of the user interface thread is higher than that of the asynchronous thread; The electronic device comprises a display screen; the device comprises: An acquisition unit, configured to acquire a first message through the user interface thread, wherein the first message is used to trigger the display screen to update display content, and the content to be displayed corresponds to multiple frames; A determination unit, configured to trigger the user interface thread to respond to the first message and determine an identifier of a resource that needs to be preloaded; A sending unit, used for triggering the user interface thread to send a second message to the asynchronous thread, wherein the second message carries the identifier; a processing unit, configured to trigger the asynchronous thread to read the preloaded resources from the relevant file according to the identifier and save the preloaded resources read into the first cache when the user interface thread is idle; a reading unit, configured to trigger the user interface thread to read the resources corresponding to the frame to be displayed in the first cache when the first cache includes the resources of the frame to be displayed; The rendering unit is used to trigger the graphics processor to render the resources corresponding to the frame to be displayed and read from the first cache to obtain the frame to be displayed.
9. An electronic device, characterized in that: The electronic device comprises: a processor and a memory; the memory is coupled to the processor, the memory is used to store computer program code, the computer program code comprises computer instructions, and the processor calls the computer instructions to enable the electronic device to execute the method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium comprises instructions, which, when executed on an electronic device, cause the electronic device to perform the method as claimed in any one of claims 1 to 7.
Citation Information
Patent Citations
Method for managing big data poster information of smart television on basis of 3D model
CN104301795A
Image processing method and device, electronic equipment and computer readable storage medium
CN109801210A
H5 page preloading and skipping method and device, equipment and medium
CN112035186A
Media content caching method and device, computing equipment and storage medium
CN115795190A
Thread acceleration processing method and device
CN117130774A
Cited By
Game resource loading method and system and operation terminal
CN121668691A