Method, device, equipment and storage medium for realizing automatic loop infinite scrolling list
By using a single-cycle linked list in computer display technology to display the data to be displayed, the resource waste and lag caused by frequent refresh of scrolling lists in the existing technology is solved, and the smoothness and seamless connection effect of page scrolling is achieved.
Patent Information
- Application Number
- CN202410284945.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-13
- Publication Date
- 2025-05-13
- Estimated Expiration
- 2044-03-13
AI Technical Summary
When implementing scrolling lists, frequent refreshing of page nodes results in large resource losses, poor update data, and prone to lag, especially when cycling large amounts of data, it is inefficient.
The data to be displayed is placed in it using a single-cycle linked list, and according to the preset minimum scroll value, every time the preset time passes, the corresponding number of pieces of data is cyclically extracted from the single-cycle linked list and placed in the display list to realize automatic loop infinite scrolling.
Through the single-circular linked list method, frequent redrawing of the page is avoided, the burden on the page is reduced, and the smoothness and seamless connection effect of page scrolling are achieved.
Smart Images

Figure CN118151814B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer display technology, and in particular to a method, device, equipment and storage medium for realizing an automatic circular infinite scrolling list. Background Art
[0002] In computer web pages, scrolling lists are often used to display aggregate data, achieving a real-time dynamic refresh effect. They often appear on large screens and statistical chart pages, making the page more dynamic and beautiful.
[0003] The existing technology implements the scrolling list control by deleting the top of the list and then adding new data to the bottom in real time. Since the page nodes are frequently refreshed, a large amount of resources are wasted, the data update is not smooth, and there will be jams. In addition, when a large amount of data is circulated, the inefficiency causes jams and the loading of data is not smooth. Summary of the invention
[0004] In view of this, the purpose of the present invention is to provide a method, device, equipment and storage medium for realizing an automatic circular infinite scrolling list, so as to solve the problems in the prior art to a certain extent.
[0005] According to a first aspect of an embodiment of the present invention, a method for realizing an automatic loop infinite scrolling list is provided, comprising:
[0006] Acquire data to be displayed, and place the data to be displayed into a single circular linked list;
[0007] According to a preset minimum scroll value, a corresponding number of to-be-displayed data are cyclically taken out from the single-circular linked list every preset time, and the to-be-displayed data are placed in a preset display list;
[0008] The data to be displayed in the display list is displayed.
[0009] Preferably, the step of cyclically taking out a corresponding number of data to be displayed from the single-circular linked list according to a preset minimum scroll value includes:
[0010] Obtain the number of data to be displayed in the single circular linked list;
[0011] Comparing the number of data to be displayed with the minimum scroll value;
[0012] If the number of the data to be displayed is not greater than the minimum scroll value, all the data to be displayed are cyclically taken out from the single-circular linked list and placed into a preset display list.
[0013] Preferably, the step of cyclically taking out a corresponding number of data to be displayed from the single-circular linked list according to a preset minimum scroll value includes:
[0014] Obtain the number of data to be displayed in the single circular linked list;
[0015] Comparing the number of data to be displayed with the minimum scroll value;
[0016] If the number of data to be displayed is greater than the minimum scroll value, then,
[0017] Create a head pointer and a tail pointer, the head pointer points to the first data to be displayed in the single circular linked list, and the tail pointer points to the Nth data to be displayed in the single circular linked list, N=X, X is the minimum scroll value; every preset time, the head pointer and the tail pointer traverse backwards once;
[0018] The data to be displayed pointed to by the head pointer and the tail pointer and the data to be displayed between the head pointer and the tail pointer are taken out, and placed in a preset display list.
[0019] Preferably, when the head pointer or the tail pointer points to the last piece of data in the single circular linked list, after a preset time, the head pointer or the tail pointer points to the first piece of data in the single circular linked list again.
[0020] Preferably, before acquiring the data to be displayed and placing the data to be displayed into the single circular linked list, the method further includes:
[0021] Initialize the preset display list.
[0022] According to a second aspect of an embodiment of the present invention, there is provided a device for implementing an automatic circular infinite scrolling list, comprising:
[0023] A data acquisition module, used for acquiring data to be displayed, and placing the data to be displayed into a single circular linked list;
[0024] A cyclic extraction module, used for cyclically extracting a corresponding number of to-be-displayed data from the single-circular linked list every preset time according to a preset minimum scroll value, and placing the to-be-displayed data into a preset display list;
[0025] The display module is used to display the data to be displayed in the display list.
[0026] According to a third aspect of an embodiment of the present invention, there is provided a device for implementing an automatic loop infinite scrolling list, comprising:
[0027] A main controller, and a memory connected to the main controller;
[0028] a memory in which program instructions are stored;
[0029] The main controller is used to execute program instructions stored in the memory to perform any of the above methods.
[0030] According to a fourth aspect of an embodiment of the present invention, a computer-readable storage medium is provided, storing a computer program, and when the computer program is executed by a processor, the method described in any one of the above is implemented.
[0031] The technical solution provided by the embodiments of the present invention may have the following beneficial effects:
[0032] It is understandable that the technical solution shown in the present invention can obtain the data to be displayed, and place the data to be displayed in a single loop linked list; according to the preset minimum scroll value, every preset time, the corresponding number of data to be displayed is cyclically taken out from the single loop linked list, and the data to be displayed is placed in a preset display list; and the data to be displayed in the display list is displayed. It is understandable that the technical solution shown in the present invention uses the method of single loop linked list cyclic display, which avoids frequent page redrawing and reduces the page burden. The single loop linked list display makes the page scrolling smoother and can achieve a seamless effect.
[0033] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.
[0035] Figure 1 It is a schematic diagram of steps of a method for realizing an automatic loop infinite scrolling list according to an exemplary embodiment;
[0036] Figure 2 The present invention is a flowchart of a method for realizing an automatic loop infinite scrolling list according to an exemplary embodiment. DETAILED DESCRIPTION
[0037] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Instead, they are merely examples of devices and methods consistent with some aspects of the present invention as detailed in the appended claims.
[0038] Embodiment 1
[0039] Figure 1is a schematic diagram of a method for implementing an automatic loop infinite scrolling list according to an exemplary embodiment. Figure 1 , provides a method for realizing an automatic loop infinite scrolling list, including:
[0040] Acquire data to be displayed, and place the data to be displayed into a single circular linked list;
[0041] According to a preset minimum scroll value, a corresponding number of to-be-displayed data are cyclically taken out from the single-circular linked list every preset time, and the to-be-displayed data are placed in a preset display list;
[0042] The data to be displayed in the display list is displayed.
[0043] In specific practice, a circular singly linked list is a form of a singly linked list, and its structural feature is that the pointer field of the last node in the linked list is no longer an end mark, but points to the first node of the entire linked list, so that the linked list forms a loop. Therefore, after placing the data to be displayed into the single circular linked list, a corresponding number of data to be displayed are selected from the single circular linked list, and when the last data in the single circular linked list is looped, the first data in the single circular linked list can be looped in the next loop, thereby avoiding the operation of deleting the top of the list and then adding new data at the bottom in real time in the prior art.
[0044] The data to be displayed in the display list is displayed, and the display device can be a computer web page or any display device that can scroll and display.
[0045] It is understandable that the technical solution shown in this embodiment can obtain the data to be displayed, and place the data to be displayed in a single loop linked list; according to the preset minimum scroll value, every preset time, the corresponding number of data to be displayed is cyclically taken out from the single loop linked list, and the data to be displayed is placed in a preset display list; and the data to be displayed in the display list is displayed. It is understandable that the technical solution shown in this embodiment uses the method of single loop linked list cyclic display, which avoids frequent page redrawing and reduces the page burden. The single loop linked list display makes the page scrolling smoother and can achieve a seamless effect.
[0046] In actual application, this embodiment will pre-generate a list, called a display list, and then put the data to be displayed into a single circular linked list, and then determine whether scrolling display is required based on the set minimum scrolling number.
[0047] It should be noted that see Figure 2 , the step of cyclically taking out a corresponding number of data to be displayed from the single circular linked list according to a preset minimum scroll value includes:
[0048] Obtain the number of data to be displayed in the single circular linked list;
[0049] Comparing the number of data to be displayed with the minimum scroll value;
[0050] If the number of the data to be displayed is not greater than the minimum scroll value, all the data to be displayed are cyclically taken out from the single-circular linked list and placed into a preset display list.
[0051] In specific practice, if the number of entries with cyclic data in a single circular linked list is less than or equal to the value of the minimum scrolling number, all the data in the single circular linked list are directly assigned to the display list, so that the display device can statically display the data in the single circular linked list.
[0052] For example, there are 3 pieces of data to be displayed, all of which are placed in a single circular linked list. The minimum scrolling number that the display module can display simultaneously is 5. This proves that the display module can display 5 pieces of data at the same time, and can display all 3 pieces of data to be displayed at the same time, so it is a static display.
[0053] It should be noted that see Figure 2 , the step of cyclically taking out a corresponding number of data to be displayed from the single circular linked list according to a preset minimum scroll value includes:
[0054] Obtain the number of data to be displayed in the single circular linked list;
[0055] Comparing the number of data to be displayed with the minimum scroll value;
[0056] If the number of data to be displayed is greater than the minimum scroll value, then,
[0057] Create a head pointer and a tail pointer, the head pointer points to the first data to be displayed in the single circular linked list, and the tail pointer points to the Nth data to be displayed in the single circular linked list, N=X, X is the minimum scroll value; every preset time, the head pointer and the tail pointer traverse backwards once;
[0058] The data to be displayed pointed to by the head pointer and the tail pointer and the data to be displayed between the head pointer and the tail pointer are taken out, and placed in a preset display list.
[0059] In practice, if the number of entries in a single circular linked list is greater than the minimum scrolling number, the data in the single circular linked list is traversed through a while loop and assigned to the display list.
[0060] The specific implementation is achieved through double pointers. The head pointer headPointer points to the first data in the linked list, and the tail pointer rearPointer traverses the single-loop linked list until the minimum scrolling number is reached and stops. The display list scrolls in the visible area of the page to display the data between the two pointers. After each scrolling of a piece of data, the head pointer headPointer and the tail pointer rearPointer traverse backwards once to point to the new data, and the scrolling is repeated in this way to achieve an infinite scrolling effect.
[0061] In actual application scenarios, if the value of the minimum scroll number is 5 and there are 10 data in the single circular linked list, then first, the head pointer points to the first data, the tail pointer points to the fifth data, and the display module displays the first to fifth data at the same time. After the preset time, the head pointer points to the second data, and the tail pointer points to the sixth data, then the display module displays the second to sixth data at the same time, and so on.
[0062] It should be noted that, when the head pointer or the tail pointer points to the last piece of data in the single circular linked list, after a preset time, the head pointer or the tail pointer points to the first piece of data in the single circular linked list again.
[0063] In actual application scenarios, since a single circular linked list is used, when the head pointer points to the 5th data and the tail pointer points to the 10th data, the data pointed to by the tail pointer is the last data of the single circular linked list. Then after the preset time, the head pointer points to the 6th data and the tail pointer points to the 1st data. The display module simultaneously displays the 6th to 10th data and the 1st data.
[0064] In practice, see Figure 2 , before obtaining the data to be displayed and placing the data to be displayed into the single circular linked list, it also includes:
[0065] Initialize the preset display list.
[0066] It can be understood that initializing the display list can avoid the presence of previously leftover data in the display list and avoid display anomalies.
[0067] Preferably, the above method can be integrated into an automatic looping infinite scrolling list control on a computer for ease of use.
[0068] Embodiment 2
[0069] According to a second aspect of an embodiment of the present invention, there is provided a device for implementing an automatic circular infinite scrolling list, comprising:
[0070] A data acquisition module, used for acquiring data to be displayed, and placing the data to be displayed into a single circular linked list;
[0071] A cyclic extraction module, used for cyclically extracting a corresponding number of to-be-displayed data from the single-circular linked list every preset time according to a preset minimum scroll value, and placing the to-be-displayed data into a preset display list;
[0072] The display module is used to display the data to be displayed in the display list.
[0073] It is understandable that the technical solution shown in this embodiment can obtain the data to be displayed through the data acquisition module, and place the data to be displayed in a single loop linked list; through the loop extraction module, according to the preset minimum scroll value, every preset time, the corresponding number of data to be displayed are cyclically taken out from the single loop linked list, and the data to be displayed is placed in a preset display list; the data to be displayed in the display list is displayed through the display module. It is understandable that the technical solution shown in the present invention uses the method of single loop linked list loop display, which avoids frequent page redrawing and reduces the page burden. The single loop linked list display makes the page scrolling smoother and can achieve a seamless effect.
[0074] Embodiment 3
[0075] Provided is a device for realizing an automatic loop infinite scrolling list, comprising:
[0076] A main controller, and a memory connected to the main controller;
[0077] a memory in which program instructions are stored;
[0078] The main controller is used to execute program instructions stored in the memory to perform any of the above methods.
[0079] The automatic loop infinite scrolling list implementation device includes but is not limited to a computer display device, a display screen including a controller, etc.
[0080] Embodiment 4
[0081] According to a fourth aspect of an embodiment of the present invention, a computer-readable storage medium is provided, storing a computer program, and when the computer program is executed by a processor, the method described in any one of the above is implemented.
[0082] It can be understood that the same or similar parts of the above embodiments can be referenced to each other, and the contents not described in detail in some embodiments can refer to the same or similar contents in other embodiments.
[0083] It should be noted that, in the description of the present invention, the terms "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or implying relative importance. In addition, in the description of the present invention, unless otherwise specified, the meaning of "plurality" refers to at least two.
[0084] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, segment or portion of code that includes one or more executable instructions for implementing the steps of a specific logical function or process, and the scope of the preferred embodiments of the present invention includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in the reverse order depending on the functions involved, which should be understood by those skilled in the art to which the embodiments of the present invention belong.
[0085] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, a plurality of steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0086] A person skilled in the art may understand that all or part of the steps in the method for implementing the above-mentioned embodiment may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, which, when executed, includes one or a combination of the steps of the method embodiment.
[0087] In addition, each functional unit in each embodiment of the present invention may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium.
[0088] The storage medium mentioned above can be a read-only memory, a magnetic disk or an optical disk, etc.
[0089] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "examples", "specific examples", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.
[0090] Although the embodiments of the present invention have been shown and described above, it is to be understood that the above embodiments are exemplary and are not to be construed as limitations of the present invention. A person skilled in the art may change, modify, replace and vary the above embodiments within the scope of the present invention.
Claims
1. A method for realizing an automatic loop infinite scrolling list, characterized in that: include: Acquire data to be displayed, and place the data to be displayed into a single circular linked list; According to a preset minimum scroll value, a corresponding number of to-be-displayed data are cyclically taken out from the single-circular linked list every preset time, and the to-be-displayed data are placed in a preset display list; Display the data to be displayed in the display list; The step of cyclically taking out a corresponding number of data to be displayed from the single-circular linked list according to a preset minimum scroll value includes: Obtain the number of data to be displayed in the single circular linked list; Comparing the number of data to be displayed with the minimum scroll value; If the number of data to be displayed is greater than the minimum scroll value, then, Create a head pointer and a tail pointer, the head pointer points to the first data to be displayed in the single circular linked list, and the tail pointer points to the Nth data to be displayed in the single circular linked list, N=X, X is the minimum scroll value; every preset time, the head pointer and the tail pointer traverse backwards once; Taking out the to-be-displayed data pointed to by the head pointer and the tail pointer and the to-be-displayed data between the head pointer and the tail pointer, and placing them into a preset display list; When the head pointer or the tail pointer points to the last piece of data in the single circular linked list, after a preset time, the head pointer or the tail pointer points to the first piece of data in the single circular linked list again.
2. The method for realizing an automatic loop infinite scrolling list according to claim 1, characterized in that: The step of cyclically taking out a corresponding number of data to be displayed from the single-circular linked list according to a preset minimum scroll value includes: Obtain the number of data to be displayed in the single circular linked list; Comparing the number of data to be displayed with the minimum scroll value; If the number of the data to be displayed is not greater than the minimum scroll value, all the data to be displayed are cyclically taken out from the single-circular linked list and placed into a preset display list.
3. The method for realizing an automatic loop infinite scrolling list according to any one of claims 1 to 2, characterized in that: Before obtaining the data to be displayed and placing the data to be displayed into the single circular linked list, the method further includes: Initialize the preset display list.
4. A device for realizing an automatic loop infinite scrolling list, characterized in that: include: A data acquisition module, used for acquiring data to be displayed, and placing the data to be displayed into a single circular linked list; A cyclic extraction module, used for cyclically extracting a corresponding number of to-be-displayed data from the single-circular linked list every preset time according to a preset minimum scroll value, and placing the to-be-displayed data into a preset display list; A display module, used to display the data to be displayed in the display list; The step of cyclically taking out a corresponding number of data to be displayed from the single-circular linked list according to a preset minimum scroll value includes: Obtain the number of data to be displayed in the single circular linked list; Comparing the number of data to be displayed with the minimum scroll value; If the number of data to be displayed is greater than the minimum scroll value, then, Create a head pointer and a tail pointer, the head pointer points to the first data to be displayed in the single circular linked list, and the tail pointer points to the Nth data to be displayed in the single circular linked list, N=X, X is the minimum scroll value; every preset time, the head pointer and the tail pointer traverse backwards once; Taking out the to-be-displayed data pointed to by the head pointer and the tail pointer and the to-be-displayed data between the head pointer and the tail pointer, and placing them into a preset display list; When the head pointer or the tail pointer points to the last piece of data in the single circular linked list, after a preset time, the head pointer or the tail pointer points to the first piece of data in the single circular linked list again.
5. An automatic loop infinite scrolling list implementation device, characterized in that: include: A main controller, and a memory connected to the main controller; a memory in which program instructions are stored; The main controller is used to execute program instructions stored in the memory and execute the method according to any one of claims 1 to 3.
6. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 3 is implemented.
Citation Information
Patent Citations
Information scroll display method, device and system
CN112242118A
Infinite loop scrolling display method, device and system, and storage medium
CN116185323A