Message paging loading method and device, equipment, storage medium and program product
By extracting the data of the target jump page from the message list and performing page stitching processing, combined with transition animation, the problem of message loading time for too long during large-scale page jumps is solved, and smooth transition effects and memory savings are achieved.
Patent Information
- Application Number
- CN202411853224.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-16
- Publication Date
- 2025-05-13
AI Technical Summary
In the prior art, message lists need to load more page data when jumping on large-scale pages, resulting in the message loading time being too long and cannot provide smooth loading effects, affecting the user experience.
By obtaining the user loading request, after detecting the jump loading request, the data of the target jump page is extracted and the page splicing process is performed to obtain the splicing page information. Determine the transition animation parameters based on the splicing page information, and execute the corresponding transition animation until the target jump page is fully displayed.
There is no need to load the intermediate page data between the currently displayed page and the target jump page, reducing message loading time, saving memory resources, providing a smooth transition effect from the currently displayed page to the target jump page, and improving the user's visual experience.
Smart Images

Figure CN119987915A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of computer technology, and in particular to a message paging loading method, apparatus, device, storage medium, and program product. Background Art
[0002] In application development, message lists are one of the core functions of applications such as instant messaging and social media. As the frequency of user communication increases and historical communication data continues to accumulate, message lists often need to process a large number of historical messages. In order to solve the performance problems caused by large amounts of data, paging loading has become a common technical solution. By loading data in batches, it avoids excessive memory usage and page freezes caused by loading all messages at once.
[0003] In the related art, the paging loading mechanism adopted is sequential loading. For a large range of page jumps, more page data needs to be loaded, which easily causes the message loading time to be too long and cannot provide a smooth loading effect, affecting the user experience. Summary of the invention
[0004] The embodiments of the present application provide a message paging loading method, device and equipment, which solves the problem that the related technology needs to load a lot of page data for large-scale page jumps, which easily causes the message loading time to be too long, and cannot provide a smooth loading effect, affecting the user experience. It achieves that there is no need to load the intermediate page data between the current display page and the target jump page, reduces the message loading time, saves memory resources, provides a smooth transition effect from the current display page to the target jump page, and improves the user's visual experience.
[0005] In a first aspect, an embodiment of the present application provides a message paging loading method, the method comprising:
[0006] Obtaining a user loading request, and when detecting that the user loading request is a jump loading request, extracting a target jump page in the jump loading request, and loading target page data corresponding to the target jump page;
[0007] Perform page splicing processing based on the target page data and the starting page information corresponding to the currently displayed page to obtain splicing page information;
[0008] The transition animation parameters are determined according to the spliced page information, and the corresponding transition animation is executed based on the transition animation parameters until the target jump page is completely displayed.
[0009] In a second aspect, an embodiment of the present application further provides a message paging loading device, the device comprising:
[0010] The page data loading module is configured to obtain a user loading request, and when detecting that the user loading request is a jump loading request, extract a target jump page in the jump loading request, and load target page data corresponding to the target jump page;
[0011] A page information determination module configured to perform page splicing processing based on the target page data and the starting page information corresponding to the currently displayed page to obtain spliced page information;
[0012] The transition animation execution module is configured to determine transition animation parameters according to the spliced page information, and execute corresponding transition animation based on the transition animation parameters until the target jump page is completely displayed.
[0013] In a third aspect, an embodiment of the present application further provides a message paging loading device, the device comprising:
[0014] one or more processors;
[0015] a storage device configured to store one or more programs,
[0016] When the one or more programs are executed by the one or more processors, the one or more processors implement the message paging loading method described in the embodiment of the present application.
[0017] In a fourth aspect, an embodiment of the present application further provides a non-volatile storage medium storing computer executable instructions, wherein the computer executable instructions, when executed by a computer processor, are configured to execute the message paging loading method described in the embodiment of the present application.
[0018] In the fifth aspect, an embodiment of the present application also provides a computer program product, which includes a computer program, which is stored in a computer-readable storage medium, and at least one processor of the device reads and executes the computer program from the computer-readable storage medium, so that the device executes the message paging loading method described in the embodiment of the present application.
[0019] In the embodiment of the present application, by obtaining the user loading request, when it is detected that the user loading request is a jump loading request, the target jump page in the jump loading request is extracted, and the target page data corresponding to the target jump page is loaded; based on the target page data and the starting page information corresponding to the currently displayed page, page splicing processing is performed to obtain the splicing page information; the transition animation parameters are determined according to the splicing page information, and the corresponding transition animation is executed based on the transition animation parameters until the target jump page is completely displayed. In the above scheme, by performing page splicing processing based on the target page data and the starting page information corresponding to the currently displayed page, there is no need to load the intermediate page data between the currently displayed page and the target jump page, thereby reducing the message loading time and saving memory resources, and by executing the corresponding transition animation based on the transition animation parameters, a smooth transition effect of scrolling from the currently displayed page to the target jump page can be provided, thereby improving the user's visual experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] Figure 1 A flowchart of a message paging loading method provided in an embodiment of the present application;
[0021] Figure 2 A schematic diagram of a process of bidirectional paging loading of a message list provided in an embodiment of the present application;
[0022] Figure 3 A flowchart of a message paging loading method including a specific process of page splicing processing provided by an embodiment of the present application;
[0023] Figure 4 A flowchart of a message paging loading method including a specific process of executing a transition animation provided by an embodiment of the present application;
[0024] Figure 5 A schematic diagram of a specific implementation process of realizing transition animation based on the view layer provided in an embodiment of the present application;
[0025] Figure 6 A flowchart of another message paging loading method including a specific process of page splicing processing provided by an embodiment of the present application;
[0026] Figure 7 A flowchart of another message paging loading method including a specific process of executing a transition animation provided by an embodiment of the present application;
[0027] Figure 8 A schematic diagram of a specific implementation process of realizing transition animation based on a data layer provided in an embodiment of the present application;
[0028] Fig. 9A flowchart of a message paging loading method including a specific process of discarding loaded paging data provided by an embodiment of the present application;
[0029] Fig.10 A structural block diagram of a message paging loading device provided in an embodiment of the present application;
[0030] Fig.11 A structural diagram of a message paging loading device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0031] The embodiments of the present application are further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the embodiments of the present application, rather than to limit the embodiments of the present application. It should also be noted that, for ease of description, only parts related to the embodiments of the present application are shown in the accompanying drawings, rather than all structures.
[0032] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.
[0033] The message paging loading method provided in the embodiment of the present application can perform paging jump loading in response to the user loading request, without loading the intermediate page data between the current display page and the target jump page, reducing the message loading time, and providing transition animation to optimize the user visual experience. Related applications may include: instant messaging applications, social media applications, etc. The several application scenarios listed above are only exemplary and explanatory. In actual applications, the message paging loading method can also be used in message loading in other scenarios, and the embodiment of the present application does not limit this.
[0034] In the message paging loading method provided in the embodiment of the present application, the executor of each step can be a computer device, which refers to any electronic device with data calculation, processing and storage capabilities, such as mobile phones, PCs (Personal Computers), tablet computers and other terminal devices, which are not limited in the embodiment of the present application.
[0035] Taking the use of mobile terminals as an example, paging loading can optimize data display and avoid loading a large amount of data at one time. By dividing the message list into several pages, a fixed number of message data is obtained from the server or local database page by page each time, such as 20 messages per page. When the user slides to the top or bottom of the list, a loading request for the next page of data is triggered, and more historical messages or new messages are gradually loaded. However, when browsing the message list, the user may need to jump directly from the currently displayed page to another page far away from the current page, such as jumping directly from page 1 to page 10, while the paging loading mechanism in the related art only supports sequential loading. For a large range of page jumps, the data of all intermediate pages needs to be loaded at one time, which causes the instantaneous loading of a large amount of data, which can easily cause a surge in memory usage and may cause application crashes or page freezes. In addition, direct jumps in related technologies can cause sudden changes in pages and lack smooth visual transitions, affecting user experience. The message paging loading method, device, equipment, storage medium and program product provided by the embodiments of the present application can be used to optimize the following application scenarios: 1. Large-scale jump of chat messages: In instant messaging applications, users may need to review chat records from many years ago, such as looking for specific conversation content or attachments. The embodiments of the present application can be used to directly jump from the current page to any target jump page containing historical messages in the message list without flipping through the pages; 2. Search result positioning: When users search for chat records, they may get a large number of matching results after entering keywords. The embodiments of the present application can be used to determine the target jump page in combination with the user clicking on the search results, and quickly and smoothly jump to the corresponding message position, so that users can view the context; 3. Date selection jump: Users want to view the chat content of a specific date, such as holiday blessing messages or discussions of important events. The embodiments of the present application can determine the target jump page in combination with the date selected by the user and perform page jumps. 4. Important message mark navigation: Users can mark important messages. When they need to view them later, the embodiments of the present application can be used to combine message navigation with direct jump to the marked target jump page. Thus, the problem that the related technology needs to load a lot of page data for large-scale page jumps, which easily causes the message loading time to be too long, fails to provide a smooth loading effect, and affects the user experience is solved.
[0036] Figure 1 A flowchart of a message paging loading method provided for an embodiment of the present application. Among them, the embodiment of the present application uses the bidirectional paging loading mechanism of the message list as the basic framework, which can allow more content to be loaded downwards, and can also allow previous content to be loaded upwards. Taking a mobile terminal as an example, the bidirectional paging data loading process can trigger different page events to manage data loading and status updates by monitoring the user's screen sliding operations, load data through background asynchronous tasks, and automatically notify the user page layer to update according to the loading status. Figure 2A schematic diagram of a process of bidirectional paging loading of a message list provided in an embodiment of the present application is shown as follows: Figure 2 As shown, the dotted area indicates the display range of the terminal screen. The currently displayed content is page n of the message list. By loading upward, page n+1 can be displayed, and by loading downward, page n-1 can be displayed. Figure 1 As shown, the message paging loading method includes the following steps:
[0037] Step S101: Obtain a user loading request. When it is detected that the user loading request is a jump loading request, extract a target jump page in the jump loading request, and load target page data corresponding to the target jump page.
[0038] Among them, the user loading request can be triggered by the user performing a page operation on the terminal device, and the user loading request can be divided into a jump loading request and a sequential loading request based on the user operation type. The jump loading request can be triggered by the user through page operations such as date selection, search result click, sharing message reflow, etc., which includes the target jump page that needs to be jumped from the current display page. The sequential loading request can be triggered by the user through a screen sliding operation, which includes the target sequential pages that need to be loaded up or down. Therefore, if it is detected that the user loading request is a jump loading request, the target jump page can be extracted, and the target page data corresponding to the target jump page can be loaded for subsequent page splicing processing, without considering the intermediate page data from the current display page to the target jump page. For example, the currently displayed page is the nth page of the message list, and the message that the user expects to browse through page operations such as date selection, search result click, and message sharing reflow is located on page n+100. In this case, the n+100th page extracted from the jump loading request can be determined as the target jump page, and the target page data corresponding to the n+100th page can be loaded. Specifically, it can be obtained from the server or local database, and this application is not limited to this.
[0039] Step S102: Perform page splicing processing based on the target page data and the starting page information corresponding to the currently displayed page to obtain splicing page information.
[0040] Among them, the related art lacks a smooth transition animation from the current display page to the target jump page, which will cause a visual sense of jumping and affect the user experience. Therefore, in this embodiment, in order to smoothly transition to the target jump page without loading the intermediate page data, it is selected to perform page splicing processing to obtain splicing page information, and execute the corresponding transition animation based on the splicing page information, so as to smoothly transition from the current display page to the target jump page. Among them, the transition animation can be implemented based on different system levels. In one embodiment, the transition animation can be implemented based on the view layer, and the page splicing processing is performed by operating the view layer. Accordingly, the starting page information used in the page splicing processing can be the starting page view of the current display page, and the splicing of the target page view and the starting page view is completed in the view layer. The corresponding splicing page view is obtained, and a custom transition animation is executed. In one embodiment, the transition animation can be implemented based on the data layer, and the page splicing processing is performed by operating the data layer. Accordingly, the starting page information used in the page splicing processing can be the starting page data, and the splicing of the target page data and the starting page data is completed in the data layer. The corresponding splicing page data is obtained, and the corresponding transition animation is executed based on the scrolling display mechanism of the view component.
[0041] Step S103: determining transition animation parameters according to the spliced page information, and executing corresponding transition animation based on the transition animation parameters until the target jump page is completely displayed.
[0042] Among them, the transition animations implemented based on different system levels are based on different transition animation parameters. In one embodiment, the transition animation is implemented based on the view layer, and the corresponding splicing page information is the splicing page view. Since the splicing page view is not the original view of the view component, the original scrolling animation cannot be used. The transition animation parameters such as the scrolling length and animation duration can be determined according to the splicing page view, and a customized scrolling transition animation can be executed. In one embodiment, the transition animation is implemented based on the data layer, and the corresponding splicing page information is the splicing page data. The view position parameters of the page view corresponding to the splicing page data can be used as the transition animation parameters of the view component, and the scrolling transition animation can be executed based on the scrolling display mechanism originally set by the view component.
[0043] In the above, by obtaining the user loading request, when it is detected that the user loading request is a jump loading request, the target jump page in the jump loading request is extracted, and the target page data corresponding to the target jump page is loaded; based on the target page data and the starting page information corresponding to the currently displayed page, page splicing processing is performed to obtain the splicing page information; the transition animation parameters are determined according to the splicing page information, and the corresponding transition animation is executed based on the transition animation parameters until the target jump page is completely displayed. In the above scheme, by performing page splicing processing based on the target page data and the starting page information corresponding to the currently displayed page, there is no need to load the intermediate page data between the currently displayed page and the target jump page, thereby reducing the message loading time and saving memory resources, and by executing the corresponding transition animation based on the transition animation parameters, a smooth transition effect of scrolling from the currently displayed page to the target jump page can be provided, thereby improving the user's visual experience.
[0044] Figure 3 A flowchart of a message paging loading method including a specific process of page splicing processing provided by an embodiment of the present application, wherein the start page information includes a start page view, and the splicing page information includes a splicing page view, such as Figure 3 As shown, the following steps are included:
[0045] Step S201: Obtain a user loading request. When it is detected that the user loading request is a jump loading request, extract a target jump page in the jump loading request, and load target page data corresponding to the target jump page.
[0046] Step S202, extract the starting page view corresponding to the currently displayed page in the view component, close the original animation controller of the view component, and update the view in the view component to the target page view based on the target page data, and splice the starting page view and the target page view to obtain the spliced page view.
[0047] Among them, this embodiment implements transition animation based on the view layer. Taking Android application development as an example, the view component can be RecyclerView, and corresponding view components can also be used for other application systems, which is not limited in this application. Extract the starting page view corresponding to the currently displayed page in the view component. Specifically, it can be to record the view content, location information and view identification of the starting page view, and set the animation running state of the local dynamic view in the starting page view to prohibited to avoid overlapping with subsequent transition animations. Since the spliced page view is not the original view of the view component, the original scrolling animation cannot be used. You can choose to turn off the original animation controller of the view component, and update the view in the view component to the target page view based on the target page data. Taking the application view component RecyclerView as an example, the specific update process can be to refresh the page data in the view component based on the target page data by calling adapter.notifyDataSetChanged(), update the display of RecyclerView, and use
[0048] layoutManager.scrollToPositionWithOffset(position,offset,bottom) scrolls the Recycler View to the position of the target page view. After completing the view update in the view component, the start page view and the target page view can be spliced to obtain the spliced page view. Specifically, when the layout of the RecyclerView is monitored to change, the target page view is extracted, and the target page view is spliced with the start page view to obtain the spliced page view.
[0049] Step S203: determining transition animation parameters according to the spliced page view, and executing corresponding transition animation based on the transition animation parameters until the target jump page is completely displayed.
[0050] As described above, by splicing the start page view and the target page view to obtain the spliced page view, page splicing in the view layer dimension is achieved, which can provide effective reference information for the subsequent execution of a customized transition animation.
[0051] Figure 4 A flowchart of a message paging loading method including a specific process of executing a transition animation is provided in an embodiment of the present application, wherein the start page information includes a start page view, and the splicing page information includes a splicing page view, such as Figure 4 As shown, the following steps are included:
[0052] Step S301: Obtain a user loading request. When it is detected that the user loading request is a jump loading request, extract a target jump page in the jump loading request, and load target page data corresponding to the target jump page.
[0053] Step S302, extract the starting page view corresponding to the currently displayed page in the view component, close the original animation controller of the view component, and update the view in the view component to the target page view based on the target page data, and splice the starting page view and the target page view to obtain the spliced page view.
[0054] Step S303: determine the target scrolling length and animation duration according to the first view position and the second view position respectively corresponding to the starting page view and the target page view in the spliced page view, and execute the corresponding transition animation based on the target scrolling length and the animation duration until the target jump page is completely displayed.
[0055] Among them, the target scrolling length can be calculated according to the first view position and the second view position corresponding to the starting page view and the target page view, respectively, to calculate the distance to be moved and determine the moving range of the transition animation. The animation duration can be calculated according to the target scrolling length and the preset rules to ensure the smooth animation effect, wherein the preset rules can be a fixed scrolling speed, or can be calculated based on the set time-length function. Taking Android application development as an example, the corresponding transition animation is executed based on the target scrolling length and the animation duration. Specifically, a ValueAnimator instance can be created, and its transition from 0 to 1 is defined to indicate the progress of the transition animation. The translationY attribute of the starting page view and the target page view is updated frame by frame, thereby realizing smooth scrolling of the view, and adjusting the displacement direction and distance of the view according to the upward or downward scrolling direction, and finally completing the execution of the transition animation. In one embodiment, during the execution of the transition animation, the scrolling display and interaction of the RecyclerView itself can be disabled to prevent user interference. In one embodiment, after the display of the target jump page is completed, the start page view can be cleared, memory resources can be released, the state of the target page view can be reset, and the view attributes can be ensured to be zeroed, so as not to affect the subsequent RecyclerView data display, and the RecyclerView's own scrolling display and interaction can be restored to allow the user to continue the operation.
[0056] As described above, by executing the corresponding transition animation based on the calculated target scroll length and animation duration, a customized scroll animation can be implemented to complete a smooth transition of a large range of jumps, providing a smoother paging loading experience.
[0057] In one embodiment, Figure 5 A schematic diagram of a specific implementation process of realizing transition animation based on the view layer provided in an embodiment of the present application, such as Figure 5As shown, the dotted area indicates the screen display range. After the user triggers the jump, steps S401 are executed in sequence: save the starting page view, i.e., paging n; step S402: load the target page data, i.e., paging n+10000, monitor view changes, and at the same time close the original animation controller of the view component; step S403: save the target page view, i.e., paging n+10000; step S404: concatenate the starting page view and the target page view; step S405: execute the transition animation until the display of paging n+10000 is completed; step S406: clear the starting page view.
[0058] Figure 6 A flowchart of another message paging loading method including a specific process of page splicing processing provided by an embodiment of the present application, wherein the starting page information includes the starting page data, such as Figure 6 As shown, the following steps are included:
[0059] Step S501: Obtain a user loading request. When it is detected that the user loading request is a jump loading request, extract a target jump page in the jump loading request, and load target page data corresponding to the target jump page.
[0060] Step S502: extract the starting page data corresponding to the currently displayed page, and splice the target page data with the starting page data based on the page jump direction to obtain spliced page data.
[0061] Among them, this embodiment realizes transition animation based on the data layer. Since the target jump page may be the previous message or the next message relative to the current display page, the target page data and the starting page data can be spliced to obtain spliced page data according to the page jump direction. For example, if the page jump direction is forward jump, the target page data can be spliced to the head of the starting page data. If the page jump direction is backward jump, the target page data can be spliced to the tail of the starting page data. After completing the page data splicing of the data layer, the view control can be reused to display the transition animation.
[0062] Step S503: determining transition animation parameters according to the spliced page data, and executing corresponding transition animation based on the transition animation parameters until the target jump page is completely displayed.
[0063] As described above, by splicing the target page data and the start page data to obtain the spliced page data, page splicing in the data layer dimension is achieved, and corresponding page data can be provided for subsequent execution of the scrolling transition animation.
[0064] Figure 7 A flowchart of another message paging loading method including a specific process of executing transition animation is provided in an embodiment of the present application, wherein the transition animation parameters include view position parameters, such as Figure 7 As shown, the following steps are included:
[0065] Step S601: Obtain a user loading request. When it is detected that the user loading request is a jump loading request, extract a target jump page in the jump loading request, and load target page data corresponding to the target jump page.
[0066] Step S602: extract the starting page data corresponding to the currently displayed page, and splice the target page data with the starting page data based on the page jump direction to obtain spliced page data.
[0067] Step S603: update the page view in the view component based on the spliced page data, and determine the view position parameters corresponding to the page view, and execute the corresponding transition animation according to the view position parameters and the set scrolling display mechanism until the target jump page is fully displayed.
[0068] Among them, taking the application view component RecyclerView as an example, the scrolling display mechanism of RecyclerView can be used by calling the scrollTo-PositionWithOffset() method, and the target jump page can be scrolled and jumped in combination with the view position parameter to complete the execution of the transition animation.
[0069] In one embodiment, after updating the page view in the view component based on the spliced page data, the method further includes:
[0070] A placeholder or dividing line view is added between the first view portion and the second view portion corresponding to the current display page and the target jump page in the page view.
[0071] Among them, inserting a placeholder or dividing line view between the target jump page and the currently displayed page can serve as a marker for data segmentation, providing users with a visual prompt that data is loading, and can also serve as a logical dividing line between the target jump page and the currently displayed page to maintain the integrity of the jump.
[0072] In one embodiment, after the display of the target adjustment page is completed, the start page data can be cleared, as well as the inserted placeholder or dividing line view, which can effectively release memory resources and prevent redundant data from occupying resources.
[0073] As described above, by performing transition animation display based on spliced page data, the original scrolling animation of the view component can be reused to achieve smooth page jump transition and optimize the user's page viewing experience.
[0074] In one embodiment, Figure 8 A schematic diagram of a specific implementation process of realizing transition animation based on a data layer provided in an embodiment of the present application, such as Figure 8As shown, the dotted area marks the screen display range. After the user triggers the jump, step S701 is executed in sequence: splicing the starting page data and the target page data, that is, splicing the data of paging n-10000 and paging n, step S702: updating the page view, inserting a placeholder between the starting page view and the target page view, step S703: sliding to the target page view, step S704: clearing the starting page data.
[0075] Fig. 9 A flowchart of a message paging loading method including a specific process of discarding loaded paging data is provided in an embodiment of the present application, such as Fig. 9 As shown, the following steps are included:
[0076] Step S801: Obtain a user loading request.
[0077] Step S802: When it is detected that the user loading request is a jump loading request, a target jump page in the jump loading request is extracted, and target page data corresponding to the target jump page is loaded.
[0078] Step S803: Perform page splicing processing based on the target page data and the starting page information corresponding to the currently displayed page to obtain splicing page information.
[0079] Step S804: determining transition animation parameters according to the spliced page information, and executing corresponding transition animation based on the transition animation parameters until the target jump page is completely displayed.
[0080] Step S805: When it is detected that the user loading request is a sequential loading request, it is detected whether the message list reaches a set boundary threshold.
[0081] As the user continues to slide the message list, the length of the message list gradually increases. If the total length of the message list is large, for example, more than 10,000 messages, the memory usage will gradually increase. Therefore, it is necessary to discard some data and release the memory in time. If the message list does not reach the set boundary threshold, no data is loaded; if the message list reaches the set boundary threshold, it is determined whether there is any list data that has not been loaded. If so, the list data continues to be loaded and the message list is updated.
[0082] Step S806: When it is detected that the message list reaches the boundary threshold and the list data loading is completed, it is detected whether the current message storage length reaches the preset length threshold.
[0083] Among them, if the message list reaches the boundary threshold and the list data is loaded, it is determined whether the current message storage length reaches the preset length threshold. If so, it means that the preset memory limit has been reached. If not, it means that new list data can continue to be stored.
[0084] Step S807: When it is detected that the message storage length reaches a preset length threshold, discard the preset number of first messages in the message list that meet the earliest loading time, and store the most recently loaded second message.
[0085] If the message storage length reaches a preset length threshold, the first message in the message list that meets the preset number of earliest loading times can be discarded, and the list data that is no longer displayed can be discarded to release memory resources.
[0086] In one embodiment, after the first message that meets the preset number of earliest loading times in the discarded message list, the method further includes:
[0087] When it is detected that the target message corresponding to the sequential loading request is the first message, the first message is reloaded.
[0088] Among them, if the user slides back to the discarded data area, the discarded data can be reloaded. Therefore, if it is detected that the target message corresponding to the sequential loading request is the first message, and the first message has been discarded due to memory management, the first message can be reloaded without affecting the user's viewing of the message list.
[0089] As mentioned above, by introducing data boundary detection and memory management mechanisms and setting the maximum length of message storage, a reasonable storage range of loaded data can be maintained. When the message storage length reaches the preset length threshold, old data that exceeds the range is discarded to release memory resources, prevent memory overflow problems caused by unlimited growth of paging loaded data, ensure application stability and efficiency, and optimize resource utilization.
[0090] Fig.10 This is a structural block diagram of a message paging loading device provided in an embodiment of the present application. The device is configured to execute the message paging loading method provided in the above embodiment and has the corresponding functional modules and beneficial effects of the execution method. Fig.10 As shown, the device comprises:
[0091] The page data loading module 101 is configured to obtain a user loading request, and when it is detected that the user loading request is a jump loading request, extract a target jump page in the jump loading request, and load the target page data corresponding to the target jump page;
[0092] The page information determination module 102 is configured to perform page splicing processing based on the target page data and the starting page information corresponding to the currently displayed page to obtain spliced page information;
[0093] The transition animation execution module 103 is configured to determine transition animation parameters according to the spliced page information, and execute corresponding transition animation based on the transition animation parameters until the target jump page is completely displayed.
[0094] In the above, by obtaining the user loading request, when it is detected that the user loading request is a jump loading request, the target jump page in the jump loading request is extracted, and the target page data corresponding to the target jump page is loaded; based on the target page data and the starting page information corresponding to the currently displayed page, page splicing processing is performed to obtain the splicing page information; the transition animation parameters are determined according to the splicing page information, and the corresponding transition animation is executed based on the transition animation parameters until the target jump page is completely displayed. In the above scheme, by performing page splicing processing based on the target page data and the starting page information corresponding to the currently displayed page, there is no need to load the intermediate page data between the currently displayed page and the target jump page, thereby reducing the message loading time and saving memory resources, and by executing the corresponding transition animation based on the transition animation parameters, a smooth transition effect of scrolling from the currently displayed page to the target jump page can be provided, thereby improving the user's visual experience.
[0095] In a possible embodiment, the start page information includes a start page view, the spliced page information includes a spliced page view, and the page information determination module 102 is further configured to:
[0096] Extract the starting page view corresponding to the currently displayed page in the view component, close the original animation controller of the view component, and update the view in the view component to the target page view based on the target page data;
[0097] The start page view and the target page view are concatenated to obtain the concatenated page view.
[0098] In a possible embodiment, the transition animation parameters include a target scroll length and an animation duration, and the transition animation execution module 103 is configured as follows:
[0099] Determine a target scrolling length and animation duration according to a first view position and a second view position respectively corresponding to a start page view and a target page view in the spliced page view;
[0100] Perform the corresponding transition animation based on the target scroll length and animation duration.
[0101] In a possible embodiment, the start page information includes start page data, and the page information determination module 102 is further configured to:
[0102] Extract the starting page data corresponding to the currently displayed page;
[0103] The target page data and the start page data are spliced together based on the page jump direction to obtain spliced page data.
[0104] In a possible embodiment, the transition animation parameters include view position parameters, and the transition animation execution module 103 is further configured to:
[0105] Update the page view in the view component based on the spliced page data, and determine the view position parameters corresponding to the page view;
[0106] Execute the corresponding transition animation according to the view position parameters and the set scrolling display mechanism.
[0107] In a possible embodiment, it further includes a view segmentation module configured to:
[0108] A placeholder or dividing line view is added between the first view portion and the second view portion corresponding to the current display page and the target jump page in the page view.
[0109] In a possible embodiment, it further includes a message discarding module configured to:
[0110] When it is detected that the user loading request is a sequential loading request, it is detected whether the message list reaches a set boundary threshold;
[0111] When it is detected that the message list reaches the boundary threshold and the list data loading is completed, it is detected whether the current message storage length reaches the preset length threshold;
[0112] When it is detected that the message storage length reaches a preset length threshold, the first messages in the message list that meet the preset number of earliest loading times are discarded, and the most recently loaded second messages are stored.
[0113] In a possible embodiment, a message reloading module is further included, configured as follows:
[0114] When it is detected that the target message corresponding to the sequential loading request is the first message, the first message is reloaded.
[0115] Fig.11 A structural diagram of a message paging loading device provided in an embodiment of the present application, such as Fig.11 As shown, the device includes a processor 201, a memory 202, an input device 203 and an output device 204; the number of processors 201 in the device can be one or more. Fig.11 A processor 201 is taken as an example; the processor 201, memory 202, input device 203 and output device 204 in the device can be connected by a bus or other means. Fig.11The example of connecting through a bus is taken. The memory 202, as a computer-readable storage medium, can be configured to store software programs, computer executable programs and modules, such as program instructions / modules corresponding to the message paging loading method in the embodiment of the present application. The processor 201 executes various functional applications and data processing of the device by running the software programs, instructions and modules stored in the memory 202, that is, implements the above-mentioned message paging loading method. The input device 203 can be configured to receive input digital or character information, and generate key signal input related to user settings and function control of the device. The output device 204 may include a display device such as a display screen.
[0116] An embodiment of the present application also provides a non-volatile storage medium containing computer executable instructions. When the computer executable instructions are executed by a computer processor, they are configured to execute a message paging loading method described in the above embodiment, which includes: obtaining a user loading request, and when it is detected that the user loading request is a jump loading request, extracting the target jump page in the jump loading request, and loading the target page data corresponding to the target jump page; performing page splicing processing based on the target page data and the starting page information corresponding to the currently displayed page to obtain splicing page information; determining transition animation parameters according to the splicing page information, and executing the corresponding transition animation based on the transition animation parameters until the target jump page is completely displayed.
[0117] It is worth noting that in the embodiment of the above-mentioned message paging loading device, the various units and modules included are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not configured to limit the protection scope of the embodiments of the present application.
[0118] In some possible implementations, various aspects of the method provided by the present application may also be implemented in the form of a program product, which includes a program code. When the program product is run on a computer device, the program code is configured to enable the computer device to execute the steps of the method according to various exemplary embodiments of the present application described above in this specification. For example, the computer device may execute the message paging loading method recorded in the embodiment of the present application. The program product may be implemented in any combination of one or more readable media.
Claims
1. A message paging loading method, characterized in that: include: Obtaining a user loading request, and when detecting that the user loading request is a jump loading request, extracting a target jump page in the jump loading request, and loading target page data corresponding to the target jump page; Perform page splicing processing based on the target page data and the starting page information corresponding to the currently displayed page to obtain splicing page information; The transition animation parameters are determined according to the spliced page information, and the corresponding transition animation is executed based on the transition animation parameters until the target jump page is completely displayed.
2. The message paging loading method according to claim 1, characterized in that: The starting page information includes a starting page view, the splicing page information includes a splicing page view, and the page splicing process is performed based on the starting page information corresponding to the target page data and the currently displayed page to obtain the splicing page information, including: Extracting a start page view corresponding to a currently displayed page in the view component, closing an original animation controller of the view component, and updating the view in the view component to a target page view based on the target page data; The start page view and the target page view are spliced together to obtain a spliced page view.
3. The message paging loading method according to claim 2, characterized in that: The transition animation parameters include a target scrolling length and an animation duration, and the determining of the transition animation parameters according to the spliced page information and executing the corresponding transition animation based on the transition animation parameters include: Determine a target scrolling length and animation duration according to a first view position and a second view position respectively corresponding to the start page view and the target page view in the spliced page view; A corresponding transition animation is performed based on the target scroll length and the animation duration.
4. The message paging loading method according to claim 1, characterized in that: The starting page information includes starting page data, and the page splicing process is performed based on the starting page information corresponding to the target page data and the currently displayed page to obtain the spliced page information, including: Extract the starting page data corresponding to the currently displayed page; The target page data and the start page data are spliced together based on the page jump direction to obtain spliced page data.
5. The message paging loading method according to claim 4 is characterized in that: The transition animation parameters include view position parameters, and the determining of the transition animation parameters according to the spliced page information and executing the corresponding transition animation based on the transition animation parameters include: Update the page view in the view component based on the spliced page data, and determine the view position parameter corresponding to the page view; According to the view position parameters and the set scrolling display mechanism, the corresponding transition animation is executed.
6. The message paging loading method according to claim 5, characterized in that: After the page view in the view component is updated based on the spliced page data, the method further includes: A placeholder or a dividing line view is added between the first view portion and the second view portion corresponding to the current display page and the target jump page in the page view.
7. The message paging loading method according to claim 1, characterized in that: Also includes: In the case where it is detected that the user loading request is a sequential loading request, detecting whether the message list reaches a set boundary threshold; When it is detected that the message list reaches the boundary threshold and the list data loading is completed, detecting whether the current message storage length reaches the preset length threshold; When it is detected that the message storage length reaches the preset length threshold, the first messages in the message list that meet the preset number of earliest loading times are discarded, and the most recently loaded second messages are stored.
8. The message paging loading method according to claim 7, characterized in that: After discarding the first messages in the message list that meet the preset number of earliest loading times, the method further includes: When it is detected that the target message corresponding to the sequential loading request is the first message, the first message is reloaded.
9. A message paging loading device, characterized in that: include: The page data loading module is configured to obtain a user loading request, and when detecting that the user loading request is a jump loading request, extract a target jump page in the jump loading request, and load target page data corresponding to the target jump page; A page information determination module configured to perform page splicing processing based on the target page data and the starting page information corresponding to the currently displayed page to obtain spliced page information; The transition animation execution module is configured to determine transition animation parameters according to the spliced page information, and execute corresponding transition animation based on the transition animation parameters until the target jump page is completely displayed.
10. A message paging loading device, the device comprising: one or more processors; A storage device configured to store one or more programs, when the one or more programs are executed by the one or more processors, enables the one or more processors to implement the message paging loading method described in any one of claims 1-8.
11. A non-volatile storage medium storing computer executable instructions, wherein the computer executable instructions are configured to execute the message paging loading method according to any one of claims 1 to 8 when executed by a computer processor.
12. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the message paging loading method described in any one of claims 1 to 8 is implemented.