CN114021050B - Data processing method, data processing device, computer equipment and storage medium - Google Patents

Data processing method, data processing device, computer equipment and storage medium Download PDF

Info

Publication number
CN114021050B
CN114021050B CN202210000811.6A CN202210000811A CN114021050B CN 114021050 B CN114021050 B CN 114021050B CN 202210000811 A CN202210000811 A CN 202210000811A CN 114021050 B CN114021050 B CN 114021050B
Authority
CN
China
Prior art keywords
data
level
index
display interface
attribute value
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202210000811.6A
Other languages
Chinese (zh)
Other versions
CN114021050A (en
Inventor
廖利彬
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Taiping Financial Technology Services Shanghai Co Ltd Shenzhen Branch
Original Assignee
Taiping Financial Technology Services Shanghai Co Ltd Shenzhen Branch
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Taiping Financial Technology Services Shanghai Co Ltd Shenzhen Branch filed Critical Taiping Financial Technology Services Shanghai Co Ltd Shenzhen Branch
Priority to CN202210000811.6A priority Critical patent/CN114021050B/en
Publication of CN114021050A publication Critical patent/CN114021050A/en
Application granted granted Critical
Publication of CN114021050B publication Critical patent/CN114021050B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/957Browsing optimisation, e.g. caching or content distillation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/21Design, administration or maintenance of databases
    • G06F16/219Managing data history or versioning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/951Indexing; Web crawling techniques
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/958Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The application relates to a data processing method, a data processing device, computer equipment and a storage medium. The method comprises the following steps: the computer equipment responds to a webpage data loading instruction of the terminal, acquires a first data version number from the server, acquires a preset amount of webpage data from the first webpage data in the local storage space under the condition that the first data version number is consistent with a second data version number in the local storage space, displays the webpage data on a display interface of the terminal, monitors an operation event triggered based on the display interface, and executes corresponding data processing operation according to the operation event and the webpage data. In the method, under the condition that the data version number in the server is consistent with the data version number in the local storage space, the computer equipment responds to each data loading operation based on the data in the local storage space, and loads quantitative data to the display interface, so that the pressure of the server is reduced, and the phenomena of blocking and collapse caused by overlarge data loading amount are avoided.

Description

Data processing method, data processing device, computer equipment and storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a data processing method and apparatus, a computer device, and a storage medium.
Background
In the context of big data, a browser of a terminal needs to consume a large amount of rendering resources and data transmission resources when acquiring data for data rendering, for example, in the prior art, a terminal acquires all data from a server at one time, and renders and displays the data to a webpage of the browser. The method for loading data at one time can cause the browser to have obvious situations of loading jam and even browser crash in the context of big data.
In view of the above situation, a method for paging data is proposed. The terminal acquires data of one page from the server every time, and renders and displays the data of one page to the webpage of the browser, so that the phenomena of network blocking and breakdown caused by loading all the data at one time are avoided.
However, in the method of paging and loading data, the terminal needs to send a data acquisition request to the server for multiple times, which has a high requirement on network quality, and the multiple data acquisition requests put a great pressure on the server.
Disclosure of Invention
In view of the above, it is necessary to provide a data processing method, an apparatus, a computer device and a storage medium capable of solving the data loading pressure.
In a first aspect, a data processing method is provided, which includes:
responding to a webpage data loading instruction of a terminal, and acquiring a first data version number from a server;
under the condition that the first data version number is consistent with the second data version number in the local storage space, acquiring a preset number of webpage data from the first webpage data in the local storage space, and displaying the webpage data on a display interface of the terminal;
monitoring an operation event triggered based on the display interface, and executing corresponding data processing operation according to the operation event and the webpage data.
In one optional embodiment, the method further comprises:
under the condition that the first data version number is inconsistent with the second data version number, second webpage data corresponding to the first data version number are obtained from the server and stored in a local storage space;
and acquiring a preset amount of webpage data from the second webpage data in the local storage space, and displaying the webpage data on a display interface of the terminal.
In one optional embodiment, if the operation event is a first selection event, monitoring the operation event triggered based on the display interface, and executing corresponding data processing operations according to the operation event and the webpage data, including:
determining first selected data from the webpage data according to the first selection event;
acquiring a hierarchy index and an attribute value of the first selected data;
storing the hierarchical index of the first selected data into a preset index array, storing the attribute value into a preset attribute value array, and storing the first selected data into a preset selected variable array.
In one optional embodiment, if the operation event is a scroll event, monitoring the operation event triggered based on the display interface, and executing a corresponding data processing operation according to the operation event and the web page data, further comprising:
under the condition that the rolling is monitored to stop, the current data length of the index array is obtained;
if the current data length of the index array is equal to zero, determining target data from the webpage data, and determining whether the data in the local storage space is completely loaded according to a first hierarchical index and a first attribute value of the target data;
and if the current data length of the index array is larger than zero, traversing the level indexes in the index array, and determining whether the data corresponding to the level indexes are in the visual area of the display interface.
In one optional embodiment, the target data is the last piece of data of the first-level data in the webpage data; determining whether the data in the local storage space is completely loaded according to the first hierarchical index and the first attribute value of the target data, wherein the determining comprises the following steps:
comparing the first attribute value of the target data with the second attribute value of the last data in the first-level data in the local storage space;
if the first attribute value is equal to the second attribute value, determining that all the first-level data in the local storage space are completely loaded;
if the first attribute value is not equal to the second attribute value, determining that the unloaded first-level data still exists in the local storage space, and acquiring a preset number of first-level data from the local storage space according to the first-level index and loading the first-level data into the display interface.
In one optional embodiment, traversing the hierarchical indexes in the index array to determine whether data corresponding to each hierarchical index is in a visible area of the display interface includes:
traversing data corresponding to the level indexes in the index array, and judging whether lower-level data of the data of each level index is in a visible area or not;
and if the last lower data in the data of the hierarchy indexes is in the visible area, acquiring a third hierarchy index of the last lower data, and acquiring a preset number of lower data from the local storage space according to the third hierarchy index and loading the lower data into the display interface.
In one optional embodiment, the determining whether lower-level data of the data of each hierarchy index is within the visible region includes:
acquiring a first height distance between a display position of lower data and a top layer edge of a display interface and a rolling value corresponding to a rolling event;
if the first height distance is greater than the rolling value and the first height distance is less than the sum of the rolling value and the absolute height value of the visual area of the display interface, determining that the lower-level data is in the visual area; the absolute height value of the viewing area is determined based on the total height of the viewing area.
In one optional embodiment, the method further comprises:
under the condition that the scroll is monitored to be stopped, acquiring a second selection event based on the display interface;
determining second selected data in the webpage data according to the second selection event;
judging whether the second selected data comprises lower-level data;
under the condition that the second selected data comprises lower-level data, acquiring a fourth-level index and a fourth attribute value of the second selected data;
and respectively adding the fourth level index and the fourth attribute value into the index array and the attribute value array, and acquiring corresponding lower-level data of the second selected data in preset quantity from the local storage space according to the fourth level index and loading the lower-level data into the display interface.
In one optional embodiment, the method further comprises:
and if the lower-level data of the second selected data are all loaded into the display interface, deleting the fourth-level index and the fourth attribute value of the second selected data from the index array and the attribute value array.
In one optional embodiment, the method further comprises:
determining second selected data according to the second selection event;
judging whether the selected variable array is empty or not;
under the condition that the selected variable array is not empty, determining third selected data in the selected variable array, deleting the interface identifier of the third selected data on the display interface, and adding the interface identifier of the second selected data in the display interface;
and storing the second selected data into the selected variable array, and deleting the third selected data from the selected variable array.
In one optional embodiment, the preset number of calculation methods includes:
acquiring the total height of a visual area in a display interface, a first distance between the visual area and the top layer edge of the display interface and a second distance between the visual area and the bottom layer edge of the display interface;
determining the total height, the first distance and the second distance as the absolute height of the visual area;
and determining the ratio of the absolute height to the preset data line height as a preset number.
In a second aspect, there is provided a data processing apparatus, the apparatus comprising:
the acquisition module is used for responding to a webpage data loading instruction of the terminal and acquiring a first data version number from the server;
the loading module is used for acquiring a preset number of webpage data from the first webpage data in the local storage space and displaying the webpage data on a display interface of the terminal under the condition that the first data version number is consistent with the second data version number in the local storage space;
and the processing module is used for monitoring an operation event triggered based on the display interface and executing corresponding data processing operation according to the operation event and the webpage data.
In a third aspect, there is provided a computer device comprising a memory storing a computer program and a processor implementing the method of any of the first aspects when the processor executes the computer program.
In a fourth aspect, there is provided a computer readable storage medium having stored thereon a computer program which, when executed by a processor, performs the method of any of the first aspects described above.
According to the data processing method, the data processing device, the computer equipment and the storage medium, the computer equipment responds to a webpage data loading instruction of the terminal, obtains a first data version number from the server, obtains a preset amount of webpage data from the first webpage data in the local storage space under the condition that the first data version number is consistent with a second data version number in the local storage space, displays the webpage data on a display interface of the terminal, monitors an operation event triggered based on the display interface, and executes corresponding data processing operation according to the operation event and the webpage data. In the method, before a web system of a terminal is started for the first time to load corresponding web page data, a computer device obtains a data version number of a server and compares the data version number with a data version number in a local storage space, under the condition that the data version numbers are consistent, the computer device responds to each data loading operation directly based on the data in the local storage space to perform quantitative data loading operation, does not need to respond to one data loading operation, and initiates a data obtaining request to the server to reduce data interaction with the server and relieve pressure for the server.
Drawings
FIG. 1 is a diagram of an application environment of a data processing method in one embodiment;
FIG. 2 is a flow diagram illustrating a data processing method according to one embodiment;
FIG. 3 is a flow diagram illustrating a data processing method according to one embodiment;
FIG. 4 is a flow diagram illustrating a data processing method according to one embodiment;
FIG. 5 is a flow diagram illustrating a data processing method according to one embodiment;
FIG. 6 is a flow diagram illustrating a data processing method according to one embodiment;
FIG. 7 is a flow diagram illustrating a data processing method according to one embodiment;
FIG. 8 is a flow diagram illustrating a data processing method according to one embodiment;
FIG. 9 is a flow diagram illustrating a data processing method according to one embodiment;
FIG. 10 is a block diagram showing the structure of a data processing apparatus according to an embodiment;
FIG. 11 is a block diagram showing the structure of a data processing apparatus according to an embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
The data processing method provided by the application can be applied to the application environment shown in fig. 1. In one embodiment, a computer device is provided, which may be a server, the internal structure of which may be as shown in fig. 1. The computer device includes a processor, a memory, a communication interface, a display screen, and an input device 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 nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The communication interface of the computer device is used for carrying out wired or wireless communication with an external terminal, and the wireless communication can be realized through WIFI, an operator network, NFC (near field communication) or other technologies. The computer program is executed by a processor to implement a data processing method. The display screen of the computer equipment can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer equipment can be a touch layer covered on the display screen, a key, a track ball or a touch pad arranged on the shell of the computer equipment, an external keyboard, a touch pad or a mouse and the like.
Those skilled in the art will appreciate that the architecture shown in fig. 1 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
The applicable scenario of the data processing method provided by the embodiment may be that, in a web system of a terminal, webpage data are loaded, for example, data corresponding to a web end of a social platform are data published by each user recommended on the social platform; or, the data may also be a web end of a certain service system, and the corresponding data is service data related in the service system. The application scenario may also be an application system of the terminal, and the data in the application is loaded, for example, e-commerce platform application, and the corresponding data is product data of a display interface of the application. In order to better explain the data processing method provided by this embodiment, this embodiment provides a common method that needs to be used by the underlying logic in the process of implementing the data processing method.
Taking a web system as an example, in order to implement data processing on web page data of the web system by constructing a data structure generally used in the web system as a json data structure, in this case, it is necessary to convert each json data into data of an html structure, and a method for converting the json data into the html structure data is set as createlement (json data, level, indexStart, parentCodePath, parentIndexPath), where json data is an incoming parameter json data, level is a level of the data, indexStart is an index of the data starting at a same level, parentcodepathis a code value hierarchical path of a data parent layer, and parentIndexPath is an index position hierarchical path of the data parent layer.
For example, the json data can be expressed as [ { code: '01', name: 'first-order 1', children: [ ] }, { code: '02', name: 'first-order 2', children: [ ] }, { code: '03', name: 'first-order 3', children: [ ] } ] from the beginning
Then the function method createElement may perform the following logic:
(1) create div element by calling document createlement (' div '), and set line height and indentation, the line height being set by style, such as style = ' height:22px; line-height:22px; indentation is set by level, level is multiplied by 20 for indentation width, and level is equal to 0 for no indentation.
(2) When constructing an html element according to indexStart, the index of all data of the data element at its same level being constructed is recorded, and the data element is connected with parentIndexPath with the symbol '/' and recorded on the attribute of the element html.
(3) Connecting the parentCodePath with the code value of the element being constructed by using a '/' symbol, and recording the value path of the data element being constructed;
(4) whether the current data has sublevel data children is judged through the incoming data, and if yes, and the data of children is larger than 0, a pull-down arrow is created to show the sublevel data. Alternatively, the pull-down arrow may be created with document createlement ('span'), with the style set to display: inline-block, and the pull-down arrow may be exposed by setting the background picture to a triangle arrow picture or other designated symbol.
(5) Data content is populated by creating a span tag. Alternatively, the computer device may create a label through document createlement ('span'), e.g., the style may be set to display inline-block.
(6) Through the logic execution of the above steps, the code of the constructed html data can be expressed as:
< div codePath = "01" indexPath = "0" style = "height: 22px; line-height:22px; margin-left: 0;" > < span style = "display: inline-block; background: url: (img/arc. png) > < span style =" display: inline-block "> primary 1</span > </div >"
<div codePath="02" indexPath="1" style=”height:22px;line-height:22px;margin-left:0;”>
< span style = "display: inline-block," > primary 2</span > </div >, background: url (img/arc.png) > ", display: inline-block >"
<div codePath="03" indexPath="2" style=”height:22px;line-height:22px;margin-left:0;”>
< span style = "display: inline-block," > primary 3</span > </div >, background: url (img/arc.png) > ", display: inline-block >"
The html structure data corresponds to json data { code: '01', name: 'primary 1', children: [ ] }, { code: '02', name: 'primary 2', children: [ ] }, { code: '03', name: 'primary 3', children: [ ] } in the above example, in which the attributes codePath and indexPath record the value hierarchy and the hierarchy index of the corresponding data, respectively.
After the transformation construction of the data structure of the data of the web system, the computer device is used for data processing based on the constructed html structure data.
The following describes in detail the technical solutions of the present application and how the technical solutions of the present application solve the above technical problems by embodiments and with reference to the drawings. The following several specific embodiments may be combined with each other, and details of the same or similar concepts or processes may not be repeated in some embodiments. It should be noted that, in the data processing method provided in the embodiments of fig. 2 to fig. 9 of the present application, the execution main body is a computer device, and may also be a data processing apparatus, and the data processing apparatus may be a part or all of the computer device by software, hardware, or a combination of software and hardware. In the following method embodiments, the execution subject is a computer device as an example.
In one embodiment, as shown in fig. 2, there is provided a data processing method including the steps of:
s201, responding to a webpage data loading instruction of the terminal, and acquiring a first data version number from the server.
In this embodiment, after receiving the web page data loading instruction, the computer device requests the server for the version number webVersion of the current data, that is, obtains the first data version number, for example, the data version number is a character string of a specified length composed of letters and numbers, which is not limited in this embodiment.
S202, under the condition that the first data version number is consistent with the second data version number in the local storage space, acquiring a preset number of webpage data from the first webpage data in the local storage space, and displaying the webpage data on a display interface of the terminal.
In this embodiment, the computer device obtains the second data version number dataVersion of the local storage space after obtaining the first data version number webVersion to the server, and compares webVersion with dataVersion, optionally, the comparison result includes that webVersion is consistent with dataVersion, or that webVersion is inconsistent with dataVersion, wherein the inconsistent result includes that dataVersion is less than webVersion, or that dataVersion is empty.
Under the condition that the computer equipment determines that webVersion is consistent with dataVersion, the computer equipment determines that data are not updated, and at the moment, the computer equipment can directly acquire preset amount of webpage data from the data in the local storage space and load the webpage data into a display interface without initiating an acquisition request operation to a server. Alternatively, the computer device may implement data storage of the local storage space by a method window.
The method for constructing html structural data provided by the embodiment includes performing structure conversion on a first set of data in a preset amount, and loading the first set of data into a visual area of a display interface, where the visual area may be displayed in a drop-down box form.
S203, monitoring an operation event triggered based on the display interface, and executing corresponding data processing operation according to the operation event and the webpage data.
The operation event includes a scroll event, a click event, a selection event and the like triggered based on the display interface, the scroll event is an event triggered according to a pulley or a dragging scroll bar of an external device of the computer device, and the computer device can determine a corresponding scroll value according to the scroll event. The click event can be a single click event or a multi-click event, and the computer device can determine the selected webpage data in the display interface through the click event, so as to load lower-level data or display the value of the webpage data according to the webpage data. The selection event may be an event triggered by data having a selection box in the display interface, and if the selection event trigger is detected based on the selection box, the selected webpage data is determined according to the selection box, and a lower-level data loading operation or a value display operation of the webpage data is performed according to the webpage data.
In this embodiment, the display interface includes a visual area, which is exemplified by taking the visual area as a drop-down frame and the operation event as a scroll event, the computer device may monitor the scroll event in the drop-down frame dropWrap by setting a monitoring event, record a scroll distance scrollTop corresponding to the scroll event in one second of delay in the event, clear the delay method during scrolling, execute the delay method only when the scrolling is stopped, and obtain the corresponding scroll distance scrollTop, so as to perform corresponding data processing operations according to parameters such as the scroll distance and an index path of web page data in the drop-down frame, which is not limited in this embodiment.
In the data processing method, the computer equipment responds to a webpage data loading instruction of the terminal, acquires a first data version number from the server, acquires a preset amount of webpage data from the first webpage data in the local storage space under the condition that the first data version number is consistent with a second data version number in the local storage space, displays the webpage data on a display interface of the terminal, monitors an operation event triggered based on the display interface, and executes corresponding data processing operation according to the operation event and the webpage data. In the method, before a web system of a terminal is started for the first time to load corresponding web page data, a computer device obtains a data version number of a server and compares the data version number with a data version number in a local storage space, under the condition that the data version numbers are consistent, the computer device responds to each data loading operation directly based on the data in the local storage space to perform quantitative data loading operation, does not need to respond to one data loading operation, and initiates a data obtaining request to the server to reduce data interaction with the server and relieve pressure for the server.
According to the comparison and judgment of the first data version number and the second data version number, there is another case, in an optional embodiment, as shown in fig. 3, the method further includes:
s301, under the condition that the first data version number is not consistent with the second data version number, second webpage data corresponding to the first data version number are obtained from the server and stored in the local storage space.
In the above example of step 201, the first data version number is webVersion, the second data version number is dataVersion, and the case where the first data version number is inconsistent with the second data version number includes the case where the dataVersion is smaller than the webVersion or the case where the dataVersion is empty. dataVersion is smaller than webVersion, which means that the data is updated, and the computer device needs to obtain the updated data from the server, that is, obtain the second web page data, and store the second web page data in the local storage space. dataVersion indicates that the web system is used for the first time and the local storage space does not have the relevant data stored therein, in which case the computer device also needs to retrieve the second web page data from the server for storage in the local storage space. Alternatively, the computer device may initiate a data acquisition request to the server by using AJAX to acquire all the second webpage data.
Optionally, the computer device performs storage of the second web page data based on the local storage space. The database objects and the warehouse objects can be referenced by newly creating variables var db, objectStore, respectively. The ongradeeneed callback method is performed after the database is successfully created by creating or opening a local database by the method var rqObj = window. Illustratively, the onpgradeeed callback method is as follows:
RqObj.onupgradeneeded = function (event) {
db = event.target.result;
if (!db.objectStoreNames.contains('jigou')) {
objectStore = db, createobjectstore ('jigou', { keyPath: 'id' }); here, create jigou this repository object and set the primary key id
}
}
The method for storing the second webpage data into the local storage space by the computer device may refer to the following method:
transaction ([ 'jilou' ], 'readwrite'). objectStore ('jilou'). add ({ id: 1, name: 'Amin', age: 22, email: 'abc123@ example.com' });
optionally, the method for the computer device to read the web page data from the local storage space is as follows:
db.transaction(['jigou'], 'readwrite').objectStore('jigou').get(1)
get () method can read data, and the parameter is the primary key value
Further, the computer device may update the data in the local storage space, wherein the method of updating the data is as follows:
transaction ([ 'jilou' ], 'readwrite'). objectStore ('jilou'). put ({ id: 1, name: 'Mingming', age: 25, email: 'abc123@ example.com' });
in addition, the computer device may also delete data in the local storage space, wherein the method for deleting data is as follows:
db.transaction(['jigou'], 'readwrite').objectStore('jigou').delete(1)
delete () method can delete data, and the parameter is the primary key value
S302, acquiring a preset amount of webpage data from the second webpage data in the local storage space, and displaying the webpage data on a display interface of the terminal.
In this embodiment, similar to that in step 201, after acquiring the second webpage data, the computer device stores the second webpage data in the local storage space, and acquires a preset amount of data to load into the display interface. Alternatively, the computer device may use the window.
In this embodiment, in the event that the first data version number does not correspond to the second data version number, initiating a request for acquiring all data to a server, acquiring the latest data and performing local data coverage update, wherein the computer device only needs to initiate a data request to the server once and does not need to initiate a data acquisition request to the server once in response to a data loading operation, thereby reducing resource waste caused by data interaction and relieving the pressure of the server, and further, in the embodiment, in the concrete implementation method for realizing data storage and use of the local storage space, the method performs access based on the indexDB method, and replaces the localStorage method in the prior art, the method in the embodiment can store a large amount of data, the storage space of the computer device can be 50% of the disk of the computer device, so that the performance of local storage is optimized.
The operation event may include various types of events, for example, a selection event, a click event, a scroll event, and the like, and in a scenario where the operation event is a first selection event, as shown in fig. 4, the computer device monitors the operation event triggered based on the display interface, and performs corresponding data processing operations according to the operation event and the web page data, including:
s401, according to the first selection event, first selected data are determined from the webpage data.
In this embodiment, the computer device responds to a first selection event of the display interface, and determines selected first selected data in the web page data of the display interface according to the position of the display interface triggered by the first selection event. Optionally, the computer device may obtain, by using the method drop wrap, the first selected data corresponding to the first selection time [1]. chip nodes [3]. chip nodes [2], where, for example, the obtained first selected data is allData [1] [3] [2 ].
S402, obtaining the hierarchy index and the attribute value of the first selected data.
In this embodiment, the computer device determines, according to the first selected data, its corresponding hierarchical index indexPath and attribute value codePath. Wherein the attribute value is used to identify a path index of the value of the data.
S403, storing the hierarchical index of the first selected data into a preset index array, storing the attribute value into a preset attribute value array, and storing the first selected data into a preset selected variable array.
The index array is used for recording the index relationship of the data, namely the hierarchical index relationship of the data; the attribute value array is used for recording a value hierarchy path codePath of the selected data, namely the hierarchy relationship of the data. The computer device may determine the position and value relationship of the data in all data based on the index array indexPath [ ], the attribute value array codePath [ ]. Exemplarily, an index array indexPath = [ '1/3/2' ], an attribute value array codePath = [ '01/0103/010302' ]; the index starts from 0, the index array and the attribute value array represent the 3 rd data of the third level in the 4 th data of the second level of the 2 nd data of the selected first level, and the value of the selected data is 010302.
In this embodiment, after acquiring the hierarchy index indexPath and the attribute value codePath of the first selected data, the computer device writes the hierarchy index indexPath into a preset index array, and writes the attribute value codePath into a preset attribute value array. Optionally, the computer device may further construct a selected variable array for storing the selected element variable nodeSelected, and after determining the first selected data, assign a value of the first selected data to the selected element variable nodeSelected.
Optionally, in an application scenario of displaying back selected data, when determining the selected data, the computer device may further mark the selected data from the visual area, in this embodiment, the computer device may split the hierarchical index of the tree structure of the selected data into a plurality of array data, and when performing data loading or data positioning on a subsequent computer device based on a corresponding hierarchy, the computer device may perform comparison and determination with the split array data, and the hierarchical index of the tree structure does not need to be traversed, so that the number of polling times is reduced.
In this embodiment, the computer device may determine first selected data according to the first selection event, and write the hierarchical index and the attribute value corresponding to the selected data into the corresponding array, so as to provide data support for data playback and data loading later, and perform data positioning according to the set hierarchical index, thereby reducing the number of data polling and reducing the time cost of data polling.
In the case that the operational event is a second selection event, the computer device may further execute the following logic, and in an optional embodiment, as shown in fig. 5, the method further includes:
s501, acquiring a second selection event based on the display interface under the condition that the scroll is monitored to stop.
And S502, determining second selected data in the webpage data according to the second selected event.
S503, judging whether the second selected data comprises lower data.
S504, under the condition that the second selected data comprises lower-level data, a fourth-level index and a fourth attribute value of the second selected data are obtained.
And S505, adding the fourth level index and the fourth attribute value into the index array and the attribute value array respectively, and acquiring corresponding lower-level data of the second selected data in preset quantity from the local storage space according to the fourth level index and loading the lower-level data into the display interface.
In this embodiment, when monitoring that scrolling is stopped, the computer device determines whether a display interface triggers a selection event, and when the selection event is triggered, acquires second selected data corresponding to the selection event in web page data of the display interface, determines whether the second selected data includes lower-level data (sub-level data), and when the second selected data includes the sub-level data, adds a hierarchical index exppath and an attribute value codePath of the second selected data to an index array indexPath [ ] and an attribute value array codePath [ ], and loads, to the display interface, sub-level data of a preset number of second selected data acquired from a local storage space according to the hierarchical index indexPath of the second selected data, where before loading data, the computer device needs to construct html structure data of the sub-level data. In another case, if it is determined that the second selected data does not include the sub-level data, the computer device indicates that the value of the second selected data is selected by the current selection event, in this case, the computer device directly takes the attribute value codePath of the second selected data, which is not limited in this embodiment.
In this embodiment, the computer device determines whether the second selected data includes the sub-level data according to the selection event, so as to determine that the sub-level data needs to be loaded or the value of the second selected data needs to be saved.
In one optional embodiment, during the data loading process based on the second selection event, the method further includes:
and if the lower-level data of the second selected data are all loaded into the display interface, deleting the fourth-level index and the fourth attribute value of the second selected data from the index array and the attribute value array.
In this embodiment, after the computer device determines the second selected data, optionally, it may also be determined whether the sub-level data of the second selected data is completely loaded, and if it is determined that the sub-level data of the second selected data is already loaded in the display interface, the computer device performs round-robin on the index array indexPath [ ] and the attribute value array codePath [ ], and deletes the hierarchical index and the attribute value of the second selected data.
In this embodiment, after determining that the sub-level data of the second selected data is loaded, the computer device deletes the level index and the attribute value of the second selected data in time, and optimizes the judgment of the data in the visible area to reduce the round robin number.
In the case that the operational event is a second selection event, the computer device may further execute the following logic, and in an optional embodiment, as shown in fig. 6, the method further includes:
s601, according to the second selection event, second selected data are determined.
S602, judging whether the selected variable array is empty.
S603, under the condition that the selected variable array is not empty, determining third selected data in the selected variable array, deleting the interface identifier of the third selected data on the display interface, and adding the interface identifier of the second selected data in the display interface.
S604, storing the second selected data into the selected variable array, and deleting the third selected data from the selected variable array.
In this embodiment, it is described from the dimension of the interface display, after the computer device determines the second selected data based on the second selection time, the computer device may label the selected style of the second selected data on the display interface, optionally, the computer device may determine whether there is a value in a previously-constructed selected variable array nodeSelected, that is, determine whether there is already selected data in the display interface, and if the selected variable array has a value and is not null, it is determined that there is other already selected data in the display interface.
In this embodiment, the computer device may determine whether the display interface has other data that has been selected based on the selected variable array nodeSelected, so as to optimize the display identifier of the display interface and optimize the user experience.
In a scenario where the operation event is a scroll event, in one optional embodiment, as shown in fig. 7, monitoring the operation event triggered based on the display interface, and executing a corresponding data processing operation according to the operation event and the web page data, further includes:
and acquiring the current data length of the index array under the condition of monitoring that the rolling is stopped.
In this embodiment, when the computer device monitors that the scrolling is stopped, the computer device obtains the current data length of the index array, and determines whether the selected web page data exists in the display interface, where the determination is performed according to the current data length of the index array, and includes two cases:
one of the situations is: and if the current data length of the index array is equal to zero, determining target data from the webpage data, and determining whether the data in the local storage space is completely loaded according to the first hierarchical index and the first attribute value of the target data.
In this embodiment, the computer device determines that the current data length of the index data is equal to 0, that is, there is no selected web page data in the display interface, that is, the web page data in the current display interface is still the first-level data, and at this time, the computer device needs to determine the data to be loaded according to the web page data. Alternatively, the computer device may determine target data from the web page data, and obtain a preset amount of data for loading based on the hierarchical index of the target data.
Optionally, in one optional embodiment, as shown in fig. 7, the computer device needs to perform the following steps:
s701, comparing a first attribute value of target data with a second attribute value of the last piece of data in the first-level data in the local storage space;
s702, if the first attribute value is equal to the second attribute value, determining that all first-level data in the local storage space are completely loaded;
s703, if the first attribute value is not equal to the second attribute value, determining that the unloaded first-level data still exists in the local storage space, and acquiring a preset number of first-level data from the local storage space according to the first-level index and loading the first-level data into the display interface.
The computer device determines that the data length of the index array is equal to 0, and in this case, the computer device determines the last piece of data in the first-level data in the loaded data of the display interface, acquires the first-level index indexPath and the first attribute value codePath of the last piece of data, compares the first attribute value codePath with the second attribute value of the last piece of data in all the data in the current storage space, and if the first attribute value is equal to the second attribute value, indicates that all the first-level data in all the data are displayed, that is, all the data are loaded on the display interface. If the first attribute value is not equal to the second attribute value, it indicates that the first-level data in the local storage space has not been completely loaded, and in this case, the computer device may know, according to the first-level index indexPath, that the last piece of loaded data is the several pieces of data in the first-level data in the local storage space, and therefore, the computer device may obtain a preset number of first-level data again according to the first-level index indexPath to perform html structure construction, and load the first-level data into the visible region.
Optionally, after determining that the last piece of data is the several pieces of data in the first-level data in the local storage space according to the first-level index indexPath, the computer device may further determine whether the last piece of data is within a visible area of the display interface, and when determining that the last piece of data is within the visible area of the display interface, obtain a preset number of pieces of first-level data from the indexPath + 1 pieces of data to construct an html structure, and load the html structure into the visible area, which is not limited in this embodiment.
Another case is: and if the current data length of the index array is larger than zero, traversing the level indexes in the index array, and determining whether the data corresponding to the level indexes are in the visual area of the display interface.
In this embodiment, the computer device determines that the current data length of the index data is greater than zero, that is, there is the selected web page data in the display interface, and the web page data in the current display interface may include multiple levels of data, for example, including first level data, second level data, and the like.
Optionally, in one optional embodiment, as shown in fig. 8, the computer device needs to perform the following steps:
s801, traversing data corresponding to the hierarchy indexes in the index array, and judging whether lower-level data of the data of each hierarchy index is in a visible area or not;
s802, if the last lower data in the data of the hierarchy indexes is in the visible area, obtaining a third hierarchy index of the last lower data, and obtaining a preset number of lower data from the local storage space and loading the lower data into the display interface according to the third hierarchy index.
In this embodiment, the computer device determines that the current data length of the index array is greater than 0, that is, there is data in the index array, in this case, the computer device needs to perform round-robin determination on the data in the index array indexPath, and determine whether a last element in lower-level data in the data corresponding to each hierarchical index indexPath is within a visible area, where the lower-level data refers to sub-level data of the data, and for example, the lower-level data of the first-level data is corresponding second-level data. In a case where it is determined that the last element in the lower level data is within the visible region of the display interface, the computer device acquires a preset number of data of the current level from the level index indexPath according to the level index indexPath of the last element in the lower level data, for example, the lower level data is second level data, that is, the preset number of second level data is acquired from the level index indexPath, constructs html structure data, and loads the data into the visible region of the display interface. If the computer device determines that the last element in the lower level data is not within the viewable area of the display interface, it ignores.
In this embodiment, the computer device determines, in response to the scroll time operation, whether the selected webpage data exists according to the data length of the index array, that is, determines whether the initial index of the data of the preset number to be acquired is the index of the default first-level data or the index of the sub-level data, so that data loading can be quickly and accurately implemented according to the index, and the data loading efficiency is improved.
The computer device determines whether the data is in the visible area according to the position and the rolling value of the data, and in an alternative embodiment, as shown in fig. 9, the determining whether lower-level data of the data of each hierarchical index is in the visible area includes:
s901, obtaining a display position of the lower-level data, a first height distance of a top layer edge of a display interface and a rolling value corresponding to a rolling event.
In this embodiment, the computer device obtains the position of the lower-level data on the display interface, obtains the first height distance offsetTop from the top-level edge of the display interface according to the position, and obtains the scroll value scrollTop according to the method for calculating the scroll value corresponding to the scroll event.
S902, if the first height distance is greater than the rolling value and smaller than the sum of the rolling value and the absolute height value of the visual area of the display interface, determining that the lower-level data is in the visual area; the absolute height value of the viewing area is determined based on the total height of the viewing area.
The absolute height value height of the visual area is obtained by subtracting a first distance between the visual area and the top layer edge of the display interface and a second distance between the visual area and the bottom layer edge of the display interface from the total height of the visual area. In this embodiment, if the computer device determines that the subordinate data is in the visible region, otherwise, the subordinate data is not in the visible region, which is not limited in this embodiment. In the present embodiment, the method for determining whether data of other levels, for example, data of the first level, is in the visible area is similar, and details are not described here.
In this embodiment, the computer device can determine whether the data is in the visible area according to the rolling value and the first height distance obtained by the calculation.
In one optional embodiment, the method for calculating the preset amount includes:
acquiring the total height of a visual area in a display interface, a first distance between the visual area and the top layer edge of the display interface and a second distance between the visual area and the bottom layer edge of the display interface; determining the total height, the first distance and the second distance as the absolute height of the visual area; and determining the ratio of the absolute height to the preset data line height as a preset number.
In this embodiment, the preset amount may be understood as one screen of data, that is, the amount of data loaded at most each time of the pull-down refresh. The computer device may calculate the preset number by using a screen datacount () method, where the specific logic includes obtaining a total height of the visible region, subtracting a distance between the visible region and the top layer edge and the bottom layer edge from the total height to obtain a height value dropHeight of the visible region, and then obtaining a set height itemhight of each line of data, where the calculating the preset number is the height value dropHeight of the visible region divided by the height itemhight of one line of data, that is, n = dropHeight/itemhight is determined as the preset number, and this embodiment is not limited thereto.
In this embodiment, the computer device may calculate the number of data loaded at one time in the visible area of the display interface according to the size of the display interface and the position of the visible area, the method is small in calculation amount, and data loading is performed based on the preset number, so that the loading of data by the computer device is not blocked.
It should be understood that although the various steps in the flow charts of fig. 2-9 are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least some of the steps in fig. 2-9 may include multiple steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, which are not necessarily performed in sequence, but may be performed in turn or alternately with other steps or at least some of the other steps.
In one embodiment, as shown in fig. 10, there is provided a data processing apparatus including: the system comprises an acquisition module 01, a loading module 02 and a processing module 03, wherein:
the acquisition module 01 is used for responding to a webpage data loading instruction of a terminal and acquiring a first data version number from a server;
the loading module 02 is configured to, when the first data version number is consistent with the second data version number in the local storage space, obtain a preset number of pieces of webpage data from the first webpage data in the local storage space, and display the webpage data on a display interface of the terminal;
the processing module 03 is configured to monitor an operation event triggered based on the display interface, and execute a corresponding data processing operation according to the operation event and the web page data.
In one optional embodiment, the obtaining module 01 is further configured to obtain, from the server, second webpage data corresponding to the first data version number and store the second webpage data in the local storage space when the first data version number is inconsistent with the second data version number; the loading module 02 is further configured to obtain a preset number of web page data from the second web page data in the local storage space, and display the web page data on a display interface of the terminal.
In one optional embodiment, if the operation event is a first selection event, the processing module 03 is configured to determine first selected data from the web page data according to the first selection event; acquiring a hierarchy index and an attribute value of the first selected data; storing the hierarchical index of the first selected data into a preset index array, storing the attribute value into a preset attribute value array, and storing the first selected data into a preset selected variable array.
In one optional embodiment, if the operation event is a scroll event, the processing module 03 is further configured to obtain a current data length of the index array when the scroll is monitored to be stopped; if the current data length of the index array is equal to zero, determining target data from the webpage data, and determining whether the data in the local storage space is completely loaded according to a first hierarchical index and a first attribute value of the target data; and if the current data length of the index array is larger than zero, traversing the level indexes in the index array, and determining whether the data corresponding to the level indexes are in the visual area of the display interface.
In one optional embodiment, the target data is the last piece of data of the first-level data in the webpage data; the processing module 03 is configured to compare a first attribute value of the target data with a second attribute value of the last piece of data in the first-level data in the local storage space; if the first attribute value is equal to the second attribute value, determining that all the first-level data in the local storage space are completely loaded; if the first attribute value is not equal to the second attribute value, determining that the unloaded first-level data still exists in the local storage space, and acquiring a preset number of first-level data from the local storage space according to the first-level index and loading the first-level data into the display interface.
In one optional embodiment, the processing module 03 is configured to traverse data corresponding to a hierarchical index in the index array; judging whether the lower-level data of the data of each level index is in a visible area or not; and if the last lower data in the data of the hierarchy indexes is in the visible area, acquiring a third hierarchy index of the last lower data, and acquiring a preset number of lower data from the local storage space according to the third hierarchy index and loading the lower data into the display interface.
In one optional embodiment, the processing module 03 is configured to obtain a display position of the lower level data, a first height distance of a top-level edge of the display interface, and a scroll value corresponding to the scroll event; if the first height distance is greater than the rolling value and the first height distance is less than the sum of the rolling value and the absolute height value of the visual area of the display interface, determining that the lower-level data is in the visual area; the absolute height value of the viewing area is determined based on the total height of the viewing area.
In one optional embodiment, the processing module 03 is further configured to, in a case that it is monitored that the scrolling is stopped, obtain a second selection event based on the display interface; determining second selected data in the webpage data according to the second selection event; judging whether the second selected data comprises lower-level data; under the condition that the second selected data comprises lower-level data, acquiring a fourth-level index and a fourth attribute value of the second selected data; and respectively adding the fourth level index and the fourth attribute value into the index array and the attribute value array, and acquiring corresponding lower-level data of the second selected data in preset quantity from the local storage space according to the fourth level index and loading the lower-level data into the display interface.
In one optional embodiment, the processing module 03 is further configured to delete the fourth-level index and the fourth attribute value of the second selected data from the index array and the attribute value array if lower-level data of the second selected data is loaded into the display interface.
In an optional embodiment, the processing module 03 is further configured to determine second selected data according to a second selection event; judging whether the selected variable array is empty or not; under the condition that the selected variable array is not empty, determining third selected data in the selected variable array, deleting the interface identifier of the third selected data on the display interface, and adding the interface identifier of the second selected data in the display interface; and storing the second selected data into the selected variable array, and deleting the third selected data from the selected variable array.
In one optional embodiment, as shown in fig. 11, the data processing apparatus further includes a calculating module 04, configured to obtain a total height of the visible region in the display interface, a first distance between the visible region and a top edge of the display interface, and a second distance between the visible region and a bottom edge of the display interface; determining the total height, the first distance and the second distance as the absolute height of the visual area; and determining the ratio of the absolute height to the preset data line height as a preset number.
For specific limitations of the data processing apparatus, reference may be made to the above limitations of the data processing method, which are not described herein again. The various modules in the data processing apparatus described above 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, comprising a memory and a processor, the memory having a computer program stored therein, the processor implementing the following steps when executing the computer program:
responding to a webpage data loading instruction of a terminal, and acquiring a first data version number from a server;
under the condition that the first data version number is consistent with the second data version number in the local storage space, acquiring a preset number of webpage data from the first webpage data in the local storage space, and displaying the webpage data on a display interface of the terminal;
monitoring an operation event triggered based on the display interface, and executing corresponding data processing operation according to the operation event and the webpage data.
The implementation principle and technical effect of the computer device provided by the above embodiment are similar to those of the above method embodiment, and are not described herein again.
In one embodiment, a computer-readable storage medium is provided, having a computer program stored thereon, which when executed by a processor, performs the steps of:
responding to a webpage data loading instruction of a terminal, and acquiring a first data version number from a server;
under the condition that the first data version number is consistent with the second data version number in the local storage space, acquiring a preset number of webpage data from the first webpage data in the local storage space, and displaying the webpage data on a display interface of the terminal;
monitoring an operation event triggered based on the display interface, and executing corresponding data processing operation according to the operation event and the webpage data.
The implementation principle and technical effect of the computer-readable storage medium provided by the above embodiments are similar to those of the above method embodiments, and are not described herein again.
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 hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database or other medium used in the embodiments provided herein can include at least one of non-volatile and volatile memory. Non-volatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical storage, or the like. Volatile Memory can include Random Access Memory (RAM) or external cache Memory. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM), among others.
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (11)

