Data display method and device

文档序号:1816139 发布日期:2021-11-09 浏览:24次 中文

阅读说明:本技术 一种数据展示的方法和装置 (Data display method and device ) 是由 凡红恩 于 2021-08-26 设计创作,主要内容包括:本发明公开了一种数据展示的方法和装置,涉及计算机技术领域。该方法的一具体实施方式包括:从用户的数据查询请求中解析出查询条件和第一目标分页标识;确定与第一目标分页标识对应的最小指针和最大指针;所述最小指针指示已展示数据的最小编码,所述最大指针指示已展示数据的最大编码;确定与所述查询条件对应的第一结果数据集,根据所述最小指针和所述最大指针从第一结果数据集中筛选N条数据;N为正整数,代表第一目标分页数据量;展示所述N条数据,并更新所述最小指针和所述最大指针。该实施方式能够在确保用户浏览数据时查看到较新数据的情况下避免看到已浏览的数据。(The invention discloses a data display method and device, and relates to the technical field of computers. One embodiment of the method comprises: analyzing a query condition and a first target paging identifier from a data query request of a user; determining a minimum pointer and a maximum pointer corresponding to the first target paging identifier; the minimum pointer indicates a minimum encoding of the presented data, the maximum pointer indicates a maximum encoding of the presented data; determining a first result data set corresponding to the query condition, and screening N pieces of data from the first result data set according to the minimum pointer and the maximum pointer; n is a positive integer and represents a first target paging data size; and displaying the N pieces of data, and updating the minimum pointer and the maximum pointer. This embodiment can avoid viewing already viewed data while ensuring that the user views the data sees newer data.)

1. A method of data presentation, comprising:

analyzing a query condition and a first target paging identifier from a data query request of a user;

determining a minimum pointer and a maximum pointer corresponding to the first target paging identifier; the minimum pointer indicates a minimum encoding of the presented data, the maximum pointer indicates a maximum encoding of the presented data;

determining a first result data set corresponding to the query condition, and screening N pieces of data from the first result data set according to the minimum pointer and the maximum pointer; n is a positive integer and represents a first target paging data size;

and displaying the N pieces of data, and updating the minimum pointer and the maximum pointer.

2. The method of claim 1, wherein the first target page id is a page id of the first page; the minimum pointer and the maximum pointer corresponding to the first target paging identifier are respectively initial values;

filtering N pieces of data from a first result dataset according to the minimum pointer and the maximum pointer, comprising: and acquiring N pieces of data with codes larger than the maximum pointer from the first result data set according to the sequence from large codes to small codes.

3. The method of claim 1, wherein the first target page id is a page id of a page other than the first page;

determining a minimum pointer and a maximum pointer corresponding to the first target page identifier, including: taking the maximum value of the codes of all the data in the first result data set as the maximum pointer; determining a first displayed data volume according to each page with the page identifier smaller than the first target page identifier and the page data volume thereof, and determining the minimum pointer according to the first displayed data volume and the code of each piece of data in the first result data set;

filtering N pieces of data from a first result dataset according to the minimum pointer and the maximum pointer, comprising: and screening the N pieces of data which are encoded to be smaller than the minimum pointer from the first result data set according to the sequence from large to small of the code.

4. The method according to any one of claims 1-3, further comprising:

after the N pieces of data are displayed, receiving a paging query request of the user, and analyzing a second target paging identifier from the paging query request;

determining a second result data set corresponding to the query condition, and screening M pieces of data from the second result data set according to the minimum pointer and the maximum pointer; m is a positive integer and represents a second target paging data size;

and displaying the M pieces of data, and updating the minimum pointer and the maximum pointer.

5. The method of claim 4, wherein screening M pieces of data from the second result dataset according to the minimum pointer and the maximum pointer in case that the second target page identifier is consecutive to the first target page identifier and is larger than the first target page identifier comprises:

judging whether data with codes larger than the maximum pointer exist in the second result data set or not;

if yes, judging whether the difference value N1 between the maximum code of the data in the second result data set and the maximum pointer is larger than or equal to M; if so, acquiring M pieces of data with codes larger than the maximum pointer from the second result data set according to the sequence from small codes to large codes; if not, acquiring M1 pieces of data with codes larger than the maximum pointer from the second result data set according to the sequence from small to large of the codes, and acquiring (M-M1) pieces of data with codes smaller than the minimum pointer from the second result data set according to the sequence from large to small of the codes; m1 is a positive integer;

and otherwise, acquiring M pieces of data with codes smaller than the minimum pointer from the second result data set according to the sequence from large codes to small codes.

6. The method of claim 4, wherein screening M pieces of data from the second result dataset according to the minimum pointer and the maximum pointer in case that the second target page id is not consecutive to the first target page id and is larger than the first target page id comprises:

determining a second displayed data volume according to each page with the page identifier smaller than the second target page identifier and the page data volume of the page, and updating the maximum pointer according to the second displayed data volume;

