Information display method, device, equipment and storage medium

By monitoring user operation behavior to obtain data volume and displaying it in pages, a cross-frame information display method is implemented, which solves the problem of resource waste and time-consuming on different frameworks, and achieves cross-frame versatility and efficiency.

CN113760272BActive Publication Date: 2024-10-18BEIJING WODONG TIANJUN INFORMATION TECH CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202010858310.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-08-24
Publication Date
2024-10-18
Estimated Expiration
2040-08-24

AI Technical Summary

Technical Problem

When different front-end technology frameworks (such as Vue, React, and mini programs) implement page paging functions, there are resource waste and time-consuming problems. Because each framework has its own unique development methods and components, the same functions require different frameworks. Redevelopment.

Method used

By monitoring the user operation behavior in the device view window, the displayed data volume is obtained, and the page display is performed based on the displayed data volume and the theoretical display data volume, and the target data is requested and displayed to achieve cross-frame versatility.

Benefits of technology

There is no need to distinguish between framework languages, and it can be directly applied to multiple different frameworks, avoiding resource waste and time-consuming, and solving problems caused by incompatible frameworks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113760272B_ABST
    Figure CN113760272B_ABST
Patent Text Reader

Abstract

The embodiment of the present application provides an information display method, apparatus, device and storage medium, which obtains the data to be displayed of the current page and the amount of displayed data of the current page by monitoring the user operation behavior in the device view window, and then displays the target data corresponding to the content display request in pages according to the amount of displayed data and the theoretical display data amount of each page. In this technical solution, the data to be displayed for each page is obtained by monitoring the user operation behavior, and the method does not distinguish between framework languages ​​and can be directly applied to multiple different frameworks without redevelopment, which solves the problem of resource waste and time consumption caused by the non-universality of the framework in the prior art.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of computer technology, and in particular to an information display method, device, equipment and storage medium. Background Art

[0002] With the rapid development of front-end technology, there are various technical frameworks for application development, such as Vue, applet, React, Sea.Js, etc. Since the development language and development rules of each framework are different, different frameworks use different development methods to implement a certain page function. Each framework corresponds to a different encapsulation method, and each page function needs to be redeveloped when used on different frameworks.

[0003] In the process of implementing the present invention, the inventors found that there are at least the following problems in the prior art: for the paging function of information display in the page, Vue paging uses the Scroller component of Vux, React paging uses the iScroll component, and the mini-program paging uses the scroll-view component. Although each component is very convenient to use within its own technical framework, the page functions such as information display between frameworks are not universal. Therefore, when the same page functions such as information display are implemented on different frameworks, they need to be developed separately, resulting in a waste of R&D resources and time-consuming problems. Summary of the invention

[0004] The embodiments of the present application provide an information display method, apparatus, device and storage medium to solve the problem that the same page function needs to be developed separately when implemented on different frameworks, resulting in a waste of R&D resources and time.

[0005] In a first aspect, an embodiment of the present application provides an information display method, including:

[0006] Get the data to be displayed on the current page;

[0007] Obtaining the amount of displayed data of the current page by monitoring user operation behavior in the device view window;

[0008] According to the displayed data volume and the theoretical display data volume of each page, the target data corresponding to the content display request is displayed in pages.

[0009] In a possible design of the first aspect, acquiring the amount of displayed data of the current page by monitoring the user operation behavior in the device view window includes:

[0010] Obtaining the scroll height of the current page by monitoring the user operation behavior in the device view window;

[0011] The displayed height of the current page and the amount of displayed data corresponding to the displayed height are determined according to the height of the visible area of ​​the device view window and the scrolling height of the current page.

[0012] In another possible design of the first aspect, the paging display of the target data corresponding to the content display request according to the displayed data volume and the theoretical display data volume of each page includes:

[0013] Determine whether the displayed data amount is greater than or equal to the theoretical displayed data amount of each page, and obtain a first result;

[0014] Determine whether the total amount of data displayed on the current page and all pages before the current page is less than the target total amount of data, and obtain a second result;

[0015] Determining the value of the preset bottoming parameter according to the position of the last piece of data on the current page;

[0016] When the first result, the second result and the preset bottoming parameter are all true, the undisplayed data in the target data is requested and displayed in the target page.

[0017] Optionally, determining the value of the preset bottoming parameter according to the position of the last piece of data on the current page includes:

[0018] When the last piece of data on the current page is located at the bottom of the device view window, setting the value of the preset bottoming parameter to true;

[0019] When the last piece of data on the current page is not at the bottom of the device view window, it is determined that the value of the preset bottoming parameter is false.

[0020] Optionally, the requesting for undisplayed data in the target data includes:

[0021] Sending a content acquisition request to a server of the target system, wherein the content acquisition request carries an identifier and a theoretical data volume of the target page;

[0022] The data to be displayed sent by the server is received, where the data to be displayed is the theoretical data amount that needs to be displayed on the target page.

[0023] Furthermore, the method further comprises:

[0024] The data to be displayed are sequentially added to an array directory, where the array directory is a directory created when the content display request is received and used to sequentially store target data.

[0025] In another possible design of the first aspect, before obtaining the data to be displayed on the current page, the method further includes:

[0026] Obtaining a content display request, wherein the content display request includes: a keyword;

[0027] Based on the keyword, the server of the target system is interacted with to obtain the total amount of target data corresponding to the content display request.

[0028] In yet another possible design of the first aspect, the method is executed within an initialization lifecycle of each framework.

[0029] In a second aspect, an embodiment of the present application provides an information display device, including: an acquisition module, a monitoring module and a processing module;

[0030] The acquisition module is used to acquire the data to be displayed on the current page;

[0031] The monitoring module is used to obtain the amount of displayed data of the current page by monitoring the user operation behavior in the device view window;

