Search

CN-121996330-A - List rendering method and device, electronic equipment and storage medium

CN121996330ACN 121996330 ACN121996330 ACN 121996330ACN-121996330-A

Abstract

The embodiment of the disclosure discloses a list rendering method, a device, electronic equipment and a storage medium, wherein the method comprises the steps of responding to a loading event of a list page, requesting list data through a native network request code, loading a cross-terminal component code, rendering a list frame in the list page through the cross-terminal component code, responding to the successful list data request through the native network request code, sending a notification message to a native component code, wherein the requested list data is stored in a preset data manager, acquiring the list data from the preset data manager through the native component code according to the notification message, and rendering a list card to the list frame according to the list data. The list rendering time can be reduced, and the user experience is improved.

Inventors

  • ZHANG YU
  • FENG YONGLING
  • LI SIKUAN
  • BAO YULI

Assignees

  • 北京字跳网络技术有限公司

Dates

Publication Date
20260508
Application Date
20241104

Claims (13)

  1. 1. A method of rendering a list, comprising: Responding to a loading event of the list page, requesting list data through a native network request code, and loading cross-terminal component codes; rendering a list frame in the list page through the cross-terminal component code; sending a notification message to a native component code in response to success of the list data request through the native network request code, wherein the requested list data is stored in a preset data manager; and acquiring the list data from the preset data manager according to the notification message through the native component code, and rendering a list card to the list framework according to the list data.
  2. 2. The method of claim 1, wherein the native network request code and the native component code have a calling relationship with the cross-end component code; The method further comprises the steps of: Calling the cross-terminal component code according to the update event of the list page through the native component code; and calling the native network request code to request updated list data through the cross-terminal component code.
  3. 3. The method according to claim 2, wherein the call relation is implemented based on a bridge mode, and the setting procedure of the bridge mode includes: Packaging the target list component according to a preset packaging requirement, and registering the packaged target list component to a cross-end engine; The target list component is packaged by the native network request code and the native component code, wherein the cross-terminal engine is used for running the cross-terminal component code.
  4. 4. The method of claim 3, wherein the target list component is obtained by repackaging a base list component of a native system.
  5. 5. The method of claim 2, wherein invoking, by the cross-end component code, the native network request code to request updated list data comprises: Acquiring a first network request address through the cross-terminal component code, and calling the list data which is requested to be updated by the native network request code according to the first network request address; Wherein the first network request address is the same as a second network request address used when the native network code requests list data.
  6. 6. The method as recited in claim 1, further comprising: transmitting the page identifier and the list identifier of the list page to the native network request code through the cross-terminal component code; And constructing key data according to the page identifier and the list identifier through the native network request code, constructing value data according to the requested list data, and storing key value pairs constructed by the key data and the value data in the preset data manager.
  7. 7. The method of claim 1, wherein the obtaining the list data from the preset data manager comprises: And acquiring the list data from the preset data manager based on a preset network request simulation mechanism.
  8. 8. The method as recited in claim 1, further comprising: splitting the requested list data through the native network request code to obtain target data, and storing the target data in the preset data manager.
  9. 9. The method of claim 1, further comprising at least one of: Callback the request result of the list data to the cross-terminal component code through the native network request code; and callback is conducted to the cross-end component code through the native component code on the list state of the list page.
  10. 10. A list rendering apparatus, comprising: the request and loading module is used for responding to a loading event of the list page, requesting list data through a native network request code and loading cross-terminal component codes; The frame rendering module is used for rendering the list frames in the list page through the cross-end component codes; The notification module is used for sending a notification message to the original component code according to the success of the request of the list data through the original network request code, wherein the requested list data is stored in a preset data manager; And the card rendering module is used for acquiring the list data from the preset data manager according to the notification message through the native component code and rendering the list card to the list frame according to the list data.
  11. 11. An electronic device, the electronic device comprising: One or more processors; Storage means for storing one or more programs, When executed by the one or more processors, causes the one or more processors to implement the method of rendering a list as recited in any one of claims 1-9.
  12. 12. A storage medium containing computer executable instructions which, when executed by a computer processor, are for performing the method of rendering a list as claimed in any one of claims 1 to 9.
  13. 13. A computer program product, characterized in that the computer program product comprises a computer program which, when executed by a processor, implements the method of rendering a list according to any of claims 1-9.

Description

List rendering method and device, electronic equipment and storage medium Technical Field The embodiment of the disclosure relates to the technical field of computers, in particular to a list rendering method, a list rendering device, electronic equipment and a storage medium. Background Based on the list components developed by the cross-end development technique, a variety of operating systems may be adapted. However, since the cross-end development technology generally uses an interpreted scripting language, which needs to be translated before each execution, the rendering process is excessively long for the list component with complex functions, which greatly affects the user experience. Disclosure of Invention The embodiment of the disclosure provides a list rendering method, a device, electronic equipment and a storage medium, which can reduce list rendering time and improve user experience. In a first aspect, an embodiment of the present disclosure provides a method for rendering a list, including: Responding to a loading event of the list page, requesting list data through a native network request code, and loading cross-terminal component codes; rendering a list frame in the list page through the cross-terminal component code; sending a notification message to a native component code in response to success of the list data request through the native network request code, wherein the requested list data is stored in a preset data manager; and acquiring the list data from the preset data manager according to the notification message through the native component code, and rendering a list card to the list box according to the list data. In a second aspect, an embodiment of the present disclosure further provides a list rendering apparatus, including: the request and loading module is used for responding to a loading event of the list page, requesting list data through a native network request code and loading cross-terminal component codes; The frame rendering module is used for rendering the list frames in the list page through the cross-end component codes; The notification module is used for sending a notification message to the original component code according to the success of the request of the list data through the original network request code, wherein the requested list data is stored in a preset data manager; And the card rendering module is used for acquiring the list data from the preset data manager according to the notification message through the native component code and rendering the list card to the list frame according to the list data. In a third aspect, embodiments of the present disclosure further provide an electronic device, including: One or more processors; Storage means for storing one or more programs, The one or more programs, when executed by the one or more processors, cause the one or more processors to implement a method of rendering a list as described in any of the embodiments of the present disclosure. In a fourth aspect, the disclosed embodiments also provide a storage medium containing computer-executable instructions, which when executed by a computer processor, are for performing a method of rendering a list as described in any of the disclosed embodiments. According to the technical scheme, list data is requested through a native network request code in response to a loading event of a list page, cross-terminal component codes are loaded, a list frame in the list page is rendered through the cross-terminal component codes, a notification message is sent to the native component codes through the native network request code in response to successful list data request, the requested list data is stored in a preset data manager, the list data is obtained from the preset data manager through the native component codes according to the notification message, and list cards are rendered to the list frame according to the list data. In contrast to using pure cross-end code to render a list in the related art, the technical solution of the embodiments of the present disclosure may render a list through cross-end code (including cross-end component code), as well as native system code (including native network request code and native component code). In the embodiment of the disclosure, list data is not required to be requested after the cross-end component code is loaded, but the list data is requested in parallel through independent native network requests in the cross-end component code loading process, so that the idle time of the data requests can be reduced, and the list rendering time is shortened. In addition, after the list data is requested, the list card can be rendered directly through the native component codes, so that communication with the cross-end component codes is not needed, the list card is not needed to be rendered through the cross-end component codes, communication time and code translation time can be saved, and list rendering time can be furthe