judging whether data with codes larger than the maximum pointer exist in the second result data set or not;

if yes, judging whether the difference value N1 between the maximum code of the data in the second result data set and the maximum pointer is larger than or equal to M; if so, acquiring M pieces of data with codes larger than the maximum pointer from the second result data set according to the sequence from small codes to large codes; if not, acquiring M1 pieces of data with codes larger than the maximum pointer from the second result data set according to the sequence from small to large of the codes, and acquiring (M-M1) pieces of data with codes smaller than the minimum pointer from the second result data set according to the sequence from large to small of the codes; m1 is a positive integer;

and otherwise, acquiring M pieces of data with codes smaller than the minimum pointer from the second result data set according to the sequence from large codes to small codes.

7. The method of claim 4, wherein the amount of paging data for each page is the same.

8. An apparatus for data presentation, comprising:

the analysis module is used for analyzing the query condition and the first target paging identifier from the data query request of the user;

the pointer determining module is used for determining a minimum pointer and a maximum pointer corresponding to the first target paging identifier; the minimum pointer indicates a minimum encoding of the presented data, the maximum pointer indicates a maximum encoding of the presented data;

the data screening module is used for determining a first result data set corresponding to the query condition and screening N pieces of data from the first result data set according to the minimum pointer and the maximum pointer; n is a positive integer and represents a first target paging data size;

and the display module displays the N pieces of data and updates the minimum pointer and the maximum pointer.

9. An electronic device for data presentation, comprising:

one or more processors;

a storage device for storing one or more programs,

when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-7.

10. A computer-readable medium, on which a computer program is stored, which, when being executed by a processor, carries out the method according to any one of claims 1-7.

Technical Field

The invention relates to the technical field of computers, in particular to a data display method and device.

Background

The current browsing data is displayed page by page according to data deviation, the latest data is often the most forward and is divided into the first page during paging, and the later page during paging is the older data, so that a user cannot timely view the newly added data during paging. In addition, due to the dynamic increase of data, the previous data can be paged to the following page, so that the user can see the browsed data when turning the page.

Disclosure of Invention

In view of this, embodiments of the present invention provide a method and an apparatus for displaying data, which can avoid viewing browsed data while ensuring that a user views data to see newer data.

To achieve the above object, according to an aspect of an embodiment of the present invention, there is provided a data presentation method, including:

analyzing a query condition and a first target paging identifier from a data query request of a user;

determining a minimum pointer and a maximum pointer corresponding to the first target paging identifier; the minimum pointer indicates a minimum encoding of the presented data, the maximum pointer indicates a maximum encoding of the presented data;

determining a first result data set corresponding to the query condition, and screening N pieces of data from the first result data set according to the minimum pointer and the maximum pointer; n is a positive integer and represents a first target paging data size;

and displaying the N pieces of data, and updating the minimum pointer and the maximum pointer.

Optionally, the first target page identifier is a page identifier of the first page; the minimum pointer and the maximum pointer corresponding to the first target paging identifier are respectively initial values;

filtering N pieces of data from a first result dataset according to the minimum pointer and the maximum pointer, comprising: and acquiring N pieces of data with codes larger than the maximum pointer from the first result data set according to the sequence from large codes to small codes.

Optionally, the first target page identifier is a page identifier of a page other than the first page;

determining a minimum pointer and a maximum pointer corresponding to the first target page identifier, including: taking the maximum value of the codes of all the data in the first result data set as the maximum pointer; determining a first displayed data volume according to each page with the page identifier smaller than the first target page identifier and the page data volume thereof, and determining the minimum pointer according to the first displayed data volume and the code of each piece of data in the first result data set;

filtering N pieces of data from a first result dataset according to the minimum pointer and the maximum pointer, comprising: and screening the N pieces of data which are encoded to be smaller than the minimum pointer from the first result data set according to the sequence from large to small of the code.

Optionally, the method further includes:

after the N pieces of data are displayed, receiving a paging query request of the user, and analyzing a second target paging identifier from the paging query request;

determining a second result data set corresponding to the query condition, and screening M pieces of data from the second result data set according to the minimum pointer and the maximum pointer; m is a positive integer and represents a second target paging data size;

and displaying the M pieces of data, and updating the minimum pointer and the maximum pointer.

Optionally, screening M pieces of data from the second result data set according to the minimum pointer and the maximum pointer under the condition that the second target page identifier is continuous with the first target page identifier and is greater than the first target page identifier, including:

judging whether data with codes larger than the maximum pointer exist in the second result data set or not;

if yes, judging whether the difference value N1 between the maximum code of the data in the second result data set and the maximum pointer is larger than or equal to M; if so, acquiring M pieces of data with codes larger than the maximum pointer from the second result data set according to the sequence from small codes to large codes; if not, acquiring M1 pieces of data with codes larger than the maximum pointer from the second result data set according to the sequence from small to large of the codes, and acquiring (M-M1) pieces of data with codes smaller than the minimum pointer from the second result data set according to the sequence from large to small of the codes; m1 is a positive integer;