[0032] The processing module is used to display the target data corresponding to the content display request in pages according to the displayed data volume and the theoretical display data volume of each page.

[0033] In a possible design of the second aspect, the monitoring module is specifically used to obtain the scrolling height of the current page by monitoring user operation behaviors in the device view window, and determine the displayed height of the current page and the amount of displayed data corresponding to the displayed height according to the visible area height of the device view window and the scrolling height of the current page.

[0034] In another possible design of the second aspect, the processing module is specifically configured to:

[0035] Determine whether the displayed data amount is greater than or equal to the theoretical displayed data amount of each page, and obtain a first result;

[0036] Determine whether the total amount of data displayed on the current page and all pages before the current page is less than the target total amount of data, and obtain a second result;

[0037] Determining the value of the preset bottoming parameter according to the position of the last piece of data on the current page;

[0038] When the first result, the second result and the preset bottoming parameter are all true, the undisplayed data in the target data is requested and displayed in the target page.

[0039] Optionally, the processing module is used to determine the value of the preset bottoming parameter according to the position of the last piece of data on the current page, specifically:

[0040] The processing module is specifically used to set the value of the preset bottoming parameter to true when the last data of the current page is located at the bottom of the device view window, and to determine that the value of the preset bottoming parameter is false when the last data of the current page is not located at the bottom of the device view window.

[0041] Optionally, the processing module is used to request the undisplayed data in the target data, specifically:

[0042] The processing module is specifically used to send a content acquisition request to the server of the target system through the sending module, and the content acquisition request carries the identifier and theoretical data volume of the target page. The data to be displayed sent by the server is received through the receiving module, and the data to be displayed is the theoretical data volume that needs to be displayed on the target page.

[0043] Optionally, the processing module is further used to add the to-be-displayed data to an array directory in sequence, where the array directory is a directory created when the content display request is received and used to store target data in sequence.

[0044] In another possible design of the second aspect, the acquisition module is also used to obtain a content display request before obtaining the data to be displayed on the current page, and the content display request includes: keywords, interacting with the server of the target system based on the keywords, and obtaining the total amount of target data corresponding to the content display request.

[0045] In a third aspect, an embodiment of the present application provides a computer device, comprising a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the method described in the first aspect and various possible designs is implemented.

[0046] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, they are used to implement the method described in the first aspect and various possible designs.

[0047] The information display method, device, equipment and storage medium provided in the embodiments of the present application obtain the data to be displayed on the current page, and obtain the amount of displayed data on the current page by monitoring the user operation behavior in the device view window, and then display the target data corresponding to the content display request in pages according to the amount of displayed data and the theoretical display data amount of each page. In this technical solution, the data to be displayed on each page is obtained by monitoring the user operation behavior, and the method does not distinguish between framework languages ​​and can be directly applied to multiple different frameworks without redevelopment, which solves the problem of resource waste and time consumption caused by the non-universality of the framework in the prior art. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.

[0049] Figure 1 A schematic diagram of an application scenario of the information display method provided in an embodiment of the present application;

[0050] Figure 2 A flowchart of the first embodiment of the information display method provided in the embodiment of the present application;

[0051] Figure 3 A flowchart of the second embodiment of the information display method provided in the embodiment of the present application;

[0052] Figure 4 A schematic diagram representing the displayed height of the current page based on the scroll height of the current page and the device view window;

[0053] Figure 5 A flowchart of a third embodiment of the information display method provided in the embodiment of the present application;

[0054] Figure 6 A schematic diagram of the structure of an information display device embodiment provided in an embodiment of the present application;

[0055] Figure 7 A schematic diagram of the structure of a computer device embodiment provided in an embodiment of the present application.

[0056] The above drawings show clear embodiments of the present disclosure, which will be described in more detail below. These drawings and text descriptions are not intended to limit the scope of the present disclosure in any way, but to illustrate the concepts of the present disclosure to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION

[0057] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.

[0058] First, the terms involved in the embodiments of the present application are explained:

[0059] Vue (similar to view) is a progressive JavaScript framework for building user interfaces. It is designed to be applied layer by layer from the bottom up. The core library of Vue only focuses on the view layer, which is convenient for integration with third-party libraries or existing projects.

[0060] React uses a JavaScript library to build user interfaces. It is based on the idea of ​​specifying the user interface declaratively on top of a data model, and the user interface is automatically kept in sync with the underlying data.

[0061] Sea.JS is a module loading framework that follows the CommonJS specification and can be used to load any JavaScript module. The standard modules supported by Sea.JS follow the define format of the Modules / Wrappings specification and can run in Web browsers and node.JS environments.

[0062] H5 refers to the fifth generation of HTML, and also refers to all digital products made with the H5 language.

[0063] The application background of the embodiments of the present application is explained below.

[0064] With the rapid development of computer technology, there are various frameworks for developing application technologies, such as Vue, mini-programs, React, Sea.Js, etc. However, with the emergence of various framework technologies, the commonly used technologies in the page have their own separate encapsulation methods. Taking the paging function of the page as an example, the Vue paging function has the Vux Scroller component, the React paging function has the iScroll component, and the mini-program paging function has the scroll-view component. Each component is very convenient to use within its corresponding technical framework, but once it involves cross-framework, it is not applicable.

[0065] For example, div is the code used by h5 and Vue, and View is the code used by React and Taro. The development language and development rules of each front-end framework are different. Therefore, different frameworks have different development methods for different functions when implementing a certain function of the page. For example, when a developer has developed a paging function on react, and suddenly needs to make a similar function on the Vue project, the current practice is to redevelop it with your own code language for different frameworks, which will waste R&D resources and waste time.

