Method and apparatus for displaying information
By obtaining and processing the frame list of web page display area, inserting and hiding cells to achieve two-end alignment, the problem of alignment of the last row of elements in the adaptive web page layout is solved, improving display effect and performance.
Patent Information
- Application Number
- CN201810151711.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2018-02-14
- Publication Date
- 2024-12-03
- Estimated Expiration
- 2038-02-14
AI Technical Summary
The prior art is difficult to achieve the alignment of the two ends of the last line of elements in an adaptive web page layout, resulting in poor display effect and affecting the user experience.
By obtaining the frame list of the page display area, extract the number of cells in the last row. If it is less than the preset number, insert the target number of cells in the frame list, set its properties to achieve the alignment of both ends, and place it in the display area. hide.
It realizes adaptive alignment of the last row of elements, improves the web display effect, meets the display needs of different terminal devices, and reduces JavaScript calculation and DOM operations, improving rendering performance and information processing efficiency.
Smart Images

Figure CN110209965B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of computer technology, and more particularly to a method and device for displaying information. Background Art
[0002] With the development of the display industry and the popularity of terminals such as smartphones and tablets, fixed-width web page layouts can no longer meet people's requirements for web browsing experience. Therefore, as terminal adaptive layouts become more and more popular, e-commerce websites are also increasingly adopting adaptive layouts. In adaptive layouts, the adaptive alignment of list elements at both ends is widely used, such as the adaptive alignment of the two ends of the product list on e-commerce websites. Summary of the invention
[0003] The embodiments of the present application provide a method and device for displaying information.
[0004] In a first aspect, an embodiment of the present application provides a method for displaying information, including: obtaining a frame list for displaying item information in a display area of a page, wherein both ends of cells in each row of the frame list are aligned; extracting the number of cells in the last row of the frame list, and determining whether the number is less than a preset number; in response to determining that it is less than, inserting a target number of cells at a preset position in the last row of the frame list, wherein the target number is the difference between the preset number and the number of cells in the last row; setting the attributes of the target number of cells to preset attributes, and generating a target frame list, wherein cells with preset attributes are not displayed in the display area.
[0005] In some embodiments, extracting the number of cells in the last row of the frame list includes: traversing the frame list to determine the total number of cells in the frame list and the maximum number of cells in a row; determining whether a remainder of the total number divided by the maximum number is a preset value; in response to determining that the remainder of the total number divided by the maximum number is not the preset value, using the remainder as the number of cells in the last row of the frame list.
[0006] In some embodiments, the preset number is the maximum number of cells in a row.
[0007] In some embodiments, a frame list is established by the following steps: obtaining the position of a display area of a page and item information of items to be displayed, wherein the item information includes image information and quantity of the items; arranging and laying out the image information of the items to be displayed in sequence in the display area indicated by the position, wherein both ends of each row of image information after layout are adaptively aligned; generating a frame list according to the layout of the image information of the display area, wherein the items to be displayed correspond one-to-one to the cells in the frame list.
[0008] In some embodiments, the method further includes: setting the image information of the items to be displayed in the target cells of the target frame list one by one, wherein the target cells are cells in the target frame list other than the cells of the inserted target number; establishing a connection relationship between each image information and the detailed page of the item described by each image information, generating display information of the display area of the page to display the image information of the item.
[0009] In a second aspect, an embodiment of the present application provides a device for displaying information, including: an acquisition unit, configured to acquire a frame list for displaying item information in a display area of a page, wherein both ends of cells in each row of the frame list are aligned; a determination unit, configured to extract the number of cells in the last row of the frame list, and determine whether the number is less than a preset number; an insertion unit, configured to, in response to determining that it is less than, insert a target number of cells at a preset position in the last row of the frame list, wherein the target number is the difference between the preset number and the number of cells in the last row; a generation unit, configured to set attributes of the target number of cells to preset attributes, and generate a target frame list, wherein cells with preset attributes are not displayed in the display area.
[0010] In some embodiments, the determination unit includes: a traversal subunit configured to traverse the frame list and determine the total number of cells in the frame list and the maximum number of cells in a row; a determination subunit configured to determine whether the remainder of the total number divided by the maximum number is a preset value; and a response subunit configured to, in response to determining that the remainder of the total number divided by the maximum number is not a preset value, use the remainder as the number of cells in the last row of the frame list.
[0011] In some embodiments, the preset number is the maximum number of cells in a row.
[0012] In some embodiments, the device also includes a frame list establishment unit, which is configured to: obtain the position of the display area of the page and the item information of the items to be displayed, wherein the item information includes the image information and quantity of the items; arrange the image information of the items to be displayed in sequence in the display area indicated by the position, wherein the two ends of each row of image information after layout are adaptively aligned; generate a frame list according to the layout of the image information of the display area, wherein the items to be displayed correspond one-to-one to the cells in the frame list.
[0013] In some embodiments, the device also includes: a setting unit, configured to set the image information of the items to be displayed in the target cells of the target frame list one by one, wherein the target cells are cells in the target frame list other than the cells of the inserted target number; a display unit, configured to establish a connection relationship between each image information and a detailed page of the item described by each image information, and generate display information of the display area of the page to display the image information of the item.
[0014] In a third aspect, an embodiment of the present application provides an electronic device, comprising: one or more processors; a storage device for storing one or more programs; when the one or more programs are executed by one or more processors, the one or more processors implement the method described in any embodiment of the first aspect above.
[0015] In a fourth aspect, an embodiment of the present application provides a computer-readable medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the method described in any embodiment of the first aspect above.
[0016] The method and device for displaying information provided by the embodiment of the present application can extract the number of cells in the last row of the frame list by acquiring the frame list for displaying item information in the display area of the page to determine whether the number is less than the preset number. The two ends of the cells in each row of the frame list are aligned. If it is determined to be less than, a target number of cells can be inserted into the preset position of the last row in the frame list. The target number is the difference between the preset number and the number of cells in the last row. Then, the properties of the target number of cells can be set to preset properties to generate a target frame list. Cells with preset properties are not displayed in the display area. In this way, the adaptive alignment setting of each cell in the last row can be made to achieve the desired display effect. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Other features, objects and advantages of the present application will become more apparent by reading the detailed description of non-limiting embodiments made with reference to the following drawings:
[0018] Figure 1 is an exemplary system architecture diagram to which the present application may be applied;
[0019] Figure 2 is a flow chart of an embodiment of a method for displaying information according to the present application;
[0020] Figure 3A It is a schematic diagram of the arrangement and layout of the item information in the display area;
[0021] Figure 3BIt is another schematic diagram of the arrangement and layout of the item information in the display area;
[0022] Figure 3C This is another schematic diagram of the arrangement and layout of the item information in the display area.
[0023] Figure 3D This is a schematic diagram of the frame list after the cell is inserted;
[0024] Figure 4 is a schematic structural diagram of an embodiment of a device for displaying information according to the present application;
[0025] Figure 5 It is a structural diagram of a computer system suitable for implementing an electronic device of an embodiment of the present application. DETAILED DESCRIPTION
[0026] The present application will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the relevant invention, rather than to limit the invention. It should also be noted that, for ease of description, only the parts related to the relevant invention are shown in the accompanying drawings.
[0027] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0028] Figure 1 An exemplary system architecture 100 is shown to which the method for displaying information or the apparatus for displaying information according to the embodiments of the present application can be applied.
[0029] like Figure 1 As shown, the system architecture 100 may include terminals 101, 102, 103, a network 104, a server 105, and a database server 106. The network 104 is used to provide a medium for communication links between the terminals 101, 102, 103, the server 105, and the database server 106. The network 104 may include various connection types, such as wired, wireless communication links, or optical fiber cables, etc.
[0030] Users can use terminals 101, 102, 103 to interact with server 105 and database server 106 through network 104 to receive or send messages, etc. Various client applications can be installed on terminals 101, 102, 103, such as web browsers, web design applications, shopping applications, and instant messaging tools.
[0031] Terminals 101, 102, 103 may be various electronic devices with display screens, including but not limited to smart phones, tablet computers, e-book readers, laptop computers, desktop computers, and the like.
[0032] The database server 106 may be a server that provides various services. For example, the database server 106 may store item information of items to be displayed. The item information may include (but is not limited to) image information, description information, price information, etc. of the item.
[0033] The server 105 may also be a server that provides various services, such as a background server that provides support for various applications displayed on the terminals 101, 102, and 103. The background server may analyze and process the frame list data used to display item information in the display area of the page. At the same time, the item information of the items to be displayed obtained from the database server 106 may be analyzed and processed, and the processing results (such as the generated target frame list or the display information of the display area of the page) may be sent to the terminals 101, 102, and 103.
[0034] It should be noted that the method for displaying information provided in the embodiments of the present application is generally executed by the server 105 , and accordingly, the device for displaying information is generally set in the server 105 .
[0035] It should be noted that when the server 105 has the function of the database server 106 , the system architecture 100 may not be provided with the database server 106 .
[0036] It should be understood that Figure 1 The number of terminals, networks, servers and database servers in the embodiment is only for illustration. Any number of terminals, networks, servers and database servers may be provided according to the implementation requirements.
[0037] Continue to see Figure 2 , which shows a process 200 of an embodiment of a method for displaying information according to the present application. The method for displaying information may include the following steps:
[0038] Step 201, obtaining a frame list for displaying item information in a display area of a page.
[0039] In this embodiment, the method for displaying information is executed on an electronic device (eg Figure 1 The server 105 shown in the figure can obtain the frame list for displaying item information in the display area of the page through various methods. The two ends of each row of cells in the frame list are aligned. For example, the electronic device can obtain the above frame list from the local computer; or it can obtain the frame list from a database server (e.g., Figure 1 The database server 106 shown in the figure obtains the above-mentioned framework list.
[0040] It should be noted that in the process of web page production, the frame of the web page is usually designed according to the content of the web page. Among them, the frame of the web page can contain module units of different positions and different functions. In this way, the corresponding web page content is filled in each module unit, and the final web page can be generated. Therefore, the above-mentioned frame list is equivalent to the frame of the display area of the page, and the cells in the frame list are equivalent to the module units. By replacing the item information in each cell of the frame list, different content can be displayed in the display area of the page. In addition, in order to make the display effect more beautiful, the two ends of each row of cells in the frame list are usually aligned. In other words, the item information displayed in each row of the display area is arranged at equal intervals, and the item information located at the edge of the display area is aligned.
[0041] In this embodiment, the item information may be various information used to describe the items to be displayed. For example, the item information may include at least one of the following: number, brief text description, video, image information, price, etc. And the above frame list may be pre-generated or generated in real time.
[0042] In some optional implementations of this embodiment, a candidate frame list set may be pre-stored in the electronic device or the database server. The candidate frame list in the candidate frame list set may be a list of candidate frames that can be stored by the staff according to different terminals (e.g. Figure 1 In this way, the electronic device can select a matching candidate frame list from the candidate frame list set according to the size of the current terminal display screen to serve as the frame list of the display area of the above page.
[0043] Optionally, the above framework list can be established by following the steps below:
[0044] First, the electronic device can obtain the location of the display area of the page and the item information of the items to be displayed, wherein the item information includes the image information and quantity of the items. The format of the image information is not limited in this application, and it can be a static picture or a dynamic image. The quantity here refers to the total number of different items to be displayed. If the items to be displayed include item A and item B, then the total number is 2.
[0045] For example, a user can determine the location of the display area of a page through a terminal, so that the terminal can send the location information to the electronic device. At the same time, the user can use the terminal to send the identifier of the item to be displayed to the electronic device, so that the electronic device can obtain the item information of the item indicated by the identifier from a local or database server according to the identifier. The identifier can be information used to uniquely describe the item. The identifier can include at least one of text, numbers, letters, and characters.
[0046] Afterwards, the image information of the objects to be displayed may be sequentially arranged and laid out in the display area indicated by the position, wherein both ends of each row of the image information after the layout are adaptively aligned.
[0047] For example, the computer language functions of Cascading Style Sheets (CSS) can be used to arrange the image information of the items to be displayed in sequence in the display area, and the two ends of the arranged image information will be adaptively aligned. Specifically, by applying the CSS declaration: "text-align:justify", the image information of each row can be evenly spaced according to the width of the display area, and the two ends of the rows can be aligned. At the same time, by applying the CSS declaration: "display:inline-block", the image information of different items can show the characteristics of inline block elements. At this time, the following can be achieved: Figure 3A The arrangement layout shown.
[0048] CSS is a computer language used to express the style of files such as HTML (Hyper Text Markup Language) or XML (Extensible Markup Language). CSS can not only modify web pages statically, but also dynamically format the elements of web pages in conjunction with various scripting languages. It can precisely control the layout of the elements in the web page at the pixel level, supports almost all font sizes and styles, and has the ability to edit web page objects and model styles.
[0049] However, it should be noted that this method generally does not perform adaptive alignment processing on the layout of the last row, such as Figure 3A As shown in the figure, the layout of the last row is usually left-aligned by default. This causes the image information of the last row to be unable to align with the image information of other rows in the column direction, affecting the display effect. The row direction can refer to Figure 3A The first direction in the column direction can refer to Figure 3A The row direction and the column direction may be perpendicular to each other.
[0050] As an example, you can use the CSS declaration "text-align:last" again for the image information in the last row to achieve an adaptive alignment of the two ends of the last row. Figure 3B For example, you can declare the following after pseudo-object for the HTML tag (such as ul) of the item in the last row (each element in the page can be regarded as an object):
[0051]
[0052]
[0053] For another example, you can also use a direct scripting language (JavaScript) to arrange the image information of the displayed items in the display area in sequence. This method will calculate and update the position of the image information in the display area in real time, so as to achieve adaptive alignment of the two ends of the arranged image information. Figure 3C The arrangement layout shown.
[0054] JavaScript is a dynamically typed, weakly typed, prototype-based language with built-in support for types. However, it should be noted that this method that relies entirely on the JavaScript language to implement layout will involve a large amount of calculations and DOM (Document Object Model) operations when there are a large number of items to be displayed or the size of the display area changes frequently. This will in turn affect the information processing efficiency and the rendering performance of the browser. In addition, since different versions of browsers from different manufacturers have different support for JavaScript versions, compatibility issues also need to be addressed.
[0055] Finally, a frame list can be generated according to the layout of the image information of the display area, wherein the items to be displayed correspond to the cells in the frame list one by one. That is, the number of cells in the frame list is the same as the number of the items to be displayed, and the arrangement layout of the frame list is the same as the layout of the image information of the display area, and the two ends of the frame list are aligned.
[0056] Step 202, extract the number of cells in the last row of the frame list, and determine whether the number is less than a preset number.
[0057] In this embodiment, for the frame list obtained in step 201, the electronic device can extract the number of cells in the last row of the frame list, and then determine whether the number is less than a preset number. The preset number here can be set according to actual conditions. If it is determined that the number is less than the preset number, step 203 can be continued.
[0058] In some optional implementations of this embodiment, the electronic device may start traversing each cell of the frame list from the end of the frame list or any end of the last row, and stop traversing when it is determined that the cell has wrapped, so that the number of cells in the last row can be extracted. Here, the method for determining that the cell has wrapped is not limited in this application. For example, JavaScript can be used to calculate the distance between the specific position of each cell and the bottom of the display area in sequence. Among them, the specific position can be (but not limited to) the center point of the cell, any vertex or border, etc.
[0059] Optionally, first, the electronic device may traverse the frame list to determine the total number of cells in the frame list and the maximum number of cells in a row; then, it may determine whether the remainder of the total number of cells in the frame list divided by the maximum number of cells in a row is a preset value (usually 0); then, in response to determining that the remainder of the total number divided by the maximum number is not a preset value, the remainder may be used as the number of cells in the last row of the frame list. This process may also be implemented using JavaScript.
[0060] It is understandable that, since each item to be displayed corresponds to a cell in the frame list, if the electronic device has obtained the number of items to be displayed, the number of items to be displayed can be used as the total number of cells in the frame list. At this time, the electronic device can only traverse the first row of the frame list to determine the maximum number of cells in a row. Figure 3A and Figure 3B It can be seen that, usually, except for the last row in the frame list, the number of cells in other rows is the same, that is, the maximum number of cells in a row. The specific determination method can refer to the relevant description of the method for determining the number of cells in the last row above, which will not be repeated here.
[0061] Furthermore, the preset number may be the maximum number of cells in a row. It should be noted that if the number of cells in the last row is the same as the preset number, that is, the maximum number of cells in a row, or the remainder is 0, it means that the layout of the cells in the last row is the same as the layout of the cells in other rows. That is, there is no need to process the obtained frame list.
[0062] Step 203: In response to determining that it is less than, inserting a target number of cells at a preset position of the last row in the frame list.
[0063] In this embodiment, according to the determination result in step 202, if the electronic device determines that the number of cells in the last row is less than the preset number, a target number of cells may be inserted at the preset position of the last row in the frame list. The target number may be the difference between the preset number and the number of cells in the last row.
[0064] The preset position here can be set according to the arrangement and layout of the frame list. For example, if each row of cells is arranged from left to right, the preset position can be the right side of the last row. For another example, if each row of cells is arranged from right to left, the preset position can be the left side of the last row. In other words, the target number of cells can be inserted at the end of the frame list (i.e. after the last cell).
[0065] In this way, the cells in the last row (including the original cells and the inserted cells) can be adaptively aligned at both ends. In addition, the cells in the last row are aligned with the cells in the same column of other rows, so as to achieve a better display effect. At this time, the frame list can be as follows Figure 3D As shown in the figure. The dotted cells are the inserted cells.
[0066] It should be noted that the last row in this embodiment generally refers to a row at the end of the frame list according to the arrangement and layout order. That is, when the arrangement and layout are arranged from top to bottom, the last row is the bottom row; when the arrangement and layout are arranged from bottom to top, the last row is the top row.
[0067] Step 204, setting the properties of the target number of cells to preset properties, and generating a target framework list.
[0068] In this embodiment, the electronic device may set the properties of the target number of cells inserted in step 203 as preset properties. The cells with the preset properties are not displayed in the display area. That is, by setting the properties of the target number of cells inserted as preset properties, the display of the item information in the display area can be avoided from being affected. Furthermore, the electronic device may use the frame list after the target number of cells are inserted as the target frame list to generate and store the target frame list.
[0069] As an example, you can also use CSS to declare a new class selector, such as .extra:
[0070]
[0071] In this way, the element with this type selector applied is neither visible nor clickable. At this point, you can set the properties of the target number of cells to be inserted to extra. In other words, cells with this type of property will not be displayed to users in the display area, and when users click on the position of these cells in the display area, no triggering action will occur.
[0072] In some application scenarios, after generating the target frame list, the electronic device can also set the image information of the items to be displayed in the target cells of the target frame list one by one. The target cells can be cells in the target frame list other than the cells of the inserted target number. Afterwards, a connection relationship can be established between each image information and the detailed page of the item described by each image information, and the display information of the display area of the page can be generated to display the image information of the item. That is, the item information of the items to be displayed is filled into each target cell of the target frame list one by one, so that the item information can be displayed on the terminal used by the user in the layout form of the target frame list. The display effect can be seen in FIG. Figure 3C When the user triggers any item information displayed on the terminal by clicking or the like, the terminal may further display a detailed page of the item described by the item information. It should be noted that the item information here may include (but is not limited to) the above-mentioned image information.
[0073] It is understandable that by using CSS as the main method and JavaScript as the auxiliary method to complete the layout of the item display page, the space of the page can be fully utilized to display items and realize adaptive alignment of the two ends of the items, so as to meet the item display requirements in different application scenarios. That is, the number of items displayed in each row can be adaptively adjusted. At the same time, the layout of the last row can meet the required effect. In addition, compared with the method of relying entirely on JavaScript for layout in the prior art, JavaScript does not directly participate in the layout, but only provides assistance to a certain extent. In this way, JavaScript calculations and DOM operations can be greatly reduced, which can help improve the browser's rendering performance of the displayed content and improve information processing efficiency.
[0074] The method for displaying information provided in this embodiment obtains a frame list for displaying item information in a display area of a page, thereby extracting the number of cells in the last row of the frame list to determine whether the number is less than a preset number. The two ends of the cells in each row of the frame list are aligned. If it is determined to be less than, a target number of cells can be inserted into the preset position of the last row in the frame list. The target number is the difference between the preset number and the number of cells in the last row. Then, the properties of the target number of cells can be set to preset properties, thereby generating a target frame list. Cells with preset properties are not displayed in the display area. In this way, the adaptive alignment setting of each cell in the last row can be made to improve the information display effect.
[0075] See also Figure 4 As an implementation of the methods shown in the above figures, the present application provides an embodiment of a device for displaying information. The embodiment of the device for displaying information is similar to the above Figure 1 to Figure 2 The embodiment of the method for displaying information shown in FIG. Figure 1 to Figure 2 The operations and features described in the method for displaying information are also applicable to the device 400 for displaying information and the units included therein, which will not be described in detail here. The device can be specifically applied to various electronic devices.
[0076] like Figure 4 As shown, the device 400 for displaying information in this embodiment may include: an acquisition unit 401, configured to acquire a frame list for displaying item information in a display area of a page, wherein both ends of cells in each row of the frame list are aligned; a determination unit 402, configured to extract the number of cells in the last row of the frame list, and determine whether the number is less than a preset number; an insertion unit 403, configured to, in response to determining that it is less than, insert a target number of cells at a preset position in the last row of the frame list, wherein the target number is the difference between the preset number and the number of cells in the last row; a generation unit 404, configured to set the properties of the target number of cells to preset properties, and generate a target frame list, wherein cells with preset properties are not displayed in the display area.
[0077] In some optional implementations of this embodiment, the determination unit 402 may include: a traversal subunit (not shown in the figure), configured to traverse the frame list and determine the total number of cells in the frame list and the maximum number of cells in a row; a determination subunit (not shown in the figure), configured to determine whether a remainder of the total number divided by the maximum number is a preset value; and a response subunit (not shown in the figure), configured to, in response to determining that the remainder of the total number divided by the maximum number is not a preset value, use the remainder as the number of cells in the last row of the frame list.
[0078] Optionally, the preset number may be the maximum number of cells in the above row.
[0079] In some embodiments, the device 400 may further include a frame list establishing unit (not shown in the figure), configured to: obtain the position of the display area of the page and the item information of the items to be displayed, wherein the item information includes the image information and quantity of the items; arrange the image information of the items to be displayed in sequence in the display area indicated by the position, wherein the two ends of each row of image information after layout are adaptively aligned; generate a frame list according to the layout of the image information of the display area, wherein the items to be displayed correspond one-to-one to the cells in the frame list.
[0080] Furthermore, the device 400 may also include: a setting unit (not shown in the figure), configured to set the image information of the items to be displayed in the target cells of the target frame list one by one, wherein the target cells are cells in the target frame list except for the cells of the inserted target number; a display unit (not shown in the figure), configured to establish a connection relationship between each image information and a detailed page of the item described by each image information, and generate display information of the display area of the page to display the image information of the item.
[0081] See below Figure 5 , which shows a schematic diagram of the structure of a computer system 500 suitable for implementing an electronic device of an embodiment of the present application. Figure 5 The electronic device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0082] like Figure 5 As shown, the computer system 500 includes a central processing unit (CPU) 501, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 502 or a program loaded from a storage part 508 into a random access memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the system 500 are also stored. The CPU 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.
[0083] The following components are connected to the I / O interface 505: an input section 506 including a touch screen, a keyboard, a mouse, etc.; an output section 507 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 508 including a hard disk, etc.; and a communication section 509 including a network interface card such as a LAN card, a modem, etc. The communication section 509 performs communication processing via a network such as the Internet. A drive 510 is also connected to the I / O interface 505 as needed. A removable medium 511, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 510 as needed, so that a computer program read therefrom is installed into the storage section 508 as needed.
[0084] 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 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 part 509, and / or installed from the removable medium 511. When the computer program is executed by the central processing unit (CPU) 501, the above functions defined in the method of the present application are executed. It should be noted that the computer-readable medium of the present application can be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium can be, for example, - but not limited to - an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, 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 conductors, 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 application, a computer-readable medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, an apparatus or a device. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. Such propagated data signals 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, which may send, propagate, or transmit a program for use by or in combination with an instruction execution system, an apparatus or a device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
[0085] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the 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 square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square 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 square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0086] The units involved in the embodiments described in the present application may be implemented by software or hardware. The units described may also be set in a processor, for example, it may be described as: a processor includes an acquisition unit, a determination unit, an insertion unit, and a generation unit. The names of these units do not constitute a limitation on the unit itself in some cases. For example, the acquisition unit may also be described as "a unit for displaying a frame list of item information in the display area of an acquisition page".
[0087] As another aspect, the present application also provides a computer-readable medium, which may be included in the electronic device described in the above embodiment; or it may exist independently and not be assembled into the electronic device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by the electronic device, the electronic device: obtains a frame list for displaying item information in the display area of the page, wherein both ends of each row of cells in the frame list are aligned; extracts the number of cells in the last row of the frame list, and determines whether the number is less than a preset number; in response to determining that it is less than, inserts a target number of cells at a preset position in the last row of the frame list, wherein the target number is the difference between the preset number and the number of cells in the last row; sets the properties of the target number of cells to preset properties, and generates a target frame list, wherein cells with preset properties are not displayed in the display area.
[0088] The above description is only a preferred embodiment of the present application and an explanation of the technical principles used. Those skilled in the art should understand that the scope of the invention involved in the present application is not limited to the technical solution formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above invention concept. For example, the above features are replaced with the technical features with similar functions disclosed in this application (but not limited to) by each other to form a technical solution.
Claims
1. A method for displaying information, comprising: Obtaining a frame list for displaying item information in a display area of a page, wherein both ends of cells in each row of the frame list are aligned; Extracting the number of cells in the last row of the framework list, and determining whether the number is less than a preset number, wherein the preset number is the maximum number of cells in a row of the framework list; In response to determining that it is less than, inserting a target number of cells at a preset position of the last row in the frame list, wherein the target number is a difference between the preset number and the number of cells in the last row; The properties of the target number of cells are set as preset properties to generate a target frame list, wherein the cells with the preset properties are not displayed in the display area.
2. The method according to claim 1, wherein: The step of extracting the number of cells in the last row of the frame list includes: Traversing the frame list, determining the total number of cells in the frame list and the maximum number of cells in a row of the frame list; Determine whether a remainder obtained by dividing the total number by the maximum number is a preset value; In response to determining that a remainder obtained by dividing the total number by the maximum number is not a preset value, the remainder is used as the number of cells in the last row of the frame list.
3. The method according to any one of claims 1-2, wherein: The framework list is built by the following steps: Obtaining the location of the display area of the page and the item information of the items to be displayed, wherein the item information includes the image information and quantity of the items; Arranging the image information of the objects to be displayed in sequence in the display area indicated by the position, wherein both ends of each row of the image information after the layout are adaptively aligned; A frame list is generated according to the layout of the image information of the display area, wherein the objects to be displayed correspond one-to-one to the cells in the frame list.
4. The method according to claim 3, wherein: The method further comprises: Setting the image information of the items to be displayed in the target cells of the target framework list one by one, wherein the target cells are cells in the target framework list except the target number of cells inserted; A connection relationship is established between each piece of image information and a detailed page of the object described by each piece of image information, and display information of a display area of the page is generated to display the image information of the object.
5. A device for displaying information, comprising: An acquisition unit configured to acquire a frame list for displaying item information in a display area of a page, wherein both ends of cells in each row of the frame list are aligned; a determination unit configured to extract the number of cells in the last row of the framework list and determine whether the number is less than a preset number, wherein the preset number is the maximum number of cells in a row of the framework list; an inserting unit configured to, in response to determining that it is less than, insert a target number of cells at a preset position of the last row in the frame list, wherein the target number is a difference between the preset number and the number of cells in the last row; The generating unit is configured to set the properties of the target number of cells to preset properties and generate a target frame list, wherein the cells having the preset properties are not displayed in the display area.
6. The device according to claim 5, wherein: The determining unit comprises: A traversal subunit configured to traverse the frame list to determine the total number of cells in the frame list and the maximum number of cells in a row of the frame list; a determination subunit, configured to determine whether a remainder obtained by dividing the total number by the maximum number is a preset value; The response subunit is configured to, in response to determining that a remainder of the total number divided by the maximum number is not a preset value, use the remainder as the number of the last row of cells in the frame list.
7. The device according to any one of claims 5 to 6, wherein: The device further comprises a framework list establishing unit configured to: Obtaining the location of the display area of the page and the item information of the items to be displayed, wherein the item information includes the image information and quantity of the items; Arranging the image information of the objects to be displayed in sequence in the display area indicated by the position, wherein both ends of each row of the image information after the layout are adaptively aligned; A frame list is generated according to the layout of the image information of the display area, wherein the objects to be displayed correspond one-to-one to the cells in the frame list.
8. The device according to claim 7, wherein: The device also includes: A setting unit, configured to set the image information of the to-be-displayed items in the target cells of the target framework list one by one, wherein the target cells are cells in the target framework list except for the target number of cells inserted; The display unit is configured to establish a connection relationship between each image information and a detailed page of the object described by each image information, and generate display information of a display area of the page to display the image information of the object.
9. An electronic device, comprising: one or more processors; A storage device for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 4.
10. A computer readable medium having a computer program stored thereon, wherein: When the computer program is executed by a processor, the method according to any one of claims 1 to 4 is implemented.
