Card template generation method, content display card display method and terminal

By loading card components from the card component library and setting card content to generate content display card templates, it solves the problems of single card design and low utilization in different business scenarios, and achieves efficient development and efficient utilization of card components.

CN112732137BActive Publication Date: 2024-09-27BIGO TECH PTE LTD
View PDF 10 Cites 0 Cited by

Patent Information

Application Number
CN202110012602.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-01-06
Publication Date
2024-09-27
Estimated Expiration
2041-01-06

AI Technical Summary

Technical Problem

Existing applications require separate design and development of cards in different business scenarios, resulting in high development costs and low card utilization.

Method used

By loading card components from the card component library, setting card content according to template generation instructions, and generating content display card templates, card component reuse and data decoupling are achieved.

Benefits of technology

It improves application development efficiency, reduces development costs, and improves card component utilization and card display efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112732137B
    Figure CN112732137B
Patent Text Reader

Abstract

The embodiment of the present application discloses a card template generation method, a content display card display method and a terminal, and belongs to the field of computer technology. The method includes: based on the component style indicated by the template generation instruction, loading the card component from the card component library; setting the card content corresponding to the card component according to the data conversion relationship contained in the template generation instruction; assembling the set card component according to the template generation instruction, and generating a card template for the content display card. In response to the card display instruction, a card component is created according to the card template in the current application scenario; the received content to be displayed is converted into the card content corresponding to the card component; the card component is assembled according to the card format indicated by the card template, and the content display card is generated and displayed. The development efficiency of the application is improved, the development cost is reduced, and the decoupling of the card display data and the business data is realized, and the utilization rate of the card component is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of computer technology, and in particular to a method for generating a card template, a method for displaying a content display card, and a terminal. Background Art

[0002] Currently, in most applications with information push functions, such as social, question-and-answer, video, and communication applications, information is displayed in the form of an information stream (Feed stream) on the interface. The Feed stream consists of message cards. Usually, one post or one message corresponds to one card. The card contains the message content, publisher information, and operation controls, etc., for users to browse and like, forward, comment on the message content, etc.

[0003] In the related art, different business scenarios usually exist in the same application, such as a personal homepage, a contact dynamic page, and a content recommendation page of the application. There are differences between the cards corresponding to these business scenarios. For example, each card in the album page only contains pictures and videos, while the card in the contact dynamic page contains message content, contact information, and operation controls. During the application development process, developers will design and generate separate cards for different business scenarios, which leads to high application development costs, relatively single application scenarios of cards, and low utilization rates. Summary of the invention

[0004] The embodiment of the present application provides a card template generation method, a content display card display method and a terminal. The technical solution is as follows:

[0005] In one aspect, the present application provides a method for generating a card template, the method comprising:

[0006] Based on the component style indicated by the template generation instruction, a card component is loaded from a card component library, wherein the card component is used to form a content display card, and different card components are used to display card contents for different purposes;

[0007] According to the data conversion relationship contained in the template generation instruction, the card content corresponding to the card component is set, wherein the data conversion relationship is a conversion relationship between business data and card display data, the business data is data corresponding to the card content, and the card display data is data required to display the card component;

[0008] The card component that has been set up is assembled according to the template generation instruction to generate a card template for the content display card.

[0009] On the other hand, the present application provides a method for displaying a content display card, the method comprising:

[0010] In response to the card display instruction, a card component is created according to the card template in the current application scenario, wherein the content display card is composed of at least one of the card components, and different card components are used to display card contents for different purposes;

[0011] Convert the received content to be displayed into the card content corresponding to the card component;

[0012] The card component is assembled according to the card format indicated by the card template, and the content display card is generated and displayed.

[0013] On the other hand, an embodiment of the present application provides a device for generating a card template, the method comprising:

[0014] A loading module, used to load card components from a card component library based on the component style indicated by the template generation instruction, wherein the card components are used to form content display cards, and different card components are used to display card contents for different purposes;

[0015] A first setting module, used to set the card content corresponding to the card component according to the data conversion relationship contained in the template generation instruction, wherein the data conversion relationship is a conversion relationship between business data and card display data, the business data is data corresponding to the card content, and the card display data is data required to display the card component;

[0016] The first generating module is used to assemble the card component that has been set up according to the template generating instruction, and generate a card template of the content display card.

[0017] On the other hand, an embodiment of the present application provides a display device for a content display card, the device comprising:

[0018] A second generating module is used to create a card component according to a card template in a current application scenario in response to a card display instruction, wherein a content display card is composed of at least one of the card components, and different card components are used to display card contents for different purposes;

[0019] A conversion module, used for converting the received content to be displayed into the card content corresponding to the card component;

[0020] The display module is used to assemble the card component according to the card format indicated by the card template, and generate and display the content display card.