[0066] In actual applications, for the paging function, in order to solve the problem of different frameworks not being universal, which leads to waste of R&D resources and time consumption, the inventor found that: since each front-end framework is a framework derived from javascript, that is, different frameworks are derivatives of javascript, the embodiment of the present application can use the most basic monitoring method of browser and javascript and the paging judgment conditions obtained based on practical summary to solve the above technical problems. The above is the technical concept of the present application.

[0067] The information display method provided in the embodiment of the present application can be applied to the client (i.e., the terminal device), that is, the user operation is judged on the client, and when paging is required, the data of the next page needs to be obtained from the server, and then appended to the bottom of the current data. Therefore, when the user slides on the page, he will find that data will be displayed as the page keeps sliding, for example, the recommended for you on the homepage of an e-commerce platform, the user's order list, after-sales list, etc. Optionally, when the data request is completed, the sliding page touches the bottom, and at this time, the bottom of the data generally prompts the user that the record has been completed or displays an app logo, etc.

[0068] In summary, the information display method provided by the embodiment of the present application obtains the data to be displayed of the current page, obtains the amount of displayed data of the current page by monitoring the user operation behavior in the device view window, and then displays the target data corresponding to the content display request in pages according to the amount of displayed data and the theoretical display data amount of each page. In this technical solution, the data to be displayed for each page is obtained by monitoring the user operation behavior, and the method does not distinguish between framework languages ​​and can be directly applied to multiple different frameworks without redevelopment, which solves the problem of resource waste and time consumption caused by the non-universality of the framework in the prior art.

[0069] For example, Figure 1 Schematic diagram of application scenarios of the information display method provided in the embodiment of the present application. Figure 1As shown, the application scenario may include a terminal device 11 and a server 12 of a target system. The terminal device 11 has a device view window 110, through which a user may issue a content display request. After receiving the content display request, the terminal device 11 interacts with the server 12 to determine the target data volume corresponding to the content display request.

[0070] It is understandable that during the interaction between the terminal device 11 and the server 12, the terminal device 11 can send the theoretical display data volume of each page to the server 12, so that when the server 12 feeds back the target data volume corresponding to the content display request to the terminal device 11, it can also send the data to be displayed of the first page to the terminal device 11, so that the terminal device 11 can display them in sequence in the device view window 110.

[0071] For example, refer to Figure 1 As shown, the height of the device view window 110 of the terminal device 11 can be greater than or equal to the height of each page. For example, the theoretical display data volume of each page is 10 data items, and the device view window 110 can display 4 data items at the same time, so that the other 6 data items can be displayed in sequence during the scrolling of the page.

[0072] Regarding how to perform paging display after the terminal device displays the data of a certain page through the device view window, please refer to the records in the following specific embodiments, which will not be repeated here.

[0073] In the embodiment of the present application, the terminal device may be a mobile terminal such as a mobile phone or a tablet, or may be other service terminals with a viewing window, etc. The embodiment of the present application does not limit the specific form of the terminal device, which may be determined according to the actual scenario, and will not be repeated here.

[0074] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.

[0075] Figure 2 This is a flow chart of the first embodiment of the information display method provided in the present application. The method can be applied to Figure 1 The terminal device in the scenario shown. Figure 2 As shown, the method may include the following steps:

[0076] S201, obtaining the data to be displayed on the current page.

[0077] In an embodiment of the present application, when a terminal device needs to display and / or present data through a device view window, it first determines the identifier of the current page, and then obtains the data to be displayed of the current page by interacting with the server.

[0078] It is understandable that the timing of data acquisition for different pages may be different, which is mainly reflected in the first page of the content display request and any page after the first page.

[0079] For example, if the current page is the first page of the content display request, the terminal device can carry the theoretical display data volume of each page when sending the content display request to the server, so that when the server feeds back the target data volume to the terminal device, it can also feed back the data to be displayed of the first page. If the current page is any page after the first page, the terminal device can send the identifier of the current page to the server when the data display of the previous page is completed, so that the server can determine the data to be displayed for the current page based on the identifier of the current page, and then send it to the terminal device, so that the terminal device can obtain the data to be displayed for the current page.

[0080] Exemplarily, in an embodiment of the present application, before step S201, the method may further include the following steps:

[0081] A1. Obtain a content display request, where the content display request includes: keywords.

[0082] Optionally, when a user browses a website and needs to request to display certain content, a content display request can be issued through the device view window. For example, a keyword is entered in the search box of the device view window to issue a content display request, or a content display request is issued by requesting to search for content related to the keyword through voice based on prompt information in the device view window. Accordingly, the terminal device can obtain a content display request including the keyword.

[0083] It is understandable that the embodiments of the present application do not limit the manner in which a user issues a content display request, which can be determined based on actual application scenarios and will not be elaborated herein.

[0084] A2. Based on the above keywords, the server of the target system is interacted with to obtain the total amount of target data corresponding to the content display request.

[0085] Exemplarily, the terminal device can determine the keyword used for search by analyzing the obtained content display request, and then send the keyword to the server of the target system so that the server can query the target data related to the keyword and the total amount of target data (for example, the total number of target data items) in the target system based on the keyword, and then feed back the total amount of target data to the terminal device.

[0086] Optionally, when the terminal device sends keywords to the server, it can also send the theoretical display data volume for each page at the same time. In this way, when the server feeds back the total target data volume corresponding to the above content display request to the terminal device, it can also send the data to be displayed of the first page to the terminal device. Therefore, the terminal device can also present the data to be displayed of the first page in sequence through the device view window.

[0087] It is understandable that the arrangement order of the target data corresponding to the content display request on each page can be determined based on preset rules, for example, the order of relevance from strong to weak, the order of time from recent to distant, etc. The embodiment of the present application does not limit the arrangement order of data on each page, which can be determined according to the actual scenario, and will not be repeated here.