and otherwise, acquiring M pieces of data with codes smaller than the minimum pointer from the second result data set according to the sequence from large codes to small codes.

Optionally, screening M pieces of data from the second result data set according to the minimum pointer and the maximum pointer under the condition that the second target page identifier is not consecutive to the first target page identifier and is greater than the first target page identifier, including:

determining a second displayed data volume according to each page with the page identifier smaller than the second target page identifier and the page data volume of the page, and updating the maximum pointer according to the second displayed data volume;

judging whether data with codes larger than the maximum pointer exist in the second result data set or not;

if yes, judging whether the difference value N1 between the maximum code of the data in the second result data set and the maximum pointer is larger than or equal to M; if so, acquiring M pieces of data with codes larger than the maximum pointer from the second result data set according to the sequence from small codes to large codes; if not, acquiring M1 pieces of data with codes larger than the maximum pointer from the second result data set according to the sequence from small to large of the codes, and acquiring (M-M1) pieces of data with codes smaller than the minimum pointer from the second result data set according to the sequence from large to small of the codes; m1 is a positive integer;

and otherwise, acquiring M pieces of data with codes smaller than the minimum pointer from the second result data set according to the sequence from large codes to small codes.

Optionally, the paging data amount of each page is the same.

According to a second aspect of the embodiments of the present invention, there is provided an apparatus for data presentation, including:

the analysis module is used for analyzing the query condition and the first target paging identifier from the data query request of the user;

the pointer determining module is used for determining a minimum pointer and a maximum pointer corresponding to the first target paging identifier; the minimum pointer indicates a minimum encoding of the presented data, the maximum pointer indicates a maximum encoding of the presented data;

the data screening module is used for determining a first result data set corresponding to the query condition and screening N pieces of data from the first result data set according to the minimum pointer and the maximum pointer; n is a positive integer and represents a first target paging data size;

and the display module displays the N pieces of data and updates the minimum pointer and the maximum pointer.

Optionally, in the parsing module, the first target page identifier is a page identifier of a first page; in the pointer determining module, a minimum pointer and a maximum pointer corresponding to the first target paging identifier are respectively initial values;

the data filtering module filters N pieces of data from the first result dataset according to the minimum pointer and the maximum pointer, including: and acquiring N pieces of data with codes larger than the maximum pointer from the first result data set according to the sequence from large codes to small codes.

Optionally, in the parsing module, the first target page identifier is a page identifier of another page except the first page;

the pointer determination module determines a minimum pointer and a maximum pointer corresponding to the first target page identifier, including: taking the maximum value of the codes of all the data in the first result data set as the maximum pointer; determining a first displayed data volume according to each page with the page identifier smaller than the first target page identifier and the page data volume thereof, and determining the minimum pointer according to the first displayed data volume and the code of each piece of data in the first result data set;

the data filtering module filters N pieces of data from the first result dataset according to the minimum pointer and the maximum pointer, including: and screening the N pieces of data which are encoded to be smaller than the minimum pointer from the first result data set according to the sequence from large to small of the code.

Optionally, after the N pieces of data are displayed, the parsing module receives a paging query request of the user, and parses a second target paging identifier from the paging query request;

the data screening module determines a second result data set corresponding to the query condition, and screens M pieces of data from the second result data set according to the minimum pointer and the maximum pointer; m is a positive integer and represents a second target paging data size;

and the display module displays the M pieces of data and updates the minimum pointer and the maximum pointer.

Optionally, when the second target page identifier is continuous with the first target page identifier and is greater than the first target page identifier, the data filtering module filters M pieces of data from the second result data set according to the minimum pointer and the maximum pointer, including:

judging whether data with codes larger than the maximum pointer exist in the second result data set or not;

if yes, judging whether the difference value N1 between the maximum code of the data in the second result data set and the maximum pointer is larger than or equal to M; if so, acquiring M pieces of data with codes larger than the maximum pointer from the second result data set according to the sequence from small codes to large codes; if not, acquiring M1 pieces of data with codes larger than the maximum pointer from the second result data set according to the sequence from small to large of the codes, and acquiring (M-M1) pieces of data with codes smaller than the minimum pointer from the second result data set according to the sequence from large to small of the codes; m1 is a positive integer;

and otherwise, acquiring M pieces of data with codes smaller than the minimum pointer from the second result data set according to the sequence from large codes to small codes.

Optionally, screening M pieces of data from the second result data set according to the minimum pointer and the maximum pointer under the condition that the second target page identifier is not consecutive to the first target page identifier and is greater than the first target page identifier, including: determining a second displayed data volume according to each page with the page identifier smaller than the second target page identifier and the page data volume of the page, and updating the maximum pointer according to the second displayed data volume;

judging whether data with codes larger than the maximum pointer exist in the second result data set or not;

