Data paging method and device, computer equipment and storage medium

文档序号:763050 发布日期:2021-04-06 浏览:9次 中文

阅读说明:本技术 数据分页方法、装置、计算机设备及存储介质 (Data paging method and device, computer equipment and storage medium ) 是由 梁嘉文 于 2020-12-28 设计创作,主要内容包括:本发明涉及数据展示技术领域,公开了一种数据分页方法、装置、计算机设备及存储介质,包括根据客户端发送的文件数据,获取解析数据,解析数据包括应用场景;若应用场景为目标场景,则将解析数据存储在非关系型数据库中,依据解析数据生成目标数据链表,目标数据链表包括链表标识和与链表标识对应的数据容量;将链表标识和数据容量发送给客户端,接收客户端基于链表标识和数据容量发送的分页请求,分页请求包括分页参数;基于分页参数,确定分页数据链表、分页数据地址和展示数量;根据分页数据地址从分页数据链表中获取目标数据,依据展示数量对目标数据进行处理,获取分页结果,将分页结果发送给客户端,以实现对目标场景下的数据快速分页。(The invention relates to the technical field of data display, and discloses a data paging method, a data paging device, computer equipment and a storage medium, wherein the data paging method comprises the steps of obtaining analysis data according to file data sent by a client, wherein the analysis data comprises an application scene; if the application scene is a target scene, storing the analysis data in a non-relational database, and generating a target data linked list according to the analysis data, wherein the target data linked list comprises a linked list identifier and data capacity corresponding to the linked list identifier; sending the linked list identification and the data capacity to a client, and receiving a paging request sent by the client based on the linked list identification and the data capacity, wherein the paging request comprises paging parameters; determining a paging data linked list, paging data addresses and display quantity based on the paging parameters; and acquiring target data from the paging data linked list according to the paging data address, processing the target data according to the display quantity, acquiring a paging result, and sending the paging result to the client so as to realize rapid paging of the data in the target scene.)

1. A data paging method is characterized by comprising the following steps executed by a server:

acquiring analysis data according to file data sent by a client, wherein the analysis data comprises an application scene;

if the application scene is a target scene, storing the analysis data in a non-relational database, and generating a target data linked list according to the analysis data, wherein the target data linked list comprises linked list identifications and data capacities corresponding to the linked list identifications;

sending the linked list identification and the data capacity to a client, and receiving a paging request sent by the client based on the linked list identification and the data capacity, wherein the paging request comprises paging parameters;

determining a paging data linked list, paging data addresses and display quantity based on the paging parameters;

and acquiring target data from the paging data linked list according to the paging data address, processing the target data according to the display quantity, acquiring a paging result, and sending the paging result to the client.

2. The data paging method as claimed in claim 1, wherein the obtaining parsing data according to the file data sent by the client comprises:

and acquiring file data sent by a client, and processing the file data by adopting an analysis interface to acquire analysis data.

3. The method for paging data as claimed in claim 1, wherein the storing the parsed data in a non-relational database, and generating a target data chain table according to the parsed data comprises:

preprocessing the analytic data to obtain preprocessed data;

acquiring warehousing data based on the preprocessing data;

and pressing the warehoused data into an empty linked list according to a preset sequence to generate a target data linked list.

4. The method for paging data as claimed in claim 3, wherein the preprocessing the parsed data to obtain preprocessed data comprises:

if the analysis data has abnormal data, cleaning the analysis data to obtain preprocessed data;

and if the analysis data does not have abnormal data, determining the analysis data as the preprocessing data.

5. The data paging method as claimed in claim 3, wherein the obtaining the binned data based on the preprocessed data comprises:

traversing the preprocessed data, and judging whether the preprocessed data has non-basic type data;

if the preprocessed data has non-basic type data, performing serialization processing on the non-basic type data to obtain warehousing data;

and if the preprocessed data does not have non-basic type data, determining the preprocessed data as warehousing data.

6. The data paging method as claimed in claim 3, wherein the pushing the binned data into an empty linked list according to a preset order to generate a target data linked list comprises:

pressing the input data into an empty linked list according to a preset sequence to generate an original data linked list carrying a source identifier;

and if the number of the original data linked lists is not 1, calling a function to aggregate the original data linked lists with the same source identification to obtain a target data linked list.

7. The data paging method of claim 3, wherein after sending the paging result to the client, the data paging method further comprises:

and setting expiration time for the warehousing data, and if the current time reaches the expiration time, starting an expiration automatic deleting mechanism to delete the warehousing data.

8. A paging device, comprising:

the analysis data acquisition module is used for acquiring analysis data according to the file data sent by the client, wherein the analysis data comprises an application scene;

a target data linked list obtaining module, configured to store the analysis data in a non-relational database if the application scene is a target scene, and generate a target data linked list according to the analysis data, where the target data linked list includes a linked list identifier and a data capacity corresponding to the linked list identifier;

the paging request acquisition module is used for sending the linked list identifier and the data capacity to a client and receiving a paging request sent by the client based on the linked list identifier and the data capacity, wherein the paging request comprises paging parameters;

the paging information acquisition module is used for determining a paging data linked list, a paging data address and a display number based on the paging parameters;

and the paging result acquisition module is used for acquiring target data from the paging data linked list according to the paging data address, processing the target data according to the display quantity, acquiring a paging result and sending the paging result to the client.

9. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the data paging method as claimed in any one of claims 1 to 7 when executing the computer program.

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

Technical Field

The present invention relates to the field of data display technologies, and in particular, to a data paging method and apparatus, a computer device, and a storage medium.

Background

The paging technology is a technology for displaying data segments to a user, and is a very common scenario in software design.

At present, the paging technology usually stores data in a relational database, the relational database has clear field and table relationship and a strict structure, and when paging is performed, a strict index structure needs to be established, programming is complex, response speed is slow, and therefore, the relational database is not suitable for paging requirements of data which do not need persistent storage, have small data volume and have high concurrency requirements.

Disclosure of Invention

The embodiment of the invention provides a data paging method, a data paging device, computer equipment and a storage medium, and aims to solve the problem that a relational database is not suitable for paging requirements of data which do not need persistent storage, are small in data volume and have high concurrency requirements.

A method of paging data, comprising:

acquiring analysis data according to file data sent by a client, wherein the analysis data comprises an application scene;

if the application scene is a target scene, storing the analysis data in a non-relational database, and generating a target data linked list according to the analysis data, wherein the target data linked list comprises linked list identifications and data capacities corresponding to the linked list identifications;

sending the linked list identification and the data capacity to a client, and receiving a paging request sent by the client based on the linked list identification and the data capacity, wherein the paging request comprises paging parameters;

determining a paging data linked list, paging data addresses and display quantity based on the paging parameters;

and acquiring target data from the paging data linked list according to the paging data address, processing the target data according to the display quantity, acquiring a paging result, and sending the paging result to the client.

A data paging device, comprising:

the analysis data acquisition module is used for acquiring analysis data according to the file data sent by the client, wherein the analysis data comprises an application scene;

a target data linked list obtaining module, configured to store the analysis data in a non-relational database if the application scene is a target scene, and generate a target data linked list according to the analysis data, where the target data linked list includes a linked list identifier and a data capacity corresponding to the linked list identifier;

the paging request acquisition module is used for sending the linked list identifier and the data capacity to a client and receiving a paging request sent by the client based on the linked list identifier and the data capacity, wherein the paging request comprises paging parameters;

the paging information acquisition module is used for determining a paging data linked list, a paging data address and a display number based on the paging parameters;

and the paging result acquisition module is used for acquiring target data from the paging data linked list according to the paging data address, processing the target data according to the display quantity, acquiring a paging result and sending the paging result to the client.

A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, the processor implementing the steps of the above data paging method when executing the computer program.

A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of the above-mentioned data paging method.

According to the data paging method, the data paging device, the computer equipment and the storage medium, analysis data are obtained according to file data sent by a client, and the analysis data comprise application scenes; if the application scene is a target scene, the analysis data is stored in a non-relational database, a target data linked list is generated according to the analysis data, the target data linked list comprises linked list identification and data capacity corresponding to the linked list identification, the analysis data is data which does not need persistent storage, is simple in relation and has high concurrency requirement, and is stored in the target data linked list of the non-relational database in order to ensure convenience of subsequent paging. And sending the linked list identification and the data capacity to a client, and sending the linked list identification and the data capacity to the client, so that the data is more transparent, the user can check the data conveniently, and a subsequent paging request is generated by decision. And receiving a paging request sent by a client based on the linked list identification and the data capacity, wherein the paging request comprises paging parameters so as to facilitate data scheduling and ensure that target data can be rapidly displayed subsequently. And determining a paging data linked list, paging data addresses and display quantity based on the paging parameters, and realizing flexible data scheduling. And acquiring target data from the paging data linked list according to the paging data address, processing the target data according to the display quantity, acquiring a paging result, sending the paging result to the client, and paging in a non-relational database, wherein the paging process is simple, and the response speed is effectively improved.

Drawings

In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the description of the embodiments of the present invention will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art that other drawings can be obtained according to these drawings without inventive labor.

FIG. 1 is a diagram illustrating an application environment of a data paging method according to an embodiment of the present invention;

FIG. 2 is a flow chart of a data paging method according to an embodiment of the present invention;

FIG. 3 is a flowchart illustrating a data paging method according to an embodiment of the present invention;

FIG. 4 is a flowchart illustrating a data paging method according to an embodiment of the present invention;

FIG. 5 is a flowchart illustrating a data paging method according to an embodiment of the present invention;

FIG. 6 is a flowchart illustrating a data paging method according to an embodiment of the present invention;

FIG. 7 is a diagram illustrating a paging device according to an embodiment of the present invention;

FIG. 8 is a schematic diagram of a computer device according to an embodiment of the invention.

Detailed Description

The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.

The data paging method provided by the embodiment of the invention can be applied to the application environment shown in fig. 1, wherein computer equipment/terminal equipment is communicated with a server through a network. The data paging method provided by the embodiment of the invention can rapidly page data in a target scene. The data paging method provided by the embodiment of the invention can be applied to a server side and terminal equipment. The computer device/terminal device may include, but is not limited to, various personal computers, notebook computers, smart phones, tablet computers, and portable wearable devices, among others. The server may be implemented as a stand-alone server or as a server cluster consisting of a plurality of servers.

In an embodiment, as shown in fig. 2, a data paging method is provided, which is described by taking the server in fig. 1 as an example, and includes the following steps:

s201: and acquiring analysis data according to the file data sent by the client, wherein the analysis data comprises an application scene.

The file data refers to a file sent by the client to the server, and for example, the file data may be an Excel file.

The analysis data is data obtained by analyzing file data sent by the client. The application scenario is a scenario for forming file data, for example, the application scenario may be a scenario corresponding to forming file data that needs to be persistently stored. And forming a scene corresponding to the file data without persistent storage. And forming scenes corresponding to small data quantity, simple data relation and high concurrent requirement file data. The data with high concurrency requirement refers to data formed by a plurality of users accessing the same application program interface or the same Url address at the same time point.

As an example, the application scenario may be a scenario corresponding to file data formed based on a commodity in a shopping cart when the user adds the commodity in the shopping cart. It can be understood that the purpose of obtaining the commodity added to the shopping cart by the user is to analyze the user, and the commodity added to the shopping cart by the user has the characteristics of real-time performance, small data volume and the like, so that an application scenario forms a scenario corresponding to the data volume being small, the relationship between the data being simple, but the high-file data being concurrently required. For example, the amount of data may be 1 thousand, 2 thousand, or the like.

As another example, the application scenario may be statistical company employee information, and the company employee information forms a scenario corresponding to the document data. It can be understood that the company employee information is generally important and has a stability characteristic, and therefore, in this case, the application scenario needs a scenario corresponding to the persistently stored file data.

Specifically, a client acquires file data carrying an application scene, a data uploading interface is arranged on the client, a user calls the data uploading interface to sequentially send the file data to a server, and the file data is analyzed to obtain analyzed data comprising the application scene.

S202: and if the application scene is a target scene, storing the analysis data in a non-relational database, and generating a target data linked list according to the analysis data, wherein the target data linked list comprises linked list identifications and data capacity corresponding to the linked list identifications.

The target scene is a scene corresponding to the analysis data which does not need persistent storage, is simple in relation and has high concurrency requirements.

The target data linked list is a linked list used for storing data (i.e. data to be put in storage) obtained after the analysis data is processed. In this embodiment, the linked list is a storage structure formed by a series of nodes (each data in the linked list is referred to as a node) established on the non-relational database, the logical order of the data is realized by the link order of the pointers in the linked list, and the nodes can be dynamically generated during operation. Each node comprises two parts: one is a data field for storing data and the other is a pointer field for storing the address of the next node. Compared with a linear table sequential structure, the linked list is convenient for searching numbers. The target data linked list is a bidirectional linked list, and can be traversed in two directions when data processing is subsequently carried out, so that the data processing time is shortened, the processing efficiency is improved, and the number of the target data linked lists is at least one. The linked list identifier is an identifier for uniquely identifying the target linked list of data. For example, the linked list identification may be list01 or list02, etc.

The data capacity is the amount of data stored in each target data link list. For example, the target data link list01 includes data a, b, c, and d, that is, the data capacity of the target data link list01 is 4.

A non-relational database, referred to as Not Only SQL, means: not just SQL (Structured query language), describes a collection of large numbers of Structured data storage methods. Non-relational databases include redis, and the like.

At present, data is usually directly stored in a relational database during paging, and the response speed is slow because the relational database is stored on a hard disk. The input/output speed of the hard disk is low, but the input/output speed of the analysis data with high concurrency requirement is high, and the analysis data with high concurrency requirement can not be effectively processed by the relational database. And a strict index structure needs to be established in the process of storing the data in the relational database so as to be convenient for subsequent indexing, and the coding is complex. In this embodiment, when the application scene is a target scene, the analysis data is data that does not need persistent storage, has a simple relationship, and has a high concurrency requirement, and in order to ensure convenience of subsequent paging, the analysis data is processed to exclude abnormal data in the analysis data, and then the data with the abnormal exclusion is stored in a target data linked list of the non-relational database.

S203: and sending the linked list identification and the data capacity to a client, and receiving a paging request sent by the client based on the linked list identification and the data capacity, wherein the paging request comprises paging parameters.

The paging request is a request for paging part or all of the target data linked list to be displayed at the client.

The paging parameter is a parameter for paging so that the server sends data to be paged to the client. Paging is a technique for displaying data stored in a non-relational database on a client for a user to view. In the embodiment, the linked list identifier and the data capacity are sent to the client, so that the data is more transparent, the user can check the data conveniently, and a subsequent paging request is generated in a decision-making manner.

Specifically, in order to facilitate the user to determine the target linked list data stored in the non-relational database and the data capacity of each target linked list data, the linked list identifier and the data capacity are sent to the client, so that the user can determine the data to be displayed according to the linked list identifier and the data capacity, the data can be scheduled, and the target data can be rapidly displayed subsequently.

S204: and determining a paging data linked list, a paging data address and a display number based on the paging parameters.

The paging data linked list is a linked list which needs paging and is selected by a user, and flexible scheduling is achieved.

The paging data address is an address indicating a start position and an end position of data obtained from the paging data link table. In this embodiment, flexible data calling can be implemented by using the paging parameter.

And when the display quantity is returned to the client, the quantity of the data displayed on each page is convenient for orderly managing the data.

In this embodiment, when the server obtains the paging parameter, the paging parameter is read to obtain the paging data linked list, the paging data address, and the display number, thereby realizing flexible scheduling of data.

S205: and acquiring target data from the paging data linked list according to the paging data address, processing the target data according to the display quantity, acquiring a paging result, and sending the paging result to the client.

The target data refers to data for presentation at the client.

The paging result is obtained by processing the target data, and the paging result is specifically a result of obtaining the number of data shown in each page according to the number of data shown. For example, the target data is 200 pieces of data, the display number is 100, and the paging result includes 2 pages, the 1 st piece of data to the 100 th piece of data are used as the data of the first page, and the 101 st piece of data to the 200 th piece of data are used as the data of the second page, so that the paging result is formed, and the data are ensured to be displayed in order.

Specifically, target data to be displayed are obtained from a linked list queue according to the paging data address, the total amount of the target data is divided by the display amount to obtain data displayed on each page, and a paging result is formed. The embodiment performs paging in the non-relational database, the paging process is simple, and the response speed is effectively improved. Wherein the non-basic type data refers to data other than the basic type data. The basic type data refers to data corresponding to data types such as byte, short, int, long, float, double, borolean, char, and the like.

According to the data paging method provided by the embodiment, analytic data are obtained according to file data sent by a client, and the analytic data comprise an application scene; if the application scene is a target scene, the analysis data is stored in a non-relational database, a target data linked list is generated according to the analysis data, the target data linked list comprises linked list identification and data capacity corresponding to the linked list identification, the analysis data is data which does not need persistent storage, is simple in relation and has high concurrency requirement, and is stored in the target data linked list of the non-relational database in order to ensure convenience of subsequent paging. And sending the linked list identification and the data capacity to a client, and sending the linked list identification and the data capacity to the client, so that the data is more transparent, the user can check the data conveniently, and a subsequent paging request is generated by decision. And receiving a paging request sent by a client based on the linked list identification and the data capacity, wherein the paging request comprises paging parameters so as to facilitate data scheduling and ensure that target data can be rapidly displayed subsequently. And determining a paging data linked list, paging data addresses and display quantity based on the paging parameters, and realizing flexible data scheduling. And acquiring target data from the paging data linked list according to the paging data address, processing the target data according to the display quantity, acquiring a paging result, sending the paging result to the client, and paging in a non-relational database, wherein the paging process is simple, and the response speed is effectively improved.

In an embodiment, step S201, acquiring parsing data according to file data sent by a client, includes:

and acquiring file data sent by the client, and processing the file data by adopting an analysis interface to acquire analysis data.

The parsing interface is an interface for parsing the file data to parse the file data into parsing data recognizable to the computer, for example, the parsing interface may be an interface provided by an Apache POI, such as a create interface.

Specifically, the number of file data to be uploaded to the server is determined, and if the number of the file data is smaller than a preset number, a data uploading interface is called to send the file data to the server. If the number of the file data is not less than the preset number, in order to facilitate operation, when the number of the file data is large, the batch uploading interface is called, all the file data are simultaneously selected, all the file data are sent to the server, the operation is convenient and simple, the server calls the analysis interface provided by the apache.

In an embodiment, as shown in fig. 3, step S202, that is, storing the parsed data in a non-relational database, and generating a target data linked list according to the parsed data includes:

s301: and preprocessing the analytic data to obtain preprocessed data.

The preprocessing is processing for eliminating abnormal data such as null values and the like existing in the analysis data so as to ensure the accuracy of subsequently displayed data. The preprocessed data are data obtained through preprocessing. Specifically, traversing the analysis data, and when abnormal data such as null values exist in the analysis data, cleaning the data and eliminating the interference of the abnormal data.

S302: and acquiring warehousing data based on the preprocessing data.

Wherein the binned data is data stored in the target data linked list.

Specifically, when the non-basic type data exists in the preprocessed data, the non-basic type data is serialized to obtain the standard format of the data to be put in storage, so that the buffer pressure is reduced, and the subsequent data transmission is facilitated.

S303: and pressing the data to be stored into the empty linked list according to a preset sequence to generate a target data linked list.

The preset sequence is a preset sequence, and the preset sequence is the left side of the empty linked list or the right side of the empty linked list and can be determined according to the actual needs of the user. In this embodiment, the put-in data is pressed into the empty linked list according to the preset sequence, which is beneficial to ensuring the ordering of the put-in data.

As an example, the put-in data is sequentially pressed into the empty linked list from the left side of the empty linked list, and then the paging data is displayed in the client according to a first-in first-out sequence when being subsequently displayed.

As another example, if the put-in data is sequentially pressed into the empty linked list from the right side of the empty linked list, the paging data is displayed in the client according to the order of first input and last output when being displayed subsequently.

The data paging method provided by this embodiment preprocesses the analysis data to obtain preprocessed data, and eliminates abnormal data interference. And acquiring warehousing data based on the preprocessing data. And the warehoused data are pressed into the empty linked list according to a preset sequence to generate a target data linked list, so that the orderliness of the warehoused data is guaranteed.

In an embodiment, as shown in fig. 4, step S301, namely, preprocessing the parsed data to obtain preprocessed data, includes:

s401: and if the analyzed data has abnormal data, cleaning the analyzed data to obtain preprocessed data.

The abnormal data refers to data such as a null value. In this embodiment, the analysis data is cleaned, so that the abnormal data is cleaned, the abnormal data is favorably eliminated, the cache pressure is reduced, and the effectiveness of the analysis data is ensured.

S402: and if the analysis data does not have abnormal data, determining the analysis data as the preprocessing data.

In the embodiment, the analysis data with abnormal data is cleaned to obtain the data to be processed, so that the interference of the abnormal data is eliminated, and the accuracy of the subsequently displayed data is ensured.

According to the data paging method provided by the embodiment, if the analyzed data has abnormal data, the analyzed data is cleaned to obtain the preprocessed data, so that the abnormal data can be eliminated, the cache pressure is reduced, and the effectiveness of the analyzed data is ensured. And if the analysis data does not have abnormal data, determining the analysis data as the preprocessing data.

In an embodiment, as shown in fig. 5, the step S302, namely acquiring the binned data based on the preprocessed data, includes:

s501: and traversing the preprocessed data, and judging whether the preprocessed data has non-basic type data.

S502: and if the preprocessed data has non-basic type data, performing serialization processing on the non-basic type data to acquire the database data.

The serialization processing refers to the processing of converting non-basic type data into byte sequences, so that computer identification is facilitated, storage space is effectively reduced, and quick response is guaranteed.

Specifically, a Serializable interface is constructed, ObjectOutputStream is adopted in the Serializable interface to process non-basic type data so as to convert the non-basic type data into byte sequence warehousing data and transmit the warehousing data, furthermore, when irrelevant data such as presentation time exist in the preprocessed data, the irrelevant data does not need to be stored in a non-relational database and only needs to be displayed on a client, and ObjectOutputStream is called to carry out serialization processing on the data except the irrelevant data in the preprocessed data, so that the serialization processing is carried out according to actual needs, the warehousing data is obtained, and the space occupied by the warehousing data is reduced.

S503: and if the non-basic type data does not exist in the preprocessed data, determining the preprocessed data as the input data.

According to the data paging method provided by the embodiment, when the preprocessed data has non-basic type data, the non-basic type data is serialized to obtain the database data, so that the identification of a computer is facilitated, the storage space is effectively reduced, and the quick response is ensured. And if the non-basic type data does not exist in the preprocessed data, determining the preprocessed data as the warehousing data.

In an embodiment, as shown in fig. 3, step S303 is to press the warehoused data into the empty linked list according to a preset sequence, and generate a target data linked list, where the step includes:

s601: and pressing the warehoused data into the empty linked list according to a preset sequence to generate an original data linked list carrying the source identification.

S602: if the number of the original data linked lists is not 1, calling a function to carry out aggregation processing on the original data linked lists with the same source identification to obtain a target data linked list.

The source identifier is an identifier indicating file data corresponding to the put-in data in the original data linked list. When the data amount in the file data is larger than the preset amount and needs to be sent to the server for multiple times, the process of obtaining the data from the file data for multiple times exists, and when the data is obtained from the analyzed data each time, the data is enabled to carry the source identifier indicating the file data, so that the follow-up sequential formation of the original data linked list carrying the source identifier is ensured. In this embodiment, when the number of the original data linked lists is not 1, the original data linked lists may be obtained according to different file data or may be obtained according to the same file data, and at this time, a function is called to perform aggregation processing on the original data linked lists with the same source identifier, so as to exclude repeatedly obtained data. It is understood that the original data linked lists with different source identifications are directly aggregated to form the target data linked list. In this embodiment, the step of calling a function to aggregate the original data linked lists with the same source identifier to exclude the repeatedly acquired data specifically includes: traversing one original data linked list in the original data linked lists with the same source identification to obtain each data in the original data linked lists, taking one of the original data linked lists as a calibration data linked list, judging whether each data in other original data linked lists with the same source identification is the same as the data in the calibration data linked list, and if each data in other original data linked lists with the same source identification is different from the data in the calibration data linked list, pressing the data into the calibration data linked list. And if each piece of data in other original data linked lists with the same source identification is the same as the data in the calibration data linked list, deleting the data to form a target data linked list, and ensuring that the data in the target data linked list is not repeated.

According to the data paging method provided by the embodiment, the input data is pressed into the empty linked list according to the preset sequence, and the original data linked list carrying the source identifier is generated. If the number of the original data linked lists is not 1, a function is called to carry out aggregation processing on the original data linked lists with the same source identification to obtain a target data linked list, and data in the target data linked list are ensured not to be repeated.

In an embodiment, after step S205, that is, after the paging result is sent to the client, the data paging method further includes:

and setting expiration time for the warehousing data, and if the current time reaches the expiration time, starting an expiration automatic deleting mechanism to delete the warehousing data.

Wherein the current time is the time displayed by the computer. The expiration time is the time after the current time to realize the expiration setting of the warehousing data, and the expiration time is flexibly set to relieve the cache, for example, the expiration time may be the time after 10 seconds from the current time. The automatic deletion mechanism refers to a mechanism for actively deleting the warehousing data.

Specifically, in this embodiment, the warehoused data is obtained by processing the analysis data which does not need persistent storage, has a simple relationship and has a high concurrency requirement, and therefore, the warehoused data does not need persistent storage, and therefore, the exit interface is called to set the expiration time of the warehoused data, automatic management is achieved, and caching is reduced. When the current time reaches the expiration time, a function is called to remove all the data in storage, so that the stability and the robustness of the system are maintained.

It should be understood that, the sequence numbers of the steps in the foregoing embodiments do not imply an execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present invention.

In one embodiment, a data paging device is provided, wherein the data paging device corresponds to the data paging method in the above embodiments one to one. As shown in fig. 7, the data paging apparatus includes a parsing data obtaining module 701, a target data linked list obtaining module 702, a paging request obtaining module 703, a paging information obtaining module 704, and a paging result obtaining module 705. The functional modules are explained in detail as follows:

the analysis data obtaining module 701 is configured to obtain analysis data according to file data sent by the client, where the analysis data includes an application scenario.

A target data linked list obtaining module 702, configured to store the analysis data in a non-relational database if the application scene is the target scene, and generate a target data linked list according to the analysis data, where the target data linked list includes a linked list identifier and a data capacity corresponding to the linked list identifier.

The paging request obtaining module 703 is configured to send the linked list identifier and the data capacity to the client, and receive a paging request sent by the client based on the linked list identifier and the data capacity, where the paging request includes a paging parameter.

The paging information obtaining module 704 is configured to determine a paging data linked list, a paging data address, and a display number based on the paging parameter.

The paging result obtaining module 705 is configured to obtain target data from the paging data linked list according to the paging data address, process the target data according to the display quantity, obtain a paging result, and send the paging result to the client.

Preferably, the parsing data obtaining module 701 includes: and an analysis unit.

And the analysis unit is used for acquiring the file data sent by the client, processing the file data by adopting an analysis interface and acquiring the analysis data.

Preferably, the target data linked list obtaining module 702 includes: the system comprises a preprocessing unit, a database data acquisition unit and a target data linked list generation unit.

And the preprocessing unit is used for preprocessing the analysis data to obtain preprocessed data.

And the warehousing data acquisition unit is used for acquiring warehousing data based on the preprocessing data.

And the target data linked list generating unit is used for pressing the warehoused data into the empty linked list according to a preset sequence to generate a target data linked list.

Preferably, the pre-processing unit comprises: a first preprocessing subunit and a second preprocessing subunit.

And the first preprocessing subunit is used for cleaning the analysis data to acquire the preprocessed data if the analysis data has abnormal data.

And the second preprocessing subunit is used for determining the analysis data as the preprocessing data if the analysis data has no abnormal data.

Preferably, the warehousing data acquisition unit includes: the device comprises a traversal subunit, a serialization processing subunit and a non-serialization processing subunit.

And the traversal subunit is used for traversing the preprocessed data and judging whether the preprocessed data has non-basic type data.

And the serialization processing subunit is used for carrying out serialization processing on the non-basic type data to acquire the warehousing data if the non-basic type data exists in the preprocessed data.

And the non-serialization processing subunit is used for determining the preprocessed data as the input data if the preprocessed data does not have non-basic type data.

Preferably, the target data linked list generating unit includes: the system comprises an original data linked list generating subunit and an aggregation processing subunit.

And the original data linked list generating subunit is used for pressing the input data into the empty linked list according to a preset sequence to generate an original data linked list carrying the source identifier.

And the aggregation processing subunit is used for calling a function to aggregate the original data linked lists with the same source identifier to obtain the target data linked list if the number of the original data linked lists is not 1.

Preferably, after the paging result obtaining module 705, the data paging method further includes: an expiration time setting unit.

And the expiration time setting unit is used for setting expiration time for the warehousing data, and if the current time reaches the expiration time, an expiration automatic deleting mechanism is started to delete the warehousing data.

For the specific limitation of the data paging device, reference may be made to the above limitation of the data paging method, which is not described herein again. The various modules in the data paging device may be implemented in whole or in part by software, hardware, and combinations thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.

In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as shown in fig. 8. The computer device includes a processor, a memory, a network interface, and a database connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a storage medium and an internal memory. The storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operating system and computer programs in the storage medium to run. The database of the computer device is used for storing a target data linked list. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a data paging method.

In an embodiment, a computer device is provided, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and when the processor executes the computer program, the steps of the data paging method in the foregoing embodiments are implemented, for example, steps S201 to S205 shown in fig. 2 or steps shown in fig. 3 to fig. 6, which are not repeated herein to avoid repetition. Alternatively, when the processor executes the computer program, the functions of each module/unit in the data paging device embodiment, for example, the functions of the analysis data obtaining module 701, the target data linked list obtaining module 702, the paging request obtaining module 703, the paging information obtaining module 704, and the paging result obtaining module 705 shown in fig. 7, are not described herein again to avoid repetition.

In an embodiment, a computer-readable storage medium is provided, where a computer program is stored on the computer-readable storage medium, and when executed by a processor, the computer program implements the steps of the data paging method in the foregoing embodiments, such as steps S201 to S205 shown in fig. 2 or steps shown in fig. 3 to fig. 6, which are not repeated herein to avoid repetition. Alternatively, when the processor executes the computer program, the functions of each module/unit in the data paging device embodiment, for example, the functions of the analysis data obtaining module 701, the target data linked list obtaining module 702, the paging request obtaining module 703, the paging information obtaining module 704, and the paging result obtaining module 705 shown in fig. 7, are not described herein again to avoid repetition.

It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, which can be stored in a computer-readable storage medium, and can include the processes of the embodiments of the methods described above when the computer program is executed. Any reference to memory, storage, database, or other medium used in the embodiments provided herein may include non-volatile and/or volatile memory, among others. Non-volatile memory can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-mentioned division of the functional units and modules is illustrated, and in practical applications, the above-mentioned function distribution may be performed by different functional units and modules according to needs, that is, the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-mentioned functions.

The above-mentioned embodiments are only used for illustrating the technical solutions of the present invention, and not for limiting the same; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present invention, and are intended to be included within the scope of the present invention.

17页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种信息展示方法及装置

网友询问留言

已有0条留言

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

精彩留言,会给你点赞!