[0088] S202: Obtain the amount of displayed data of the current page by monitoring the user operation behavior in the device view window.

[0089] Optionally, in an embodiment of the present application, when the terminal device displays target data through a device view window, the user operation in the device view window can be monitored to detect whether the user has operated the data in the device view window, such as scrolling operations such as sliding up and sliding down, and preview operations such as clicking. Therefore, the terminal device can determine the sliding height of the current page and the current display height of the current page based on the monitoring results and in combination with the height information of the visible area of ​​the device view window, and further, in combination with the height of each piece of data, the amount of displayed data of the current page can be determined.

[0090] In actual applications, the scrolling of the device view window can also be based on the height of each data. In this way, the terminal device can determine the amount of displayed data on the current page based on the amount of data scrolled up and the amount of data that can be displayed in the device view window.

[0091] S203: Display the target data corresponding to the content display request in pages according to the displayed data volume and the theoretical display data volume of each page.

[0092] In an embodiment of the present application, the terminal device can determine whether the data of the current page has been displayed based on the amount of data displayed for each page and the theoretical amount of data to be displayed for each page. When the data of the current page has been displayed, a request can be sent to the server of the target system to obtain the data to be displayed for the next page, so that after the data to be displayed for the next page is obtained, it can be placed behind the last data of the current page to achieve continuous display of the target data.

[0093] Optionally, the terminal device can determine the number of pages required to display all target data based on the total data volume of the target data corresponding to the content display request, and then when all the data to be displayed corresponding to the previous page are displayed, it requests the server of the target system to obtain the data to be displayed for the next page, and displays it in the device view window, thereby realizing automatic paging display of the target data corresponding to the content display request.

[0094] The information display method provided in the embodiment of the present application obtains the data to be displayed on the current page, obtains the amount of displayed data on the current page by monitoring the user operation behavior in the device view window, and then displays the target data corresponding to the content display request in pages according to the amount of displayed data and the theoretical display data amount of each page. In this technical solution, the data to be displayed on each page is obtained by monitoring the user operation behavior, and the method does not distinguish between framework languages ​​and can be directly applied to multiple different frameworks without redevelopment, which solves the problem of resource waste and time consumption caused by the non-universality of the framework in the prior art.

[0095] Based on the above embodiments, Figure 3 This is a flow chart of the second embodiment of the information display method provided in the present application. Figure 3 As shown, the above S202 can be implemented by the following steps:

[0096] S301. Obtain the scroll height of the current page by monitoring the user operation behavior in the device view window.

[0097] In an embodiment of the present application, once the terminal device enters the current page corresponding to the content display request, it starts to monitor the page scrolling in the device view window before all the content in the current page (the data to be displayed on the current page) is displayed. For example, a method for monitoring page scrolling is executed, such as: window.addEventListener('scroll', this.handleScroll.bind(this)).

[0098] Optionally, when monitoring that a user slides a page in the device view window so that the page scrolls up, the terminal device can obtain the scroll height of the current page. Exemplarily, in the handleScroll method, the page scroll bar height is obtained, that is, the height of the data in the current page that is scrolled out from the top of the device view window and is no longer displayed in the device view window.

[0099] In actual applications, due to the different frameworks of various browsers, scrollTop under various browsers has certain differences. For example, some support document.body.scrollTop, and some support document.documentElement.scrollTop. Therefore, in order to improve the compatibility between browsers, the method for the terminal device to obtain the scroll bar height of the current page is:

[0100] scrollTop=event.srcElement.body.scrollTop||document.body.scrollTop||document.documentElement.scrollTop;

[0101] Among them, || is an OR operation, and the above formula means: if event.srcElement.body.scrollTop has a value, the value of scrollTop is equal to the value of event.srcElement.body.scrollTop; if event.srcElement.body.scrollTop has no value, then the value of document.body.scrollTop is obtained; if document.body.scrollTop has a value, the value of scrollTop is equal to the value of document.body.scrollTop; if document.body.scrollTop has no value, then the value of scrollTop is equal to the value of document.documentElement.scrollTop.

[0102] Specifically, in IE browser, for pages without doctype (text type) declaration, use document.body.scrollTop or document.documentElement.scrollTop to get the height of the scroll bar. For pages with doctype (text type) declaration, use document.documentElement.scrollTop to get the height of the scroll bar. In Chrome and Firefox browsers, for pages without doctype declaration, use document.body.scrollTop to get the height of scrollTop; for pages with doctype declaration, use document.documentElement.scrollTop to get the height of scrollTop. In Safari browser, Safari uses its own internal setting window.pageYOffset to get scrollTop.

[0103] Therefore, in order to be compatible with all browsers, when the page is scrolled up out of the visible area of ​​the device view window, the definition of the scroll height can be defined as: scrollTop = event.srcElement.body.scrollTop||document.body.scrollTop||document.documentElement.scrollTop. Among them, event.srcElement.body.scrollTop represents the scroll height of the event source of the current page, document.body.scrollWidth represents the full text height of the web page, and document.documentElement.scrollTop represents the scroll bar position.

[0104] S302: Determine the displayed height of the current page and the amount of displayed data corresponding to the displayed height according to the height of the visible area of ​​the device view window and the scrolling height of the current page.

[0105] Optionally, the terminal device can determine the height of the visible area of ​​the device view window based on internal preset information, and combine it with the scrolling height of the current page determined by S301 above. By summing the height of the visible area of ​​the device view window and the scrolling height of the current page, the displayed height of the current page can be obtained, and then combined with the height of each piece of data, the amount of displayed data corresponding to the displayed height can be calculated.