if yes, judging whether the difference value N1 between the maximum code of the data in the second result data set and the maximum pointer is larger than or equal to M; if so, acquiring M pieces of data with codes larger than the maximum pointer from the second result data set according to the sequence from small codes to large codes; if not, acquiring M1 pieces of data with codes larger than the maximum pointer from the second result data set according to the sequence from small to large of the codes, and acquiring (M-M1) pieces of data with codes smaller than the minimum pointer from the second result data set according to the sequence from large to small of the codes; m1 is a positive integer;

and otherwise, acquiring M pieces of data with codes smaller than the minimum pointer from the second result data set according to the sequence from large codes to small codes.

Optionally, the paging data amount of each page in the data screening module is the same.

According to a third aspect of the embodiments of the present invention, there is provided an electronic device for data presentation, including:

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 are caused to implement the method provided by the first aspect of the embodiments of the present invention.

According to a fourth aspect of embodiments of the present invention, there is provided a computer readable medium, on which a computer program is stored, which when executed by a processor, implements the method provided by the first aspect of embodiments of the present invention.

One embodiment of the above invention has the following advantages or benefits: the minimum pointer and the maximum pointer corresponding to the target paging identifier are determined through the data of the displayed page, the data are screened by the bidirectional pointer and displayed to the user, the user can check the current newer data, and the browsed data are avoided.

Further effects of the above-mentioned non-conventional alternatives will be described below in connection with the embodiments.

Drawings

The drawings are included to provide a better understanding of the invention and are not to be construed as unduly limiting the invention. Wherein:

FIG. 1 is a schematic diagram of a main flow of a method of data presentation according to an embodiment of the invention;

FIG. 2 is a schematic flow chart of data presentation in some alternative embodiments of the invention;

FIG. 3 is a schematic flow chart of data presentation in accordance with further alternative embodiments of the present invention;

FIG. 4 is a schematic diagram of the main modules of a data-displaying apparatus according to an embodiment of the present invention;

FIG. 5 is an exemplary system architecture diagram in which embodiments of the present invention may be employed;

fig. 6 is a schematic block diagram of a computer system suitable for use in implementing a terminal device or server of an embodiment of the invention.

Detailed Description

Exemplary embodiments of the present invention are described below with reference to the accompanying drawings, in which various details of embodiments of the invention are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the invention. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.

According to one aspect of the embodiments of the present invention, a method of data presentation is provided.

Fig. 1 is a schematic diagram of a main flow of a data presentation method according to an embodiment of the present invention. As shown in fig. 1, the method for data presentation according to the embodiment of the present invention includes: step S101-step S104.

Step S101, analyzing a query condition and a first target paging identifier from a data query request of a user;

step S102, determining a minimum pointer and a maximum pointer corresponding to the first target paging identifier;

step S103, determining a first result data set corresponding to the query condition, and screening N pieces of data from the first result data set according to the minimum pointer and the maximum pointer; n is a positive integer and represents a first target paging data size;

and step S104, displaying the N pieces of data, and updating the minimum pointer and the maximum pointer.

The current data presentation mode is usually to place the latest data on the first page or the first few pages, so that the user cannot view the latest data in time when turning back (or sliding) the page. In addition, when new data is generated, the data originally positioned on the front page can be moved to the rear page by the continuously increased new data, so that the browsed data can be seen when the user turns pages. In view of this, the present invention processes each piece of data, such as adding a code or identifier to each piece of data, which is referred to as an Identity document (Id) field. The field is a self-increment field, which is automatically incremented as the table data is increased. In one embodiment, each data is assigned with its corresponding code in order according to the generation time of each data not shown, the larger the Id value is, the newer the data is, and the smaller the Id value is, the older the data is, so that the code reflects the generation order of the data.

In actual use, the query condition and the first target page identifier are firstly analyzed from the data query request of the user. The query conditions can be set by the user according to the requirements, such as querying a certain type of product. The first target paging identifier refers to a page number corresponding to a specific certain page of data that the user actually wants to view. It can be understood that a plurality of pieces of data can be obtained according to the query condition of the user, and the data can be displayed to the user page by page in a paging mode. Illustratively, the first result data set includes 1000 pieces of data, and the front page presents 100 pieces of data per page, the first result data set may present the data to the user page by page through 10 pages. The first target page may be a first page (also referred to as a first page), or may be other pages other than the first page, such as a second page, a third page, and so on. The first target page id refers to an id of the first target page. The first target page identifier is an identifier of the first target page and is used for uniquely representing one page.

