A card adaptation and display management method and device, and a display device

By accurately determining card types and using a unified protocol method to create card view instances, combined with on-demand image loading, the problems of code duplication and poor scalability in card display technology are solved, achieving efficient adaptation and display, and improving response speed and code maintainability.

CN122261701APending Publication Date: 2026-06-23SHENZHEN GREEN CONNECTION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SHENZHEN GREEN CONNECTION TECH CO LTD
Filing Date
2026-02-03
Publication Date
2026-06-23

AI Technical Summary

Technical Problem

Existing card display technologies suffer from problems such as code duplication, poor scalability, high maintenance costs, and low reusability, making it impossible to achieve efficient card adaptation and display.

Method used

By accurately determining the target card type, creating card view instances using a unified target protocol method and factory method, and combining this with on-demand image loading, efficient card adaptation and display are achieved.

Benefits of technology

It improves the response speed and accuracy of card display, reduces memory usage, and enhances code maintainability and display device performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122261701A_ABST
    Figure CN122261701A_ABST
Patent Text Reader

Abstract

The application discloses a card adaptation and display management and control method and device, display equipment, and the like. Through accurate determination of a target card and a card type thereof, through clear target protocol method specification style attributes, and through unified creation of a card view instance in combination with a factory method, efficient adaptation and display of the card are realized, response speed and response accuracy of card display requirements are improved, display efficiency and display accuracy of the target card are improved, maintainability of code corresponding to card management is improved, card data is accurately obtained from a data model in combination with picture on-demand loading operation, memory occupation is effectively reduced while ensuring that display content is accurate and complete, display equipment operation performance is improved, and display effect of the target card is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of display control technology, and in particular to a card adaptation and display control method and apparatus, and a display device. Background Technology

[0002] Existing card display technologies typically employ a method of configuring specific models for different cards, establishing a one-to-one correspondence between cards and models. Specifically, each card view is bound to a unique data model type, forming a tight one-to-one relationship. In this model, the card view directly uses the specific model type without going through protocol abstraction; the view can directly access the model's attributes without needing to perform conversions via protocol methods. Furthermore, each card focuses on a specific business scenario, and its type is determined during the program compilation phase.

[0003] However, this technical solution has many significant drawbacks: Firstly, it suffers from severe code duplication. Similar layout logic, such as image loading, title display, and focus animation, needs to be implemented repeatedly in multiple card views, resulting in code redundancy and greatly increasing the difficulty of later maintenance. Secondly, it has poor scalability. When a new data type is added, a corresponding card view must be added simultaneously. Existing cards cannot be reused using a unified interface, and each expansion requires a complete implementation of the new view, leading to high development costs. Furthermore, maintenance costs are high. When styles or interactions change, multiple card view files need to be modified simultaneously. Adjustments to common logic, such as rounded corners, spacing, and animations, also need to be repeated in multiple places, which is not only easy to overlook but also prone to inconsistencies. In addition, reusability is low. A card view can only display one specific type of data, and it is impossible to display multiple types of data with the same card, limiting the versatility of the component and further increasing the amount of code. Summary of the Invention

[0004] This invention provides a card adaptation and display control method and apparatus, and a display device, which can achieve efficient card adaptation and display, while improving the speed and accuracy of response and display.

[0005] The first aspect of this invention discloses a card adaptation and display control method, which is applied to a display device with an application installed and a card display function, wherein the display device is communicatively connected to a network attached storage device, and the display device accesses the network attached storage device through the application. The method includes: When a card display requirement is detected, the target card to be displayed and its corresponding card type are determined based on the card display requirement and a predefined card style strategy enumeration; the card style strategy enumeration includes a variety of predefined card types. Based on the card display requirements, a target protocol method is determined for displaying the target card. The target protocol method encapsulates the style attributes required for card display. A preset factory method is invoked to create a card view instance for the target card based on the factory method and the card type; the card view instance follows a unified and predefined card protocol method. According to the target protocol method, card data adapted to the target card is obtained from the data model implementing the card protocol method; the card data includes at least a card title and a card image; When the target card is detected to have entered the display area of ​​the display device, an on-demand image loading operation is performed on the card data according to the card display requirements, and the card view instance is rendered according to the style attributes to display the card data and the card view instance on the display area; the on-demand image loading operation is used to control the timing of loading and releasing the card data.

[0006] As an optional implementation, in a first aspect of the invention, rendering the card view instance according to the style attribute includes: The card protocol method is invoked, and the card protocol method has a placeholder method set; Based on the card display requirements, determine whether the placeholder method needs to be implemented when implementing the card protocol method. If it is determined that the placeholder method needs to be implemented when implementing the card protocol method, perform a placeholder rendering operation that matches the placeholder method on the card view instance to render the card view instance as a placeholder card in the placeholder style. When it is determined that the placeholder method does not need to be implemented when implementing the card protocol method, a regular card rendering operation matching the card protocol method is performed on the card view instance to create a regular card corresponding to the card protocol method.

[0007] As an optional implementation, in the first aspect of the present invention, the method further includes: Based on the card display requirements, it is determined whether a preset progress information method needs to be implemented when implementing the card protocol method. If it is determined that a preset progress information method needs to be implemented when implementing the card protocol method, the progress information method is called to obtain the progress information returned by the progress information method. The progress information is a named tuple including progress value, percentage description and duration information. According to the progress information method and the card protocol method, the progress information is updated to the regular card so as to display the progress information on the regular card.

[0008] As an optional implementation, in the first aspect of the present invention, determining the target card to be displayed and its corresponding card type based on the card display requirements and a predefined card style strategy enumeration includes: Analyze the card display requirements to obtain the data model type or business scenario identifier corresponding to the card display requirements; Invoke the predefined card style strategy enumeration, and determine the target card to be displayed and its corresponding card type that matches the data model type or business scenario identifier based on the card style strategy enumeration.

[0009] As an optional implementation, in the first aspect of the present invention, the target protocol method includes a first protocol method, or the target protocol method includes a first protocol method and a non-first protocol method; the first protocol method is a protocol method that must be implemented. The step of obtaining card data adapted to the target card from the data model implementing the card protocol method according to the target protocol method includes: When the target protocol method only includes the first protocol method, according to the first protocol method, the first card data corresponding to the card image and card title is obtained from the data model that implements the card protocol method, and used as the card data adapted to the target card; When the target protocol method includes the first protocol method and the non-first protocol method, according to the first protocol method, first card data corresponding to the card image and card title is obtained from the data model implementing the card protocol method. At the same time, according to the non-first protocol method, second card data corresponding to the card progress and card style is obtained from the data model. The first card data and the second card data are determined as card data adapted to the target card. The image type of the card image must at least match the aspect ratio of the target card, and the image type can be a horizontal image or a vertical image.

[0010] As an optional implementation, in the first aspect of the present invention, the first protocol method includes a single image acquisition method and a multiple image acquisition method; The step of obtaining first card data corresponding to the card image and card title from the data model implementing the card protocol method according to the first protocol method includes: Based on the card display requirements, determine the image display requirements for the card view instance. These image display requirements may be either single-image display requirements or multiple-image display requirements. When it is determined that the image display requirement for the card view instance is the multi-image display requirement, the multi-image acquisition method is called, and the first card data corresponding to the multiple card images and multiple card titles corresponding to the multi-image display requirement is obtained from the data model implementing the card protocol method according to the multi-image acquisition method. When it is determined that the image display requirement for the card view instance is the single image display requirement, the single image acquisition method is called, and the card image and the first card data corresponding to the card title corresponding to the single image display requirement are obtained from the data model implementing the card protocol method according to the single image acquisition method. When the image display requirement is the same as the single image display requirement, the multi-image acquisition method returns an empty array by default.

[0011] As an optional implementation, in the first aspect of the invention, the data model is referenced in the card protocol method through a generic constraint mechanism and a type erasure mechanism, wherein: In scenarios where only a single type of data model is used, the generic constraint mechanism is employed; In scenarios where multiple types of the data model need to be used together, the type erasure mechanism is employed.

[0012] A second aspect of the present invention discloses a card adaptation and display control device, which is applied to a display device having an application installed and a card display function, wherein the display device is communicatively connected to a network attached storage device, and the display device accesses the network attached storage device through the application. The device includes: The determination module is used to determine the target card to be displayed and its corresponding card type based on the card display requirement and a predefined card style strategy enumeration when a card display requirement is detected; the card style strategy enumeration includes a variety of predefined card types. The determining module is further configured to determine the target protocol method required to display the target card based on the card display requirements, wherein the target protocol method encapsulates the style attributes required for card display; The instance creation module is used to call a preset factory method to create a card view instance for the target card according to the factory method and the card type; the card view instance follows a unified and predefined card protocol method; The data acquisition module is used to acquire card data adapted to the target card from the data model implementing the card protocol method according to the target protocol method; the card data includes at least the card title and card image; The display control module is used to, when the target card is detected to enter the display area of ​​the display device, perform an on-demand image loading operation on the card data according to the card display requirements, and render the card view instance according to the style attributes, so as to display the card data and the card view instance on the display area; the on-demand image loading operation is used to control the timing of loading and releasing the card data.

[0013] As an optional implementation, in a second aspect of the present invention, the method by which the display control module renders the card view instance according to the style attribute specifically includes: The card protocol method is invoked, and the card protocol method has a placeholder method set; Based on the card display requirements, determine whether the placeholder method needs to be implemented when implementing the card protocol method. If it is determined that the placeholder method needs to be implemented when implementing the card protocol method, perform a placeholder rendering operation that matches the placeholder method on the card view instance to render the card view instance as a placeholder card in the placeholder style. When it is determined that the placeholder method does not need to be implemented when implementing the card protocol method, a regular card rendering operation matching the card protocol method is performed on the card view instance to create a regular card corresponding to the card protocol method.

[0014] As an optional implementation, in a second aspect of the invention, the apparatus further includes: The judgment module is used to determine, based on the card display requirements, whether a preset progress information method needs to be implemented when implementing the card protocol method; The display control module is further configured to call the progress information method when the judgment module determines that a preset progress information method needs to be implemented when implementing the card protocol method, and obtain the progress information returned by the progress information method. The progress information is a named tuple including progress value, percentage description and duration information. The display control module is further configured to update the progress information to the regular card according to the progress information method and the card protocol method, so as to display the progress information on the regular card.

[0015] As an optional implementation, in the second aspect of the present invention, the method by which the determining module determines the target card to be displayed and its corresponding card type based on the card display requirements and a predefined card style strategy enumeration specifically includes: Analyze the card display requirements to obtain the data model type or business scenario identifier corresponding to the card display requirements; Invoke the predefined card style strategy enumeration, and determine the target card to be displayed and its corresponding card type that matches the data model type or business scenario identifier based on the card style strategy enumeration.

[0016] As an optional implementation, in the second aspect of the present invention, the target protocol method includes a first protocol method, or the target protocol method includes a first protocol method and a non-first protocol method; the first protocol method is a protocol method that must be implemented. The data acquisition module obtains card data adapted to the target card from the data model implementing the card protocol method according to the target protocol method in the following specific ways: When the target protocol method only includes the first protocol method, according to the first protocol method, the first card data corresponding to the card image and card title is obtained from the data model that implements the card protocol method, and used as the card data adapted to the target card; When the target protocol method includes the first protocol method and the non-first protocol method, according to the first protocol method, first card data corresponding to the card image and card title is obtained from the data model implementing the card protocol method. At the same time, according to the non-first protocol method, second card data corresponding to the card progress and card style is obtained from the data model. The first card data and the second card data are determined as card data adapted to the target card. The image type of the card image must at least match the aspect ratio of the target card, and the image type can be a horizontal image or a vertical image.

[0017] As an optional implementation, in a second aspect of the present invention, the first protocol method includes a single image acquisition method and a multiple image acquisition method; The data acquisition module obtains the first card data corresponding to the card image and card title from the data model implementing the card protocol method according to the first protocol method in the following specific ways: Based on the card display requirements, determine the image display requirements for the card view instance. These image display requirements may be either single-image display requirements or multiple-image display requirements. When it is determined that the image display requirement for the card view instance is the multi-image display requirement, the multi-image acquisition method is called, and the first card data corresponding to the multiple card images and multiple card titles corresponding to the multi-image display requirement is obtained from the data model implementing the card protocol method according to the multi-image acquisition method. When it is determined that the image display requirement for the card view instance is the single image display requirement, the single image acquisition method is called, and the card image and the first card data corresponding to the card title corresponding to the single image display requirement are obtained from the data model implementing the card protocol method according to the single image acquisition method. When the image display requirement is the same as the single image display requirement, the multi-image acquisition method returns an empty array by default.

[0018] As an optional implementation, in a second aspect of the invention, the data model is referenced in the card protocol method through a generic constraint mechanism and a type erasure mechanism, wherein: In scenarios where only a single type of data model is used, the generic constraint mechanism is employed; In scenarios where multiple types of the data model need to be used together, the type erasure mechanism is employed.

[0019] A third aspect of the present invention discloses a display device, wherein the display device has an application installed and a card display function; the display device is communicatively connected to a network attached storage device; and the display device accesses the network attached storage device through the application. The display device integrates a card adaptation and display control device as described in any of the second aspects of the present invention, and is used to perform a card adaptation and display control method as described in any of the first aspects of the present invention. The display device is also configured to, after detecting a video display requirement, load target media data corresponding to the video display requirement from the network-attached storage device according to the application, and display and play the target media data on the display device.

[0020] The fourth aspect of the present invention discloses a card adaptation and display control system, which is applied in a display device; the system performs a demand response operation on card display requests triggered by the display device in accordance with the card adaptation and display control method as described in any one of the first aspects of the present invention.

[0021] Compared with the prior art, the present invention has the following beneficial effects: This invention provides a card adaptation and display control method. By accurately determining the target card and its type, standardizing style attributes through a clear target protocol method, and uniformly creating card view instances using a factory method, this invention achieves efficient card adaptation and display, improves the response speed and accuracy of card display requirements, enhances the display efficiency and accuracy of target cards, and improves the maintainability of the code corresponding to card management. Furthermore, by accurately obtaining card data from the data model and combining it with on-demand image loading operations, this method effectively reduces memory usage while ensuring accurate and complete display content, thus improving the performance of the display device and enhancing the display effect of the target card. Attached Figure Description

[0022] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0023] Figure 1 This is a flowchart illustrating a card adaptation and display control method disclosed in an embodiment of the present invention; Figure 2 This is a flowchart illustrating another card adaptation and display control method disclosed in an embodiment of the present invention; Figure 3 This is a schematic diagram of the structure of a card adaptation and display control device disclosed in an embodiment of the present invention; Figure 4 This is a schematic diagram of another card adaptation and display control device disclosed in an embodiment of the present invention; Figure 5 This is a schematic diagram of the structure of a display device disclosed in an embodiment of the present invention; Figure 6 This is a schematic diagram of the structure of a card adaptation and display control system disclosed in an embodiment of the present invention; Figure 7 This is a schematic diagram of the card display effect of a card adaptation and display control method disclosed in an embodiment of the present invention; Figure 8 This is a schematic diagram of the card display effect of another card adaptation and display control method disclosed in an embodiment of the present invention; Figure 9 This is a schematic diagram illustrating the card display effect of another card adaptation and display control method disclosed in this embodiment of the invention. Detailed Implementation

[0024] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0025] The terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this invention are used to distinguish different objects, not to describe a specific order. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, apparatus, product, or end that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products, or ends.

[0026] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of the invention. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.

[0027] This invention discloses a card adaptation and display control method and apparatus, as well as a display device. By accurately determining the target card and its type, standardizing style attributes through a clear target protocol method, and uniformly creating card view instances using a factory method, it achieves efficient card adaptation and display, improves the response speed and accuracy of card display needs, enhances the display efficiency and accuracy of target cards, and improves the maintainability of the code corresponding to card management. Furthermore, by accurately obtaining card data from the data model and combining it with on-demand image loading operations, it effectively reduces memory usage while ensuring accurate and complete display content, thus improving the operating performance of the display device and enhancing the display effect of the target cards. These are described in detail below.

[0028] Example 1 Please see Figure 1 , Figure 1 This is a flowchart illustrating a card adaptation and display control method disclosed in an embodiment of the present invention. Figure 1The described card adaptation and display control method can be applied to a card adaptation and display control device. Optionally, this card adaptation and display control method can also be applied to a display device with an application installed and card display function, wherein the display device is communicatively connected to a network attached storage device, and the display device accesses the network attached storage device through the application. This embodiment of the invention does not limit the scope of the application. Figure 1 As shown, the card adaptation and display control method may include the following operations: 101. When a card display requirement is detected, the target card to be displayed and its corresponding card type are determined by enumerating the card display requirement and the predefined card style strategy.

[0029] In this embodiment of the invention, the card style strategy enumeration includes a variety of predefined card types. Specifically, the predefined card types can be any one of the following: ordinary card, ordinary locatable card, recently played card, recently played locatable card, recently updated card, media library card, and media library locatable card.

[0030] In this embodiment of the invention, the card style strategy enumeration covers a variety of predefined card types, enabling the display device to accurately and quickly determine the cards to be displayed according to different scenarios and needs, avoiding unnecessary card display, improving the response efficiency of card display needs, as well as the display efficiency and accuracy of target cards.

[0031] 102. Based on the card display requirements, determine the target protocol method required to display the target card. The target protocol method encapsulates the style attributes required for card display.

[0032] In this embodiment of the invention, based on step 102, clear and detailed style specifications are provided for subsequent card display, ensuring that cards can be displayed in a unified style that meets design requirements. For example, the target protocol method specifies style attributes such as font size, color, and background pattern of the cards, ensuring consistency in the display of different types of cards.

[0033] In this embodiment of the invention, it should be noted that for each target protocol method, since it encapsulates the style attributes required for card display, such as general style attributes, after the target protocol method is called and implemented in the view layer, the corresponding specific style is returned. If multiple target protocol methods are called, the target card can combine the styles returned by the multiple target protocol methods according to its own state to obtain the final card display content required.

[0034] In this embodiment of the invention, by encapsulating style attributes within protocol methods, adding or removing style attributes can be achieved simply by adding or removing enumeration values, without modifying multiple parts of the view code. This improves code maintainability and scalability. Furthermore, each enumeration value expresses its intent through a method name, making its semantics clear and highly readable.

[0035] 103. Call the preset factory method to create a card view instance for the target card based on the factory method and the card type.

[0036] In this embodiment of the invention, the card view instance follows a unified and predefined card protocol method.

[0037] In this embodiment of the invention, by setting and calling a factory method, the creation of card view instances is separated from business logic, which improves code maintainability and scalability. Simultaneously, adhering to a unified card protocol ensures consistency in data processing and display logic for view instances of different card types, facilitating unified management and development. For example, when a new card type needs to be added, development can be carried out according to the unified protocol method without requiring large-scale modifications to the overall framework.

[0038] 104. Based on the target protocol method, obtain card data that is compatible with the target card from the data model that implements the card protocol method.

[0039] In this embodiment of the invention, the data model is referenced in the card protocol method through generic constraint mechanism and type erasure mechanism, wherein: In scenarios where only a single type of data model is used, a generic constraint mechanism is employed; In scenarios where multiple data models need to be used together, a type erasure mechanism should be adopted.

[0040] In this embodiment of the invention, the card data includes at least the card title and the card image.

[0041] In this embodiment of the invention, the data model is an entity object of the listened card data. In actual application, the entity object can be: UGSVideoArr (video array), UGSCollection (collection), UGEntrenceModel (entry model, placeholder), UGCMediaItem (media item), UGSVideoInfo (video information), etc. The specific entity object can be adjusted according to the actual application situation, and this embodiment of the invention does not limit it.

[0042] In this embodiment of the invention, the use of the generic constraint mechanism and the type erasure mechanism can be selected according to the actual scenario. Optionally, the type erasure mechanism (anyUGCardProtocol) can be used for scenarios that require flexibility, while the generic constraint mechanism / concrete type mechanism (such as UGMediaItem) can be used where type safety and performance are required, thus taking into account flexibility, performance and type safety.

[0043] 105. When a target card is detected to enter the display area of ​​the display device, the card data is loaded with images on demand according to the card display requirements, and the card view instance is rendered according to the style attributes so as to display the card data and the card view instance on the display area.

[0044] In this embodiment of the invention, the on-demand image loading operation is used to control the timing of loading and releasing card data, thereby effectively reducing the memory usage of the display device. For example, when a user browses a large amount of card content, the corresponding image is only loaded when the card enters the display area, and the image resources are released when the card leaves the display area. This avoids the problem of excessive memory consumption caused by loading all images at once, and helps improve the operating performance of the display device.

[0045] In this embodiment of the invention, the card view instance is rendered according to the style attribute, and the card data and the card view instance are displayed on the display area, thus ensuring the display function of the card.

[0046] It is evident that implementation Figure 1 The described card adaptation and display control method achieves efficient card adaptation and display by accurately identifying target cards and their types, standardizing style attributes through a clear target protocol method, and uniformly creating card view instances using a factory method. This improves the response speed and accuracy of card display requirements, enhances the display efficiency and accuracy of target cards, and improves the maintainability of the code corresponding to card management. Furthermore, by accurately obtaining card data from the data model and combining it with on-demand image loading, the method effectively reduces memory usage while ensuring accurate and complete display content, thus improving the performance of display devices and enhancing the display effect of target cards.

[0047] In an optional embodiment, step 105 above, which renders the card view instance according to the style attributes, specifically includes: Call the card protocol method, which has a placeholder method set. Based on the card display requirements, determine whether a placeholder method needs to be implemented when implementing the card protocol method. If it is determined that a placeholder method needs to be implemented when implementing the card protocol method, perform a placeholder rendering operation that matches the placeholder method on the card view instance to render the card view instance as a placeholder card in the placeholder style. When it is determined that a placeholder method does not need to be implemented when implementing a card protocol method, the regular card rendering operation matching the card protocol method is performed on the card view instance to create a regular card corresponding to the card protocol method.

[0048] In this optional embodiment, please refer to Figure 7 , Figure 7 This is a schematic diagram illustrating the card display effect of a card adaptation and display control method disclosed in an embodiment of the present invention. Figure 7 As shown, in actual application, this card protocol method is specifically a predefined protocol / method named UGCardProtocol, which is originally intended for ordinary cards (such as video cards and playlist cards) to provide data such as titles, images, and styles. Now, an optional protocol method, denoted as the placeholder method cardPlaceHolder(), is added to the UGCardProtocol card protocol method. By implementing this placeholder method, a special card (such as...) can be constructed. Figure 7 The "More Content" entry shown is a special card that has no specific content and only serves as a placeholder and clickable entry point.

[0049] In this optional embodiment, compared to the traditional approach of writing a separate set of view components and models for the "More Content" card, this application adopts a method where the "More Content" data model also implements the same UGCardProtocol protocol method. This results in a new placeholder method / placeholder model, cardPlaceHolder(), being added to the UGCardProtocol protocol method. Furthermore, because this placeholder model conforms to the same protocol, the existing view components used for rendering ordinary cards can be directly used to render it without any modification; that is, "reusing existing card views" is achieved.

[0050] In this optional embodiment, an optional method is added to the UGCardProtocol card protocol methods, such as the cardPlaceHolder() placeholder method mentioned above. In practical applications, for ordinary card models: this method is not implemented, or it is made to return false. For placeholder models: this method is implemented, and it is made to return true. Furthermore, for the view layer: during rendering, it is first checked whether the model returns cardPlaceHolder() == true. If it does, it is rendered according to the special style of the "placeholder" (such as a gray background with a "+" icon), thus generating a placeholder card; if not, it is rendered normally as an ordinary card, thus generating a regular card.

[0051] In this optional embodiment, it should be noted that the UGCardProtocol card protocol method inherits from the Identifiable protocol and supports analysis based on different ID types. This has the advantage of maintaining type safety and SwiftUI compatibility while allowing each data model to select the most suitable type based on its data characteristics. Compared to solutions such as mandatory uniform types, custom attributes, associated types, enumeration wrappers, base classes, and default implementations of protocol extensions, the UGCardProtocol card protocol method, which inherits from the Identifiable protocol, is superior in terms of flexibility, performance, type safety, and maintainability, aligning with Swift's protocol-oriented programming and Identifiable design principles.

[0052] As can be seen, in this optional embodiment, by adding an optional placeholder method to the existing card protocol method, special cards and ordinary cards follow the same protocol specification, realizing the reuse of view components and improving code reusability and development efficiency; in addition, the flexible judgment and rendering mechanism can enhance the flexibility and scalability of the system and facilitate the dynamic adjustment of card display effects; furthermore, adopting a unified specification can reduce the system maintenance cost and improve the development and maintenance efficiency of developers.

[0053] In another alternative embodiment, the method further includes: Based on the card display requirements, determine whether a preset progress information method needs to be implemented when implementing the card protocol method. If it is determined that a preset progress information method needs to be implemented when implementing the card protocol method, call the progress information method and obtain the progress information returned by the progress information method. The progress information is a named tuple that includes the progress value, percentage description and duration information. Based on the progress information method and card protocol method, the progress information is updated to the regular card so that the progress information can be displayed on the regular card.

[0054] Please see Figure 8 , Figure 8 This is a schematic diagram illustrating the card display effect of another card adaptation and display control method disclosed in an embodiment of the present invention. Figure 8 As shown, the bottom of the card can display the card's progress percentage (the percentage description is not shown, but it can specifically show 60%) and duration information (referring to the current playback time and total duration, corresponding to...). Figure 8 Information such as 10:50 / 45:34 in the text.

[0055] In this optional embodiment, a mechanism is provided to determine whether a preset progress information method needs to be implemented. This mechanism allows for timely and one-time invocation of the progress information method when needed, retrieving progress information including progress value, percentage description, and duration information. For example, in a video playback application, when a user watches a video, the card can display not only the video's cover and title but also the current playback progress value (e.g., played to the 15th minute), percentage description (e.g., 30% played), and total video duration information (e.g., 50 minutes). By setting this progress information method, multi-dimensional progress information can be flexibly presented when the user needs it, improving the convenience for the user to view and use the target card. When the user does not have a need to view progress information, no unnecessary display is performed, thus avoiding unnecessary code overhead and resource consumption.

[0056] As can be seen, in this optional embodiment, by determining whether a preset progress information method needs to be implemented and obtaining progress information including progress value, percentage description, and duration information, it is updated to the regular card display. By setting this management mechanism for the progress information method, the display dimensions of card information are enriched, which is conducive to improving the user's experience in viewing and using the card; at the same time, the function of flexibly displaying or not displaying the progress information enhances the overall card's flexibility and adaptability; and it also achieves accurate updating and synchronization of progress information, ensuring data consistency.

[0057] In another optional embodiment, the method by which step 101 above determines the target card to be displayed and its corresponding card type based on card display requirements and predefined card style strategies specifically includes: Analyze the card display requirements to obtain the data model type or business scenario identifier corresponding to the card display requirements; Invoke the predefined card style strategy enumeration, and determine the target card to be displayed and its corresponding card type that matches the data model type or business scenario identifier based on the card style strategy enumeration.

[0058] In this optional embodiment, the card style strategy enumeration described above can predefine the correspondence between various data model types or business scenario identifiers and target cards and their types. This allows for matching with the data model types or business scenario identifiers obtained from parsing card display requirements, ensuring fast and accurate matching of target cards and their types that fit the current scenario, thus improving the accuracy of card display.

[0059] In this optional embodiment, based on the card style strategy enumeration, it is possible to avoid large-scale modifications to the core card display logic. Simply add the corresponding matching rules to the card style strategy enumeration to associate the new business scenario identifier or data model type with the corresponding target card and its type. This reduces the difficulty of system maintenance and upgrades, while improving the scalability of the system.

[0060] As can be seen, in this optional embodiment, the data model type or business scenario identifier is obtained by parsing the card display requirements, and the predefined card style strategy enumeration is called for accurate matching to determine the target card and its type. Through this matching mechanism based on card style strategy enumeration, the accuracy of card display is improved, and at the same time, there is no need to make large-scale modifications to the core card display logic. Only the corresponding matching rules need to be added to the card style strategy enumeration, which enhances the flexibility and scalability of the system.

[0061] Example 2 Please see Figure 2 , Figure 2 This is a flowchart illustrating another card adaptation and display control method disclosed in an embodiment of the present invention. Figure 2 The described card adaptation and display control method can be applied to card adaptation and display control devices, and the embodiments of the present invention are not limited thereto. Figure 2 As shown, the card adaptation and display control method may include the following operations: 201. When a card display requirement is detected, the target card to be displayed and its corresponding card type are determined by enumerating the card display requirement and the predefined card style strategy.

[0062] 202. Based on the card display requirements, determine the target protocol method required to display the target card. The target protocol method encapsulates the style attributes required for card display.

[0063] In this embodiment of the invention, the target protocol method includes a first protocol method, or the target protocol method includes a first protocol method and a non-first protocol method; the first protocol method is a protocol method that must be implemented.

[0064] 203. Call the preset factory method to create a card view instance for the target card based on the factory method and the card type.

[0065] In this embodiment of the invention, in practical application, a corresponding card view instance can be created based on the style parameter. Specifically, the factory uses a switch statement to select the corresponding card view implementation class based on the style parameter and instantiates it to obtain the final card view instance.

[0066] In this embodiment of the invention, during subsequent use, the caller only needs to pass in the strategy enumeration value, without needing to concern itself with the specific implementation class, to invoke the card view instance, which conforms to the dependency inversion principle. Furthermore, all card view instances conform to a unified interface method such as the UGCardProtocol protocol, ensuring the consistency of the data source interface. This allows the subsequent data model to adapt to all card styles simply by implementing the unified UGCardProtocol protocol, thus achieving a highly cohesive and loosely coupled architecture design.

[0067] 204. When the target protocol method only includes the first protocol method, according to the first protocol method, the first card data corresponding to the card image and card title is obtained from the data model that implements the card protocol method, and used as the card data adapted to the target card.

[0068] In this embodiment of the invention, the first protocol method may include cardImageURL() for rendering background / card images and cardTitle() for rendering card titles, as methods that must be implemented.

[0069] In this embodiment of the invention, the target protocol method includes only a first protocol method. Based on this first protocol method, the first card data corresponding to the card image and card title can be accurately obtained from the data model implementing the card protocol method. This data acquisition mechanism for the first protocol method is suitable for scenarios with relatively basic and simple requirements for card display content, ensuring that the card can present the core content in a concise and clear manner, meeting the user's need to quickly browse the title and obtain intuitive visual information.

[0070] In this embodiment of the invention, for protocol methods that are not required to be implemented, they are selectively implemented or not implemented, thereby effectively reducing the implementation cost of protocol methods.

[0071] For specific examples from the embodiments of the present invention, please refer to [link / reference]. Figure 9 , Figure 9 This is a schematic diagram illustrating the card display effect of another card adaptation and display control method disclosed in this embodiment of the invention, as shown below. Figure 9As shown, for multiple cards to be displayed, each card may correspond to different resolution information. Specifically, one or more cards require displaying resolution information, while the others do not. For the other cards, the display of resolution information can be set as optional. That is, for the other cards, if the protocol method corresponding to the resolution information (corresponding to the non-first protocol method mentioned above) is not implemented, then no protocol method is implemented, and an empty view is provided by default, without rendering the resolution information. For specific display effects, please refer to [reference needed]. Figure 9 The content in the upper right corner box of each card is labeled with 4K or 1080P resolution information on some cards, while other cards do not have any style labeling for resolution information.

[0072] 205. When the target protocol method includes the first protocol method and non-first protocol methods, according to the first protocol method, the first card data corresponding to the card image and card title is obtained from the data model implementing the card protocol method.

[0073] 206. According to the non-first protocol method, obtain the second card data corresponding to the card progress and card style from the data model.

[0074] 207. Determine the first card data and the second card data as card data that are compatible with the target card.

[0075] In this embodiment of the invention, the image type of the card image is at least matched with the aspect ratio of the target card, and the image type is either a horizontal image or a vertical image.

[0076] In this embodiment of the invention, when the target protocol method includes a first protocol method and a non-first protocol method, the first card data corresponding to the first protocol method and the second card data corresponding to the non-first protocol method can be obtained in an orderly manner, thereby providing users with more comprehensive, richer and more personalized card content.

[0077] In this embodiment of the invention, it is explicitly stipulated that the image type of the card image must at least match the aspect ratio of the target card, and the image type must be either a landscape or portrait image. That is, an intelligent adaptation mechanism is set up for the card image to be displayed, which can effectively avoid problems such as image distortion and stretching caused by the mismatch between the image aspect ratio and the card, ensuring that the card image maintains a suitable visual proportion and clarity when displayed.

[0078] In this embodiment of the invention, optionally, when obtaining a card image, a 16:9 landscape image is output by default. If a portrait image is required, a fixed enumeration of portrait images or a specific image ratio can be passed in. Subsequently, the data model can select and load images of different ratios according to the specific ratio. Optionally, if no image matching the specific ratio is found in the data model, or if the currently passed ratio is not supported, the default image is used as a fallback.

[0079] 208. When a target card is detected to enter the display area of ​​the display device, the card data is loaded with images on demand according to the card display requirements, and the card view instance is rendered according to the style attributes so as to display the card data and the card view instance on the display area.

[0080] For further descriptions of steps 201-203 and 208 in this embodiment of the invention, please refer to the other specific descriptions of steps 101-103 and 105 in Embodiment 1. These descriptions will not be repeated in this embodiment of the invention.

[0081] It is evident that implementation Figure 2 The described card adaptation and display control method, through a flexible combination of the first protocol method (which must be implemented) and non-first protocol methods, achieves accurate acquisition of card data for target card adaptation, meeting the diverse needs of card display in different scenarios. That is, it improves the accuracy of card data acquisition while also improving the accuracy and flexibility of card display. In addition, it also specifies the matching of card image type and aspect ratio, further improving the accuracy and reliability of image display.

[0082] In an optional embodiment, the first protocol method includes a single-image acquisition method and a multi-image acquisition method; The specific methods for obtaining the first card data corresponding to the card image and card title from the data model implementing the card protocol method in step 204 or step 205 above, according to the first protocol method, include: Based on the card display requirements, determine the image display requirements for the card view instance. These requirements may be for a single image or multiple images. When it is determined that the image display requirement for the card view instance is a multi-image display requirement, the multi-image acquisition method is called, and the data of the first card corresponding to the multi-image display requirement and the multi-card title corresponding to the card protocol method are obtained from the data model of the card protocol method according to the multi-image acquisition method. When it is determined that the image display requirement for the card view instance is a single image display requirement, the single image retrieval method is called, and the card image and the first card data corresponding to the card title are retrieved from the data model that implements the card protocol method according to the single image retrieval method. When the image display requirement is a single image display, the multi-image retrieval method returns an empty array by default.

[0083] In this optional embodiment, a matching response mechanism is set for different image display requirements: a multi-image acquisition method and a single-image acquisition method, thereby ensuring that images can be accurately acquired according to the actual image display requirements, and improving the accuracy and reliability of image acquisition.

[0084] In this optional embodiment, for scenarios requiring single-image display, the multi-image acquisition method returns an empty array by default. This design avoids unnecessary data queries and processing when multiple image data are not needed, thus reducing the waste of system resources.

[0085] In this optional embodiment, compared to solutions that only provide multiple image acquisition methods, only provide single image acquisition methods, enumeration differentiation, splitting protocols, optional arrays, configuration objects, associated types, and view layer judgment, this approach that provides both single image acquisition methods and multiple image acquisition methods, and allows the view layer to adaptively select methods according to the scenario, improves the flexibility, accuracy, and reliability of image acquisition.

[0086] As can be seen, in this optional embodiment, by distinguishing between single-image and multi-image display requirements and calling single-image acquisition methods and multi-image acquisition methods respectively to accurately obtain card data, the flexibility of card display is improved; at the same time, the system's resource utilization is optimized, the development complexity is reduced, and the system's compatibility and scalability are enhanced.

[0087] Example 3 Please see Figure 3 , Figure 3 This is a schematic diagram of a card adaptation and display control device disclosed in an embodiment of the present invention. The card adaptation and display control device can be a card adaptation and display control terminal, device, system, or server. The server can be a local server, a remote server, or a cloud server (also known as a cloud-based server). When the server is not a cloud server, it can communicate with the cloud server; this embodiment of the present invention does not impose limitations. Optionally, the device is applied to a display device with an application installed and card display functionality, and the display device is communicatively connected to a network attached storage device. The display device accesses the network attached storage device through the application; this embodiment of the present invention does not impose limitations. Figure 3 As shown, the card adapter and display control device may include a determination module 301, an instance creation module 302, a data acquisition module 303, and a display control module 304, wherein: The determination module 301 is used to determine the target card to be displayed and its corresponding card type based on the card display requirement and the predefined card style strategy enumeration when a card display requirement is detected; the card style strategy enumeration includes a variety of predefined card types.

[0088] The determination module 301 is also used to determine the target protocol method required to display the target card according to the card display requirements. The target protocol method encapsulates the style attributes required for card display.

[0089] The instance creation module 302 is used to call a preset factory method to create a card view instance for the target card based on the factory method and the card type; the card view instance follows a unified and predefined card protocol method.

[0090] The data acquisition module 303 is used to acquire card data that is compatible with the target card from the data model that implements the card protocol method, according to the target protocol method; the card data includes at least the card title and card image.

[0091] In this embodiment of the invention, the data model is referenced in the card protocol method through generic constraint mechanism and type erasure mechanism, wherein: In scenarios where only a single type of data model is used, a generic constraint mechanism is employed; In scenarios where multiple data models need to be used together, a type erasure mechanism should be adopted.

[0092] The display control module 304 is used to perform an on-demand image loading operation on the card data according to the card display requirements when the target card is detected to enter the display area of ​​the display device, and to render the card view instance according to the style attributes so as to display the card data and the card view instance on the display area; the on-demand image loading operation is used to control the timing of loading and releasing card data.

[0093] It is evident that implementation Figure 3 The described card adaptation and display control device achieves efficient card adaptation and display by accurately identifying target cards and their types, standardizing style attributes through a clear target protocol method, and uniformly creating card view instances using a factory method. This improves the response speed and accuracy of card display requirements, enhances the display efficiency and accuracy of target cards, and improves the maintainability of the code corresponding to card management. Furthermore, by accurately acquiring card data from the data model and combining it with on-demand image loading, it effectively reduces memory usage while ensuring accurate and complete display content, thus improving the performance of the display device and enhancing the display effect of the target cards.

[0094] In an optional embodiment, the display control module 304 renders the card view instance according to the style attributes in the following specific ways: Call the card protocol method, which has a placeholder method set. Based on the card display requirements, determine whether a placeholder method needs to be implemented when implementing the card protocol method. If it is determined that a placeholder method needs to be implemented when implementing the card protocol method, perform a placeholder rendering operation that matches the placeholder method on the card view instance to render the card view instance as a placeholder card in the placeholder style. When it is determined that a placeholder method does not need to be implemented when implementing a card protocol method, the regular card rendering operation matching the card protocol method is performed on the card view instance to create a regular card corresponding to the card protocol method.

[0095] As can be seen, in this optional embodiment, by adding an optional placeholder method to the existing card protocol method, special cards and ordinary cards follow the same protocol specification, realizing the reuse of view components and improving code reusability and development efficiency; in addition, the flexible judgment and rendering mechanism can enhance the flexibility and scalability of the system and facilitate the dynamic adjustment of card display effects; furthermore, adopting a unified specification can reduce the system maintenance cost and improve the development and maintenance efficiency of developers.

[0096] In another alternative embodiment, please refer to Figure 4 , Figure 4 This is a schematic diagram of the structure of a card adaptation and display control device disclosed in an embodiment of the present invention. Figure 4 As shown, the device also includes a judgment module 305, wherein: The judgment module 305 is used to determine whether a preset progress information method needs to be implemented when implementing the card protocol method, based on the card display requirements. The display control module 304 is also used to call the progress information method when the judgment module 305 determines that a preset progress information method needs to be implemented when implementing the card protocol method, and to obtain the progress information returned by the progress information method. The progress information is a named tuple including progress value, percentage description and duration information. The display control module 304 is also used to update the progress information to the regular card according to the progress information method and the card protocol method, so as to display the progress information on the regular card.

[0097] As can be seen, in this optional embodiment, by determining whether a preset progress information method needs to be implemented and obtaining progress information including progress value, percentage description, and duration information, it is updated to the regular card display. By setting this management mechanism for the progress information method, the display dimensions of card information are enriched, which is conducive to improving the user's experience in viewing and using the card; at the same time, the function of flexibly displaying or not displaying the progress information enhances the overall card's flexibility and adaptability; and it also achieves accurate updating and synchronization of progress information, ensuring data consistency.

[0098] In another optional embodiment, the method by which the determining module 301 determines the target card to be displayed and its corresponding card type based on card display requirements and predefined card style strategies specifically includes: Analyze the card display requirements to obtain the data model type or business scenario identifier corresponding to the card display requirements; Invoke the predefined card style strategy enumeration, and determine the target card to be displayed and its corresponding card type that matches the data model type or business scenario identifier based on the card style strategy enumeration.

[0099] As can be seen, in this optional embodiment, the data model type or business scenario identifier is obtained by parsing the card display requirements, and the predefined card style strategy enumeration is called for accurate matching to determine the target card and its type. Through this matching mechanism based on card style strategy enumeration, the accuracy of card display is improved, and at the same time, there is no need to make large-scale modifications to the core card display logic. Only the corresponding matching rules need to be added to the card style strategy enumeration, which enhances the flexibility and scalability of the system.

[0100] In another optional embodiment, the target protocol method includes a first protocol method, or the target protocol method includes a first protocol method and a non-first protocol method; the first protocol method is a protocol method that must be implemented. The data acquisition module 303, according to the target protocol method, obtains card data adapted to the target card from the data model implementing the card protocol method in the following specific ways: When the target protocol method only includes the first protocol method, the first card data corresponding to the card image and card title is obtained from the data model that implements the card protocol method according to the first protocol method, and used as the card data adapted to the target card; When the target protocol method includes a first protocol method and a non-first protocol method, according to the first protocol method, the first card data corresponding to the card image and card title is obtained from the data model that implements the card protocol method. At the same time, according to the non-first protocol method, the second card data corresponding to the card progress and card style is obtained from the data model. The first card data and the second card data are determined as card data that are adapted to the target card. The image type of the card must at least match the aspect ratio of the target card, and the image type can be either a landscape image or a portrait image.

[0101] As can be seen, in this optional embodiment, by flexibly combining the first protocol method (which must be implemented) and non-first protocol methods, accurate acquisition of card data adapted to the target card is achieved, meeting the diverse needs of card display in different scenarios. That is, while improving the accuracy of card data acquisition, it can also improve the accuracy and flexibility of card display. In addition, the matching of card image type and aspect ratio is specified, which further improves the accuracy and reliability of image display.

[0102] In yet another optional embodiment, the first protocol method includes a single-image acquisition method and a multi-image acquisition method; The data acquisition module 303, according to the first protocol method, obtains the first card data corresponding to the card image and card title from the data model implementing the card protocol method in the following specific ways: Based on the card display requirements, determine the image display requirements for the card view instance. These requirements may be for a single image or multiple images. When it is determined that the image display requirement for the card view instance is a multi-image display requirement, the multi-image acquisition method is called, and the data of the first card corresponding to the multi-image display requirement and the multi-card title corresponding to the card protocol method are obtained from the data model of the card protocol method according to the multi-image acquisition method. When it is determined that the image display requirement for the card view instance is a single image display requirement, the single image retrieval method is called, and the card image and the first card data corresponding to the card title are retrieved from the data model that implements the card protocol method according to the single image retrieval method. When the image display requirement is a single image display, the multi-image retrieval method returns an empty array by default.

[0103] As can be seen, in this optional embodiment, by distinguishing between single-image and multi-image display requirements and calling single-image acquisition methods and multi-image acquisition methods respectively to accurately obtain card data, the flexibility of card display is improved; at the same time, the system's resource utilization is optimized, the development complexity is reduced, and the system's compatibility and scalability are enhanced.

[0104] Example 4 Please see Figure 5 , Figure 5 This is a schematic diagram of the structure of a display device disclosed in an embodiment of the present invention, such as... Figure 5 As shown, the display device has an application installed and a card display function; the display device is communicatively connected to a network attached storage device; the display device accesses the network attached storage device through the application. The display device integrates a card adaptation and display control device as described in any one of Embodiment 3 of the present invention, and is used to perform some or all of the steps in the card adaptation and display control method as described in any one of Embodiment 1 or Embodiment 2 of the present invention. The display device is also used to load target media data corresponding to the video display requirement from the network-attached storage device according to the application after detecting the video display requirement, and to display and play the target media data on the display device.

[0105] Example 5 Please see Figure 6 , Figure 6 This invention discloses a card adaptation and display control system, such as... Figure 6 As shown, the system is applied in a display device, and the system performs a demand response operation on the card display demand triggered by the display device in accordance with any one of the card adaptation and display control methods in Embodiment 1 or the first aspect of Embodiment 2 of the present invention.

[0106] The apparatus and system embodiments described above are merely illustrative. The modules described as separate components may or may not be physically separate. The components shown as modules may or may not be physical modules; that is, they may be located in one place or distributed across multiple network modules. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.

[0107] Through the detailed description of the above embodiments, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, including read-only memory (ROM), random access memory (RAM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), one-time programmable read-only memory (OTPROM), electrically-Erasable Programmable Read-Only Memory (EEPROM), compact disc read-only memory (CD-ROM) or other optical disc storage, disk storage, magnetic tape storage, or any other computer-readable medium that can be used to carry or store data.

[0108] Finally, it should be noted that the above embodiments are merely preferred embodiments of the present invention and are only used to illustrate the technical solutions of the present invention, not to limit them. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A card adaptation and display control method, characterized in that, The method is applied to a display device with an installed application and card display function, wherein the display device is communicatively connected to a network attached storage device, and the display device accesses the network attached storage device through the application. The method includes: When a card display requirement is detected, the target card to be displayed and its corresponding card type are determined based on the card display requirement and a predefined card style strategy enumeration; the card style strategy enumeration includes a variety of predefined card types. Based on the card display requirements, a target protocol method is determined for displaying the target card. The target protocol method encapsulates the style attributes required for card display. A preset factory method is invoked to create a card view instance for the target card based on the factory method and the card type; the card view instance follows a unified and predefined card protocol method. According to the target protocol method, card data adapted to the target card is obtained from the data model implementing the card protocol method; the card data includes at least a card title and a card image; When the target card is detected to have entered the display area of ​​the display device, an on-demand image loading operation is performed on the card data according to the card display requirements, and the card view instance is rendered according to the style attributes to display the card data and the card view instance on the display area; the on-demand image loading operation is used to control the timing of loading and releasing the card data.

2. The card adaptation and display control method according to claim 1, characterized in that, The step of rendering the card view instance according to the style attribute includes: The card protocol method is invoked, and the card protocol method has a placeholder method set; Based on the card display requirements, determine whether the placeholder method needs to be implemented when implementing the card protocol method. If it is determined that the placeholder method needs to be implemented when implementing the card protocol method, perform a placeholder rendering operation that matches the placeholder method on the card view instance to render the card view instance as a placeholder card in the placeholder style. When it is determined that the placeholder method does not need to be implemented when implementing the card protocol method, a regular card rendering operation matching the card protocol method is performed on the card view instance to create a regular card corresponding to the card protocol method.

3. The card adaptation and display control method according to claim 2, characterized in that, The method further includes: Based on the card display requirements, it is determined whether a preset progress information method needs to be implemented when implementing the card protocol method. If it is determined that a preset progress information method needs to be implemented when implementing the card protocol method, the progress information method is called to obtain the progress information returned by the progress information method. The progress information is a named tuple including progress value, percentage description and duration information. According to the progress information method and the card protocol method, the progress information is updated to the regular card so as to display the progress information on the regular card.

4. The card adaptation and display control method according to any one of claims 1-3, characterized in that, The step of determining the target card to be displayed and its corresponding card type based on the card display requirements and predefined card style strategies includes: Analyze the card display requirements to obtain the data model type or business scenario identifier corresponding to the card display requirements; Invoke the predefined card style strategy enumeration, and determine the target card to be displayed and its corresponding card type that matches the data model type or business scenario identifier based on the card style strategy enumeration.

5. The card adaptation and display control method according to any one of claims 1-3, characterized in that, The target protocol method includes a first protocol method, or the target protocol method includes a first protocol method and a non-first protocol method; the first protocol method is a protocol method that must be implemented. The step of obtaining card data adapted to the target card from the data model implementing the card protocol method according to the target protocol method includes: When the target protocol method only includes the first protocol method, according to the first protocol method, the first card data corresponding to the card image and card title is obtained from the data model that implements the card protocol method, and used as the card data adapted to the target card; When the target protocol method includes the first protocol method and the non-first protocol method, according to the first protocol method, first card data corresponding to the card image and card title is obtained from the data model implementing the card protocol method. At the same time, according to the non-first protocol method, second card data corresponding to the card progress and card style is obtained from the data model. The first card data and the second card data are determined as card data adapted to the target card. The image type of the card image must at least match the aspect ratio of the target card, and the image type can be a horizontal image or a vertical image.

6. The card adaptation and display control method according to claim 5, characterized in that, The first protocol method includes a single-image acquisition method and a multi-image acquisition method; The step of obtaining first card data corresponding to the card image and card title from the data model implementing the card protocol method according to the first protocol method includes: Based on the card display requirements, determine the image display requirements for the card view instance. These image display requirements may be either single-image display requirements or multiple-image display requirements. When it is determined that the image display requirement for the card view instance is the multi-image display requirement, the multi-image acquisition method is called, and the first card data corresponding to the multiple card images and multiple card titles corresponding to the multi-image display requirement is obtained from the data model implementing the card protocol method according to the multi-image acquisition method. When it is determined that the image display requirement for the card view instance is the single image display requirement, the single image acquisition method is called, and the card image and the first card data corresponding to the card title corresponding to the single image display requirement are obtained from the data model implementing the card protocol method according to the single image acquisition method. When the image display requirement is the same as the single image display requirement, the multi-image acquisition method returns an empty array by default.

7. The card adaptation and display control method according to claim 1, 2, 3, or 6, characterized in that, The data model is referenced in the card protocol method through generic constraint mechanism and type erasure mechanism, wherein: In scenarios where only a single type of data model is used, the generic constraint mechanism is employed; In scenarios where multiple types of the data model need to be used together, the type erasure mechanism is employed.

8. A card adapter and display control device, characterized in that, The device is used in a display device with an application installed and card display function, and the display device is communicatively connected to a network-attached storage device. The display device accesses the network-attached storage device through the application. The device includes: The determination module is used to determine the target card to be displayed and its corresponding card type based on the card display requirement and a predefined card style strategy enumeration when a card display requirement is detected; the card style strategy enumeration includes a variety of predefined card types. The determining module is further configured to determine the target protocol method required to display the target card based on the card display requirements, wherein the target protocol method encapsulates the style attributes required for card display; The instance creation module is used to call a preset factory method to create a card view instance for the target card according to the factory method and the card type; the card view instance follows a unified and predefined card protocol method; The data acquisition module is used to acquire card data adapted to the target card from the data model implementing the card protocol method according to the target protocol method; the card data includes at least the card title and card image; The display control module is used to, when the target card is detected to enter the display area of ​​the display device, perform an on-demand image loading operation on the card data according to the card display requirements, and render the card view instance according to the style attributes, so as to display the card data and the card view instance on the display area; the on-demand image loading operation is used to control the timing of loading and releasing the card data.

9. A display device, characterized in that, The display device has an application installed and a card display function; the display device is communicatively connected to a network attached storage device; the display device accesses the network attached storage device through the application. The display device integrates the card adaptation and display control device as described in claim 8, and is used to perform the card adaptation and display control method as described in any one of claims 1-7; The display device is also configured to, after detecting a video display requirement, load target media data corresponding to the video display requirement from the network-attached storage device according to the application, and display and play the target media data on the display device.

10. A card adaptation and display control system, characterized in that, The system is applied to a display device, and the system performs a demand response operation on the card display demand triggered by the display device in accordance with the card adaptation and display control method as described in any one of claims 1-7.