[0106] For example, Figure 4This is a schematic diagram representing the displayed height of the current page based on the scroll height of the current page and the device view window. Figure 4 As shown, the scrolling height of the current page is the height corresponding to data 1 to data m, and the visible area height of the device view window is the height corresponding to data m+1 to data n. Therefore, the displayed height of the current page is the height corresponding to data 1 to data n.

[0107] Optional, Figure 4 The total height of the current page is also shown, that is, the total height of the current page is the height corresponding to data 1 to data N. In actual applications, the terminal device continues to monitor the user's operation behavior, data m and other data can be scrolled out of the device view window, and correspondingly, data n+1 to data N can be displayed in the device view window.

[0108] The information display method provided in the embodiment of the present application obtains the scroll height of the current page by monitoring the user operation behavior in the device view window, and determines the displayed height of the current page and the amount of displayed data corresponding to the displayed height according to the height of the visible area of ​​the device view window and the scroll height of the current page. In this technical solution, by obtaining the scroll height of the current page and combining it with the height of the visible area of ​​the device view window, the amount of displayed data of the current page can be accurately determined, which lays the foundation for the subsequent analysis of whether to perform paging.

[0109] Based on the above embodiments, Figure 5 This is a flow chart of the third embodiment of the information display method provided in the present application. Figure 5 As shown, the above S203 can be implemented by the following steps:

[0110] S501: Determine whether the displayed data volume is greater than or equal to the theoretical displayed data volume of each page, and obtain a first result.

[0111] In an embodiment of the present application, after the terminal device determines the displayed data volume of the current page, it compares it with the preset theoretical displayed data volume of each page to obtain a first result. Optionally, the first result includes: the displayed data volume is greater than or equal to the theoretical displayed data volume of each page, and the displayed data volume is less than the theoretical displayed data volume of each page.

[0112] When the amount of displayed data is greater than or equal to the theoretical amount of displayed data for each page, it indicates that the data to be displayed corresponding to the current page has been fully displayed, and the first paging condition is met. When the amount of displayed data is less than the theoretical amount of displayed data for each page, it indicates that part of the data to be displayed corresponding to the current page has not been displayed. At this time, the user operation behavior in the device view window can be continuously monitored until the data corresponding to the current page is fully displayed.

[0113] Exemplarily, the terminal device may also compare the displayed height of the current page (i.e., the sum of the scrolling height of the current page and the height of the visible area of ​​the device view window) with the total height of the current page to obtain a first result. When the displayed height of the current page is greater than or equal to the total height of the current page, it is determined that the data to be displayed corresponding to the current page has been fully displayed. When the displayed height of the current page is less than the total height of the current page, it is determined that part of the data to be displayed corresponding to the current page has not been displayed.

[0114] Illustratively, in an embodiment of the present application, the total height of the page may be expressed in the following form: scrollHeight=document.documentElement.scrollHeight.

[0115] S502: Determine whether the total amount of data displayed on the current page and all pages before the current page is less than the target total amount of data, and obtain a second result.

[0116] In an embodiment of the present application, before executing paging, the terminal device first needs to obtain the total amount of data that has been displayed for the current page and all pages before the current page, that is, sum the amount of data that has been displayed for the current page and all pages before the current page to obtain the amount of displayed data corresponding to the content display request, and then compare the amount of displayed data corresponding to the content display request with the total amount of target data corresponding to the content display request; if the total amount of data that has been displayed for the current page and all pages before the current page is less than the total amount of target data, it is necessary to request the data of the next page; if the total amount of data that has been displayed for the current page and all pages before the current page is greater than or equal to the total amount of target data, it indicates that the target data corresponding to the content display request has been fully displayed and no further paging is required.

[0117] S503: Determine the value of the preset bottoming parameter according to the position of the last data item on the current page.

[0118] In an embodiment of the present application, the terminal device obtains the position of the last data of the current page in real time. If the last data of the current page is at the bottom of the device view window, it indicates that the data of the current page has been fully displayed and it is necessary to request the data of the next page. If the last data of the current page is not at the bottom of the device view window, it indicates that the data of the current page has not been fully displayed and it is not necessary to request the data of the next page.

[0119] For example, from the above analysis, when the last data of the current page is at the bottom of the device view window, the value of the preset bottoming parameter can be set to true, and the second paging condition is met. When the last data of the current page is not at the bottom of the device view window, the value of the preset bottoming parameter is determined to be false, and the paging operation is not performed.

[0120] Optionally, when the current page is scrolled to the position where paging is to be performed (satisfying the first condition for paging), and the number of items on the current page is less than the total number of items (satisfying the second condition for paging), a problem will arise at this time, that is, since the results of the first condition and the second condition may always be true (true), the scrollToLower() method will be repeatedly executed. In order to avoid this problem, a bottoming parameter (isReachBottom parameter) is set in the page initialization life cycle of the terminal device. The initial value of the bottoming parameter is false (false), which is used as a switch to avoid repeated data requests. Therefore, by controlling the value state of the bottoming parameter, the timing of requesting paging can be well controlled, thereby avoiding repeated data requests. That is, when it is determined that paging is required, the value of the preset bottoming parameter is set to true, otherwise the value of the preset bottoming parameter is determined to be false.

[0121] S504: When the values ​​of the first result, the second result, and the preset bottoming parameter are all true, request the undisplayed data in the target data and display it in the target page.

[0122] Exemplarily, the terminal device requests the undisplayed data in the target data, that is, requests the data of the next page after the current page, when it determines that the amount of displayed data of the current page is greater than or equal to the theoretical amount of displayed data of each page, and the total amount of data displayed for the current page and all pages before the current page is less than the total amount of target data, and the values ​​of the preset bottoming parameters are all true.