In actual use, however, the user may browse from the first page or jump to any page for browsing. Therefore, in order to respond to the request of the user in real time, an embodiment of the present invention selects to parse the first target page id of the user first, that is, parse the data of which page the user wants to view first. It is assumed here that when the user directly skips to a certain page of browsing data, the page or pages of data skipped by the user are regarded as browsed data. Therefore, in order to enable the user to always see the latest data and avoid seeing browsed data in the process of continuing to turn pages backwards, the second step needs to determine a minimum pointer and a maximum pointer corresponding to the first target paging identifier; the minimum pointer indicates the minimum code of the displayed data, the maximum pointer indicates the maximum code of the displayed data, and the data browsed by the user are filtered out through the bidirectional pointer; then determining a first result data set corresponding to the query condition, and screening N pieces of data from the first result data set according to the minimum pointer and the maximum pointer; n is a positive integer representing the first target page data size. Finally, the N pieces of data are presented to the user. In addition, the minimum pointer and the maximum pointer can be updated to prevent the user from viewing browsed data. Specifically, when the N pieces of data are displayed, corresponding minimum codes and maximum codes are extracted from the browsed data and are respectively assigned to the minimum pointer and the maximum pointer, so as to complete updating of the minimum pointer and the maximum pointer.

It should be noted that, if the first target page is not the first page, that is: if the first time the user views the page is not the first page, regarding the data on each page before the first target page as viewed data, and updating the minimum pointer and the maximum pointer according to the viewed data. For example, if the user first views the data on page 3, the minimum pointer is updated to 701 and the maximum pointer is updated to 1000.

By default, the minimum and maximum pointers are initial values, such as 0 or a null character. In some alternative embodiments, the first target page identifier is a page identifier of the first page; the minimum pointer and the maximum pointer corresponding to the first target page identifier are respectively initial values. Referring to fig. 2, in step S201, a query condition and a first target page id are parsed from a data query request of a user, and in step S202, it is determined whether the first target page id is a page id of a first page. If so, go to step S203, otherwise go to step S205. In step S203, the minimum pointer and the maximum pointer are determined to be initial values. In step S204, the N pieces of data are filtered from the first result dataset according to the minimum pointer and the maximum pointer, including: and acquiring N pieces of data with codes larger than the maximum pointer from the first result data set according to the sequence from large to small of the codes. For example, the first N pieces of data are selected from the first result data set according to the descending order of codes, or the last N pieces of data are selected from the first result data set according to the ascending order of codes. The acquired data is presented in step S205, and the minimum pointer and the maximum pointer are updated. For example, the data of the user query shown in the table below can be sorted by number to select the latest N pieces of data, for example, screening 4 pieces of latest data, and then the data with the numbers of 7-10 can be sequentially selected by Id number.

TABLE 1 first result data

Id Name Content
1 A1
2 A2
3 A3
4 A4
5 A5
6 A6
7 A7
8 A8
9 A9
10 A10

In other alternative embodiments, the first target page identifier is a page identifier of a page other than the first page. Referring to fig. 2, determining a minimum pointer and a maximum pointer corresponding to a first target page identifier includes: step S205, taking the maximum value of the codes of all the data in the first result data set as a maximum pointer; step S206, the displayed data volume is determined according to each page with the page identifier smaller than the first target page identifier and the page data volume thereof, and the minimum pointer is determined according to the displayed data volume and the code of each piece of data in the first result data set. In step S207, N pieces of data encoded with less than the smallest pointer are filtered from the first result data set in the order of the encoding from large to small. In step S208, the acquired data is displayed, and the minimum pointer and the maximum pointer are updated.

In one embodiment, when the first target page identifier is a page identifier of a page other than the first page, that is, a user wants to view data other than the first page, the maximum value of the encoding of each piece of data in the first result data set may be used as the maximum pointer. It is assumed here that when the user directly skips to a certain page of browsing data, the page or pages of data skipped by the user are regarded as browsed data. At this time, the first displayed data volume is determined according to each page with the page identifier smaller than the first target page identifier and the page data volume thereof, and then the minimum pointer is determined according to the first displayed data volume and the code of each piece of data in the first result data set. Specifically, each displayed data may be compared with each data in the first result data set, so as to obtain a code corresponding to each displayed data, and then a minimum code of the displayed data is obtained through a sorting algorithm or the like as a minimum pointer. Then, screening N pieces of data with codes smaller than the minimum pointer from the first result data set according to the sequence from large codes to small codes; thereby obtaining the N current latest data corresponding to the current page.

Illustratively, 1000 pieces of data are presented to the user by 10 pages, each page having a page data size of 100, and 1000 pieces of data encoded as 1-1000. Before the user views the data, the minimum pointer and the maximum pointer are respectively 0; when a user views the data of the 3 rd paging for the first time, since the amount of the data displayed in the first two paging is 200, the minimum pointer is updated to 801, the maximum pointer is updated to 1000, and 100 pieces of data with encoding less than 800 are screened from the 1000 pieces of data and are displayed to the user as the data of the 3 rd paging.

In practical application, after a user first views data of one page, the user may continue to view data of other pages. After N pieces of data of a first page are displayed, if a page query request of a user is received, a second target page identifier is analyzed from the page query request, a second result data set corresponding to a query condition is determined, M pieces of data are screened from the second result data set according to a minimum pointer and a maximum pointer, the M pieces of data are displayed, and the minimum pointer and the maximum pointer are updated; m is a positive integer representing the second target page data size. The value of M may be the same as or different from N in the foregoing.

