Component multiplexing method and device, electronic equipment and storage medium

By splitting cards into reusable element components, the problem of low reusability of list components is solved, resulting in reduced memory usage and improved smoothness.

CN121597296APending Publication Date: 2026-03-03BEIJING ZITIAO NETWORK TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411132705.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-16
Publication Date
2026-03-03

AI Technical Summary

Technical Problem

In existing technologies, list components have low reusability, resulting in high memory consumption and low list smoothness.

Method used

The card is broken down into finer-grained element components. By recycling and reusing the element component dimension, only the missing element components are created to render new cards.

Benefits of technology

It improves component reusability, reduces memory usage, and enhances list smoothness.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121597296A_ABST
    Figure CN121597296A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a component multiplexing method and device, electronic equipment and a storage medium, and the method comprises the steps: obtaining a second card from a card cache in response to a rendering instruction of a first card; in response to different card types of the first card and the second card, multiplexing a second element component contained in the first card in the first element component of the second card to generate a third card; in response to a third element component which is not cached in the component cache, creating the third element component which is not cached; wherein the third element component comprises an element component lacked by the third card compared with the first card; and adding the created third element component to the third card so as to render and obtain the first card. The reusability can be improved, the memory occupation can be reduced, and the list fluency can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of computer technology, and more particularly to a method, apparatus, electronic device, and storage medium for reusing components. Background Technology

[0002] Currently, list items in the list component can be rendered as cards (which can be called View Holders), and cards of the same type can be recycled and reused. This reuse method has a low reuse rate, requires a large amount of memory to create different types of cards, and results in poor list smoothness. Summary of the Invention

[0003] This disclosure provides a method, apparatus, electronic device, and storage medium for reusing components, which can improve the reuse rate, reduce memory usage, and improve the fluency of lists.

[0004] In a first aspect, embodiments of this disclosure provide a method for reusing components, including:

[0005] In response to the rendering command for the first card, retrieve the second card from the card cache;

[0006] In response to the fact that the first card and the second card are of different card types, the second element component contained in the first card of the second card is reused to generate a third card;

[0007] In response to the fact that a third element component is not cached in the component cache, the uncached third element component is created; wherein, the third element component includes the element component that is missing from the third card compared to the first card;

[0008] The created third element component is added to the third card to render the first card.

[0009] Secondly, embodiments of this disclosure also provide a component reuse apparatus, including:

[0010] The acquisition module is used to retrieve the second card from the card cache in response to the rendering command of the first card;

[0011] A reuse module is used to, in response to the fact that the card types of the first card and the second card are different, reuse the second element component contained in the first card of the second card to generate a third card;

[0012] A creation module is used to create the uncached third element component in response to the component cache not being cached; wherein the third element component includes the element component that is missing from the third card compared to the first card;

[0013] An add module is used to add the created third element component to the third card to render the first card.

[0014] Thirdly, embodiments of this disclosure also provide an electronic device, the electronic device comprising:

[0015] One or more processors;

[0016] Storage device for storing one or more programs.

[0017] When the one or more programs are executed by the one or more processors, the one or more processors implement the component reuse method as described in any embodiment of this disclosure.

[0018] Fourthly, embodiments of this disclosure also provide a storage medium containing computer-executable instructions, which, when executed by a computer processor, are used to perform a method for reusing components as described in any of the embodiments of this disclosure.

[0019] The technical solution of this embodiment of the disclosure, in response to the rendering instruction of the first card, retrieves the second card from the card cache; in response to the fact that the card types of the first card and the second card are different, reuses the second element component contained in the first card of the second card to generate a third card; in response to the fact that the third element component is not cached in the component cache, creates the uncached third element component; wherein, the third element component includes the element component that is missing from the third card compared to the first card; and adds the created third element component to the third card to render the first card.

[0020] By breaking down cards into finer-grained element components, recycling and reuse at the element component level can be achieved. When rendering a new card, identical element components from cached cards can be reused; only missing element components need to be created. Creating missing element components, compared to traditionally recreating cards, likely reduces memory usage and creation time, thereby improving component reusability, reducing memory consumption, and enhancing list smoothness. Attached Figure Description

[0021] The above and other features, advantages, and aspects of the embodiments of this disclosure will become more apparent from the accompanying drawings and the following detailed description. Throughout the drawings, the same or similar reference numerals denote the same or similar element components. It should be understood that the drawings are schematic, and the originals and element components are not necessarily drawn to scale.

[0022] Figure 1 A schematic flowchart illustrating a component reuse method provided in an embodiment of this disclosure;

[0023] Figure 2 A schematic flowchart illustrating a component reuse method provided in an embodiment of this disclosure;