[0123] For example, the scroll height of the current page + the height of the visible area of ​​the device view window >= the total height of the current page scrollHeight&&! isReachBottom&&When the total amount of data displayed on the current page and all pages before the current page is less than the total amount of target data, the scrollToLower() method is executed and isReachBottom is set to true. At this time, the terminal device executes the solution of requesting the undisplayed data in the target data.

[0124] Optionally, if the total number of requests for the current page and all pages before the current page is greater than or equal to the total amount of target data, the execution is stopped; otherwise, the execution continues, and the page number of the paging is increased by 1, and then the data request for the next page is made.

[0125] For example, each time the terminal device makes a data request, it will determine whether the number of requests for the current page and all pages before the current page is greater than or equal to the total number of data items. If the judgment result is true, a text prompt "All loaded" is displayed at the bottom of the page data.

[0126] In S504 of the embodiment of the present application, the scheme for requesting the undisplayed data in the target data may be as follows:

[0127] The terminal device sends a content acquisition request to the server of the target system, and the content acquisition request carries the identifier and theoretical data volume of the target page.

[0128] The data to be displayed sent by the receiving server is a theoretical amount of data that needs to be displayed on the target page.

[0129] Specifically, when the terminal device determines that it needs to request the data of the next page, it first sends a content acquisition request carrying the identifier of the target page and the theoretical data amount to the server of the target system, so that the server obtains the data to be displayed of the target page according to the received identifier of the target page, and the data amount of the data to be displayed is equal to the size of the theoretical data amount.

[0130] Furthermore, in an embodiment of the present application, in order to improve the user experience, the display of the target data in the device view window of the terminal device is continuous. Therefore, after requesting the data to be displayed of the target page, the information display method may further include the following steps:

[0131] S505: Add the data to be displayed to the array directory in sequence. The array directory is a directory created when a content display request is received and used to store target data in sequence.

[0132] In the embodiment of the present application, an array directory for sequentially storing data is pre-created in the terminal device. When the terminal device obtains the data to be displayed, it can store it in the array directory in sequence, that is, the newly requested page data is appended to the previously paging data, so that the data seen by the user in the page is continuous during display.

[0133] In actual application, it has the following specific definition: page directory pageList = requested data directory list result, array target list = pageList? list.concat(pageList):list. Among them, pageList and list are self-defined variable names, which can be changed. For example, pageList refers to the page display data obtained by the current operation paging. For example, a user has 30 orders. When he views the order list, if 10 items are displayed on one page, all the data needs to be queried three times in paging to be fully displayed. The 10 items on the first page, the 10 items on the second page, and the 10 items on the third page are all pageList data. These data are stored in sequence as list, which represents the total data. List = pageList? list.concat(pageList):list, which means: if pageList has a value, pageList is appended to list. If pageList has no value, list is equal to itself.

[0134] The information display method provided in the embodiment of the present application obtains the first result by judging whether the amount of displayed data is greater than or equal to the theoretical amount of displayed data for each page, and obtains the second result by judging whether the total amount of data displayed on the current page and all pages before the current page is less than the total amount of target data, and determines the value of the preset bottoming parameter according to the position of the last data on the current page, and then requests the undisplayed data in the target data when the first result, the second result and the value of the preset bottoming parameter are all true, and displays it in the target page. In this technical solution, whether to perform paging is determined based on the amount of displayed data on the current page, the amount of displayed data on all pages and the value of the bottoming parameter, which can effectively avoid repeated requests and lay the foundation for the paging display of subsequent terminal devices.

[0135] The following is an introduction to the embodiments of the present application using a specific example.

[0136] For example, suppose user A requests to display order data, and the terminal device receives 30 orders from the server. If 10 items are displayed on each page, 3 pages of data need to be requested, that is, 30 items of data are displayed through 3 pages.

[0137] Optionally, when the user sends an order display request, the terminal device can obtain the data of the first page and display it in the device view window when requesting the total order amount. When the user slides up the page to browse the order, the page scroll listener event window.addEventListener ('scroll' method) starts to execute (all browsers support this method), and then calculates whether the conditions for requesting the next page of data are met. The judgment conditions are:

[0138] 1. Whether the sum of the page scrolling height (the height that the user slides up) and the height of the visible area of ​​the device view window is greater than or equal to the total height of the current page;

[0139] 2. Whether the total number of data items on the current page and the current page is less than the total number of data items (30 items), if so, it indicates that paging can be performed, if not, it indicates that the data request has been completed and all data has been displayed, so there is no need to request paging;

[0140] 3. When both conditions are met, there is a problem with the method of requesting paging, which is that it will keep requesting. Because when the user slides the page to the bottom, since 10 items are always less than 30 items, this condition is always true. At this time, the paging request will be sent continuously, and may request dozens of pages, but there are only 3 pages of data in reality. In order to make up for the loophole in this judgment logic, a bottoming parameter (isReachBottom) can be set. It is set to false before requesting paging. When the paging condition is met, it is immediately set to true. After the next page of paging data is requested, it is set to false again. Therefore, in the embodiment of the present application, the implementation of the paging operation needs to meet the following conditions: the displayed data of the current page is greater than or equal to the total data of the current page&&! isReachBottom is true&& the total number of data items on the current page, that is, all pages before the current page, is less than the total target data amount corresponding to the order display request is true.

[0141] It is worth noting that, in any of the above embodiments of the present application, the information display method is executed within the initialization life cycle of each framework.

[0142] Specifically, put the execution code corresponding to the information display method into the initialization life cycle, that is, put window.addEventListener ('scroll' method) into the method executed at the beginning of the page, so that the monitoring will be executed.