In actual use, after browsing the data displayed on the current page, a user may randomly view data of other pages; therefore, after the first viewed N pieces of data are displayed, the data can be obtained according to the paging query request of the user and displayed. Referring to fig. 3, in step S301, a paging query request of a user is received, and an identifier corresponding to a next page to be viewed by the user, that is, a second target paging identifier, is parsed from the paging query request. The next page may be a continuous next page from the current page, or a continuous previous page, or a discontinuous page. In one embodiment, a problem of real-time data update needs to be considered, for example, if a user has data update during browsing, the updated data needs to be displayed to the user in time. In step S302, a second result data set corresponding to the foregoing query condition is determined, and the second result data set collects the added data on the basis of the first result data set. See, for example, the data set shown in table 2, which is augmented with new data having ids 11 and 12 relative to table 1. M pieces of data are filtered from the second result data set according to the minimum pointer and the maximum pointer in step S303, the M pieces of data are presented to the user in step S304, and the minimum pointer and the maximum pointer are updated.

TABLE 2 second result data

Id Name Content
1 A1
2 A2
3 A3
4 A4
5 A5
6 A6
7 A7
8 A8
9 A9
10 A10
11 A11
12 A12

Optionally, screening M pieces of data from the second result data set according to the minimum pointer and the maximum pointer under the condition that the second target page identifier is continuous with the first target page identifier and is greater than the first target page identifier, including:

judging whether data with codes larger than the maximum pointer exist in the second result data set;

if yes, judging whether the difference value N1 between the maximum code of the data in the second result data set and the maximum pointer is larger than or equal to M; if so, acquiring M pieces of data with codes larger than the maximum pointer from the second result data set according to the sequence of the codes from small to large; if not, acquiring M1 pieces of data with codes larger than the maximum pointer from the second result data set according to the sequence from small to large of the codes, and acquiring (M-M1) pieces of data with codes smaller than the minimum pointer from the second result data set according to the sequence from large to small of the codes; m1 is a positive integer;

otherwise, acquiring M pieces of data with codes smaller than the minimum pointer from the second result data set according to the sequence from large codes to small codes.

When the data size of the code smaller than the minimum pointer is smaller than (M-M1), the data is filtered according to the data size that can be actually acquired

For the situation that new data is added, whether data with codes larger than the maximum pointer exists in the second result data set needs to be judged; such data is thus preferentially presented to enable the user to obtain current up-to-date data. Therefore, if there exists such data, it is necessary to determine whether the quantity of such data meets the display requirement set by the user, that is, whether the difference N1 between the maximum code of the result data in the second result data set and the maximum pointer is greater than or equal to M; if so, acquiring M pieces of data with codes larger than the maximum pointer from the second result data set according to the sequence from small codes to large codes; that is, the latest M pieces of data are obtained from the second result data set in the order of the codes from small to large. If not, acquiring M1 pieces of data with codes larger than the maximum pointer from the second result data set according to the sequence from small to large of the codes, and acquiring (M-M1) pieces of data with codes smaller than the minimum pointer from the second result data set according to the sequence from large to small of the codes; that is, the latest (M-M1) pieces of data are currently obtained from the second result data set in the order of the codes from large to small. Wherein M is a positive integer. Taking the data shown in table 2 as an example, 4 pieces of data with Id of 7-10 (in this case, the minimum pointer is 7, and the maximum pointer is 10) are shown. The 11 th and 12 th items are new data. Assume that the target paging data amount is 4 (i.e., M — 4); then the 2 pieces of data encoding more than the largest pointer (i.e., the data with Id of 11 and 12, respectively) are first obtained from table 2 in the order of coding from small to large, and the (4-2) pieces of data encoding less than the smallest pointer (i.e., the data with Id of 5 and 6, respectively) are obtained from the second result dataset in the order of coding from large to small. And when the data with the codes larger than the maximum pointer does not exist in the second result data set, acquiring the M pieces of data with the codes smaller than the minimum pointer from the second result data set according to the sequence from large codes to small codes.

Optionally, screening M pieces of data from the second result data set according to the minimum pointer and the maximum pointer under the condition that the second target page identifier is not consecutive to the first target page identifier and is greater than the first target page identifier, including:

determining a second displayed data volume according to each page with the page identifier smaller than the second target page identifier and the page data volume of the page, and updating the maximum pointer according to the displayed data volume;

judging whether data with codes larger than the maximum pointer exist in the second result data set;

if yes, judging whether the difference value N1 between the maximum code of the data in the second result data set and the maximum pointer is larger than or equal to M; if so, acquiring M pieces of data with codes larger than the maximum pointer from the second result data set according to the sequence of the codes from small to large; if not, acquiring M1 pieces of data with codes larger than the maximum pointer from the second result data set according to the sequence from small to large of the codes, and acquiring (M-M1) pieces of data with codes smaller than the minimum pointer from the second result data set according to the sequence from large to small of the codes; m1 is a positive integer;