[0024] Figure 3 A data flow diagram illustrating a component reuse method provided in an embodiment of this disclosure;

[0025] Figure 4 A schematic diagram of a communication message card in a component reuse method provided in an embodiment of this disclosure;

[0026] Figure 5 A schematic diagram of the structure of a component reuse device provided in an embodiment of this disclosure;

[0027] Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this disclosure. Detailed Implementation

[0028] Embodiments of this disclosure will now be described in more detail with reference to the accompanying drawings. While some embodiments of this disclosure are shown in the drawings, it should be understood that this disclosure can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of this disclosure. It should be understood that the accompanying drawings and embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of protection of this disclosure.

[0029] It should be understood that the steps described in the method embodiments of this disclosure may be performed in different orders and / or in parallel. Furthermore, the method embodiments may include additional steps and / or omit the steps shown. The scope of this disclosure is not limited in this respect.

[0030] The term "comprising" and its variations as used herein are open-ended inclusions, meaning "including but not limited to". The term "based on" means "at least partially based on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Definitions of other terms will be given in the description below.

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

[0032] It should be noted that the terms "a" and "a plurality of" used in this disclosure are illustrative rather than restrictive, and those skilled in the art should understand that, unless otherwise expressly indicated in the context, they should be understood as "one or more".

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

[0034] In related technologies, the native Android Recycler View component can contain at least one list item (referred to as an item), and the list item is rendered as a whole, represented by a card (referred to as a View Holder). The card can be used to refer to a list item. Furthermore, the native cache pool is also constructed for caching and reuse based on the card dimension.

[0035] However, in this reuse method, if the cached card type (or View Type) is the same as the card type of the card to be rendered, then the cached card can be reused. If the card types are different, then even if the cached card contains the elements required by the card to be rendered, it cannot be reused. This means that when rendering a new card, the cached card is very likely to be unusable, requiring new memory to be allocated to create the card, and recreating the card also takes time. In other words, the reuse method in related technologies has a low reuse rate, requires a large amount of memory to create different types of cards, and has low list smoothness.

[0036] Figure 1 This is a flowchart illustrating a component reuse method provided in an embodiment of this disclosure. This disclosure is applicable to the recycling and reuse of list components, such as in the Android system. The method can be executed by a component reuse device, which can be implemented in software and / or hardware and can be configured in an electronic device, such as an electronic device running the Android operating system.

[0037] like Figure 1 As shown, the component reuse method provided in this embodiment may include:

[0038] S110, in response to the rendering instruction of the first card, retrieve the second card from the card cache.

[0039] In this embodiment, the card cache may cache cards that have been moved off the current page. When the current page is opened, the card cache is empty, and component reuse is not possible. At this time, it is necessary to create and render the first-screen cards. Here, the first-screen cards can be understood as the cards in the list component that are within the page range when the current page is opened.

[0040] In this example, the rendering process of the first screen card may include: loading a general layout; wherein the general layout has pre-set placeholder components; loading the element components of the card; and using the element components to replace at least some of the placeholder components in order to render the card.

[0041] The general layout can be understood as a common element layout for different cards. A general layout can be predefined, and multiple placeholder components can be set within it. Placeholder components can be understood as empty components without bound data, serving to provide available slots. The number, size, and position of placeholder components in the general layout can be set according to specific business scenarios to cover different deployment methods of element components in cards under corresponding business scenarios.

[0042] In this context, the view bound to element data can be called an element component. For each element in the card, a corresponding element view holder (represented by a Cell Holder) can be created; the Cell Holder can be considered a view holder at the element level. The element view holder can reference the view of the corresponding element to facilitate processing of that view. Element data can be bound to the corresponding element view holder to complete the loading of the element component.

[0043] In the general layout, placeholder components and element components can have a corresponding relationship. Based on this relationship, the placeholder component corresponding to the element component can be removed, and the corresponding element component can be added to achieve component replacement. This allows the element corresponding to the element component to be rendered in the card. Furthermore, placeholder groups that do not have a corresponding relationship with element components can be retained. Since the data in the retained placeholder components is empty, their existence is not noticeable in the rendered card.

[0044] In this embodiment, by splitting the card into finer-grained element components, the foundation for recycling and reuse of the element component dimension can be laid.

[0045] In this embodiment of the disclosure, the rendering instruction for the first card can be generated in response to a sliding trigger of the list component. In response to a sliding trigger of the list component, cards that have moved out of the page range can be recycled to the card cache, and cards that have moved into the page range can be identified as the first card, and the rendering instruction for the first card can be generated.