[0143] Exemplarily, the initialization life cycle of each framework is different. For example, for h5, the execution code corresponding to the method can be written into the onload method. For React, the execution code corresponding to the method can be written into the componentWillMount() method. For Vue, the execution code corresponding to the method can be written into the create method. These are the usage rules defined by the framework itself. Therefore, through the above settings, this method is based on the universality of mobile terminal usage. Page codes div and view are supported. There is no need to distinguish between framework languages. Vue, react, jquery, etc. are all applicable. You only need to put the execution code into the initialization life cycle of each framework to execute it. The universality of the code is achieved, avoiding the waste of R&D resources and time-consuming problems caused by repeated development of page functions in different frameworks.

[0144] The following is an embodiment of the device of the present application, which can be used to execute the embodiment of the method of the present application. For details not disclosed in the embodiment of the device of the present application, please refer to the embodiment of the method of the present application.

[0145] Figure 6 This is a schematic diagram of the structure of an information display device embodiment provided in the present application. Figure 6 As shown, the device may include: an acquisition module 601 , a monitoring module 602 and a processing module 603 .

[0146] The acquisition module 601 is used to acquire the data to be displayed on the current page;

[0147] The monitoring module 602 is used to obtain the amount of displayed data of the current page by monitoring the user operation behavior in the device view window;

[0148] The processing module 603 is used to display the target data corresponding to the content display request in pages according to the displayed data volume and the theoretical display data volume of each page.

[0149] Exemplarily, in a possible design of the present application, the monitoring module 602 is specifically used to obtain the scrolling height of the current page by monitoring the user operation behavior in the device view window, and determine the displayed height of the current page and the amount of displayed data corresponding to the displayed height according to the visible area height of the device view window and the scrolling height of the current page.

[0150] Exemplarily, in another possible design of the present application, the processing module 603 is specifically configured to:

[0151] Determine whether the displayed data amount is greater than or equal to the theoretical displayed data amount of each page, and obtain a first result;

[0152] Determine whether the total amount of data displayed on the current page and all pages before the current page is less than the target total amount of data, and obtain a second result;

[0153] Determining the value of the preset bottoming parameter according to the position of the last piece of data on the current page;

[0154] When the first result, the second result and the preset bottoming parameter are all true, the undisplayed data in the target data is requested and displayed in the target page.

[0155] Optionally, the processing module 603 is used to determine the value of the preset bottoming parameter according to the position of the last piece of data on the current page, specifically:

[0156] Processing module 603 is specifically used to set the value of the preset bottoming parameter to true when the last data of the current page is at the bottom of the device view window, and to determine that the value of the preset bottoming parameter is false when the last data of the current page is not at the bottom of the device view window.

[0157] Optionally, the processing module 603 is used to request the undisplayed data in the target data, specifically:

[0158] Processing module 603 is specifically used to send a content acquisition request to the server of the target system through the sending module, and the content acquisition request carries the identifier and theoretical data volume of the target page, and receives the data to be displayed sent by the server through the receiving module, and the data to be displayed is the theoretical data volume that needs to be displayed on the target page.

[0159] Furthermore, the processing module 603 is further configured to sequentially add the data to be displayed to an array directory, where the array directory is a directory created when the content display request is received and used to sequentially store target data.

[0160] Exemplarily, in another possible design of the present application, the acquisition module 601 is also used to obtain a content display request before obtaining the data to be displayed on the current page, and the content display request includes: keywords, interacting with the server of the target system based on the keywords, and obtaining the total amount of target data corresponding to the content display request.

[0161] The above-mentioned device is used to implement the technical solution in the aforementioned method embodiment, and its implementation principle and technical effect are similar, which will not be repeated here.

[0162] It should be noted that it should be understood that the division of the various modules of the above device is only a division of logical functions. In actual implementation, they can be fully or partially integrated into one physical entity, or they can be physically separated. And these modules can all be implemented in the form of software called by processing elements; they can also be all implemented in the form of hardware; some modules can also be implemented in the form of software called by processing elements, and some modules can be implemented in the form of hardware. For example, the processing module can be a separately established processing element, or it can be integrated in a chip of the above device. In addition, it can also be stored in the memory of the above device in the form of program code, and called and executed by a processing element of the above device. The implementation of other modules is similar. In addition, these modules can be fully or partially integrated together, or they can be implemented independently. The processing element described here can be an integrated circuit with signal processing capabilities. In the implementation process, each step of the above method or each module above can be completed by an integrated logic circuit of hardware in the processor element or instructions in the form of software.

[0163] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium may be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid state disk (SSD)), etc.

[0164] Figure 7 This is a schematic diagram of the structure of a computer device embodiment provided in the present application. Figure 7As shown, the computer device may include: a processor 701, a memory 702, a communication interface 703 and a system bus 704. The memory 702 and the communication interface 703 are connected to the processor 701 through the system bus 704 and communicate with each other. The memory 702 is used to store computer execution instructions, and the communication interface 703 is used to communicate with other devices. When the processor 701 executes the computer execution instructions, the technical solution described in the method embodiment is implemented.

[0165] Optionally, in an embodiment of the present application, the computer device may further include a display interface 705, and the display interface 705 may be used to display the requested data.

[0166] In this Figure 7 In the embodiment, the processor 701 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA), or other programmable logic devices, discrete gates or transistor logic devices, or discrete hardware components.

[0167] The memory 702 may include a random access memory (RAM), may include a read-only memory (RAM), and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.

[0168] The communication interface 703 is used to implement the communication between the database access device and other devices (such as the client, the read-write library and the read-only library).

[0169] The system bus 704 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The system bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.

[0170] Optionally, an embodiment of the present application further provides a computer-readable storage medium, in which computer instructions are stored. When the computer instructions are executed on a computer, the computer executes the technical solution described in the above method embodiment.

[0171] Optionally, an embodiment of the present application further provides a chip for running instructions, wherein the chip is used to execute the technical solution described in the above method embodiment.