[0021] On the other hand, an embodiment of the present application discloses a terminal, which includes a processor and a memory, wherein the memory stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set are loaded and executed by the processor to implement the method for generating a card template as described in the above aspects, or the method for displaying a content display card.

[0022] On the other hand, an embodiment of the present application discloses a computer-readable storage medium, in which at least one instruction, at least one program, a code set or an instruction set is stored. The at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by a processor to implement the method for generating a card template as described in the above aspects, or the method for displaying a content display card.

[0023] According to one aspect of the present application, a computer program product or a computer program is provided, the computer program product or the computer program including computer instructions, the computer instructions being stored in a computer-readable storage medium. A processor of a terminal reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the terminal executes the card template generation method provided in various optional implementations of the above aspects, or the content display card display method.

[0024] The beneficial effects of the technical solution provided by the embodiments of the present application include at least:

[0025] In the embodiment of the present application, the card of the content display card is designed in an elemental manner, so that the content display card is composed of card components. When generating a card template, the required card components are loaded from the card component library, and the corresponding card content is set according to the card display data of each card component. For applications that include different application scenarios, there is no need to develop and design content display cards separately for each application scenario, which improves the development efficiency of the application and reduces the development cost. The card display data and business data are separated, and the card display data and business data are decoupled while the data is decoupled from the content display card, thereby improving the utilization rate of the card components.

[0026] During the application stage, each card component is created based on the card template corresponding to the current application scenario and the corresponding card content is displayed, thereby generating and displaying the content display card. When the same card component exists in the card templates corresponding to different application scenarios, the storage space required for loading the card can be reduced, thereby improving the card display efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] Figure 1 is a schematic diagram of content display cards in two application scenarios provided by an exemplary embodiment of the present application;

[0028] Figure 2 is a flowchart of a method for generating a card template provided by an exemplary embodiment of the present application;

[0029] Figure 3 is a schematic diagram of a card assembly provided by an exemplary embodiment of the present application;

[0030] Figure 4 is a flowchart of a method for generating a card template provided by another exemplary embodiment of the present application;

[0031] Figure 5 is a flowchart of a method for generating a card template provided by another exemplary embodiment of the present application;

[0032] Figure 6 It is a schematic diagram of the relationship between classes in the program code corresponding to the card component provided by an exemplary embodiment of the present application;

[0033] Figure 7 is a flow chart of a method for displaying a content display card provided by an exemplary embodiment of the present application;

[0034] Figure 8 is a flowchart of a method for displaying a content display card provided by another exemplary embodiment of the present application;

[0035] Fig. 9 is a structural block diagram of a card template generation device provided by an exemplary embodiment of the present application;

[0036] Fig.10 It is a structural block diagram of a display device for content display cards provided by an exemplary embodiment of the present application. DETAILED DESCRIPTION

[0037] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.

[0038] The term "multiple" as used herein refers to two or more than two. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the related objects are in an "or" relationship.

[0039] At present, the information in most applications is displayed in the form of information feed streams on the interface. The feed stream consists of message cards, which contain message content, publisher information, and operation controls, etc., for users to browse and like, forward, comment on the message content. In related technologies, different business scenarios usually exist in the same application, such as a personal homepage, a contact dynamic page, and an application content recommendation page. Figure 1 As shown, for the same video content, when the content sender belongs to the user's contact, the terminal displays the video content with the content display card 101 on the left side of the contact page. At the same time, the terminal can also display the video content with the content display card 102 on the right side of the content recommendation page. In addition to displaying the video content and related text content, the content display card 101 also displays the user information of the content sender, and corresponding interactive controls, etc. The content display card 102 only displays the video content and the associated text content, the number of viewers, and other information. In the process of application development, developers will design and generate separate cards for different business scenarios, which leads to high application development costs, relatively single application scenarios of cards, and low utilization.

[0040] In order to solve the above technical problems, the embodiments of the present application provide a method for generating a card template and a method for displaying a content display card, wherein the content display card is composed of card components. The business party can select the required card components according to actual needs to generate a card template. There is no need to design and develop a complete content display card separately for each business scenario, which can improve the development efficiency of the application and reduce development costs.

[0041] Figure 2 A flowchart of a method for generating a card template provided by an exemplary embodiment of the present application is shown. This embodiment is described by taking the method used in a terminal with an application development function as an example, and the method includes the following steps:

[0042] Step 201, based on the component style indicated by the template generation instruction, load the card component from the card component library, the card component is used to compose the content display card, and different card components are used to display card content for different purposes.

[0043] Among them, the card component library contains pre-designed and developed card components. In one possible implementation, developers design and develop card components for displaying card content for different purposes based on the characteristics of content display cards in various application scenarios, so that card components can be combined to obtain content display cards. The card component library can be provided to business parties, namely application developers, for developing applications that display content in the form of card feed streams. When the application contains different application scenarios and the styles of content display cards in different application scenarios are different, developers can select appropriate card components from the card component library based on actual needs, without having to design a complete set of content display cards for each application scenario.