1. A method of data processing, the method comprising:
responding to a webpage data loading instruction of a terminal, and acquiring a first data version number from a server;
under the condition that the first data version number is consistent with a second data version number in a local storage space, acquiring a preset number of webpage data from first webpage data in the local storage space, and displaying the webpage data on a display interface of the terminal;
monitoring an operation event triggered based on the display interface, and executing corresponding data processing operation according to the operation event and the webpage data;
determining first selected data from the webpage data according to a first selection event under the condition that the operation event is the first selection event; acquiring a hierarchy index and an attribute value of the first selected data; storing the hierarchical index of the first selected data into a preset index array, storing the attribute value into a preset attribute value array, and storing the first selected data into a preset selected variable array;
monitoring that the rolling is stopped under the condition that the operation event is a rolling event, and acquiring the current data length of the index array; if the current data length of the index array is equal to zero, determining target data from the webpage data, and determining whether the data in the local storage space is completely loaded according to a first level index and a first attribute value of the target data; if the current data length of the index array is larger than zero, traversing the hierarchical indexes in the index array, and determining whether the data corresponding to each hierarchical index is in a visible area of the display interface;
under the condition that a second selection event based on the display interface is monitored to stop scrolling, second selected data in the webpage data are determined according to the second selection event; judging whether the second selected data comprises subordinate data or not; acquiring a fourth level index and a fourth attribute value of the second selected data when the second selected data comprises lower-level data; and respectively adding the fourth level index and the fourth attribute value into the index array and the attribute value array, and acquiring corresponding lower-level data of second selected data in preset quantity from the local storage space according to the fourth level index and loading the lower-level data into the display interface.
2. The method of claim 1, further comprising:
under the condition that the first data version number is not consistent with the second data version number, second webpage data corresponding to the first data version number are obtained from the server and stored in the local storage space;
and acquiring the preset amount of webpage data from the second webpage data of the local storage space, and displaying the webpage data on a display interface of the terminal.
3. The method of claim 1, wherein the target data is a last piece of data of a first level of data in the web page data; determining whether the data in the local storage space is completely loaded according to the first hierarchical index and the first attribute value of the target data, including:
comparing the first attribute value of the target data with the second attribute value of the last data in the first-level data in the local storage space;
if the first attribute value is equal to the second attribute value, determining that all first-level data in the local storage space are completely loaded;
if the first attribute value is not equal to the second attribute value, determining that the unloaded first-level data still exists in the local storage space, and acquiring the preset number of first-level data from the local storage space according to the first-level index and loading the first-level data into the display interface.
4. The method of claim 1, wherein traversing the hierarchical indexes in the index array to determine whether data corresponding to each of the hierarchical indexes is within a viewable area of the display interface comprises:
traversing data corresponding to the hierarchy indexes in the index array, and judging whether lower-level data of the data of each hierarchy index is in the visible area;
and if the last lower-level data in the data of the level indexes is in the visible area, acquiring a third level index of the last lower-level data, and acquiring the preset number of lower-level data from the local storage space according to the third level index and loading the lower-level data into the display interface.
5. The method of claim 4, wherein said determining whether lower level data of each of the hierarchically indexed data is within the visible region comprises:
acquiring a first height distance between the display position of the lower-level data and the top layer edge of the display interface and a rolling value corresponding to the rolling event;
if the first height distance is greater than the rolling value and the first height distance is less than the sum of the rolling value and an absolute height value of a visual area of the display interface, determining that the lower-level data is in the visual area; the absolute height value of the visible area is determined according to the total height of the visible area.
6. The method of claim 1, further comprising:
and if the lower-level data of the second selected data are all loaded into the display interface, deleting the fourth-level index and the fourth attribute value of the second selected data from the index array and the attribute value array.
7. The method of claim 6, further comprising:
determining the second selected data according to the second selection event;
judging whether the selected variable array is empty or not;
determining third selected data in the selected variable array under the condition that the selected variable array is not empty, deleting the interface identification of the third selected data on the display interface, and adding the interface identification of the second selected data in the display interface;
and storing the second selected data into the selected variable array, and deleting the third selected data from the selected variable array.
8. The method according to claim 1 or 2, wherein the predetermined number of calculation methods comprises:
acquiring the total height of a visual area in the display interface, a first distance between the visual area and the top layer edge of the display interface, and a second distance between the visual area and the bottom layer edge of the display interface;
determining the total height, the first spacing, and the second spacing as an absolute height of the viewing area;
and determining the ratio of the absolute height to a preset data line height as the preset quantity.
9. A data processing apparatus, characterized in that the apparatus comprises:
the acquisition module is used for responding to a webpage data loading instruction of the terminal and acquiring a first data version number from the server;
the loading module is used for acquiring a preset number of webpage data from the first webpage data in the local storage space and displaying the webpage data on a display interface of the terminal under the condition that the first data version number is consistent with the second data version number in the local storage space;
the processing module is used for monitoring an operation event triggered based on the display interface and executing corresponding data processing operation according to the operation event and the webpage data;
the processing module is used for determining first selected data from the webpage data according to a first selection event under the condition that the operation event is the first selection event; acquiring a hierarchy index and an attribute value of the first selected data; storing the hierarchical index of the first selected data into a preset index array, storing the attribute value into a preset attribute value array, and storing the first selected data into a preset selected variable array;
the processing module is used for monitoring that the rolling is stopped and acquiring the current data length of the index array under the condition that the operation event is a rolling event; if the current data length of the index array is equal to zero, determining target data from the webpage data, and determining whether the data in the local storage space is completely loaded according to a first level index and a first attribute value of the target data; if the current data length of the index array is larger than zero, traversing the hierarchical indexes in the index array, and determining whether the data corresponding to each hierarchical index is in a visible area of the display interface;
the processing module is used for determining second selected data in the webpage data according to a second selection event under the condition that the rolling stop is based on the triggering of the display interface is monitored; judging whether the second selected data comprises subordinate data or not; acquiring a fourth level index and a fourth attribute value of the second selected data when the second selected data comprises lower-level data; and respectively adding the fourth level index and the fourth attribute value into the index array and the attribute value array, and acquiring corresponding lower-level data of second selected data in preset quantity from the local storage space according to the fourth level index and loading the lower-level data into the display interface.
10. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor, when executing the computer program, implements the steps of the method of any of claims 1 to 8.
11. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 8.
CN202210000811.6A 2022-01-04 2022-01-04 Data processing method, data processing device, computer equipment and storage medium Active CN114021050B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210000811.6A CN114021050B (en) 2022-01-04 2022-01-04 Data processing method, data processing device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210000811.6A CN114021050B (en) 2022-01-04 2022-01-04 Data processing method, data processing device, computer equipment and storage medium