[0046] Different business scenarios may correspond to different first cards, which may include, for example, a communication message card. When the first card includes a communication message card, it may include at least one of the following element components: nickname component, avatar component, text content component, image content component, video content component, and emoticon component. Furthermore, it may include other components, such as a time component indicating the message sending time and a message delivery component indicating the message read status.

[0047] The communication message card can include at least one of the following card types: text card, image card, and video card. The card type can be understood as a pre-defined classification of the card based on its business function. Each card can correspond to a unique card type, and cards of the same type contain identical element components, while cards of different types can contain the same element components. For example, a text card includes at least a text content component, an image card includes at least a text content component, and a video card includes at least a video content component. Furthermore, each type of card can include other element components based on different conditions, such as determining whether to include an avatar component based on the message sending time. When the time interval between the current message and the previous message meets a preset condition, such as being less than a preset time threshold, the time card corresponding to the current message does not include an avatar component; when the time interval between the current message and the previous message meets a preset condition, such as being greater than or equal to a preset time threshold, the time card corresponding to the current message does not include an avatar component.

[0048] Specifically, based on the rendering instructions of the first card, a card can be retrieved from at least one card cached in the card cache as the second card. Specifically, it can be determined whether the card cache contains a card of the same type as the first card; if so, it can be retrieved as the second card; if not, the card with the most overlapping elements with the first card can be retrieved from the card cache according to a preset ranking of element components between card types, and used as the second card.

[0049] S120. In response to the fact that the first card and the second card are of different card types, the second element component contained in the first card of the second card is reused to generate a third card.

[0050] The first element component can refer to an element component contained in the second card; the second element component can refer to a component contained in the first card, that is, an element component that is the same in both the first and second cards. The second element component can be empty or at least one.

[0051] When the card types of the first card and the second card are different, the element view holder of the second element component can be reused, and the data within the reused element view holder can be updated to reuse the second element component. Furthermore, element components other than the second element component (i.e., unreused element components) in the first element component can be removed from the second card to generate a third card. Element components removed from the first card can be stored in a component cache, thus achieving element component-level recycling. In addition, after removing element components from the second card, corresponding placeholder components can be inserted to continue providing slots.

[0052] In some optional implementations, it may also include: reusing the second card in response to the first card and the second card having the same card type to render the first card.

[0053] In these optional implementations, if the card cache contains cards of the same type as the first card, then the retrieved second card will be of the same type as the first card. In this case, the second card can be directly reused. Reusing the second card can include reusing both the second card itself and the element view holders for each element within the second card. Therefore, only the data in the element view holders of the second card needs to be updated to render the first card.

[0054] S130. In response to the fact that a third element component is not cached in the component cache, the uncached third element component is created; wherein, the third element component includes the element component that is missing from the first card compared to the third card. The third element component may include at least one.

[0055] The component cache can cache not only unused elements from the current first element component, but also at least one of the following: unused elements from the historical first element component, and elements from a closed page. Specifically, it can determine whether the component cache contains a missing element from the first card (i.e., a third element component). If the third element component is not cached, it needs to be created.

[0056] The process of creating a third element component can be referenced from the loading process of an element component, and may include: creating an element view holder corresponding to the third element component; binding the data corresponding to the third element component to the element view holder to complete the creation of the third element component.

[0057] S140. Add the created third element component to the third card to render the first card.

[0058] Specifically, based on the correspondence between placeholder components and element components in the general layout, the created third element component can be added to the placeholder component corresponding to the third card to render the first card.

[0059] In some alternative implementations, the following may also be included: in response to the fact that at least some third-element components are cached in the component cache, the cached third-element components are reused in the third card.

[0060] In these optional implementations, if the component cache contains at least some third-element components, the element view holder of the cached third-element components can be reused, and the data within the reused element view holder can be updated to obtain the updated third-element components; the updated third-element components are then added to the third card. Adding the updated third-element components to the third card can be done similarly to adding newly created third-element components to the third card. Alternatively, the remaining uncached third-element components in the component cache can be created, and these created third-element components can be added to the third card to assemble the first card.

[0061] The technical solution of this disclosure embodiment, in response to the rendering instruction of the first card, retrieves the second card from the card cache; in response to the different card types of the first card and the second card, reuses the second element component contained in the first card of the second card to generate a third card; in response to the fact that the third element component is not cached in the component cache, creates the uncached third element component; wherein, the third element component includes the element component that is missing from the third card compared to the first card; and adds the created third element component to the third card to render the first card.

[0062] By breaking down cards into finer-grained element components, recycling and reuse at the element component level can be achieved. When rendering a new card, identical element components from cached cards can be reused; only missing element components need to be created. Creating missing element components, compared to traditionally recreating cards, likely reduces memory usage and creation time, thereby improving component reusability, reducing memory consumption, and enhancing list smoothness.