[0044] Optionally, each card component in the card component library is stored separately, or is stored by category according to the type of the card component, or is stored in sets according to preset content display cards, etc.

[0045] For example, Figure 3 As shown, the card component library includes five card components, wherein the header area component 301 is used to display relevant information of the content sender (such as avatar, nickname, etc.), the text area component 302 is used to display the text content of the post, that is, the text content entered by the content sender, the video area component 303 is used to display the video content sent by the content sender, the additional information area component 304 is used to display the theme of the post shown in the figure, and the interactive area component 305 is used to display the user interface (UI) controls attached to the post, such as like controls, comment controls, forwarding controls, etc. When the terminal receives a template generation instruction to generate a card template composed of the above five card components, the terminal loads the above five card components from the card component library.

[0046] Illustratively, the terminal runs a computer code file for developing an application, and during the running process, obtains a template generation instruction.

[0047] Step 202, according to the data conversion relationship contained in the template generation instruction, set the card content corresponding to the card component. The data conversion relationship is the conversion relationship between business data and card display data. The business data is the data corresponding to the card content, and the card display data is the data required to display the card component.

[0048] Since the card components in the card component library are reusable templates and can be applied to different application scenarios and application development, developers need to decouple the card display data of the card components and the business data corresponding to the application. When the terminal generates a card template, it only needs to convert the business data corresponding to the application scenario into card display data based on the data conversion relationship indicated by the template generation instruction, thereby improving the utilization rate of the card components.

[0049] For example, after the terminal creates a card component for displaying post content, it determines from the template generation instruction that the card component is used to display the video uploaded by the content sender in the target application scenario, thereby determining the video uploaded by the content sender as the card content corresponding to the card component.

[0050] Step 203: assemble the set card component according to the template generation instruction to generate a card template for the content display card.

[0051] Optionally, for the development of a card template in a certain application scenario, the terminal can generate and add card components in sequence based on the card format indicated by the template generation instruction. When the creation and data conversion of the last card component are completed, the terminal has generated a card template for the content display card in the application scenario; or, the terminal can simultaneously and concurrently create multiple card components indicated by the template generation instruction. After all the card components are created, the terminal can assemble the set card components based on the component size, arrangement order and other information indicated by the template generation instruction to generate a card template for the content display card. The embodiments of the present application are not limited to this.

[0052] Schematically, the terminal sorts the header area component 301, the text area component 302, the video area component 303, the additional information area component 304 and the interactive area component 305 from top to bottom, and determines the size of each component, thereby generating Figure 3 The card template for the content display card shown.

[0053] To summarize, in the embodiments of the present application, the card of the content display card is designed in an elemental manner so that the content display card is composed of card components. When generating a card template, the required card components are loaded from the card component library, and the corresponding card content is set according to the card display data of each card component. For applications that include different application scenarios, there is no need to develop and design content display cards separately for each application scenario, which improves the development efficiency of the application and reduces development costs. The card display data and business data are separated, and the decoupling of the card display data and the business data is achieved while decoupling the data from the content display card, thereby improving the utilization rate of the card components.

[0054] Figure 4 A flowchart of a method for generating a card template provided by another exemplary embodiment of the present application is shown. This embodiment is described by taking the method used in a terminal with an application development function as an example, and the method includes the following steps:

[0055] Step 401, based on the component style indicated by the template generation instruction, load the card component from the card component library, the card component is used to compose the content display card, and different card components are used to display card content for different purposes.

[0056] The specific implementation of step 401 can refer to step 201 in the above embodiment, and the embodiment of the present application will not be repeated here.

[0057] Step 402: Based on the data conversion method included in the template generation instruction, the business data corresponding to the card component is converted into component display data through the data conversion interface.

[0058] Since the card components in the card component library are used for card design and development in various application scenarios, they do not set business data. When the business party develops content display cards, they can select card components according to actual needs and set specific business data for them. In one possible implementation, the terminal converts the business data into component display data through a data conversion interface.

[0059] Schematically, the card component in the program code belongs to the card display class (CardView), which includes the head display class (HeaderView), the bottom display class (BottomView), etc. CardView and each UI element that needs to be displayed in the card component belong to the common display base class (BaseCommonView). Base CommonView contains parameters for indicating business data, that is, original data (originData). The terminal converts originData into component display data, where the component display data belongs to the common display data base class (BaseCommonViewData) in the program code.

[0060] In a possible implementation, the data conversion interface (CardViewDataConvertProcessor) includes a data conversion function (Convert). The developer writes the conversion logic for converting the business data into the component display data in the data conversion function in advance according to the requirements. When the terminal executes the template generation instruction, the terminal converts the business data into the component display data according to the conversion logic. Step 402 includes the following steps:

[0061] Step 402a, obtaining the conversion logic for converting the business data into component display data through the data conversion function in the data conversion interface.

[0062] In a possible implementation, Convert contains the conversion logic from business data to the data class required by the card component, and each card component has a corresponding Convert. For example, the Convert of the header component specifies that the business data including the avatar and nickname of the content sender is converted into component display data, and the Convert of the bottom component specifies that the business data including the UI control of likes, reposts, and comments is converted into component display data.

[0063] Step 402b, using a data conversion method, converts the business data corresponding to the card component into component display data according to the conversion logic.

[0064] After the terminal determines the conversion logic, the data conversion is completed using the data conversion method (registerConvertProcessor) corresponding to the card component, that is, according to the above conversion logic, the business data corresponding to the card component is converted into component display data.

[0065] Step 403, based on the template generation instruction, an update flag (updateFlag) is set for the card component, and the update flag is used to indicate the update method of the card content in the card component.

[0066] In a possible implementation, the terminal sets updateFlag for the card component based on the template generation instruction, so that in the subsequent application stage, the user terminal can determine whether each component is updated and the update method according to the updateFlag.

[0067] Illustratively, the terminal uses the data update and conversion method (updateDataWithConvert) corresponding to the card component to set updateFlag for the card component to implement the update of the UI content.

[0068] Step 404, based on the template generation instruction, set the preset embedding point for the card component, and the preset embedding point is used to indicate the trigger event corresponding to the trigger operation.

[0069] Since the card content or controls in the card component are triggerable UI elements when the content display card is actually displayed, the user can trigger the corresponding event by triggering the card component or the controls in the card component. For example, when the terminal receives a trigger operation on the comment control, the comment area of ​​the content display card is displayed; when the terminal receives a trigger operation on the video content component, the video uploaded by the content sender is played, etc. In a possible implementation, the developer sets a tracking point for the card component according to actual needs. In the process of generating a card template, the terminal generates instructions based on the template and sets a preset tracking point for the card component to realize the user's trigger operation.

[0070] Schematically, the terminal sets a preset embedding point for the card component through the card component callback interface (CardViewCallback).

[0071] It is worth mentioning that the above-mentioned step 403 and step 404 are in parallel relationship, and in the template generation instruction, each card component is not necessarily provided with an update mark or a preset tracking point, and the developer can make a choice according to actual needs.

[0072] Step 405: assemble the set card component according to the template generation instruction to generate a card template for the content display card.

[0073] The specific implementation of step 405 can refer to step 203 in the above embodiment, and the embodiment of the present application will not be repeated here.

[0074] In the embodiment of the present application, business data is converted into component display data through a data conversion interface. Compared with the method of directly binding business data to card components in related technologies, the separation of business data and component display data is achieved, so that card components can be provided to different application scenarios; update tags are set for each card component respectively, which facilitates the terminal in the application stage to update based on the update tag without updating the complete content display card, which can improve the card update efficiency.

[0075] The above embodiments illustrate the process of generating card templates based on template generation instructions and using a card component library. In one possible implementation, the terminal can also create new card components and add them to the card component library, that is, the business party can design card components according to their needs and use them for the development of content display cards. Figure 5 A flowchart of a method for generating a card template provided by another exemplary embodiment of the present application is shown. This embodiment is described by taking the method used in a terminal with an application development function as an example. The method includes the following steps:

[0076] Step 501 , in response to a card component generation instruction, generating a custom card component based on the encoding format of the card component in the card component library.

[0077] In a possible implementation, the card components in the card component library may not fully meet the needs of the business party, so the business party can design and develop card components on its own based on the card components included in the card component library, and encode them according to the same encoding format. When the terminal executes the card component generation instruction, a new card component is created according to the encoding format, that is, a custom card component.

[0078] Step 502: Set a custom data class and a custom data conversion class for the custom card component. The base class of the custom data class and the custom data conversion class is the same as the base class corresponding to the card component in the card component library.

[0079] In a possible implementation, the terminal executes a card component generation instruction based on a base class corresponding to the card component in the card component library, and sets a custom data class and a custom data conversion class for the custom card component.

[0080] Indicative, Figure 6 The figure shows a relationship diagram of various classes in the corresponding code of the original card components in a card component library, which includes three base classes, namely BaseCommonView, BaseCommonViewData and a data conversion base class (IViewDataConvertProcessor). The card components in the card component library correspond to a data class (CardData) inherited from BaseCommonViewData, a component class (CardView) inherited from BaseCommonView and a callback function (Callback), and data conversion interfaces Process01, Process02, Process03 inherited from IViewDataConvertProcessor. Process01, Process02, Process03 are used to convert corresponding business data (BusinessData), namely BusinessData01, BusinessData02, BusinessData03, into CardData. When the terminal executes the card component generation instruction, under the above logic, the custom data class (XXXData) and the custom data conversion class (xxxViewDataConvertProcessor) are set for the custom component class (xxxView) of the custom card component, where xxxView inherits from BaseCommonView, XXXData inherits from BaseCommonViewData, and xxxViewDataConvertProcessor inherits from IViewDataConvertProcessor.

[0081] Step 503: Add the custom card component to the card component library.

[0082] In a possible implementation, the terminal adds the custom card component to the card component library so that when a card template is subsequently generated, the custom card component is loaded through the card component library. When the card template indicated by the template generation instruction includes a custom template, the terminal loads the custom card component and other card components from the card component library to generate a card template.

[0083] In an embodiment of the present application, the terminal can not only generate card templates using existing card components in the card component library, but can also add customized card components based on the card component library to meet the needs of different application scenarios, facilitate the business party to personalize the card templates, and improve the utilization rate of the card components.

[0084] The above-mentioned embodiments illustrate the process of a terminal generating a card template of a content display card in the application development stage. In the application stage, the terminal generates and updates the content display card based on the card template. Figure 7 A flowchart of a method for displaying a content display card provided by an exemplary embodiment of the present application is shown. This embodiment is described by taking the method used in a terminal having a function of displaying content display cards as an example. The method includes the following steps:

[0085] Step 701, in response to a card display instruction, a card component is created according to a card template in the current application scenario. The content display card is composed of at least one card component, and different card components are used to display card contents for different purposes.

[0086] In a possible implementation, during the application phase, after receiving a card display instruction, the terminal displays a content display card, in which the content and related information sent by the content sender are displayed. The content sender may be a user of the application or a background server of the application. For example, when the terminal receives an instruction to start the application, before the terminal displays a default page that displays content in the form of a content display card, the terminal determines that a card display instruction has been received; when the terminal receives a refresh operation on a content page that displays content in the form of a content display card, it determines that a card display instruction has been received. An application may include a variety of application scenarios, and the forms of content display cards in different application scenarios are different. For example, the content display card in the content recommendation page does not contain the user information (avatar, nickname, etc.) of the content sender, while the content display card in the follow page or content details page contains the user information of the sender.

[0087] Step 702: Convert the received content to be displayed into card content corresponding to the card component.

[0088] After the terminal creates the card component, it binds the content that needs to be displayed in each card component to the corresponding card component. For example, the user information of the content sender is bound to the header area component, the content sent by the content sender is bound to the content display area component, and UI controls such as forwarding, likes, and comments are bound to the interactive area component.

[0089] Step 703: assemble a card component according to the card format indicated by the card template, and generate and display a content display card.

[0090] After the terminal converts the content to be displayed into the card content corresponding to the card component, it generates and displays the content display card according to the card format indicated by the card template (such as the arrangement of the card components, the display size of the card components, etc.).

[0091] To sum up, in the application stage, each card component is created based on the card template corresponding to the current application scenario and the corresponding card content is displayed, thereby generating and displaying the content display card. When the same card component exists in the card templates corresponding to different application scenarios, the storage space required for loading the card can be reduced, thereby improving the card display efficiency.

[0092] Figure 8 A flowchart of a method for displaying a content display card provided by another exemplary embodiment of the present application is shown. This embodiment is described by taking the method used in a terminal having a function of displaying a content display card as an example. The method includes the following steps:

[0093] Step 801, in response to a card display instruction, a card component is created according to a card template in the current application scenario. The content display card is composed of at least one card component, and different card components are used to display card content for different purposes.

[0094] The specific implementation of step 801 can refer to step 701 in the above embodiment, and the embodiment of the present application will not be repeated here.

[0095] Step 802, obtaining target business data corresponding to the target card component.

[0096] In a possible implementation, different card components need to display different business data, and the terminal obtains the target display content from the content to be displayed, or obtains the target display content from the preset data based on the target business data of the target card component. Figure 3 For the header area component 301, its target business data is the avatar and nickname of the content sender. For the additional information area component 304, its target business data is the subject of the post. For the interactive area component 305, its target business data is the controls therein and the number of interactions corresponding to each control.

[0097] Step 803: Determine the target content to be displayed that matches the target business data.

[0098] The target content to be displayed is the content that the target card component needs to display for the current content to be displayed. The terminal obtains the target content to be displayed from the content and related information forwarded by the server based on the target business data. For example, for Figure 3 the header area component 301 in, the terminal obtains the avatar and nickname of the content sender from the content to be displayed. For the additional information area component 304, the terminal determines the topic "#Cute Pets" forwarded by the server as the target content to be displayed. For the interaction area component 305, the terminal determines the display data corresponding to the controls therein and the number of interactions under each interaction method corresponding to the current content to be displayed sent by the server as the target business data.

[0099] Step 804: Bind the target content to be displayed to the target card component.

[0100] In a possible implementation manner, since the UI data is decoupled from the component, the terminal needs to bind the target content to be displayed to the target card component, that is, convert the relevant data of the target content to be displayed into card display data, so as to display the target content to be displayed when the card component is displayed. Step 804 includes the following steps:

[0101] Step 804a: Based on the data conversion method corresponding to the card component, convert the target content to be displayed into card display data through the data conversion interface. The card display data is the data required to display the card component. The data conversion interface contains a data conversion function, and the data conversion function is used to indicate the conversion logic for converting business data into card display data.

[0102] In a possible implementation manner, Convert contains the conversion logic from business data to the data class required by the card component, and each card component corresponds to a Convert. For example, the Convert of the header component stipulates the conversion of business data containing the avatar and nickname of the content sender into component display data, and the Convert of the bottom component stipulates the conversion of UI control business data containing likes, forwards, and comments into component display data.

[0103] The terminal uses registerConvertProcessor to implement the conversion logic contained in Convert and bind the target content to be displayed corresponding to the target business data to the target card component.

[0104] Step 805: Assemble the card component according to the card format indicated by the card template, generate and display the content display card.

[0105] The specific implementation of step 805 can refer to step 703 in the above embodiment, and the embodiment of the present application will not be repeated here.

[0106] Step 806 , in response to the card update instruction for the content display card, obtain the update mark of each card component.

[0107] Due to factors such as the editing operations of the content sender and the interactive operations of other users, the content displayed in the content display card may change. Therefore, when receiving a card update instruction for the content display card, the terminal needs to update the content in each card component in the content display card. However, usually, there is content in the content display card that cannot be updated or does not need to be updated. For example, for a content display card whose content cannot be edited after sending, there is no updated content in the card component corresponding to its content display area. In order to reduce the resources consumed by the terminal when updating the content display card and improve the update efficiency, the terminal updates based on the update mark in the card component.

[0108] Step 807: in response to the card component being set with an update mark, updating the card content in the card component according to the update method indicated by the update mark.

[0109] For a card component with an update mark, the terminal updates the card content in the card component according to the update method indicated by the update mark. For example, for an interactive area component, an update mark is set, and the update method is to update the number of interactions corresponding to each control.

[0110] Step 808: In response to the card component not setting the update flag, keep the card content in the card component unchanged.

[0111] For card components that are not set with update marks, the terminal keeps the card content in the card component unchanged. Therefore, when updating the content display card, the terminal only needs to update some card components that need to be updated, thereby improving update efficiency and reducing resource consumption.

[0112] Step 809, in response to the triggering operation of the preset embedding point in the card component, determine the triggering event based on the preset embedding point.

[0113] When the terminal receives a trigger operation, the trigger event is determined based on the preset embedding point corresponding to the trigger operation. For example, if a trigger operation is received for a like control, the trigger event is determined to be a like on the content corresponding to the content display card; if a trigger operation is received for video content, the trigger event is determined to be playing the video.

[0114] Step 810: respond to the triggering event in a preset manner.

[0115] After the terminal determines the triggering event, it responds in a preset manner. For example, when the triggering event is to like the content corresponding to the content display card, the terminal changes the display mode of the like control in a preset manner and displays the like effect animation. When the triggering event is to comment on the content corresponding to the content display card, the terminal displays the comment area of ​​the content display card.

[0116] In an embodiment of the present application, the terminal creates card components according to the card template in the current application scenario and binds the content to be displayed to each card component, thereby generating and displaying a content display card. When an update operation for the content display card is received, the terminal only needs to update the card component with an update mark without updating other card components, thereby reducing resource consumption during the card update process and improving the card update efficiency.

[0117] Fig. 9 : is a structural block diagram of a card template generation device provided by an exemplary embodiment of the present application, the device comprising:

[0118] The loading module 901 is used to load a card component from a card component library based on the component style indicated by the template generation instruction, wherein the card component is used to form a content display card, and different card components are used to display card contents for different purposes;

[0119] A first setting module 902, configured to set the card content corresponding to the card component according to the data conversion relationship contained in the template generation instruction, wherein the data conversion relationship is a conversion relationship between business data and card display data, wherein the business data is data corresponding to the card content, and the card display data is data required to display the card component;

[0120] The first generating module 903 is used to assemble the card component that has been set up according to the template generating instruction, and generate a card template of the content display card.

[0121] Optionally, the first setting module 902 includes:

[0122] The first conversion unit is used to convert the business data corresponding to the card component into the component display data through a data conversion interface based on the data conversion method included in the template generation instruction.

[0123] Optionally, the first conversion unit is further used for:

[0124] Obtaining the conversion logic for converting the business data into the component display data through the data conversion function in the data conversion interface;

[0125] The data conversion method is used to convert the business data corresponding to the card component into the component display data according to the conversion logic.

[0126] Optionally, the device further comprises:

[0127] The second setting module is used to set an update mark for the card component based on the template generation instruction, and the update mark is used to indicate the update method of the card content in the card component.

[0128] Optionally, the device further comprises:

[0129] The third setting module is used to generate instructions based on the template and set a preset embedding point for the card component, and the preset embedding point is used to indicate a trigger event corresponding to a trigger operation.