Publications (2)

Publication Number Publication Date
CN114021050A CN114021050A (en) 2022-02-08
CN114021050B true CN114021050B (en) 2022-03-29

Family

ID=80069502

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210000811.6A Active CN114021050B (en) 2022-01-04 2022-01-04 Data processing method, data processing device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114021050B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2001077883A1 (en) * 2000-04-06 2001-10-18 Netseek Pty Ltd System and method for creating and searching web sites
CN107784086A (en) * 2017-10-09 2018-03-09 中国平安人寿保险股份有限公司 A kind of loading method of webpage, terminal device and computer-readable recording medium
CN110457613A (en) * 2019-05-24 2019-11-15 平安普惠企业管理有限公司 Page data loading control method, device, computer equipment and storage medium

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2007109054A1 (en) * 2006-03-15 2007-09-27 Google Inc. Automatic display of resized images
CN109635217A (en) * 2018-12-14 2019-04-16 平安普惠企业管理有限公司 H5 page loading method, device, computer equipment and the storage medium of APP

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2001077883A1 (en) * 2000-04-06 2001-10-18 Netseek Pty Ltd System and method for creating and searching web sites
CN107784086A (en) * 2017-10-09 2018-03-09 中国平安人寿保险股份有限公司 A kind of loading method of webpage, terminal device and computer-readable recording medium
CN110457613A (en) * 2019-05-24 2019-11-15 平安普惠企业管理有限公司 Page data loading control method, device, computer equipment and storage medium