[0063] This embodiment can be combined with the various optional solutions in the component reuse method provided in the above embodiments. The component reuse method provided in this embodiment, by constructing a card cache as a first-level cache, and constructing a page cache and an external cache in the component cache as a second-level cache and a third-level cache respectively, can realize the recycling and reuse of card-level and element component-level caches, and can further improve the reuse rate of element components.

[0064] Figure 2This is a schematic flowchart illustrating a component reuse method provided in an embodiment of this disclosure. Figure 2 As shown, the component reuse method provided in this embodiment may include:

[0065] S201. In response to the rendering instruction of the first card, retrieve the second card from the card cache.

[0066] S202. Determine whether the card types of the first card and the second card are the same; if yes, jump to S203; if no, jump to S204.

[0067] S203. In response to the fact that the first card and the second card are of the same card type, update the data of the element components in the second card to render the first card.

[0068] In this embodiment, reusing the second card may include: updating the data of the element components in the second card. Updating the data of the element components in the second card may include:

[0069] The updated data source for each element component in the second card is carried by the element component assembler (represented by Cell Interact) corresponding to each element component in the second card. Each data source is then converted into a data model. Each data model is then bound to the corresponding element view holder in the second card to obtain the updated second card (i.e., the first card). Here, the data source can refer to the raw format data of the element, typically containing characters other than the data itself; the data model can refer to the data class that extracts and combines the raw data from the data source.

[0070] S204. In response to the fact that the first card and the second card are of different card types, the second element component contained in the first card of the second card is reused to generate the third card.

[0071] The process of reusing the second element component contained in the first element component of the second card to generate a third card may include: updating the data of the second element component to generate a third card.

[0072] One approach is to update the data of the second element component by referring to the method of updating the data of each element in the second card. For example, this could include: using an element component assembler to carry the updated data source corresponding to the second element component; converting the data source into a data model; and binding the data model to the original element view holder of the second element component to obtain the updated second element component.

[0073] S205. Determine if the third-party element component is cached in the page cache; if yes, proceed to S206; if no, proceed to S207.

[0074] In this embodiment, the component cache includes a page cache; the page cache may cache unused element components from the historical first element component. The third element component includes element components that are missing from the first card compared to the third card.

[0075] S206. In response to the fact that at least some third-element components are cached in the page cache, reuse the cached third-element components in the third card.

[0076] The data update method for the second element component can be referenced to update the data of the third element component for reuse. This can include: using an element component assembler to carry the updated data source corresponding to the third element component; converting the data source into a data model; and binding the data model to the element view holder of the third element component to obtain the updated third element component. Furthermore, based on the correspondence between placeholder components and element components in the general layout, the updated third element component can be added to the third card.

[0077] If all third-party element components are cached in the page cache, then reusing the cached third-party element components in the third card will yield the first card. Furthermore, for third-party element components not cached in the page cache, step S206 can be skipped to step S207 to search for these uncacheable components in external storage.

[0078] S207. In response to the fact that at least some third-element components are not cached in the page cache, search for the third-element components that are not cached in the page cache in the external cache; if the third-element components are found, jump to S208; otherwise, jump to S209.

[0079] For at least some third-party element components not cached in the page cache, they can be searched in the external cache. The component cache includes the external cache, which caches element components of the target type from closed pages. When a historical page is closed, element components of the target type from the page's list components can be stored in the external cache. The target type can be set based on the element component's reuse frequency. For example, the top N (N≥1) most frequently reused element component types within a preset time period can be used as the target type; or, the types of element components whose reuse frequency exceeds a preset number within a preset time period can be used as the target type, and so on.

[0080] S208. In response to the fact that at least some third element components are cached in the external cache, the cached third element components are reused in the third card.

[0081] The process of reusing a third-element component cached in an external cache to a third card can be referenced in the process of reusing a third-element component cached in a page cache to a third card.

[0082] If the external cache contains all third-element components that are not cached in the page cache, then reusing the cached third-element components in the external cache into the third card will yield the first card. Furthermore, for third-element components not cached in the external cache, step S208 can be skipped to step S209 to create those components.

[0083] S209. In response to a third element component not being cached in the external cache, create the third element component that is not cached in the external cache.

[0084] This allows for the creation of at least a portion of third-element components that are not cached in the external cache.

[0085] S210. Add the created third element component to the third card to render the first card.

[0086] For example, Figure 3 A schematic block diagram of the data flow for a component reuse method provided in an embodiment of this disclosure. See also... Figure 3 In the list component, cards within the page area can be represented by solid borders, while cards outside the page area can be represented by dashed borders. In response to a scrolling event of the list component, card 1 (moved out of the page area) can be returned to the card cache, and card 5 (moved into the page area) can be designated as the first card, generating rendering instructions for that first card.

[0087] Assume that card 5 and card 1 are of different types; card 5 contains three element components a, b, and c; card 1 contains three element components c, d, and e; and the card cache only caches card 1. Based on this assumption, the process of rendering card 5 can include:

[0088] Suppose that card 1 is retrieved from the card cache, and card 1 is of a different type than card 5;

[0089] The second element component (i.e. element component c) contained in the first element components c, d, and e of card 1 is reused to generate the third card;

[0090] Store the unused element components (i.e., element components d and e) in the first card into the page cache; determine whether the third element component (i.e., the missing element components a and b) is cached in the page cache;

[0091] If at least some of the third-element components are cached in the page cache, then the cached third-element components can be reused in the third card; if at least some of the third-element components are not cached in the page cache, then the uncacheable third-element components can be found in the external cache; in this example, assuming that element components a and b are not cached in the page cache, then element components a and b can be found in the external cache.

[0092] Suppose that element component a is found in the external cache but element component b is not found, then the third element component (i.e., element component a) cached in the external cache can be reused in the third card, and the third element component (i.e., element component b) not cached in the external cache can be created and added to the third card to render card 5.

[0093] Compared to the traditional method of fully creating cards 5, the reuse method provided in this embodiment can recycle and reuse element components, improve the reuse rate, and only needs to create the missing element component b, which can reduce the memory required for creation, reduce the creation time, and improve the creation efficiency.

[0094] The technical solution of this disclosure embodiment, by constructing a card cache as the first-level cache, and constructing a page cache and an external cache in the component cache as the second-level cache and the third-level cache respectively, can realize the recycling and reuse of card-level and element component-level caches, and can further improve the reuse rate of element components. The component reuse method provided in this disclosure embodiment belongs to the same disclosed concept as the component reuse method provided in the above embodiments. Technical details not described in detail in this embodiment can be referred to in the above embodiments, and the same technical features have the same beneficial effects in this embodiment and the above embodiments.

[0095] This embodiment can be combined with various optional solutions in the component reuse method provided in the above embodiments. The component reuse method provided in this embodiment is applied to application software with communication functions; wherein, the first card may include a communication message card. By recycling and reusing communication message cards at the element component level, fast rendering of communication cards can be achieved, improving communication efficiency.

[0096] Figure 4 This is a schematic diagram of a communication message card in a component reuse method provided in an embodiment of this disclosure. Figure 4 As shown, assume the first card to be rendered is a text card, and the second card retrieved from the card cache is a video card. The text card and video card can be considered different card types. The text card may include a nickname component, an avatar component, a text content component, and an emoji component. The video card may include a nickname component, an avatar component, a video content component, and an emoji component.

[0097] by Figure 4 Based on the first and second cards as examples, the component reuse method provided in this embodiment may include:

[0098] The third card is generated by reusing the second element component (nickname component, avatar component, and emoji component) contained in the first element component of the video card.

[0099] Store unused element components (i.e. video content components) in the video card to the page cache;

[0100] Determine whether the third element component (i.e., the missing text content component) is cached in the page cache;

[0101] If the text content component is cached in the page cache, it can be reused in the third card to obtain the text card; if the text content component is not cached in the page cache, it can be retrieved from the external cache.

[0102] If the text content component is found in the external cache, it can be reused in the third card to obtain a text card; if the text content component is not cached in the external cache, it can be created and added to the third card to obtain a text card.

[0103] The technical solution of this disclosure embodiment includes application software with communication functions; wherein, the first card may include a communication message card. By recycling and reusing the communication message card at the element component level, fast rendering of the communication card can be achieved, improving communication efficiency. The component reuse method provided in this disclosure embodiment belongs to the same disclosed concept as the component reuse method provided in the above embodiments. Technical details not described in detail in this embodiment can be found in the above embodiments, and the same technical features have the same beneficial effects in this embodiment and the above embodiments.

[0104] Figure 5 This is a schematic diagram of a component reuse device provided in an embodiment of the present disclosure. The component reuse device provided in this embodiment is applicable to the recycling and reuse of list components, for example, to the recycling and reuse of list components in the Android system.

[0105] like Figure 5 As shown, the component reuse apparatus provided in this embodiment of the disclosure may include:

[0106] The acquisition module 510 is used to retrieve the second card from the card cache in response to the rendering instruction of the first card;

[0107] The reuse module 520 is used to reuse the second element component contained in the first card of the second card in response to the different card types of the first card and the second card to generate a third card;

[0108] Module 530 is created in response to a third element component not being cached in the component cache, and the uncached third element component is created; wherein, the third element component includes the element component that is missing from the first card compared to the third card;

[0109] Add module 540 to add the created third element component to the third card so that the first card can be rendered.

[0110] In some alternative implementations, component reuse mechanisms can be applied to application software with communication capabilities.

[0111] In some alternative implementations, the first card includes a communication message card; the first card includes at least one of the following element components: nickname component, avatar component, text content component, image content component, video content component, emoticon component, time component, and message delivery component.

[0112] In some alternative implementations, the communication message card includes at least one of the following card types: text card, image card, and video card.

[0113] In some optional implementations, component caching includes page caching and external caching; the page cache caches unused element components from the first element component in history; the external cache caches element components of the target type from closed pages.

[0114] Modules can be created for:

[0115] In response to the fact that at least some third-party element components are not cached in the page cache, look up the third-party element components that are not cached in the page cache from the external cache;

[0116] In response to a third-party element component not being cached in the external cache, create the third-party element component that is not cached in the external cache.

[0117] In some alternative implementations, reusable modules can also be used for:

[0118] Since the first card and the second card are of the same card type, the second card is reused to render the first card.

[0119] In some alternative implementations, reusable modules can also be used for:

[0120] In response to the fact that at least some third-element components are cached in the component cache, the cached third-element components are reused in the third card.

[0121] In some alternative implementations, reusable modules can also be used for:

[0122] Update the data of the second element component to generate the third card.

[0123] In some alternative implementations, reusable modules can also be used for:

[0124] Update the data of the element components in the second card to render the first card.

[0125] The component reuse apparatus provided in the embodiments of this disclosure can execute the component reuse method provided in any embodiment of this disclosure, and has the corresponding functional modules and beneficial effects for executing the method.

[0126] It is worth noting that the various units and modules included in the above-mentioned device are only divided according to functional logic, but are not limited to the above division, as long as the corresponding functions can be realized; in addition, the specific names of each functional unit are only for easy differentiation and are not used to limit the protection scope of the embodiments of this disclosure.

[0127] The following is for reference. Figure 6 It illustrates an electronic device suitable for implementing embodiments of the present disclosure (e.g., Figure 6 The diagram below shows the structure of the terminal device or server 600. The terminal device in this embodiment may include, but is not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), and vehicle terminals (e.g., vehicle navigation terminals), as well as fixed terminals such as digital TVs and desktop computers. Figure 6 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments disclosed herein.

[0128] like Figure 6As shown, electronic device 600 may include a processing unit (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 read-only memory (ROM) 602 or a program loaded from storage device 608 into random access memory (RAM) 603. The RAM 603 also stores various programs and data required for the operation of electronic device 600. The processing unit 601, ROM 602, and RAM 603 are interconnected via bus 604. An input / output (I / O) interface 605 is also connected to bus 604.

[0129] Typically, the following devices can be connected to I / O interface 605: input devices 606 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 607 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 608 including, for example, magnetic tapes, hard disks, etc.; and communication devices 609. Communication device 609 allows electronic device 600 to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 6 An electronic device 600 with various devices is shown; however, it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed alternatively.

[0130] In particular, according to embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this disclosure include a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device 609, or installed from a storage device 608, or installed from a ROM 602. When the computer program is executed by a processing device 601, it performs the functions defined in the component reuse method of embodiments of this disclosure.

[0131] The electronic device provided in this embodiment and the component reuse method provided in the above embodiments belong to the same disclosed concept. Technical details not described in detail in this embodiment can be found in the above embodiments, and this embodiment has the same beneficial effects as the above embodiments.

[0132] This disclosure provides a storage medium for computer-executable instructions, which, when executed by a computer processor, can be used to perform the component reuse method provided in the above embodiments.

[0133] It should be noted that the storage medium described in this disclosure can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM) or flash memory (FLASH), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this disclosure, a computer-readable storage medium can be any tangible medium that contains or stores executable instructions that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this disclosure, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable executable instructions. Such transmitted data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. The computer-readable signal medium can also be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit executable instructions for use by or in connection with an instruction execution system, apparatus, or device. Executable instructions contained on the storage medium can be transmitted using any suitable medium, including but not limited to: wires, optical fibers, RF (radio frequency), etc., or any suitable combination thereof.

[0134] In some implementations, clients and servers can communicate using any currently known or future-developed network protocol such as HTTP (Hypertext Transfer Protocol) and can interconnect with digital data communication (e.g., communication networks) of any form or medium. Examples of communication networks include local area networks (“LANs”), wide area networks (“WANs”), the Internet (e.g., the Internet of Things), and end-to-end networks (e.g., ad hoc end-to-end networks), as well as any currently known or future-developed networks.

[0135] The aforementioned storage medium may be included in the aforementioned electronic device; or it may exist independently and not be assembled into the electronic device.

[0136] The aforementioned storage medium carries one or more executable instructions, which, when executed by the electronic device, cause the electronic device to:

[0137] In response to the rendering command of the first card, the second card is retrieved from the card cache; in response to the different card types of the first and second cards, the second element component contained in the first card of the second card is reused to generate the third card; in response to the fact that the third element component is not cached in the component cache, the uncached third element component is created; wherein, the third element component includes the element components that are missing from the third card compared to the first card; the created third element component is added to the third card to render the first card.

[0138] Executable instructions for performing the operations of this disclosure can be written in one or more programming languages ​​or a combination thereof, including but not limited to object-oriented programming languages ​​such as Java, Smalltalk, and C++, as well as conventional procedural programming languages ​​such as the "C" language or similar programming languages. The executable instructions can be executed entirely on the user's computer, partially on the user's computer, as a standalone 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 remote computers, the remote computer can 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 can be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0139] This disclosure also provides a computer program product, including a computer program that, when executed by a processor, can implement the component reuse method provided in any embodiment of this disclosure.

[0140] In implementing a computer program product, computer program code for performing the operations of this disclosure can be written in one or more programming languages ​​or a combination thereof. Programming languages ​​include object-oriented programming languages ​​such as Java, Smalltalk, and C++, as well as conventional procedural programming languages ​​such as C or similar languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone 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 remote computers, the remote computer can 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 can be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0141] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0142] The units described in the embodiments of this disclosure can be implemented in software or hardware. The names of the units and modules do not, in certain circumstances, constitute a limitation on the unit or module itself.

[0143] The functions described above in this document can be performed, at least in part, by one or more hardware logic components. For example, exemplary types of hardware logic components that can be used, without limitation, include: Field Programmable Gate Array (FPGA), Application Specific Integrated Circuit (ASIC), Application Specific Standard Parts (ASSP), System on Chip (SOC), Complex Programmable Logic Device (CPLD), and so on.

[0144] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0145] According to one or more embodiments of this disclosure, a method for reusing components is provided, the method comprising:

[0146] In response to the rendering command for the first card, retrieve the second card from the card cache;

[0147] In response to the fact that the first card and the second card are of different card types, the second element component contained in the first card of the second card is reused to generate a third card;

[0148] In response to the fact that a third element component is not cached in the component cache, the uncached third element component is created; wherein, the third element component includes the element component that is missing from the third card compared to the first card;

[0149] The created third element component is added to the third card to render the first card.

[0150] According to one or more embodiments of this disclosure, a method for reusing components is provided, further comprising:

[0151] In some alternative implementations, it is applied to application software with communication functions.

[0152] According to one or more embodiments of this disclosure, a method for reusing components is provided, further comprising:

[0153] In some alternative implementations, the first card includes a communication message card; the first card includes at least one of the following element components: nickname component, avatar component, text content component, image content component, video content component, emoticon component, time component, and message delivery component.

[0154] According to one or more embodiments of this disclosure, a method for reusing components is provided, further comprising:

[0155] In some alternative implementations, the communication message card includes at least one of the following card types: text card, image card, and video card.

[0156] According to one or more embodiments of this disclosure, a method for reusing components is provided, further comprising:

[0157] In some optional implementations, the component cache includes a page cache and an external cache; wherein, the page cache caches unused element components from the historical first element component; and the external cache caches element components of the target type from closed pages.

[0158] The step of responding to the fact that a third-element component is not cached in the component cache, and creating the uncached third-element component, includes:

[0159] In response to the fact that at least some of the third element components are not cached in the page cache, the third element components that are not cached in the page cache are retrieved from the external cache;

[0160] In response to the fact that at least a portion of the third element component is not cached in the external cache, the third element component that is not cached in the external cache is created.

[0161] According to one or more embodiments of this disclosure, a method for reusing components is provided, further comprising:

[0162] In some alternative implementations, in response to the first card and the second card having the same card type, the second card is reused to render the first card.

[0163] According to one or more embodiments of this disclosure, a method for reusing components is provided, further comprising:

[0164] In some alternative implementations, in response to the fact that at least a portion of the third element components are cached in the component cache, the cached third element components are reused in the third card.

[0165] According to one or more embodiments of this disclosure, a method for reusing components is provided, further comprising:

[0166] In some optional implementations, the step of reusing the second element component contained in the first element component of the second card to generate the third card includes:

[0167] Update the data of the second element component to generate the third card.

[0168] According to one or more embodiments of this disclosure, a method for reusing components is provided, further comprising:

[0169] In some optional implementations, the reuse of the second card to render the first card includes:

[0170] The data of the element components in the second card is updated to render the first card.

[0171] According to one or more embodiments of the present disclosure, a component reuse apparatus is provided, the apparatus comprising:

[0172] The acquisition module is used to retrieve the second card from the card cache in response to the rendering command of the first card;

[0173] A reuse module is used to, in response to the fact that the card types of the first card and the second card are different, reuse the second element component contained in the first card of the second card to generate a third card;

[0174] A creation module is used to create the uncached third element component in response to the component cache not being cached; wherein the third element component includes the element component that is missing from the third card compared to the first card;

[0175] An add module is used to add the created third element component to the third card to render the first card.

[0176] The above description is merely a preferred embodiment of this disclosure and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of this disclosure is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-described concept. For example, technical solutions formed by substituting the above features with (but not limited to) technical features disclosed in this disclosure that have similar functions.

[0177] Furthermore, while the operations are described in a specific order, this should not be construed as requiring these operations to be performed in the specific order shown or in a sequential order. In certain environments, multitasking and parallel processing may be advantageous. Similarly, while several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of this disclosure. Certain features described in the context of individual embodiments may also be implemented in combination in a single embodiment. Conversely, various features described in the context of a single embodiment may also be implemented individually or in any suitable sub-combination in multiple embodiments.

[0178] Although the subject matter has been described using language specific to structural features and / or methodological logic, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. Rather, the specific features and actions described above are merely illustrative examples of implementing the claims.

Claims

1. A method for reusing components, characterized in that, include: In response to the rendering command for the first card, retrieve the second card from the card cache; In response to the fact that the first card and the second card are of different card types, the second element component contained in the first card of the second card is reused to generate a third card; In response to the fact that a third element component is not cached in the component cache, the uncached third element component is created; wherein, the third element component includes the element component that is missing from the third card compared to the first card; The created third element component is added to the third card to render the first card.

2. The method according to claim 1, characterized in that, It is used in application software with communication functions.

3. The method according to claim 1, characterized in that, The first card includes a communication message card; the first card includes at least one of the following element components: nickname component, avatar component, text content component, image content component, video content component, emoticon component, time component, and message delivery component.

4. The method according to claim 3, characterized in that, The communication message card includes at least one of the following card types: text card, image card, and video card.

5. The method according to claim 1, characterized in that, The component cache includes page cache and external cache; wherein, the page cache caches unused element components from the historical first element component; the external cache caches element components of the target type from closed pages; The step of responding to the fact that a third-element component is not cached in the component cache, and creating the uncached third-element component, includes: In response to the fact that at least some of the third element components are not cached in the page cache, the third element components that are not cached in the page cache are retrieved from the external cache; In response to the fact that at least a portion of the third element component is not cached in the external cache, the third element component that is not cached in the external cache is created.

6. The method according to claim 1, characterized in that, Also includes: In response to the fact that the first card and the second card are of the same card type, the second card is reused to render the first card.

7. The method according to claim 1, characterized in that, Also includes: In response to the fact that at least a portion of the third element component is cached in the component cache, the cached third element component is reused in the third card.

8. The method according to claim 1, characterized in that, The step of reusing the second element component contained in the first card from the first element component of the second card to generate the third card includes: Update the data of the second element component to generate the third card.

9. The method according to claim 6, characterized in that, The step of reusing the second card to render the first card includes: The data of the element components in the second card is updated to render the first card.

10. A component reuse device, characterized in that, include: The acquisition module is used to retrieve the second card from the card cache in response to the rendering command of the first card; A reuse module is used to, in response to the fact that the card types of the first card and the second card are different, reuse the second element component contained in the first card of the second card to generate a third card; A creation module is used to create the uncached third element component in response to the component cache not being cached; wherein the third element component includes the element component that is missing from the third card compared to the first card; An add module is used to add the created third element component to the third card to render the first card.

11. An electronic device, characterized in that, The electronic device includes: One or more processors; Storage device for storing one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors implement the component reuse method as described in any one of claims 1-9.

12. A storage medium comprising computer-executable instructions, which, when executed by a computer processor, are used to perform a method for multiplexing components as described in any one of claims 1-9.

13. A computer program product, characterized in that, The computer program product includes a computer program that, when executed by a processor, implements the method for reusing components as described in any one of claims 1-9.