otherwise, acquiring M pieces of data with codes smaller than the minimum pointer from the second result data set according to the sequence from large codes to small codes.

When the second target page identifier is continuous with the first target page identifier, the user wants to continuously browse data. The updated max and min pointers described above may be employed at this time. When the second target paging identifier is not continuous with the first target paging identifier, the user wants to skip pages to browse data. It is assumed here that when the user directly skips to a certain page of browsing data, the page or pages of data skipped by the user are regarded as browsed data. At this point, the minimum pointer is still the minimum encoding of the data shown in the page that was previously shown. And then determining a second displayed data volume according to each page with the page identifier smaller than the second target page identifier and the page data volume thereof, and then determining a maximum pointer according to the second displayed data volume and the code of each piece of data in the second result data set. Specifically, each displayed piece of data may be compared with each piece of data in the second result data set, so as to obtain a code corresponding to each displayed piece of data, and then a maximum code of the displayed piece of data is obtained through a sorting algorithm or the like as a maximum pointer. And finally, screening the required amount of data from the second result data set according to the minimum pointer and the maximum pointer.

The user can set the page data amount of each page according to usage habits or the like. Therefore, the amount of data for each page may be the same or different.

According to a second aspect of embodiments of the present invention, there is provided an apparatus for data presentation.

Fig. 4 is a schematic diagram of main modules of data presentation according to an embodiment of the present invention, and as shown in fig. 4, the apparatus 400 of data presentation includes:

the analysis module 401 analyzes the query condition and the first target paging identifier from the data query request of the user;

a pointer determining module 402, configured to determine a minimum pointer and a maximum pointer corresponding to the first target page identifier; the minimum pointer indicates a minimum encoding of the presented data, the maximum pointer indicates a maximum encoding of the presented data;

a data screening module 403, configured to determine a first result data set corresponding to the query condition, and screen N pieces of data from the first result data set according to the minimum pointer and the maximum pointer; n is a positive integer and represents a first target paging data size;

a display module 404 for displaying the N pieces of data and updating the minimum pointer and the maximum pointer.

Optionally, in the parsing module, the first target page identifier is a page identifier of a first page; in the pointer determining module, a minimum pointer and a maximum pointer corresponding to the first target paging identifier are respectively initial values;

the data filtering module filters N pieces of data from the first result dataset according to the minimum pointer and the maximum pointer, including: and acquiring N pieces of data with codes larger than the maximum pointer from the first result data set according to the sequence from large codes to small codes.

Optionally, in the parsing module, the first target page identifier is a page identifier of another page except the first page;

the pointer determination module determines a minimum pointer and a maximum pointer corresponding to the first target page identifier, including: taking the maximum value of the codes of all the data in the first result data set as the maximum pointer; determining a first displayed data volume according to each page with the page identifier smaller than the first target page identifier and the page data volume thereof, and determining the minimum pointer according to the first displayed data volume and the code of each piece of data in the first result data set;

the data filtering module filters N pieces of data from the first result dataset according to the minimum pointer and the maximum pointer, including: and screening the N pieces of data which are encoded to be smaller than the minimum pointer from the first result data set according to the sequence from large to small of the code.

Optionally, after the N pieces of data are displayed, the parsing module receives a paging query request of the user, and parses a second target paging identifier from the paging query request;

the data screening module determines a second result data set corresponding to the query condition, and screens M pieces of data from the second result data set according to the minimum pointer and the maximum pointer; m is a positive integer and represents a second target paging data size;

and the display module displays the M pieces of data and updates the minimum pointer and the maximum pointer.

Optionally, when the second target page identifier is continuous with the first target page identifier and is greater than the first target page identifier, the data filtering module filters M pieces of data from the second result data set according to the minimum pointer and the maximum pointer, including:

judging whether data with codes larger than the maximum pointer exist in the second result data set or not;

if yes, judging whether the difference value N1 between the maximum code of the data in the second result data set and the maximum pointer is larger than or equal to M; if so, acquiring M pieces of data with codes larger than the maximum pointer from the second result data set according to the sequence from small codes to large codes; if not, acquiring M1 pieces of data with codes larger than the maximum pointer from the second result data set according to the sequence from small to large of the codes, and acquiring (M-M1) pieces of data with codes smaller than the minimum pointer from the second result data set according to the sequence from large to small of the codes; m is a positive integer;

and otherwise, acquiring M pieces of data with codes smaller than the minimum pointer from the second result data set according to the sequence from large codes to small codes.

Optionally, when the second target page identifier is not consecutive to the first target page identifier and is greater than the first target page identifier, the data filtering module filters M pieces of data from the second result data set according to the minimum pointer and the maximum pointer, including:

determining a second displayed data volume according to each page with the page identifier smaller than the second target page identifier and the page data volume of the page, and updating the maximum pointer according to the second displayed data volume;

judging whether data with codes larger than the maximum pointer exist in the second result data set or not;

if yes, judging whether the difference value N1 between the maximum code of the data in the second result data set and the maximum pointer is larger than or equal to M; if so, acquiring M pieces of data with codes larger than the maximum pointer from the second result data set according to the sequence from small codes to large codes; if not, acquiring M1 pieces of data with codes larger than the maximum pointer from the second result data set according to the sequence from small to large of the codes, and acquiring (M-M1) pieces of data with codes smaller than the minimum pointer from the second result data set according to the sequence from large to small of the codes; m1 is a positive integer;

and otherwise, acquiring M pieces of data with codes smaller than the minimum pointer from the second result data set according to the sequence from large codes to small codes.

Optionally, the paging data amount of each page in the data screening module is the same.

Fig. 5 illustrates an exemplary system architecture 500 to which the method of data presentation or the apparatus of data presentation of embodiments of the present invention may be applied.

As shown in fig. 5, the system architecture 500 may include terminal devices 501, 502, 503, a network 504, and a server 505. The network 504 serves to provide a medium for communication links between the terminal devices 501, 502, 503 and the server 505. Network 504 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.

The user may use the terminal devices 501, 502, 503 to interact with a server 505 over a network 504 to receive or send messages or the like. The terminal devices 501, 502, 503 may have installed thereon various communication client applications, such as shopping-like applications, web browser applications, search-like applications, instant messaging tools, mailbox clients, social platform software, etc. (by way of example only).

The terminal devices 501, 502, 503 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like.

The server 505 may be a server providing various services, such as a background management server (for example only) providing support for shopping websites browsed by users using the terminal devices 501, 502, 503. The backend management server may analyze and perform other processing on the received data such as the product information query request, and feed back a processing result (for example, target push information, product information — just an example) to the terminal device.

It should be noted that the method for data presentation provided by the embodiment of the present invention is generally executed by the server 505, and accordingly, the apparatus for data presentation is generally disposed in the server 505.

It should be noted that, the method for data presentation provided in the embodiment of the present invention may also be generally executed by a terminal device, and accordingly, the apparatus for data presentation is generally disposed in the terminal device.

It should be understood that the number of terminal devices, networks, and servers in fig. 5 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.

Referring now to FIG. 6, a block diagram of a computer system 600 suitable for use with a terminal device implementing an embodiment of the invention is shown. The terminal device shown in fig. 6 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present invention.

As shown in fig. 6, the computer system 600 includes a Central Processing Unit (CPU)601 that can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM)602 or a program loaded from a storage section 608 into a Random Access Memory (RAM) 603. In the RAM 603, various programs and data necessary for the operation of the system 600 are also stored. The CPU 601, ROM 602, and RAM 603 are connected to each other via a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.

The following components are connected to the I/O interface 605: an input portion 606 including a keyboard, a mouse, and the like; an output portion 607 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage section 608 including a hard disk and the like; and a communication section 609 including a network interface card such as a LAN card, a modem, or the like. The communication section 609 performs communication processing via a network such as the internet. The driver 610 is also connected to the I/O interface 605 as needed. A removable medium 611 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 610 as necessary, so that a computer program read out therefrom is mounted in the storage section 608 as necessary.

In particular, according to the embodiments of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 609, and/or installed from the removable medium 611. The computer program performs the above-described functions defined in the system of the present invention when executed by the Central Processing Unit (CPU) 601.

It should be noted that the computer readable medium shown in the present invention can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, 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 disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present invention, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present invention, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.

The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.

The modules described in the embodiments of the present invention may be implemented by software or hardware. The described modules may also be provided in a processor, which may be described as: a processor includes a parsing module, a pointer determination module, a data screening module, and a presentation module. The names of these modules do not in some cases form a limitation on the module itself, for example, a parsing module may also be described as a module for parsing out the query condition and the first target page identifier from the data query request of the user.

As another aspect, the present invention also provides a computer-readable medium that may be contained in the apparatus described in the above embodiments; or may be separate and not incorporated into the device. The computer readable medium carries one or more programs which, when executed by a device, cause the device to comprise: analyzing a query condition and a first target paging identifier from a data query request of a user; determining a minimum pointer and a maximum pointer corresponding to the first target paging identifier; the minimum pointer indicates a minimum encoding of the presented data, the maximum pointer indicates a maximum encoding of the presented data; determining a first result data set corresponding to the query condition, and screening N pieces of data from the first result data set according to the minimum pointer and the maximum pointer; n is a positive integer and represents a first target paging data size; and displaying the N pieces of data, and updating the minimum pointer and the maximum pointer.

According to the technical scheme of the embodiment of the invention, the minimum pointer and the maximum pointer corresponding to the target paging identifier are determined through the data of the displayed page, and the current latest data is screened by using the bidirectional pointer and displayed to the user, so that the user can check the current latest data and avoid seeing the browsed data.

The above-described embodiments should not be construed as limiting the scope of the invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions can occur, depending on design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

19页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种大数据可视化系统

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!