[0130] Optionally, the device further comprises:

[0131] A third generating module, configured to generate a custom card component based on the encoding format of the card component in the card component library in response to a card component generating instruction;

[0132] A fourth setting module, used to set a custom data class and a custom data conversion class for the custom card component, wherein the base classes of the custom data class and the custom data conversion class are the same as the base classes corresponding to the card components in the card component library;

[0133] An adding module is used to add the custom card component to the card component library.

[0134] Fig.10 : is a structural block diagram of a display device for content display cards provided by an exemplary embodiment of the present application, the device comprising:

[0135] The second generation module 1001 is used to create a card component according to the card template in the current application scenario in response to the card display instruction. The content display card is composed of at least one of the card components. Different card components are used to display card contents for different purposes.

[0136] A conversion module 1002, configured to convert the received content to be displayed into the card content corresponding to the card component;

[0137] The display module 1003 is used to assemble the card component according to the card format indicated by the card template, and generate and display the content display card.

[0138] Optionally, the conversion module 1002 includes:

[0139] An acquisition unit, used to acquire target business data corresponding to a target card component;

[0140] A determination unit, configured to determine target content to be displayed that matches the target business data;

[0141] A binding unit is used to bind the target content to be displayed to the target card component.

[0142] Optionally, the binding unit is further used to:

[0143] Based on the data conversion method corresponding to the card component, the target content to be displayed is converted into card display data through a data conversion interface. The card display data is the data required to display the card component. The data conversion interface includes a data conversion function, which is used to indicate the conversion logic for converting business data into the card display data.

[0144] Optionally, the device further comprises:

[0145] An acquisition module, configured to acquire an update mark of each of the card components in response to a card update instruction for the content display card;

[0146] A first updating module, configured to update the card content in the card component in response to the card component being provided with the update mark and in accordance with the update mode indicated by the update mark;

[0147] The second updating module is used for keeping the card content in the card component unchanged in response to the card component not setting the update mark.

[0148] Optionally, the device further comprises:

[0149] A determination module, configured to respond to a trigger operation on a preset embedding point in the card component and determine a trigger event based on the preset embedding point;

[0150] The response module is used to respond to the trigger event in a preset manner.

[0151] To summarize, in the embodiments of the present application, the card of the content display card is designed in an elemental manner so that the content display card is composed of card components. When generating a card template, the required card components are loaded from the card component library, and the corresponding card content is set according to the card display data of each card component. For applications that include different application scenarios, there is no need to develop and design content display cards separately for each application scenario, which improves the development efficiency of the application and reduces development costs. The card display data and business data are separated, and the decoupling of the card display data and the business data is achieved while decoupling the data from the content display card, thereby improving the utilization rate of the card components.

[0152] During the application stage, each card component is created based on the card template corresponding to the current application scenario and the corresponding card content is displayed, thereby generating and displaying the content display card. When the same card component exists in the card templates corresponding to different application scenarios, the storage space required for loading the card can be reduced, thereby improving the card display efficiency.

[0153] In an exemplary embodiment, a terminal is also provided, which includes a processor and a memory, in which a computer program is stored, and the computer program is loaded and executed by the processor to implement a method for generating a card template as provided in the above embodiment, or a method for displaying a content display card.

[0154] An embodiment of the present application also provides a computer-readable storage medium, which stores at least one instruction, and the at least one instruction is loaded and executed by a processor to implement the card template generation method described in the above embodiments, or the content display card display method.

[0155] According to one aspect of the present application, a computer program product or a computer program is provided, the computer program product or the computer program including computer instructions, the computer instructions being stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the card template generation method provided in various optional implementations of the above aspects, or the content display card display method.

[0156] Those skilled in the art should be aware that in one or more of the above examples, the functions described in the embodiments of the present application can be implemented with hardware, software, firmware, or any combination thereof. When implemented using software, these functions can be stored in a computer-readable storage medium or transmitted as one or more instructions or codes on a computer-readable storage medium. Computer-readable storage media include computer storage media and communication media, wherein the communication media include any media that facilitates the transmission of a computer program from one place to another. The storage medium can be any available medium that a general or special-purpose computer can access.

[0157] The above description is only an optional embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application.

Claims

1. A method for generating a card template, characterized in that: The method comprises: Based on the component style indicated by the template generation instruction, a card component is loaded from a card component library, wherein the card component is used to form a content display card, and different card components are used to display card contents for different purposes; Through the data conversion function in the data conversion interface, the conversion logic of converting the business data indicated by the template generation instruction into component display data is obtained, wherein the business data is the data corresponding to the card content, and different data conversion interfaces contain different data conversion functions corresponding to different card components; Convert the business data corresponding to the card component into the component display data according to the conversion logic; Based on the template generation instruction, an update mark is set for the card component, the update mark is used to indicate the update method of the card content in the card component, and for the card component with the update mark set, the terminal updates the card content in the card component according to the update method indicated by the update mark, and for the card component without the update mark set, the card content in the card component remains unchanged; Based on the template generation instruction, a preset embedding point is set for the card component through the card component callback interface, and the preset embedding point is used to indicate a trigger event corresponding to a trigger operation; The card component that has been set up is assembled according to the template generation instruction to generate a card template for the content display card.

2. The method according to claim 1, characterized in that The method further comprises: In response to a card component generation instruction, generating a custom card component based on the encoding format of the card component in the card component library; Setting a custom data class and a custom data conversion class for the custom card component, wherein the base classes of the custom data class and the custom data conversion class are the same as the base classes corresponding to the card component in the card component library; Add the custom card component to the card component library.

3. A method for displaying a content display card, characterized in that: The method comprises: In response to the card display instruction, a card component is created according to the card template in the current application scenario, wherein the content display card is composed of at least one of the card components, and different card components are used to display card contents for different purposes; Convert the received content to be displayed into the card content corresponding to the card component; Assembling the card component according to the card format indicated by the card template, and generating and displaying the content display card; Wherein, the card template is generated according to the method described in any one of claims 1 to 2.

4. The method according to claim 3, characterized in that The step of converting the received content to be displayed into the card content corresponding to the card component includes: Get the target business data corresponding to the target card component; Determine target content to be displayed that matches the target business data; Bind the target content to be displayed to the target card component.

5. The method according to claim 4, characterized in that The step of binding the target content to be displayed to the target card component includes: Based on the data conversion method corresponding to the card component, the target content to be displayed is converted into card display data through a data conversion interface. The card display data is the data required to display the card component. The data conversion interface includes a data conversion function, which is used to indicate the conversion logic for converting business data into the card display data.

6. The method according to any one of claims 3 to 5, characterized in that: After assembling the card component according to the card format indicated by the card template and generating and displaying the content display card, the method includes: In response to a card update instruction for the content display card, acquiring an update mark of each of the card components; In response to the card component being provided with the update mark, updating the card content in the card component according to the update mode indicated by the update mark; In response to the card component not setting the update flag, keeping the card content in the card component unchanged.

7. The method according to any one of claims 3 to 5, characterized in that: After assembling the card component according to the card format indicated by the card template and generating and displaying the content display card, the method further includes: In response to a trigger operation on a preset embedding point in the card component, determining a trigger event based on the preset embedding point; Respond to the trigger event in a preset manner.

8. A card template generation device, characterized in that: The device comprises: A loading module, used to load card components from a card component library based on the component style indicated by the template generation instruction, wherein the card components are used to form content display cards, and different card components are used to display card contents for different purposes; A first conversion unit is used to obtain, through a data conversion function in a data conversion interface, a conversion logic for converting the business data indicated by the template generation instruction into component display data, wherein the business data is data corresponding to the card content, and different data conversion interfaces contain different data conversion functions corresponding to different card components; Convert the business data corresponding to the card component into the component display data according to the conversion logic; a second setting module, configured to set an update mark for the card component based on the template generation instruction, wherein the update mark is used to indicate an update method of the card content in the card component, and for the card component with the update mark set, the terminal updates the card content in the card component according to the update method indicated by the update mark, and for the card component without the update mark set, the card content in the card component remains unchanged; A third setting module is used to generate instructions based on the template, and set a preset embedding point for the card component through a card component callback interface, wherein the preset embedding point is used to indicate a trigger event corresponding to a trigger operation; The first generating module is used to assemble the card component that has been set up according to the template generating instruction, and generate a card template of the content display card.

9. A display device for content display cards, characterized in that: The device comprises: A second generating module is used to create a card component according to a card template in a current application scenario in response to a card display instruction, wherein a content display card is composed of at least one of the card components, and different card components are used to display card contents for different purposes; A conversion module, used to convert the received content to be displayed into the card content corresponding to the card component; a display module, used to assemble the card component according to the card format indicated by the card template, and generate and display the content display card; Wherein, the card template is generated according to the method described in any one of claims 1 to 2.

10. A terminal, characterized in that: The terminal includes a processor and a memory, wherein the memory stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by the processor to implement the card template generation method as described in any one of claims 1 to 2, or the content display card display method as described in any one of claims 3 to 7.

11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set are loaded and executed by the processor to implement the card template generation method as described in any one of claims 1 to 2, or the content display card display method as described in any one of claims 3 to 7.

Citation Information

Patent Citations

  • Page information showing and generating method, device and system

    CN108089878A

  • Page editing processing method and device

    CN108495192A

  • Interface development method, electronic device and readable storage medium

    CN109240688A

  • Card generation method, card generation device, mobile terminal and readable storage medium

    CN109697093A

  • Card display method and device of affiliated application terminal, equipment and storage medium

    CN110457038A