Card layout method and apparatus, medium and electronic device
The card data is distributed through the server to dynamically configure the card layout, which solves the problem of the traditional client-side card adding process affecting the user experience, and achieves efficient card layout and code maintenance.
Patent Information
- Application Number
- PCT/CN2024/085332
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-04-14
- Filing Date
- 2024-04-01
- Publication Date
- 2024-10-17
AI Technical Summary
The increase of cards in the traditional client requires the process of development, testing, release and user downloading of new versions, which affects the user experience. As the number of cards increases, the amount of client code continues to grow, making maintenance more difficult.
The card data of the card sent through the server includes layout information such as the target anchor point, the distance between the card and the target anchor point, and the target container. The terminal configures the layout attributes of the card based on this information to realize the dynamic layout of the card on the client page. Avoid the need to take the client offline and download new versions.
It improves the efficiency of card online, reduces the amount of client code, simplifies post-code maintenance, and improves the dynamic layout capabilities of cards in the client.
Smart Images

Figure CN2024085332_17102024_PF_FP_ABST
Abstract
Description
Card layout method, device, medium and electronic device
[0001] CROSS-REFERENCE TO RELATED APPLICATIONS
[0002] This application claims priority to the Chinese patent application filed on April 14, 2023, with application number 202310403869.X and invention name “Card layout method, device, medium and electronic device”. The entire contents of that application are incorporated by reference into this application. Technical Field
[0003] The present disclosure relates to the field of electronic information technology, and in particular to a card layout method, device, medium, and electronic device. Background Art
[0004] Cards are controls displayed in the client for user interaction. Traditionally, cards in clients are determined by the client itself. Adding cards requires the client to be offline. The client then undergoes a series of development, testing, release, and user downloads before the added card can be put back online. This process significantly impacts user experience. Furthermore, adding cards to the client requires adding a new set of code. As the number of cards increases, the client's codebase also grows, making it difficult to maintain.
[0005] Summary of the Invention
[0006] This summary is provided to briefly introduce concepts that will be described in detail in the detailed description below. This summary is not intended to identify key features or essential features of the claimed technical solution, nor is it intended to limit the scope of the claimed technical solution.
[0007] In a first aspect, the present disclosure provides a card layout method, comprising:
[0008] Receive card data of a card sent by a server, wherein the card data includes layout information, and the layout information includes a target anchor point, a distance between the card and the target anchor point, and a target container;
[0009] According to the layout information, attribute values of the layout attributes of the card are configured, where the layout attributes include position attributes, and the position attributes are used to determine the position of the card displayed on the client page.
[0010] In a second aspect, the present disclosure provides a card layout method, comprising:
[0011] Send the card data of the card to the terminal;
[0012] The card data includes layout information, which includes at least a target anchor point, a distance between the card and the target anchor point, and a target container. The layout information is used by the terminal to configure the attribute values of the layout attributes of the card. The layout attributes include position attributes, which are used to determine the position of the card displayed on the client page.
[0013] In a third aspect, the present disclosure provides a card layout device, comprising:
[0014] A receiving module, configured to receive card data of a card sent by a server, wherein the card data includes layout information, and the layout information includes a target anchor point, a distance between the card and the target anchor point, and a target container;
[0015] The first configuration module is used to configure the attribute values of the layout attributes of the card according to the layout information, where the layout attributes include position attributes, and the position attributes are used to determine the position of the card displayed on the client page.
[0016] In a fourth aspect, the present disclosure provides a card layout device, comprising:
[0017] A sending module, used for sending card data of the card to the terminal;
[0018] The card data includes layout information, which includes at least a target anchor point, a distance between the card and the target anchor point, and a target container. The layout information is used by the terminal to configure the attribute values of the layout attributes of the card. The layout attributes include position attributes, which are used to determine the position of the card displayed on the client page.
[0019] In a fifth aspect, the present disclosure provides a computer-readable medium having a computer program stored thereon, which, when executed by a processing device, implements the steps of the method described in the first aspect or the second aspect.
[0020] In a sixth aspect, the present disclosure provides an electronic device, including:
[0021] a storage device having a computer program stored thereon;
[0022] A processing device is used to execute the computer program in the storage device to implement the steps of the method in the first aspect or the second aspect.
[0023] Through the above technical solution, the card data of the card is sent by the server to the terminal equipped with the client, so that the terminal can configure the attribute values of the layout attributes of the card based on the target anchor point, the distance between the card and the target anchor point, and the target container included in the layout information in the card data, wherein the layout attributes include the position attribute for determining the position where the card is displayed on the client page.
[0024] Other features and advantages of the present disclosure will be described in detail in the following detailed description. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] The above and other features, advantages and aspects of the various embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and that the originals and elements are not necessarily drawn to scale. In the drawings:
[0026] FIG1 is a schematic diagram of an application environment of a card layout method according to an exemplary embodiment of the present disclosure.
[0027] FIG2 is a schematic diagram showing a client page according to an exemplary embodiment of the present disclosure.
[0028] FIG3 is a schematic diagram showing a container of a client page according to an exemplary embodiment of the present disclosure.
[0029] FIG4 is a flowchart showing a card layout method according to an exemplary embodiment of the present disclosure.
[0030] FIG5 is a schematic diagram showing the positions of a card and a target anchor point according to an exemplary embodiment of the present disclosure.
[0031] FIG6 is a schematic diagram showing the positions of a card and a target anchor point according to an exemplary embodiment of the present disclosure.
[0032] FIG7 is a schematic diagram showing a client page according to an exemplary embodiment of the present disclosure.
[0033] FIG8 is a flowchart showing a card layout method according to an exemplary embodiment of the present disclosure.
[0034] FIG9 is a block diagram showing a card layout device according to an exemplary embodiment of the present disclosure.
[0035] FIG10 is a block diagram showing a card layout device according to an exemplary embodiment of the present disclosure.
[0036] FIG11 is a block diagram of an electronic device according to an exemplary embodiment of the present disclosure. DETAILED DESCRIPTION
[0037] The following describes embodiments of the present disclosure in more detail with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as limited to the embodiments described herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are for illustrative purposes only and are not intended to limit the scope of protection of the present disclosure.
[0038] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.
[0039] As used herein, the term "including" and its variations are open-ended, i.e., "including but not limited to." The term "based on" means "based, at least in part, on." The term "one embodiment" means "at least one embodiment," the term "another embodiment" means "at least one additional embodiment," and the term "some embodiments" means "at least some embodiments." Other terms are defined in the following description.
[0040] It should be noted that the concepts of "first" and "second" mentioned in this disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.
[0041] It should be noted that the modifications of "one" and "multiple" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, they should be understood as "one or more".
[0042] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.
[0043] It is understandable that before using the technical solutions disclosed in the various embodiments of this disclosure, the type, scope of use, usage scenarios, etc. of the personal information involved in this disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.
[0044] For example, in response to a user's active request, a prompt message is sent to the user to clearly inform the user that the operation requested will require the acquisition and use of the user's personal information. This allows the user to independently choose whether to provide personal information to the electronic device, application, server, storage medium, or other software or hardware that performs the operations of the disclosed technical solution based on the prompt message.
[0045] As an optional but non-limiting implementation, in response to receiving a user's active request, the prompt information may be sent to the user in the form of a pop-up window, in which the prompt information may be presented in text form. Furthermore, the pop-up window may also contain a selection control for the user to select "agree" or "disagree" to provide personal information to the electronic device.
[0046] It is understandable that the above notification and user authorization process are merely illustrative and do not limit the implementation of the present disclosure. Other methods that comply with relevant laws and regulations may also be applied to the implementation of the present disclosure.
[0047] At the same time, it is understandable that the data involved in this technical solution (including but not limited to the data itself, the acquisition or use of the data) must comply with the requirements of relevant laws, regulations and relevant provisions.
[0048] First, the application environment involved in this disclosure is explained.
[0049] Figure 1 is a schematic diagram of an application environment for a card layout method according to an exemplary embodiment of the present disclosure. Referring to Figure 1 , the application environment includes a server and a terminal equipped with a client. The terminal receives card data for a card sent by the server. The card data includes layout information, including a target anchor point, the spacing between the card and the target anchor point, and a target container. Based on the layout information, the terminal configures the attribute values of the card's layout attributes. The layout attributes include a position attribute used to determine the position of the card on the client page, thereby dynamically arranging the cards on the client page.
[0050] FIG2 is a schematic diagram of a client page according to an exemplary embodiment of the present disclosure. Referring to FIG2 , the client page is configured with controls that interact with the user. The controls can be identified by text, such as “Home,” “Friends,” “Messages,” and “Recommendations” in FIG2 , etc. The controls can also be identified by icons, such as the “heart logo” and “five-pointed star logo” in FIG2 , etc. These controls can serve as target anchors. It is worth noting that the controls in the client page and the positions of the controls are fixed and are generally configured when the client is developed. Therefore, after the client goes online, the controls and the positions of the controls generally do not change. Therefore, they can be used as references for cards that are dynamically inserted into the client page and used for positioning the cards on the client page.
[0051] Furthermore, client pages typically have different containers in a hierarchical relationship. For two containers in a hierarchical relationship, the content in the upper container will overwrite the content in the lower container. This content can include, for example, the controls and cards on the client page. To facilitate the insertion of cards into the client page, you can configure some free containers during client development. This allows for the dynamic insertion of cards into these containers later, achieving dynamic card layout.
[0052] Referring to the schematic diagram of a container of a client page shown in FIG3 , the client page may include container 1, container 2, ..., container N, where N is an integer greater than 2. It is worth noting that the same level may include multiple containers. For example, container 2 and container 21 may belong to the same level of containers, but may have different sizes, i.e., different positions relative to the terminal screen.
[0053] FIG4 is a flowchart of a card layout method according to an exemplary embodiment of the present disclosure. The card layout method can be executed by a terminal equipped with a client. Referring to FIG1 , the method may include the following steps:
[0054] Step 401: Receive card data of a card sent by a server, wherein the card data includes layout information, and the layout information includes a target anchor point, a distance between the card and the target anchor point, and a target container.
[0055] It is worth noting that the target anchor point can be the aforementioned control, and the target container can be some idle containers pre-configured when the client is developed.
[0056] For example, the spacing between the card and the target anchor point may be the spacing between the left end of the card and the right end of the target anchor point, the spacing between the card and the target anchor point may be the spacing between the left end of the card and the left end of the target anchor point, the spacing between the card and the target anchor point may be the spacing between the right end of the card and the right end of the target anchor point, the spacing between the card and the target anchor point may be the spacing between the right end of the card and the left end of the target anchor point, the spacing between the card and the target anchor point may be the spacing between the top of the card and the top of the target anchor point, the spacing between the card and the target anchor point may be the spacing between the top of the card and the bottom of the target anchor point, the spacing between the card and the target anchor point may be the spacing between the bottom of the card and the top of the target anchor point, the spacing between the card and the target anchor point may be the spacing between the bottom of the card and the bottom of the target anchor point, and so on.
[0057] Refer to Figure 5 for a schematic diagram of the position of a card and a target anchor point. Referring to Figure 5, the distance between the left end of the card and the right end of the target anchor point is distance A, and the distance between the bottom end of the card and the top end of the target anchor point is distance B.
[0058] The distance between the card and the target anchor point can be described by a first preset variable and a second preset variable. The first preset variable is used to describe the dependency relationship between the card and the target anchor point. For example, referring to the first preset variables in Table 1 below, the first column of Table 1 below represents the meaning of the first preset variable, and the second column represents the string representation of the first preset variable:
[0059] Table 1
[0060] Table 1 above illustrates the dependency relationship between cards and target anchors.
[0061] The second preset variable is used to describe the specific spacing of the dependency relationship represented by the first preset variable. For example, referring to the second preset variable in Table 2 below, the first column in Table 2 below represents the meaning of the second preset variable, and the second column represents the string representation of the second preset variable:
[0062] Table 2
[0063] Among them, offset_left can describe the distance between the left end of the card and the right end of the target anchor point, and the distance between the left end of the card and the left end of the target anchor point. offset_bottom can describe the distance between the bottom end of the card and the top end of the target anchor point, and the distance between the bottom end of the card and the bottom end of the target anchor point. offset_right can describe the distance between the right end of the card and the right end of the target anchor point, and the distance between the right end of the card and the left end of the target anchor point. offset_top can describe the distance between the top end of the card and the top end of the target anchor point, and the distance between the top end of the card and the bottom end of the target anchor point.
[0064] For example, take the following code to describe the distance between the card and the target anchor in Figure 5:
[0065] {
[0066] left_to_right_of: "target anchor point",
[0067] offset_left: "Distance A",
[0068] bottom_to_top_of: "target anchor point",
[0069] offset_bottom: "Distance B"
[0070] }
[0071] Step 402: Configure the attribute values of the layout attributes of the card according to the layout information. The layout attributes include position attributes, which are used to determine the position of the card displayed on the client page.
[0072] As can be seen above, a client page can include multiple containers. Therefore, the card's display position on the client page includes both the card's position on the screen and the container it resides in. Continuing with the example in Figure 5 , the card's position on the screen can be determined based on distances A and B. Furthermore, the container a card resides in is determined by the target container.
[0073] In addition, layout information also includes a specified size, and layout attributes also include size attributes. Therefore, configuring the attribute value of the card layout attribute based on the layout information may also include configuring the attribute value of the card size attribute based on the specified size. The specified size here may include the width and height of the card, and correspondingly, the size attribute includes a width attribute and a height attribute.
[0074] The width attribute can be represented by the string width, and the height attribute can be represented by the string height.
[0075] In addition, the width and height of the card can also be determined based on the distance between the card and the target anchor point. It is worth noting that calculating the width of the card is similar to calculating the width of the card. For example, taking the calculation of the width of the card as an example, when the distance between the card and the target anchor point includes the distance between the left end of the card and the right end of the target anchor point and the distance between the right end of the card and the right end of the target anchor point, the distance between the right end of the card and the right end of the target anchor point and the distance between the left end of the card and the right end of the target anchor point can be used as constraints to obtain the width of the card, that is, the difference between the distance between the right end of the card and the right end of the target anchor point and the distance between the left end of the card and the right end of the target anchor point can be used as the width of the card.
[0076] For another example, refer to Figure 6. In Figure 6, the layout data sent by the server includes two target anchors: a first target anchor and a second target anchor. Taking the calculation of a card's width as an example, if the distance between the card and the first target anchor includes the distance between the card's left end and the first target anchor's right end, and the distance between the card's right end and the second target anchor's left end, the card's width can be calculated using the distance between the card and the first target anchor including the distance between the card's left end and the first target anchor's right end as a constraint.
[0077] Through the above method, the card data of the card is sent by the server to the terminal equipped with the client, so that the terminal can configure the attribute values of the layout attributes of the card based on the target anchor point, the distance between the card and the target anchor point, and the target container included in the layout information in the card data. Among them, the layout attributes include position attributes for determining the position where the card is displayed on the client page, so that there is no need to log off the client or for the user to download a new version of the client, and the dynamic layout of the card in the client can be realized, thereby improving the online efficiency of the card; in addition, since there is no need for the client to configure the card data, the amount of client code is reduced, which is conducive to the maintenance of the later code.
[0078] In some embodiments, the above-mentioned step of configuring the attribute value of the layout attribute of the card based on the layout information can be implemented in the following manner: determining the first position information of the target anchor point relative to the target container; determining the second position information of the card relative to the target container based on the first position information and the distance between the card and the target anchor point; and configuring the attribute value of the position attribute of the card based on the second position information and the position of the target container on the client page.
[0079] Among them, the position attributes of the card here may include horizontal position attributes, vertical position attributes and container attributes of the card. The horizontal position attributes include attributes describing the distance between the left end of the card and the left end of the target container and attributes describing the distance between the right end of the card and the right end of the target container. The vertical position attributes include attributes describing the distance between the top of the card and the top of the target container and attributes describing the distance between the bottom of the card and the bottom of the target container.
[0080] Among them, the attribute value type of the horizontal position attribute and the vertical position attribute is int type, that is, a numerical value, and the attribute value type of the container attribute is string type, that is, a card container identifier. For the card container identifier, please refer to the following related embodiments, which will not be described in detail in this embodiment.
[0081] Among them, taking the horizontal position attribute as an example, the first position information is the position information of the attribute value for calculating the horizontal position attribute, that is, the first position information may include the distance between the left end of the target anchor point and the left end of the target container, and the distance between the right end of the target anchor point and the right end of the target container; accordingly, the distance between the card and the target anchor point may include the distance between the left end of the target anchor point and the left end of the card, and the distance between the right end of the target anchor point and the right end of the card; accordingly, the second position information of the card relative to the target container may include the distance between the left end of the card and the left end of the target container, and the distance between the right end of the card and the right end of the target container, and the attribute value of the corresponding attribute is described according to the spacing configuration here.
[0082] Taking the vertical position attribute as an example, the first position information is the position information of the attribute value for calculating the vertical position attribute, that is, the first position information can be understood to include the distance between the top of the target anchor point and the top of the target container, and the distance between the bottom of the target anchor point and the bottom of the target container; accordingly, the distance between the card and the target anchor point includes the distance between the top of the target anchor point and the top of the card, and the distance between the bottom of the target anchor point and the bottom of the card; accordingly, the second position information of the card relative to the target container includes the distance between the top of the card and the top of the target container, and the distance between the bottom of the card and the bottom of the target container. The attribute value of the corresponding attribute is described according to the spacing configuration here.
[0083] It's worth noting that since different containers can have different sizes, the card and anchor point may be at different levels of the container. Therefore, it's necessary to determine the relative position of the card to its target container, namely the attribute values of the horizontal position attribute and the vertical position attribute. To determine the relative position of the card to its target container, the target anchor point, card, and target container need to be unified in the same coordinate system. It's worth noting that the card and target container are in the same coordinate system, and by determining the first position information of the target anchor point relative to the target container, the target anchor point and target container can be unified in the same coordinate system.
[0084] Referring to Figure 7, the card is located in the target container, and the hierarchy of the target container is the upper container of the hierarchy of the container where the target anchor point is located. Taking the terminal screen as a reference, the relative position information of the target container relative to the terminal screen can be determined, that is, the spacing shown by the third line type; taking the terminal screen as a reference, the relative position information of the target anchor point relative to the terminal screen can be determined, that is, the spacing shown by the first line type; based on the relative position information of the target container relative to the terminal screen and the relative position information of the target anchor point relative to the terminal screen, the first position information of the target anchor point relative to the target container can be determined. Then, based on the first position information of the target anchor point relative to the target container and the spacing between the card and the target anchor point, the second position information of the card relative to the target container is determined, that is, the distance shown by the second line type. Through the distance shown by the second line type, the attribute value of the attribute corresponding to the distance can be configured, and based on the attribute value of the attribute, the position where the card is displayed on the client page can be located.
[0085] Referring to Figure 7, the calculation of the distance between the left end of the card and the left end of the target container is explained as an example. In Figure 7, in the same coordinate system, the left end of the target anchor point is located outside the target container. Based on the distance between the left end of the card and the left end of the target anchor point and the distance between the left end of the target anchor point and the left end of the target container, the difference between the distance between the left end of the card and the left end of the target anchor point and the distance between the left end of the target anchor point and the left end of the target container is used as the distance between the left end of the card and the left end of the target container.
[0086] The calculation of the distance between the right end of the card and the right end of the target container is illustrated as an example. In Figure 7, in the same coordinate system, the right end of the target anchor point is located in the target container. Based on the distance between the right end of the card and the right end of the target anchor point and the distance between the right end of the target anchor point and the right end of the target container, the difference between the distance between the right end of the target anchor point and the right end of the target container and the distance between the right end of the card and the right end of the target anchor point is used as the distance between the left end of the card and the left end of the target container.
[0087] It is worth noting that the calculation method for calculating the distance between the top of the card and the top of the target container and the distance between the bottom of the card and the bottom of the target container can refer to the above-mentioned relevant embodiments, which will not be described in detail in this embodiment.
[0088] In some embodiments, the position attributes include an attribute describing the distance between the top of the card and the top of the target container, an attribute describing the distance between the bottom of the card and the bottom of the target container, an attribute describing the distance between the left end of the card and the left end of the target container, and an attribute describing the distance between the right end of the card and the right end of the target container. The height of the card can be determined by the attribute value of the attribute describing the distance between the top of the card and the top of the target container and the attribute value of the attribute describing the distance between the bottom of the card and the bottom of the target container, and the width of the card can be determined by the attribute value of the attribute describing the distance between the left end of the card and the left end of the target container and the attribute value of the attribute describing the distance between the right end of the card and the right end of the target container. The width and height determined by the attribute values of the position attributes are referred to as target sizes in relevant embodiments.
[0089] As can be seen from the above, the layout information sent by the server includes a specified size. On this basis, the method may further include: determining the target size of the card according to the attribute value of the position attribute, and updating the attribute value of the size attribute of the configured card to the target size when the target size is inconsistent with the specified size.
[0090] The determination of the target size of the card according to the attribute value of the position attribute may refer to the above-mentioned related embodiments, which will not be described in detail in this embodiment.
[0091] It is worth noting that in the code process, the specified size is read first, and the corresponding size attribute is assigned based on the read specified size; therefore, if the target size is inconsistent with the specified size, the attribute value of the size attribute of the configured card needs to be updated to the target size, that is, the corresponding size attribute needs to be re-assigned based on the target size.
[0092] In this way, the position information of the card relative to the left and right sides, as well as the top and bottom sides of the target container is calculated using the attribute value of the position attribute, thereby achieving accurate constraints on the card width and height, and minimizing the impact of newly added cards on the overall layout of the client page.
[0093] In some embodiments, the method may further include: when it is detected that the position of the target anchor point on the client page has changed, re-executing the step of configuring the attribute values of the layout attributes of the card according to the layout information.
[0094] Among them, a listener can be set to monitor whether the position of the target anchor point on the client page changes.
[0095] It is worth noting that the client is constantly iteratively updated. During this update process, the position of the target anchor point on the client page may change. Since the target anchor point is used to determine the position of the card on the client page, when it is detected that the position of the target anchor point on the client page has changed, it is necessary to re-execute the layout information and configure the attribute values of the layout attributes of the card, so as to achieve accurate layout of the position of the card on the client page.
[0096] In some embodiments, the method may further include: obtaining an anchor point identifier of at least one anchor point; storing the anchor point identifier of at least one anchor point in a software development kit of the client, so that the server side determines the target anchor point by accessing the anchor point identifier of at least one anchor point in the software development kit.
[0097] It is worth noting that the client SDK (Software Development Kit) can facilitate the creation of applications (i.e., clients) through compilers, debuggers, software frameworks, etc. It can simply provide some API (Application Programming Interface) files for a certain programming language and implement code calls by calling the API. In this embodiment, the API provided by the SDK can be used to implement dynamic card layout.
[0098] For example, the server can access the anchor identifiers stored in the SDK to obtain the target anchor configuration in the layout information. After the client receives the card data sent by the server, the SDK will parse it. Since the SDK stores the anchor identifiers of the anchors, the SDK can parse the received card data and its own stored anchor identifiers to obtain the target anchor that the card depends on.
[0099] Through the above method, the SDK is used as a bridge between the server and the client to achieve dynamic layout of cards.
[0100] In some embodiments, the method may further include: obtaining a container identifier of at least one card container, where the card container is pre-embedded in the client page; storing the container identifier of at least one card container in a software development kit of the client, so that the server side determines the target container by accessing the container identifier of at least one card container in the software development kit.
[0101] 3 , different containers are used to implement the layout of content on the client page. Therefore, when developing the client, multiple card containers can be pre-configured in the client page. The target container in the card container is used to accommodate the card. The container identifier can be a string identifier.
[0102] Similar to anchor identifiers, the server can access the container identifier of the card container stored in the SDK to obtain the target container configuration for the layout information. After the client receives the card data sent by the server, the SDK parses it. Since the SDK stores the container identifier of the card container, it can parse the received card data and its own container identifier to determine the target container that the card depends on. This approach, using the SDK as a bridge between the server and client, enables dynamic card layout.
[0103] In some embodiments, the card data further includes rendering information, and the method further includes: configuring attribute values of the rendering attributes of the card according to the rendering information, wherein the rendering information is used to determine the rendering timing of the card and whether the card is visible during rendering.
[0104] See Table 3 below:
[0105] Table 3
[0106] Among them, the rendering attributes may include rendering timing attributes and visibility control attributes. The rendering timing attribute can be represented by the parameter render_mode, and the type of the attribute value of render_mode can be int type. The rendering timing attribute is used to specify the rendering timing of the card. For example, the attribute value of render_mode can be 0, 1, 2, and 3, 0 means that the video is rendered immediately after sliding to it, 1 means that the video is rendered after the preset delay, 2 means that the previous video is rendered after sliding to it, and 3 means that the video is not actively rendered even if it is slid to it. The video here can be a video of a specified type, such as a product display video. The preset duration here is specified by the parameter render_delay_time, and the type of the attribute value of render_delay_time can also be int type. render_delay_time specifies the preset duration.
[0107] The visibility control attribute can be represented by the parameter visible. The type of the visible attribute value can be boolean type, and the visible attribute value can be true or false. True indicates that the card is visible when rendered, and false indicates that the card is invisible when rendered. If it is invisible, the client can change its attribute value from false to true through the setVisible method at an appropriate time, that is, adjust it to be visible.
[0108] It is worth noting that, similar to the above-mentioned anchor identification, the above-mentioned Table 3 can be stored in the client's SDK, and the server can access the parameters used to identify the rendering attributes and the corresponding attribute values in Table 3 to determine the rendering information and realize the dynamic layout of the card.
[0109] Based on the same inventive concept, the present disclosure also provides a card layout method, which can be executed by a server. The card layout method may include: sending card data of a card to a client, wherein the card data includes layout information, and the layout information includes at least a target anchor point, a spacing between the card and the target anchor point, and a target container. The layout information is used by the client to configure the attribute values of the layout attributes of the card, and the layout attributes include position attributes, which are used to determine the position of the card displayed on the client page.
[0110] It is worth noting that the client here is installed on the terminal.
[0111] In addition, regarding the implementation of the card layout method in this embodiment, reference can be made to the implementation of the above-mentioned related methods, and this embodiment will not be described in detail here.
[0112] Figure 8 is a flowchart illustrating a card layout method according to an exemplary embodiment of the present disclosure. Referring to Figure 8 , the server sends card data for a card to a terminal. The terminal receives the card data from the server, wherein the card data includes layout information, including a target anchor point, the spacing between the card and the target anchor point, and a target container. Based on the layout information, the terminal configures the attribute values of the card's layout attributes, including a position attribute, which is used to determine the display position of the card on the client page.
[0113] It is worth noting that the terminal here is equipped with a client.
[0114] In addition, the specific implementation of the card layout method in this embodiment can refer to the specific implementation of the above-mentioned related methods, and this embodiment will not be described in detail here.
[0115] Based on the same inventive concept, the present disclosure further provides a card layout device. FIG9 is a block diagram of a card layout device according to an exemplary embodiment of the present disclosure. The card layout device 900 includes:
[0116] The receiving module 901 is configured to receive card data of a card sent by a server, wherein the card data includes layout information, and the layout information includes a target anchor point, a distance between the card and the target anchor point, and a target container;
[0117] The first configuration module 902 is configured to configure the attribute values of the layout attributes of the card according to the layout information, wherein the layout attributes include position attributes, and the position attributes are used to determine the position of the card displayed on the client page.
[0118] In some embodiments, the first configuration module 902 includes:
[0119] A first determining submodule, configured to determine first position information of the target anchor point relative to the target container;
[0120] a second determining submodule, configured to determine second position information of the card relative to the target container based on the first position information and a distance between the card and the target anchor point;
[0121] A configuration submodule is configured to configure an attribute value of a position attribute of the card according to the second position information and the position of the target container on the client page.
[0122] In some embodiments, the position attributes include an attribute describing the distance between the top of the card and the top of the target container, an attribute describing the distance between the bottom of the card and the bottom of the target container, an attribute describing the distance between the left end of the card and the left end of the target container, and an attribute describing the distance between the right end of the card and the right end of the target container. The layout information also includes a specified size, and the layout attributes also include a size attribute. The configuration submodule is further configured to configure the attribute value of the size attribute of the card according to the specified size.
[0123] The apparatus 900 further includes:
[0124] The updating module is configured to determine a target size of the card according to the attribute value of the position attribute, and update the attribute value of the configured size attribute of the card to the target size if the target size is inconsistent with the specified size.
[0125] In some embodiments, the first configuration module 902 is further configured to re-execute the step of configuring the attribute values of the layout attributes of the card according to the layout information when it is detected that the position of the target anchor point on the client page has changed.
[0126] In some embodiments, the apparatus 900 further includes:
[0127] A first acquisition module, configured to acquire an anchor point identifier of at least one anchor point;
[0128] The first storage module is configured to store the anchor point identifier of the at least one anchor point in the software development kit of the client, so that the server side determines the target anchor point by accessing the anchor point identifier of the at least one anchor point in the software development kit.
[0129] In some embodiments, the apparatus 900 further includes:
[0130] A second acquisition module is configured to acquire a container identifier of at least one card container, where the card container is pre-embedded in the client page;
[0131] The second storage module is configured to store the container identifier of the at least one card container in the software development kit of the client, so that the server determines the target container by accessing the container identifier of the at least one card container in the software development kit.
[0132] In some embodiments, the card data further includes rendering information, and the apparatus 900 further includes:
[0133] The second configuration module is used to configure the attribute value of the rendering attribute of the card according to the rendering information, wherein the rendering information is used to determine the rendering timing of the card and whether the card is visible during rendering.
[0134] Among them, the implementation of each module in the above-mentioned device 900 can refer to the above-mentioned related embodiments, and this embodiment will not be described in detail here.
[0135] Based on the same inventive concept, the present disclosure further provides a card layout device. FIG10 is a block diagram of a card layout device according to an exemplary embodiment of the present disclosure. The card layout device 1000 includes:
[0136] The sending module 1001 is used to send the card data of the card to the terminal;
[0137] The card data includes layout information, which includes at least a target anchor point, a distance between the card and the target anchor point, and a target container. The layout information is used by the terminal to configure the attribute values of the layout attributes of the card. The layout attributes include position attributes, which are used to determine the position of the card displayed on the client page.
[0138] Among them, the implementation of each module in the above-mentioned device 1000 can refer to the above-mentioned related embodiments, and this embodiment will not be described in detail here.
[0139] Based on the same inventive concept, an embodiment of the present disclosure further provides a computer-readable medium having a computer program stored thereon, which implements the steps of the above method when executed by a processing device.
[0140] Based on the same inventive concept, an embodiment of the present disclosure further provides an electronic device, including:
[0141] a storage device having a computer program stored thereon;
[0142] A processing device is used to execute the computer program in the storage device to implement the steps of the above method.
[0143] Reference is now made to FIG11, which illustrates a schematic diagram of the structure of an electronic device (e.g., the terminal or server in FIG1) 1100 suitable for implementing embodiments of the present disclosure. The terminal device in the embodiments of the present disclosure may include, but is not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. The electronic device illustrated in FIG11 is merely an example and should not limit the functionality and scope of use of the embodiments of the present disclosure.
[0144] As shown in FIG11 , the electronic device 1100 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 1101, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1102 or a program loaded from a storage device 1108 into a random access memory (RAM) 1103. Various programs and data required for the operation of the electronic device 1100 are also stored in the RAM 1103. The processing device 1101, the ROM 1102, and the RAM 1103 are connected to each other via a bus 1104. An input / output (I / O) interface 1105 is also connected to the bus 1104.
[0145] Typically, the following devices may be connected to the I / O interface 1105: an input device 1106 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 1107 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 1108 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1109. The communication device 1109 may allow the electronic device 1100 to communicate with other devices wirelessly or by wire to exchange data. Although FIG11 illustrates the electronic device 1100 with various devices, it should be understood that not all of the illustrated devices are required to be implemented or present. More or fewer devices may alternatively be implemented or present.
[0146] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication device 1109, or installed from the storage device 1108, or installed from the ROM 1102. When the computer program is executed by the processing device 1101, the above-mentioned functions defined in the method of the embodiment of the present disclosure are performed.
[0147] It should be noted that the computer-readable medium mentioned above in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two. A computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or component, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, device, or component. In the present disclosure, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries computer-readable program code. Such a propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium may be transmitted using any suitable medium, including but not limited to wires, optical cables, RF (radio frequency), etc., or any suitable combination thereof.
[0148] In some embodiments, the client and server can communicate using any currently known or future developed network protocol, such as HTTP (HyperText Transfer Protocol), and can be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.
[0149] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.
[0150] The above-mentioned computer-readable medium carries one or more programs. When the above-mentioned one or more programs are executed by the electronic device, the electronic device: receives card data of a card sent by the server, wherein the card data includes layout information, and the layout information includes a target anchor point, the spacing between the card and the target anchor point, and a target container; configures the attribute values of the layout attributes of the card according to the layout information, and the layout attributes include position attributes, and the position attributes are used to determine the position of the card displayed on the client page.
[0151] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages, or a combination thereof, including, but not limited to, object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on the remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0152] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, program segment, or a part of code, and the module, program segment, or a part of code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order than that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of the boxes in the block diagram and / or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0153] The modules described in the embodiments of the present disclosure may be implemented in software or hardware, wherein the name of a module does not necessarily limit the module itself.
[0154] The functions described above herein may be performed, at least in part, by one or more hardware logic components. For example, and without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chip (SOCs), complex programmable logic devices (CPLDs), and the like.
[0155] In the context of the present disclosure, a machine-readable medium can be a tangible medium that can contain or store a program for use by or in conjunction with an instruction execution system, device or equipment. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium can include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0156] The above description is merely a preferred embodiment of the present disclosure and an illustration of the technical principles employed. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by the specific combination of the above-mentioned technical features, but also includes other technical solutions formed by any combination of the above-mentioned technical features or their equivalents without departing from the above-mentioned disclosed concepts. For example, a technical solution formed by replacing the above-mentioned features with (but not limited to) technical features with similar functions disclosed in this disclosure.
[0157] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details have been included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.
[0158] Although the subject matter has been described using language specific to structural features and / or methodological logical acts, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are merely example forms of implementing the claims. Regarding the apparatus in the above-described embodiments, the specific manner in which each module performs operations has been described in detail in the embodiments related to the method and will not be elaborated upon here.
Claims
1. A card layout method, comprising: Receive card data of a card sent by a server, wherein the card data includes layout information, and the layout information includes a target anchor point, a distance between the card and the target anchor point, and a target container; According to the layout information, the attribute values of the layout attributes of the card are configured, the layout attributes include position attributes, and the position attributes are used to determine the position of the card displayed on the client page.
2. The method according to claim 1, wherein configuring the attribute value of the layout attribute of the card according to the layout information comprises: Determine first position information of the target anchor point relative to the target container; Determine second position information of the card relative to the target container according to the first position information and the distance between the card and the target anchor point; The attribute value of the position attribute of the card is configured according to the second position information and the position of the target container on the client page.
3. The method according to claim 2, wherein the position attributes include attributes describing the distance between the top of the card and the top of the target container, attributes describing the distance between the bottom of the card and the bottom of the target container, attributes describing the distance between the left end of the card and the left end of the target container, and attributes describing the distance between the right end of the card and the right end of the target container, the layout information further includes a specified size, the layout attributes further include a size attribute, and the attribute values for configuring the layout attributes of the card according to the layout information further include: According to the specified size, configure the attribute value of the size attribute of the card; The method further includes: determining a target size of the card according to the attribute value of the position attribute, and updating the attribute value of the configured size attribute of the card to the target size when the target size is inconsistent with the specified size.
4. The method according to claim 1, wherein the method further comprises: When it is detected that the position of the target anchor point on the client page changes, the step of configuring the attribute value of the layout attribute of the card according to the layout information is re-executed.
5. The method according to claim 1, wherein the method further comprises: Get the anchor point identifier of at least one anchor point; The anchor point identifier of the at least one anchor point is stored in the software development kit of the client, so that the server side determines the target anchor point by accessing the anchor point identifier of the at least one anchor point in the software development kit.
6. The method according to claim 1, wherein the method further comprises: Obtaining a container identifier of at least one card container, where the card container is pre-embedded in the client page; The container identifier of the at least one card container is stored in the software development kit of the client, so that the server determines the target container by accessing the container identifier of the at least one card container in the software development kit.
7. The method according to claim 1, wherein the card data further comprises rendering information, the method further comprising: According to the rendering information, attribute values of the rendering attributes of the card are configured, wherein the rendering information is used to determine the rendering timing of the card and whether the card is visible during rendering.
8. A card layout method, comprising: Send the card data of the card to the terminal; The card data includes layout information, the layout information includes at least a target anchor point, a distance between the card and the target anchor point, and a target container, the layout information is used by the terminal to configure the attribute value of the layout attribute of the card, the layout attribute includes a position attribute, The position attribute is used to determine the position where the card is displayed on the client page.
9. A card layout device, comprising: A receiving module, configured to receive card data of a card sent by a server, wherein the card data includes layout information, and the layout information includes a target anchor point, a distance between the card and the target anchor point, and a target container; The first configuration module is used to configure the attribute value of the layout attribute of the card according to the layout information, wherein the layout attribute includes a position attribute, and the position attribute is used to determine the position of the card displayed on the client page.
10. A card layout device, comprising: A sending module, used for sending card data of the card to the terminal; Among them, the card data includes layout information, and the layout information at least includes a target anchor point, a distance between the card and the target anchor point, and a target container. The layout information is used by the terminal to configure the attribute values of the layout attributes of the card. The layout attributes include position attributes, and the position attributes are used to determine the position of the card displayed on the client page.
11. A computer readable medium having a computer program stored thereon, wherein when the program is executed by a processing device, the steps of the method according to any one of claims 1 to 8 are implemented.
12. An electronic device comprising: a storage device having a computer program stored thereon; A processing device, configured to execute the computer program in the storage device to implement the steps of the method according to any one of claims 1 to 8.
13. A computer program product, wherein when the program is executed by a processing device, the steps of the method according to any one of claims 1 to 8 are implemented.
Citation Information
Patent Citations
Interface layout method and device
CN106990950A
Interface layout changing method and device of application program
CN110968312A
Card type layout optimization method and device, storage medium and processor
CN113792237A
Card layout method and device, medium and electronic equipment
CN116414359A
Web site design system integrating dynamic layout and dynamic content
US20130219263A1
Cited By
Card rendering method and device for visual area, storage medium, electronic equipment and computer program product
CN119622143A
Construction method and device of visual data display interface, equipment and storage medium
CN121501404A