[0172] An embodiment of the present application also provides a program product, which includes a computer program, which is stored in a computer-readable storage medium. At least one processor can read the computer program from the computer-readable storage medium, and when the at least one processor executes the computer program, the technical solution described in the above method embodiment can be implemented.

[0173] In the present application, "at least one" means one or more, and "plurality" means two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can mean: the existence of A alone, the existence of A and B at the same time, and the existence of B alone, where A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship; in a formula, the character " / " indicates that the previous and next associated objects are in a "division" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single items or plural items.

[0174] It is to be understood that the various numerical numbers involved in the embodiments of the present application are only for the convenience of description and are not intended to limit the scope of the embodiments of the present application. In the embodiments of the present application, the size of the sequence number of each process does not mean the order of execution, and the execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0175] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the application disclosed herein. This application is intended to cover any variations, uses or adaptations of the present disclosure, which follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.

[0176] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims

1. An information display method, characterized in that: include: Get the data to be displayed on the current page; Obtaining the scroll height of the current page by monitoring the user operation behavior in the device view window; Determine, according to the height of the visible area of ​​the device view window and the scrolling height of the current page, the displayed height of the current page and the amount of displayed data corresponding to the displayed height; According to the displayed data volume and the theoretical display data volume of each page, the target data corresponding to the content display request is displayed in pages.

2. The method according to claim 1, characterized in that The paging display of the target data corresponding to the content display request according to the displayed data volume and the theoretical display data volume of each page includes: Determine whether the displayed data amount is greater than or equal to the theoretical displayed data amount of each page, and obtain a first result; Determine whether the total amount of data displayed on the current page and all pages before the current page is less than the target total amount of data, and obtain a second result; Determining the value of the preset bottoming parameter according to the position of the last piece of data on the current page; When the first result, the second result and the preset bottoming parameter are all true, the undisplayed data in the target data is requested and displayed in the target page.

3. The method according to claim 2, characterized in that The step of determining the value of the preset bottoming parameter according to the position of the last piece of data on the current page includes: When the last piece of data on the current page is located at the bottom of the device view window, setting the value of the preset bottoming parameter to true; When the last piece of data on the current page is not at the bottom of the device view window, it is determined that the value of the preset bottoming parameter is false.

4. The method according to claim 2, characterized in that: The requesting the undisplayed data in the target data includes: Sending a content acquisition request to a server of the target system, wherein the content acquisition request carries an identifier and a theoretical data volume of the target page; The data to be displayed sent by the server is received, where the data to be displayed is the theoretical data amount that needs to be displayed on the target page.

5. The method according to claim 4, characterized in that The method further comprises: The data to be displayed are sequentially added to an array directory, where the array directory is a directory created when the content display request is received and used to sequentially store target data.

6. The method according to any one of claims 1 to 5, characterized in that: Before obtaining the data to be displayed on the current page, the method further includes: Obtaining a content display request, wherein the content display request includes: a keyword; Based on the keyword, the server of the target system is interacted with to obtain the total amount of target data corresponding to the content display request.

7. The method according to any one of claims 1 to 5, characterized in that: The method is executed during the initialization life cycle of each frame.

8. An information display device, characterized in that: include: Acquisition module, monitoring module and processing module; The acquisition module is used to acquire the data to be displayed on the current page; The monitoring module is used to obtain the amount of displayed data of the current page by monitoring the user operation behavior in the device view window; The processing module is used to display the target data corresponding to the content display request in pages according to the displayed data volume and the theoretical display data volume of each page; The monitoring module is specifically used to obtain the scrolling height of the current page by monitoring the user operation behavior in the device view window, and determine the displayed height of the current page and the amount of displayed data corresponding to the displayed height according to the visible area height of the device view window and the scrolling height of the current page.

9. The device according to claim 8, characterized in that The processing module is specifically used for: Determine whether the displayed data amount is greater than or equal to the theoretical displayed data amount of each page, and obtain a first result; Determine whether the total amount of data displayed on the current page and all pages before the current page is less than the target total amount of data, and obtain a second result; Determining the value of the preset bottoming parameter according to the position of the last piece of data on the current page; When the first result, the second result and the preset bottoming parameter are all true, the undisplayed data in the target data is requested and displayed in the target page.

10. The device according to claim 9, characterized in that The processing module is used to determine the value of the preset bottoming parameter according to the position of the last data of the current page, specifically: The processing module is specifically used to set the value of the preset bottoming parameter to true when the last data of the current page is located at the bottom of the device view window, and to determine that the value of the preset bottoming parameter is false when the last data of the current page is not located at the bottom of the device view window.

11. The device according to claim 9, characterized in that The processing module is used to request the undisplayed data in the target data, specifically: The processing module is specifically used to send a content acquisition request to the server of the target system through the sending module, and the content acquisition request carries the identifier and theoretical data volume of the target page. The data to be displayed sent by the server is received through the receiving module, and the data to be displayed is the theoretical data volume that needs to be displayed on the target page.

12. The device according to claim 11, characterized in that The processing module is further used to sequentially add the data to be displayed to an array directory, where the array directory is a directory created when the content display request is received and used to sequentially store target data.

13. The device according to any one of claims 8 to 12, characterized in that: The acquisition module is further used to acquire a content display request before acquiring the data to be displayed on the current page, wherein the content display request includes a keyword, and interacts with a server of a target system based on the keyword to acquire the total amount of target data corresponding to the content display request.

14. A computer device comprising a processor, a memory and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the method according to any one of claims 1 to 7 is implemented.

15. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, which are used to implement the method according to any one of claims 1 to 7 when executed by a processor.

16. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, it is used to implement the method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Data paging display method and apparatus

    CN105740330A

  • Page display method and page display device

    CN106484726A