View rendering method, device, electronic device and computer readable medium

By generating animation coefficients in the same thread and performing view rendering processing during the pull-down refresh process of the applet page, the data update delay and lag caused by the event handling function and view rendering are solved, and the view rendering performance is improved.

CN113190284BActive Publication Date: 2025-05-23BEIJING WODONG TIANJUN INFORMATION TECH CO LTD +1
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202110407494.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-04-15
Publication Date
2025-05-23
Estimated Expiration
2041-04-15

AI Technical Summary

Technical Problem

During the pull-down refresh process of the applet page, the running of the event handler function and view rendering are not in the same thread, resulting in delays and stutters in data updates during the pull-down refresh, affecting the view rendering performance.

Method used

By detecting a pull-down operation corresponding to the scrollable view component in the target applet page, an animation coefficient is generated based on the page height value of the pull-down operation, and pull-down style rendering and view update processing are performed in the same thread.

Benefits of technology

It realizes the generation of animation coefficients and view rendering processing in the same thread, reducing the number of lags during pull-down refresh, and improving view rendering performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113190284B_ABST
    Figure CN113190284B_ABST
Patent Text Reader

Abstract

Embodiments of the present disclosure disclose a view rendering method, device, electronic device, and computer-readable medium. A specific implementation of the method includes: in response to detecting a pull-down operation corresponding to a scrollable view component in a target mini-program page, generating an animation coefficient based on a page height value corresponding to the pull-down operation; performing a pull-down style rendering process on the scrollable view component according to the animation coefficient; in response to detecting a view update operation corresponding to the scrollable view component, performing an update style rendering process on the scrollable view component according to the animation coefficient. This implementation can perform a pull-down style rendering process and an update style rendering process without delay. Thereby, the number of freezes that occur when pulling down to refresh can be reduced. In turn, the view rendering performance can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present disclosure relate to the field of computer technology, and in particular to a view rendering method, device, electronic device, and computer-readable medium. Background Art

[0002] Mini programs are applications that can be used without downloading and installing, which can meet the needs of users to save usage time and mobile phone memory space. At present, when pulling down to refresh the mini program page, the method usually adopted is: using the event processing function in the logic layer script file (for example, JavaScript file) corresponding to the mini program page to realize the pull-down refresh view rendering of the scrollable view component (for example, scroll-view) in the mini program page.

[0003] However, when using the above method to pull down to refresh the mini program page, the following technical problems often occur: the running of the event processing function and the pull-down refresh view rendering are not in the same thread, there is a delay in the update of the data used to display the pull-down refresh animation when pulling down to refresh, and there are many freezes when pulling down to refresh, resulting in low view rendering performance. Summary of the invention

[0004] The content of this disclosure is used to introduce concepts in a brief form, which will be described in detail in the detailed implementation section below. The content of this disclosure is not intended to identify the key features or essential features of the technical solution claimed for protection, nor is it intended to limit the scope of the technical solution claimed for protection.

[0005] Some embodiments of the present disclosure propose a view rendering method, an apparatus, an electronic device, and a computer-readable medium to solve one of the technical problems mentioned in the above background technology section.

[0006] In the first aspect, some embodiments of the present disclosure provide a view rendering method, which includes: in response to detecting a pull-down operation corresponding to a scrollable view component in a target mini-program page, generating an animation coefficient based on a page height value corresponding to the pull-down operation; performing pull-down style rendering processing on the scrollable view component according to the animation coefficient; in response to detecting a view update operation corresponding to the scrollable view component, performing update style rendering processing on the scrollable view component according to the animation coefficient.

[0007] Optionally, the method further includes: in response to detecting a view update operation corresponding to the scrollable view component, updating the page content displayed in the scrollable view component.

[0008] Optionally, the method further includes: in response to detecting an abnormal pull-down operation corresponding to the scrollable view component, performing style rendering recovery processing on the scrollable view component according to the animation coefficient.

[0009] Optionally, the updating process of the page content displayed in the scrollable view component includes: executing a page update processing function for page update in a target script file corresponding to the target applet page.

[0010] Optionally, the above-mentioned updating process of the page content displayed in the above-mentioned scrollable view component includes: obtaining target mini-program page data for updating the above-mentioned page content from a target script file corresponding to the above-mentioned target mini-program page.

[0011] Optionally, the above-mentioned update processing of the page content displayed in the above-mentioned scrollable view component also includes: inputting the above-mentioned target mini-program page data into the update processing function corresponding to the above-mentioned view update operation to update the above-mentioned page content, wherein the above-mentioned update processing function is a function for updating the above-mentioned page content according to the input target mini-program page data.

[0012] Optionally, the above-mentioned generation of the animation coefficient includes: generating a pull-down height threshold according to a preset pull-down ratio and a screen height value of the display screen showing the above-mentioned target mini-program page; and determining the ratio of the above-mentioned page height value to the above-mentioned pull-down height threshold as the animation coefficient.

[0013] In the second aspect, some embodiments of the present disclosure provide a view rendering device, which includes: a generation unit, configured to generate an animation coefficient in response to detecting a pull-down operation corresponding to a scrollable view component in a target mini-program page, based on a page height value corresponding to the above pull-down operation; a pull-down style rendering processing unit, configured to perform pull-down style rendering processing on the above scrollable view component according to the above animation coefficient; and an update style rendering processing unit, configured to perform update style rendering processing on the above scrollable view component according to the above animation coefficient in response to detecting a view update operation corresponding to the above scrollable view component.

[0014] Optionally, the apparatus further comprises: an update processing unit configured to, in response to detecting a view update operation corresponding to the scrollable view component, perform update processing on the page content displayed in the scrollable view component.

[0015] Optionally, the device further comprises: a style rendering recovery processing unit configured to, in response to detecting an abnormal pull-down operation corresponding to the scrollable view component, perform style rendering recovery processing on the scrollable view component according to the animation coefficient.

[0016] Optionally, the update processing unit is further configured to: execute a page update processing function for page update in a target script file corresponding to the target applet page.

[0017] Optionally, the update processing unit includes: an acquisition unit configured to acquire target mini-program page data for updating the above-mentioned page content from a target script file corresponding to the above-mentioned target mini-program page.

[0018] Optionally, the update processing unit also includes: an input unit, configured to input the above-mentioned target mini-program page data into the update processing function corresponding to the above-mentioned view update operation to update the above-mentioned page content, wherein the above-mentioned update processing function is a function that updates the above-mentioned page content according to the input target mini-program page data.

[0019] Optionally, the generation unit is further configured to: generate a pull-down height threshold based on a preset pull-down ratio and a screen height value of a display screen displaying the target mini-program page; and determine the ratio of the page height value to the pull-down height threshold as the animation coefficient.

[0020] In a third aspect, some embodiments of the present disclosure provide an electronic device comprising: one or more processors; a storage device on which one or more programs are stored, and when the one or more programs are executed by the one or more processors, the one or more processors implement the method described in any implementation manner of the above-mentioned first aspect.

[0021] In a fourth aspect, some embodiments of the present disclosure provide a computer-readable medium having a computer program stored thereon, wherein when the program is executed by a processor, the method described in any implementation manner of the above-mentioned first aspect is implemented.

[0022] The above-mentioned embodiments of the present disclosure have the following beneficial effects: through the view rendering method of some embodiments of the present disclosure, the view rendering performance is improved. Specifically, the reason for the low view rendering performance is that the operation of the event processing function and the pull-down refresh view rendering are not in the same thread, the data update for displaying the pull-down refresh animation is delayed when the pull-down refresh occurs, and the number of freezes when the pull-down refresh occurs is large, resulting in low view rendering performance. Based on this, the view rendering method of some embodiments of the present disclosure first generates an animation coefficient based on the page height value corresponding to the above pull-down operation in response to detecting a pull-down operation corresponding to the scrollable view component in the target mini-program page. Thus, when the pull-down operation of the pull-down scrollable view component is detected, a parameter for the pull-down style rendering process, that is, the animation coefficient, can be generated in the same thread. Then, according to the above animation coefficient, the above scrollable view component is subjected to the pull-down style rendering process. Thus, after the animation coefficient is generated in the same thread, the pull-down style rendering process can be performed without delay. Finally, in response to detecting the view update operation corresponding to the above scrollable view component, the above scrollable view component is subjected to the update style rendering process according to the above animation coefficient. As a result, when a view update operation is detected, the update style rendering process can be performed without delay. Also, because the animation coefficient is generated in the same thread, the pull-down style rendering process and the update style rendering process can be performed without delay. This can reduce the number of freezes when pulling down to refresh. This can improve the view rendering performance. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the accompanying drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and that components and elements are not necessarily drawn to scale.

[0024] Figure 1-2 is a schematic diagram of an application scenario of a view rendering method according to some embodiments of the present disclosure;

[0025] Figure 3 is a flow chart of some embodiments of the view rendering method according to the present disclosure;

[0026] Figure 4 is a flowchart of other embodiments of the view rendering method according to the present disclosure;

[0027] Figure 5 is a schematic diagram of the structure of some embodiments of the view rendering device according to the present disclosure;

[0028] Figure 6 It is a schematic diagram of the structure of an electronic device suitable for implementing some embodiments of the present disclosure. DETAILED DESCRIPTION

[0029] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments set forth herein. On the contrary, these embodiments are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.

[0030] It should also be noted that, for ease of description, only the parts related to the invention are shown in the drawings. In the absence of conflict, the embodiments and features in the embodiments of the present disclosure can be combined with each other.

[0031] It should be noted that the concepts such as "first" and "second" mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.

[0032] It should be noted that the modifications of "one" and "plurality" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".

[0033] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.

[0034] The present disclosure will be described in detail below with reference to the accompanying drawings and in conjunction with embodiments.

[0035] Figure 1-2 It is a schematic diagram of an application scenario of the view rendering method according to some embodiments of the present disclosure.

[0036] exist Figure 1 In the application scenario, first, the computing device 101 can generate an animation coefficient 104 based on the page height value 103 corresponding to the pull-down operation in response to detecting a pull-down operation corresponding to the scrollable view component 102 in the target mini-program page. Then, the computing device 101 can perform a pull-down style rendering process on the scrollable view component 102 according to the animation coefficient 104. Finally, the computing device 101 can perform an update style rendering process on the scrollable view component 102 according to the animation coefficient 104 in response to detecting a view update operation corresponding to the scrollable view component 102.

[0037] Alternatively, if Figure 2As shown, the computing device 101 may also update the page content 1021 displayed in the scrollable view component 102 in response to detecting a view update operation corresponding to the scrollable view component 102 .

[0038] It should be noted that the computing device 101 can be hardware or software. When the computing device is hardware, it can be implemented as a distributed cluster consisting of multiple servers or terminal devices, or as a single server or a single terminal device. When the computing device is embodied as software, it can be installed in the hardware devices listed above. It can be implemented as multiple software or software modules for providing distributed services, or as a single software or software module. No specific limitation is made here.

[0039] It should be understood that Figure 1-2 The number of computing devices in the embodiment is only illustrative. Any number of computing devices may be provided according to implementation requirements.

[0040] Continue to refer Figure 3 , shows a process 300 of some embodiments of the view rendering method according to the present disclosure. The view rendering method comprises the following steps:

[0041] Step 301, in response to detecting a pull-down operation corresponding to a scrollable view component in a target mini-program page, generating an animation coefficient based on a page height value corresponding to the pull-down operation.

[0042] In some embodiments, the execution body of the view rendering method (eg Figure 1The computing device 101 shown in the figure can generate an animation coefficient based on the page height value corresponding to the above pull-down operation in response to detecting a pull-down operation corresponding to the scrollable view component in the target applet page. Among them, the above target applet page can be the applet page currently displayed in the above execution body. The above applet page can be the running page of the applet. The above applet can be an application that can be used without downloading and installing. The above scrollable view component can be a view container component that can realize horizontal scrolling and / or vertical scrolling. For example, the above scrollable view component can be "scroll-view". The above page height value can be the pull-down distance during the pull-down operation. The above pull-down operation can be the operation of pulling the scrollable view component downward. In practice, the above execution body can determine the ratio of the above page height value to the preset pull-down height threshold as the animation coefficient. Among them, the above preset pull-down height threshold can be the distance from the initial pull-down position set in advance to the top of the display screen of the above execution body, which can be used to determine whether the update style rendering process can be performed during the pull-down operation. Here, the specific setting of the preset pull-down height threshold is not limited. Thus, when a pull-down operation of the scrollable view component is detected, parameters for the pull-down style rendering process, that is, the animation coefficient, can be generated in the same thread.

[0043] In some optional implementations of some embodiments, first, the above-mentioned execution subject can generate a pull-down height threshold according to a preset pull-down ratio and the screen height value of the display screen showing the above-mentioned target applet page. Among them, the above-mentioned preset pull-down ratio can be used to configure the ratio of the generated pull-down height threshold to the screen height value of the display screen showing the applet page. Here, the specific setting of the preset pull-down ratio is not limited. In practice, the above-mentioned execution subject can determine the product of the above-mentioned preset pull-down ratio and the above-mentioned screen height value as the pull-down height threshold. Then, the ratio of the above-mentioned page height value and the above-mentioned pull-down height threshold can be determined as an animation coefficient. Thus, when a pull-down operation of a pull-down scrollable view component is detected, a parameter for pull-down style rendering processing, that is, an animation coefficient, can be generated in the same thread according to the screen height value of the display screen showing the above-mentioned target applet page, so that the generated animation coefficient can be adapted to display screens of different sizes.

[0044] Step 302: Perform a drop-down style rendering process on the scrollable view component according to the animation coefficient.

[0045] In some embodiments, the execution subject may perform a drop-down style rendering process on the scrollable view component according to the animation coefficient. The drop-down style rendering process may include a style transformation process and / or a fill rendering process on the drop-down animation view in the scrollable view component. The style transformation process may be a process of performing a graphic transformation on the drop-down animation view. For example, the style transformation process may be a shrinking process of shrinking the drop-down animation view according to the animation coefficient. The fill rendering process may be a rendering process of filling the drop-down animation view. For example, the fill rendering process may be a rendering process of increasing the transparency of the drop-down animation view. The drop-down animation view may be a view that displays a drop-down effect in an animated form with a drop-down operation. For example, the drop-down effect may be an effect of shrinking the drop-down animation view with an increase in the drop-down height value. In practice, first, the execution subject may determine the animation coefficient as a reduction ratio of the drop-down animation view. Then, the drop-down animation view in the scrollable view component may be reduced according to the reduction ratio of the drop-down animation view. Thus, after the animation coefficient is generated in the same thread, the drop-down style rendering process may be performed without delay.

[0046] Step 303 : in response to detecting a view update operation corresponding to the scrollable view component, performing update style rendering processing on the scrollable view component according to the animation coefficient.

[0047] In some embodiments, the execution subject may, in response to detecting a view update operation corresponding to the scrollable view component, perform an update style rendering process on the scrollable view component according to the animation coefficient. The view update operation may be an operation of interrupting the pull-down operation in response to the page height value corresponding to the pull-down operation being greater than or equal to a preset pull-down height threshold. The update style rendering process may include a style transformation recovery process and / or a fill rendering recovery process on the pull-down animation view in the scrollable view component. The style transformation recovery process may be a process of restoring the pull-down animation view after the style transformation process to a state before the pull-down operation. For example, the style transformation recovery process may be a magnification process of magnifying the pull-down animation view according to the animation coefficient. The fill rendering recovery process may be a process of restoring the pull-down animation view after the fill rendering process to a state before the pull-down operation. The update style rendering process may also include a process of displaying a refresh animation. The refresh animation may be an animation that is displayed before the page content in the scrollable view component is updated, indicating that the content is being refreshed. The page content may be data displayed in the scrollable view component, which may include but is not limited to characters, strings, and pictures. In practice, first, the execution subject may determine the animation coefficient as the magnification ratio of the pull-down animation view. Then, the pull-down animation view in the scrollable view component can be enlarged according to the pull-down animation view enlargement ratio. Thus, when a view update operation of the update view is detected, the update style rendering process can be performed without delay.

[0048] Optionally, the execution subject may perform style rendering recovery processing on the scrollable view component according to the animation coefficient in response to detecting an abnormal pull-down operation corresponding to the scrollable view component. The abnormal pull-down operation may be an operation of interrupting the pull-down operation in response to a page height value corresponding to the pull-down operation being less than a preset pull-down height threshold. The style rendering recovery processing may include style transformation recovery processing and / or fill rendering recovery processing on the pull-down animation view in the scrollable view component. The style transformation recovery processing may be an enlargement processing of the pull-down animation view according to the animation coefficient. In practice, first, the execution subject may determine the animation coefficient as the enlargement ratio of the pull-down animation view. Then, the pull-down animation view in the scrollable view component may be enlarged according to the enlargement ratio of the pull-down animation view. Thus, when an abnormal pull-down operation is detected, the scrollable view component may be style rendering recovered without delay.

[0049] The above-mentioned embodiments of the present disclosure have the following beneficial effects: through the view rendering method of some embodiments of the present disclosure, the view rendering performance is improved. Specifically, the reason for the low view rendering performance is that the operation of the event processing function and the pull-down refresh view rendering are not in the same thread, the data update for displaying the pull-down refresh animation is delayed when the pull-down refresh occurs, and the number of freezes when the pull-down refresh occurs is large, resulting in low view rendering performance. Based on this, the view rendering method of some embodiments of the present disclosure first generates an animation coefficient based on the page height value corresponding to the above pull-down operation in response to detecting a pull-down operation corresponding to the scrollable view component in the target mini-program page. Thus, when the pull-down operation of the pull-down scrollable view component is detected, a parameter for the pull-down style rendering process, that is, the animation coefficient, can be generated in the same thread. Then, according to the above animation coefficient, the above scrollable view component is subjected to the pull-down style rendering process. Thus, after the animation coefficient is generated in the same thread, the pull-down style rendering process can be performed without delay. Finally, in response to detecting the view update operation corresponding to the above scrollable view component, the above scrollable view component is subjected to the update style rendering process according to the above animation coefficient. As a result, when a view update operation is detected, the update style rendering process can be performed without delay. Also, because the animation coefficient is generated in the same thread, the pull-down style rendering process and the update style rendering process can be performed without delay. This can reduce the number of freezes when pulling down to refresh. This can improve the view rendering performance.

[0050] Further references Figure 4 , which shows a process 400 of another embodiment of a view rendering method. The process 400 of the view rendering method includes the following steps:

[0051] Step 401, in response to detecting a pull-down operation corresponding to a scrollable view component in a target mini-program page, generating an animation coefficient based on a page height value corresponding to the pull-down operation.

[0052] Step 402: Perform a drop-down style rendering process on the scrollable view component according to the animation coefficient.

[0053] Step 403 : in response to detecting a view update operation corresponding to the scrollable view component, performing update style rendering processing on the scrollable view component according to the animation coefficient.

[0054] In some embodiments, the specific implementation of steps 401-403 and the technical effects brought about can be referred to Figure 3 The corresponding steps 301-303 in the embodiments are not described in detail here.

[0055] Step 404: in response to detecting a view update operation corresponding to the scrollable view component, update the page content displayed in the scrollable view component.

[0056] In some embodiments, the execution body of the view rendering method (eg Figure 1 The computing device 101 shown in the figure can update the page content displayed in the scrollable view component in response to detecting the view update operation corresponding to the scrollable view component. In practice, the execution subject can execute the page update processing function for page update in the target script file corresponding to the target applet page to update the page content displayed in the scrollable view component. Among them, the target script file can be a script file that communicates with the file that defines the structure and content of the target applet page across threads. For example, the target script file can be a JavaScript file. The file that defines the structure and content of the target applet page can be a WXML (WeiXin Markup Language) file. The page update processing function can be a function that updates the page content displayed in the scrollable view component according to the memory data corresponding to the modified page content. As an example, the execution subject can implement the page update processing function in the JavaScript file through WXS (WeiXin Script). Thus, when the view update operation of updating the view is detected, the page content can be updated through the page update processing function in the target script file.

[0057] In some optional implementations of some embodiments, first, the above-mentioned execution subject obtains the target applet page data for updating the above-mentioned page content from the target script file corresponding to the above-mentioned target applet page. Among them, the above-mentioned target applet page data can be the memory data corresponding to the page content displayed in the scrollable view component that modifies the above-mentioned target applet page. In practice, the above-mentioned execution subject can read the target applet page data in the above-mentioned target script file through the previously configured target applet page data variable. Then, the above-mentioned target applet page data can be input into the update processing function corresponding to the above-mentioned view update operation to update the above-mentioned page content. Among them, the above-mentioned update processing function can be a function that updates the above-mentioned page content according to the input target applet page data. The above-mentioned update processing function can be implemented in a script file that communicates with the file that defines the structure and content of the above-mentioned target applet page in a single thread. Thus, when a view update operation of updating the view is detected, the page content can be updated by the page update processing function in the script file of single-thread communication.

[0058] from Figure 4 It can be seen that Figure 3Compared with the description of some corresponding embodiments, Figure 4 The process 400 of the view rendering method in some corresponding embodiments embodies the extended steps of updating the page content displayed in the above-mentioned scrollable view component. Therefore, the schemes described in these embodiments can perform pull-down style rendering processing and update style rendering processing without delay. Thereby, the number of freezes when pulling down to refresh can be reduced. In turn, the view rendering performance can be improved. At the same time, when a view update operation of updating the view is detected, the page content can be updated through the page update processing function in the target script file.

[0059] Further references Figure 5 As an implementation of the methods shown in the above figures, the present disclosure provides some embodiments of a view rendering device, and these device embodiments are Figure 3 Corresponding to the method embodiments shown, the device can be specifically applied to various electronic devices.

[0060] like Figure 5 As shown, the view rendering device 500 of some embodiments includes: a generation unit 501, a pull-down style rendering processing unit 502, and an update style rendering processing unit 503. The generation unit 501 is configured to generate an animation coefficient based on the page height value corresponding to the pull-down operation in response to detecting a pull-down operation corresponding to the scrollable view component in the target mini-program page; the pull-down style rendering processing unit 502 is configured to perform a pull-down style rendering process on the scrollable view component according to the animation coefficient; the update style rendering processing unit 503 is configured to perform an update style rendering process on the scrollable view component according to the animation coefficient in response to detecting a view update operation corresponding to the scrollable view component.

[0061] In an optional implementation of some embodiments, the view rendering device 500 may also include: an update processing unit (not shown in the figure), which is configured to update the page content displayed in the above-mentioned scrollable view component in response to detecting a view update operation corresponding to the above-mentioned scrollable view component.

[0062] In an optional implementation of some embodiments, the view rendering device 500 may further include: a style rendering recovery processing unit (not shown in the figure), which is configured to respond to detecting an abnormal pull-down operation corresponding to the above-mentioned scrollable view component and perform style rendering recovery processing on the above-mentioned scrollable view component according to the above-mentioned animation coefficient.

[0063] In an optional implementation of some embodiments, the update processing unit may be further configured to: execute a page update processing function for page update in a target script file corresponding to the target applet page.

[0064] In an optional implementation of some embodiments, the update processing unit may include: an acquisition unit (not shown in the figure), configured to acquire target mini-program page data for updating the above-mentioned page content from a target script file corresponding to the above-mentioned target mini-program page.

[0065] In an optional implementation of some embodiments, the update processing unit may also include: an input unit (not shown in the figure), configured to input the above-mentioned target mini-program page data into the update processing function corresponding to the above-mentioned view update operation to update the above-mentioned page content, wherein the above-mentioned update processing function is a function for updating the above-mentioned page content according to the input target mini-program page data.

[0066] In an optional implementation of some embodiments, the generation unit 501 can be further configured to: generate a pull-down height threshold based on a preset pull-down ratio and a screen height value of the display screen that displays the above-mentioned target mini-program page; and determine the ratio of the above-mentioned page height value to the above-mentioned pull-down height threshold as the animation coefficient.

[0067] It is understood that the units described in the device 500 are similar to those described in the reference Figure 3 Therefore, the operations, features and beneficial effects described above for the method are also applicable to the device 500 and the units included therein, and will not be described in detail here.

[0068] Reference below Figure 6 , which shows an electronic device (eg, Figure 1 The electronic devices in some embodiments of the present disclosure may include but are not limited to mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 6 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0069] like Figure 6As shown, the electronic device 600 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage device 608 into a random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the electronic device 600 are also stored. The processing device 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.

[0070] Typically, the following devices may be connected to the I / O interface 605: an input device 606 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 607 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; and a communication device 609. The communication device 609 may allow the electronic device 600 to communicate with other devices wirelessly or by wire to exchange data. Figure 6 The electronic device 600 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead. Figure 6 Each block shown in the figure may represent one device, or may represent multiple devices as required.

[0071] In particular, according to some embodiments of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, some embodiments of the present disclosure include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In some such embodiments, the computer program can be downloaded and installed from the network through the communication device 609, or installed from the storage device 608, or installed from the ROM 602. When the computer program is executed by the processing device 601, the above-mentioned functions defined in the method of some embodiments of the present disclosure are executed.

[0072] It should be noted that the computer-readable medium recorded in some embodiments of the present disclosure may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In some embodiments of the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In some embodiments of the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.

[0073] In some embodiments, the client and the server may communicate using any currently known or future developed network protocol such as HTTP (HyperText Transfer Protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.

[0074] The computer-readable medium may be included in the electronic device; or it may exist independently without being installed in the electronic device. The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device: in response to detecting a pull-down operation corresponding to a scrollable view component in a target mini-program page, generates an animation coefficient based on a page height value corresponding to the pull-down operation; performs a pull-down style rendering process on the scrollable view component according to the animation coefficient; in response to detecting a view update operation corresponding to the scrollable view component, performs an update style rendering process on the scrollable view component according to the animation coefficient.

[0075] Computer program code for performing the operations of some embodiments of the present disclosure may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0076] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0077] The units described in some embodiments of the present disclosure may be implemented by software or by hardware. The described units may also be set in a processor, for example, may be described as: a processor includes a generation unit, a pull-down style rendering processing unit, and an update style rendering processing unit. Among them, the names of these units do not constitute a limitation on the unit itself under certain circumstances. For example, the generation unit may also be described as "a unit that generates an animation coefficient in response to detecting a pull-down operation corresponding to a scrollable view component in a target mini-program page, based on the page height value corresponding to the above pull-down operation."

[0078] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.

[0079] The above descriptions are only some preferred embodiments of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of the invention involved in the embodiments of the present disclosure is not limited to the technical solutions formed by a specific combination of the above-mentioned technical features, but should also cover other technical solutions formed by any combination of the above-mentioned technical features or their equivalent features without departing from the above-mentioned inventive concept. For example, the above-mentioned features are replaced with the technical features with similar functions disclosed in the embodiments of the present disclosure (but not limited to) and the technical solutions formed.

Claims

1. A view rendering method, include: In response to detecting a pull-down operation corresponding to a scrollable view component in a target applet page, generating an animation coefficient based on a page height value corresponding to the pull-down operation; According to the animation coefficient, performing a drop-down style rendering process on the scrollable view component; In response to detecting a view update operation corresponding to the scrollable view component, update style rendering processing is performed on the scrollable view component according to the animation coefficient, wherein the steps of generating the animation coefficient, pull-down style rendering processing, and update style rendering processing are performed within the same thread.

2. The method according to claim 1, in, The method further comprises: In response to detecting a view update operation corresponding to the scrollable view component, updating the page content displayed in the scrollable view component.

3. The method according to claim 1, in, The method further comprises: In response to detecting an abnormal pull-down operation corresponding to the scrollable view component, a style rendering recovery process is performed on the scrollable view component according to the animation coefficient.

4. The method according to claim 2, in, The updating process of the page content displayed in the scrollable view component includes: Execute a page update processing function for page update in a target script file corresponding to the target applet page.

5. The method according to claim 2, in, The updating process of the page content displayed in the scrollable view component includes: The target mini-program page data for updating the page content is obtained from the target script file corresponding to the target mini-program page.

6. The method according to claim 5, in, The updating process of the page content displayed in the scrollable view component further includes: The target mini-program page data is input into the update processing function corresponding to the view update operation to update the page content, wherein the update processing function is a function that updates the page content according to the input target mini-program page data.

7. The method according to any one of claims 1 to 6, in, The generating animation coefficient includes: Generate a pull-down height threshold according to a preset pull-down ratio and a screen height value of a display screen displaying the target mini-program page; The ratio of the page height value to the pull-down height threshold is determined as the animation coefficient.

8. A view rendering device, include: A generating unit, configured to generate an animation coefficient based on a page height value corresponding to the pull-down operation in response to detecting a pull-down operation corresponding to a scrollable view component in a target mini-program page; A drop-down style rendering processing unit, configured to perform a drop-down style rendering process on the scrollable view component according to the animation coefficient; An update style rendering processing unit is configured to, in response to detecting a view update operation corresponding to the scrollable view component, perform update style rendering processing on the scrollable view component according to the animation coefficient, wherein the steps of generating the animation coefficient, the drop-down style rendering processing, and the update style rendering processing are executed within the same thread.

9. An electronic device, include: one or more processors; a storage device having one or more programs stored thereon, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 7.

10. A computer readable medium having a computer program stored thereon, in, When the program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Method and device for refreshing application program and electronic device

    CN106909288A

  • View scrolling method and device, and electronic equipment

    CN107977150A

  • An interaction control method and device for a display page

    CN109815367A