Also Published As

Publication number Publication date
CN114021050A (en) 2022-02-08

Similar Documents

Publication Publication Date Title
US8689095B2 (en) Grid presentation in web-based spreadsheet services
US8949739B2 (en) Creating and maintaining images of browsed documents
US9026931B2 (en) Cross-browser “drag-and-drop” library
CN112667330B (en) Page display method and computer equipment
CN106528587B (en) Page display method and device in composite webpage system
US9692810B2 (en) Dynamic user interface layout algorithm
CN110781427A (en) Method, device, equipment and storage medium for calculating first screen time
US9612734B1 (en) Random access browser scrolling for large pages
CN107391534A (en) The page is shown, pagefile return method and device, computer-readable storage medium
CN111427637A (en) Page rendering method and device
CN114021050B (en) Data processing method, data processing device, computer equipment and storage medium
US10440154B2 (en) Method and system for predictive loading of software resources
CN112214697A (en) Webpage processing method and device, computer equipment and storage medium
CN113268183A (en) List page countdown display method and device
EP2821928A2 (en) Method and system for limiting output results in a mobile telecommunication system
US11816320B2 (en) Paginated growing widgets
CN117194828B (en) Table rolling paging method and device in reaction and electronic equipment
CN110059281B (en) Picture display method, device, terminal and computer readable storage medium
CN108762871B (en) Page component preloading method and device and display terminal
US9830401B2 (en) Automatically selecting optimization filters for optimizing webpages
US11640228B2 (en) Accessing virtually rendered digital content
CN108399223B (en) Data acquisition method and device and electronic equipment
CN114255278A (en) Graph click detection method and device, computer equipment and storage medium
US10909209B2 (en) Dynamic insertion of content into webpages
CN114036421A (en) Method, device and computer equipment for displaying HTML5 page response time

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant