Picture waterfall flow planning method and device based on dynamic planning, equipment and medium
By adopting a dynamic programming-based picture waterfall flow planning method in the waterfall flow layout, image distribution is performed based on the average capacity length of the column container, the problem of frequent page relay in the existing technology is solved and the user experience is improved.
Patent Information
- Application Number
- CN202411605708.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-11
- Publication Date
- 2025-03-25
- Estimated Expiration
- 2044-11-11
AI Technical Summary
When handling waterfall flow layout, the existing technology causes frequent relaying of the page, which brings visual interference to the user. Especially in lazy loading scenarios, it is difficult to display and process gracefully, resulting in poor user experience.
The image waterfall flow planning method based on dynamic programming is adopted. By calculating the average capacity length of the column container and using this as a benchmark, the image is distributed only when the current image length sum is close to the average capacity length, reducing the number of re-layouts.
By reducing the visual interference caused to users due to image loading and relaying, efficiently generating image waterfall flow planning schemes, improving the user experience in web design scenarios.
Smart Images

Figure CN119690426A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of UI design technology, which is applied to the field of financial technology business, and in particular to a method, device, equipment and medium for planning a picture waterfall flow based on dynamic planning. Background Art
[0002] In modern web design, waterfall layout is a popular visual display method, which allows content to be displayed dynamically in multiple columns, and the height of each column can vary according to the content, thus forming a visual "waterfall" effect. This layout method is particularly suitable for photo sharing websites, news aggregation platforms, etc., and can provide rich visual experience and flexible content display.
[0003] The mainstream waterfall flow calculation idea in the community is to distribute pictures of known height (getting the height after the picture is loaded triggers the re-layout) into column containers, and each column records the real-time height. For each new picture, the distribution rule is to put it in the shortest column. This algorithm is professionally called the idea of a greedy algorithm. There are some defects in the existing technology when dealing with waterfall flow layout. The main problem is that when all the pictures are loaded, the page will be rearranged once, which will cause interference to the user. Especially in the lazy loading scenario, that is, the picture is loaded when the page is scrolled, it is difficult for the existing technology to display and process it elegantly, resulting in a poor user experience. Therefore, how to more efficiently generate a picture waterfall flow planning scheme to improve the user experience in web design scenarios has become a technical problem that needs to be solved urgently. Summary of the invention
[0004] The present application provides a method, device, equipment and medium for image waterfall flow planning based on dynamic planning, which more efficiently generates image waterfall flow planning solutions to improve user experience in web page design scenarios.
[0005] In a first aspect, the present application provides a method for planning a picture waterfall flow based on dynamic programming, the method comprising:
[0006] Calculate the mean capacity length of the current column container;
[0007] Taking each preset picture distributed to the current column container as a distributed picture, and calculating the sum of current picture lengths of the distributed pictures;
[0008] When the sum of the current picture lengths is close to the mean value of the capacity lengths, determining a target picture from the list of pictures to be distributed, distributing the target picture to the current column container, and generating a picture waterfall flow planning scheme;
[0009] The preset pictures include the pictures to be distributed and the pictures that have been distributed.
[0010] In a second aspect, the present application further provides a picture waterfall flow planning device based on dynamic planning, the device comprising:
[0011] The capacity length mean calculation module is used to calculate the capacity length mean of the current column container;
[0012] A current picture length sum calculation module, used for taking each preset picture distributed to the current column container as a distributed picture, and calculating the current picture length sum of the distributed pictures;
[0013] A picture waterfall flow planning scheme generating module, used for determining a target picture from a list of pictures to be distributed when the sum of the current picture lengths is close to the mean value of the capacity lengths, distributing the target picture to the current column container, and generating a picture waterfall flow planning scheme;
[0014] The preset pictures include the pictures to be distributed and the pictures that have been distributed.
[0015] In a third aspect, the present application also provides a computer device, comprising a memory and a processor; the memory is used to store a computer program; the processor is used to execute the computer program and implement the above-mentioned dynamic programming-based image waterfall flow planning method when executing the computer program.
[0016] In a fourth aspect, the present application further provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the processor implements the image waterfall flow planning method based on dynamic planning as described above.
[0017] The present application discloses a method, device, equipment and medium for planning a picture waterfall flow based on dynamic planning. The method for planning a picture waterfall flow based on dynamic planning includes calculating the mean value of the capacity length of the current column container; treating each preset image that has been distributed to the current column container as a distributed image, and calculating the sum of the current image lengths of the distributed images; when the sum of the current image lengths is close to the mean value of the capacity lengths, determining the target image from the list of images to be distributed, distributing the target image to the current column container, and generating a picture waterfall flow planning scheme; wherein the preset image includes the image to be distributed and the distributed image. In the above manner, the present application calculates the mean value of the capacity length of the column container and distributes the image based on it, and distributes the image only when the sum of the current image lengths is close to the mean value of the capacity length, thereby reducing the visual interference caused to the user by image loading and re-layout, efficiently generating a picture waterfall flow planning scheme, and thereby improving the user experience in the web design scenario. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0019] Figure 1 is a schematic flow chart of a method for planning a picture waterfall flow based on dynamic planning provided in the first embodiment of the present application;
[0020] Figure 2 is a schematic flow chart of a method for planning a picture waterfall flow based on dynamic planning provided in the second embodiment of the present application;
[0021] Figure 3 is a schematic flow chart of a method for planning a picture waterfall flow based on dynamic planning provided in the third embodiment of the present application;
[0022] Figure 4 A schematic block diagram of a picture waterfall flow planning device based on dynamic planning provided in an embodiment of the present application;
[0023] Figure 5 A schematic block diagram of the structure of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0024] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0025] The flowcharts shown in the accompanying drawings are only examples and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps may also be decomposed, combined or partially merged, so the actual execution order may change according to actual conditions.
[0026] It should be understood that the terms used in this application specification are only for the purpose of describing specific embodiments and are not intended to limit the application. As used in this application specification and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.
[0027] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0028] The embodiments of the present application provide a method, device, equipment and medium for planning a picture waterfall flow based on dynamic planning. Among them, the method for planning a picture waterfall flow based on dynamic planning can be applied to a server, by calculating the mean value of the capacity length of the column container, and distributing pictures based on this value, and distributing pictures only when the sum of the current picture lengths is close to the mean value of the capacity lengths, thereby reducing the visual interference caused to users by picture loading and rearrangement, efficiently generating a picture waterfall flow planning scheme, and thus improving the user experience in the web design scenario. Among them, the server can be an independent server or a server cluster.
[0029] In conjunction with the accompanying drawings, some embodiments of the present application are described in detail below. In the absence of conflict, the following embodiments and features in the embodiments can be combined with each other.
[0030] See also Figure 1 , Figure 1 This is a schematic flow chart of a method for planning a picture waterfall flow based on dynamic programming provided by the first embodiment of the present application. The method for planning a picture waterfall flow based on dynamic programming can be applied to a server, and is used to distribute pictures by calculating the mean value of the capacity length of a column container, and distribute pictures only when the sum of the current picture lengths is close to the mean value of the capacity lengths, thereby reducing the visual interference caused to users by picture loading and rearrangement, efficiently generating a picture waterfall flow planning scheme, and thus improving the user experience in the web design scenario.
[0031] like Figure 1 As shown, the image waterfall flow planning method based on dynamic programming specifically includes steps S10 to S30.
[0032] Step S10, calculating the mean value of the capacity length of the current column container;
[0033] Step S20: taking each preset picture distributed to the current column container as a distributed picture, and calculating the sum of the current picture lengths of the distributed pictures;
[0034] Step S30: when the sum of the current picture lengths is close to the mean value of the capacity lengths, determine a target picture from the list of pictures to be distributed, distribute the target picture to the current column container, and generate a picture waterfall flow planning scheme;
[0035] The preset pictures include the pictures to be distributed and the pictures that have been distributed.
[0036] In one embodiment, the capacity of each column container, that is, the maximum total length of pictures that each column container can accommodate, is determined, and the average value of the capacity of all column containers is calculated through the maximum total length of pictures of each column container to obtain the capacity length mean. Each preset picture that has been distributed to the current column container is marked as a distributed picture, the sum of the current picture lengths of these distributed pictures is calculated, and the sum of the current picture lengths of the distributed pictures is compared with the capacity length mean.
[0037] If the sum of the current picture lengths is close to the mean value of the capacity lengths (for example, the difference is within a preset threshold), proceed to the next step; otherwise, wait for new pictures or adjust the layout of the distributed pictures.
[0038] Select a target image from the list of images to be distributed, evaluate the size of the target image, and ensure that it can fit in the remaining space of the current column container. Distribute the target image to the current column container, update the list of distributed images, remove the target image from the list of images to be distributed, and add it to the list of distributed images. Generate or update the image waterfall plan based on the updated list of distributed images and the new total length.
[0039] The present embodiment discloses a method, device, equipment and medium for planning a picture waterfall flow based on dynamic planning. The method for planning a picture waterfall flow based on dynamic planning includes calculating the mean value of the capacity length of the current column container; treating each preset image that has been distributed to the current column container as a distributed image, and calculating the sum of the current image lengths of the distributed images; when the sum of the current image lengths is close to the mean value of the capacity lengths, determining the target image from the list of images to be distributed, distributing the target image to the current column container, and generating a picture waterfall flow planning scheme; wherein the preset image includes the image to be distributed and the distributed image. Through the above-mentioned method, the present application calculates the mean value of the capacity length of the column container and distributes the image based on it, and distributes the image only when the sum of the current image lengths is close to the mean value of the capacity length, thereby reducing the visual interference caused to the user by image loading and re-layout, efficiently generating a picture waterfall flow planning scheme, and thereby improving the user experience in the web page design scenario.
[0040] See also Figure 2 , Figure 2 This is a schematic flow chart of a method for planning a waterfall flow of images based on dynamic programming provided by the second embodiment of the present application. The method for planning a waterfall flow of images based on dynamic programming can be applied to a server, and is used to more effectively distribute images by calculating the mean capacity length of a column container and using it as a reference standard for image distribution, thereby ensuring that the total length of the current images is close to the mean capacity length, reducing the number of times the page is re-layouted, and providing a smoother and more continuous browsing experience.
[0041] based on Figure 1 The embodiment shown, this embodiment Figure 2 As shown, step S30 includes steps S21 to S22.
[0042] Step S21, obtaining a preset first length value, and calculating a first length sum of the sum of the current image length and the preset first length value;
[0043] Step S22: Based on the first length sum, the current picture length sum and the capacity length mean, determine whether the current picture length sum is close to the capacity length mean.
[0044] In one embodiment, the definition of a preset first length value is determined, which is usually a predefined reference value for comparison with the current total length of the picture, the current total length of the picture is added to the preset first length value to obtain the first total length, and the first total length is recorded or stored for subsequent comparison.
[0045] The first length sum is compared with the capacity length mean to determine a close threshold value, which is used to judge whether the current picture length sum is close enough to the capacity length mean. If the difference between the first length sum and the capacity length mean is less than or equal to the preset threshold, the current picture length sum is considered to be close to the capacity length mean. If the difference is greater than the threshold, the current picture length sum is considered not to be close to the capacity length mean, and it may be necessary to readjust the distribution of pictures or wait for more pictures to load.
[0046] The present embodiment discloses a method, device, equipment and medium for planning a picture waterfall flow based on dynamic planning, wherein the method for planning a picture waterfall flow based on dynamic planning includes calculating the mean value of the capacity length of the current column container; treating each preset picture distributed to the current column container as a distributed picture, and calculating the sum of the current picture lengths of the distributed pictures; obtaining a preset first length value, calculating the sum of the current picture lengths and the first length sum of the preset first length value; judging whether the sum of the current picture lengths is close to the mean value of the capacity lengths based on the first length sum, the sum of the current picture lengths and the mean value of the capacity lengths; when the sum of the current picture lengths is close to the mean value of the capacity lengths, determining the target picture from the list of pictures to be distributed, distributing the target picture to the current column container, and generating a picture waterfall flow planning scheme; wherein the preset picture includes the picture to be distributed and the distributed picture. In the above manner, the present application can more effectively distribute pictures by calculating the mean value of the capacity length of the column container and using it as a reference standard for picture distribution, ensuring that the sum of the current picture lengths is close to the mean value of the capacity lengths, reducing the number of times the page is re-layouted, and providing a smoother and more continuous browsing experience.
[0047] based on Figure 2 In the embodiment shown, in this embodiment, step S202 includes:
[0048] When the sum of the current picture lengths is smaller than the capacity length mean and the first length sum is larger than the capacity length mean, it is determined that the sum of the current picture lengths is close to the capacity length mean.
[0049] In one embodiment, the sum of the current picture lengths is calculated, the capacity length mean is obtained, and the sum of the current picture lengths is compared with the capacity length mean to confirm that the sum of the current picture lengths is less than the capacity length mean.
[0050] Get the preset first length value, add the current picture length sum to the preset first length value to obtain the first length sum, and confirm that the first length sum is greater than the capacity length mean.
[0051] Define a threshold value for judging the specific standard of "closeness". This threshold value can be a percentage of the capacity length mean, or a fixed numerical difference. Calculate the difference between the first length sum and the capacity length mean. If the difference between the first length sum and the capacity length mean is less than or equal to the preset threshold, it is determined that the current picture length sum is close to the capacity length mean.
[0052] The present embodiment discloses a method, apparatus, device and medium for planning a picture waterfall flow based on dynamic programming. The method for planning a picture waterfall flow based on dynamic programming includes calculating the mean value of the capacity length of the current column container; treating each preset picture distributed to the current column container as a distributed picture, and calculating the sum of the current picture lengths of the distributed pictures; obtaining a preset first length value, calculating the sum of the current picture lengths and the first length sum of the preset first length value; when the sum of the current picture lengths is less than the mean value of the capacity lengths and the first length sum is greater than the mean value of the capacity lengths, determining that the sum of the current picture lengths is close to the mean value of the capacity lengths; when the sum of the current picture lengths is close to the mean value of the capacity lengths, determining a target picture from a list of pictures to be distributed, distributing the target picture to the current column container, and generating a picture waterfall flow planning scheme; wherein the preset pictures include the pictures to be distributed and the distributed pictures. Through the above method, the present application calculates the average capacity length of the column container and distributes the pictures based on it. The pictures are distributed only when the total length of the current pictures is close to the average capacity length, thereby reducing the visual interference caused to users by picture loading and re-layout, efficiently generating a picture waterfall flow planning scheme, and thus improving the user experience in the web design scenario.
[0053] See also Figure 3 , Figure 3 This is a schematic flow chart of a method for planning a picture waterfall flow based on dynamic programming provided by the third embodiment of the present application. The method for planning a picture waterfall flow based on dynamic programming can be applied to a server, and is used to distribute pictures by calculating the mean value of the capacity length of a column container, and distributing pictures based on this value. Pictures are distributed only when the sum of the current picture lengths is close to the mean value of the capacity lengths, thereby reducing the visual interference to users caused by picture loading and rearrangement, efficiently generating a picture waterfall flow planning scheme, and thus improving the user experience in web design scenarios.
[0054] based on Figure 2 The embodiment shown, this embodiment Figure 3 As shown, step S30 includes steps S301 to S304.
[0055] Step S301, calculating a first difference between the first length sum and the capacity length mean;
[0056] Step S302: searching for a to-be-distributed picture whose length is a preset second length value from the to-be-distributed picture list, and calculating a second length sum between the preset second length value and the sum of the current picture lengths;
[0057] Step S303, calculating a second difference between the second length sum and the capacity length mean;
[0058] Step S304: When the second difference is smaller than the first difference, determine the to-be-distributed picture whose length is the preset second length value as the target picture.
[0059] In one embodiment, the first length sum is determined, that is, the sum of the current picture length sum plus the preset first length value, and the difference between the first length sum and the capacity length mean is calculated and recorded as the first difference. The picture to be distributed whose length is equal to the preset second length value is searched from the list of pictures to be distributed, and it is confirmed whether the found picture meets the preset condition, that is, whether the length matches the preset second length value.
[0060] The preset second length value is added to the sum of the current image lengths to obtain the second length sum, and the difference between the second length sum and the capacity length mean is calculated and recorded as the second difference.
[0061] The second difference is compared with the first difference. If the second difference is smaller than the first difference, it means that after adding the to-be-distributed pictures whose length is the preset second length value, the sum is closer to the mean capacity length. When the second difference is smaller than the first difference, the to-be-distributed pictures whose length is the preset second length value are determined as the target pictures.
[0062] The present embodiment discloses a method, device, equipment and medium for planning a picture waterfall flow based on dynamic programming. The method for planning a picture waterfall flow based on dynamic programming includes calculating the mean value of the capacity length of the current column container; treating each preset picture distributed to the current column container as a distributed picture, and calculating the sum of the current picture lengths of the distributed pictures; obtaining a preset first length value, calculating the sum of the current picture lengths and the first length sum of the preset first length value; when the sum of the current picture lengths is less than the mean value of the capacity lengths, and the first length sum is greater than the mean value of the capacity lengths, determining that the sum of the current picture lengths is close to the mean value of the capacity lengths ; Calculate the first difference between the first length sum and the capacity length mean; Search for the to-be-distributed pictures whose length is a preset second length value from the to-be-distributed pictures list, and calculate the second length sum between the preset second length value and the sum of the current pictures' lengths; Calculate the second difference between the second length sum and the capacity length mean; When the second difference is less than the first difference, determine the to-be-distributed pictures whose length is the preset second length value as the target pictures, distribute the target pictures to the current column container, and generate a picture waterfall flow planning scheme; wherein the preset pictures include the to-be-distributed pictures and the distributed pictures. Through the above-mentioned method, the present application calculates the capacity length mean of the column container, and distributes the pictures based on it, and distributes the pictures only when the current picture length sum is close to the capacity length mean, thereby reducing the visual interference to the user caused by picture loading and re-layout, efficiently generating a picture waterfall flow planning scheme, and thus improving the user experience in the web page design scenario.
[0063] based on Figure 1 In the embodiment shown, in this embodiment, before step S30, the following steps are included:
[0064] Obtaining the length of each of the preset pictures;
[0065] Arrange the preset pictures in descending order according to the length of the single picture to generate a list of all pictures;
[0066] All the distributed pictures are removed from the list of all pictures to generate the list of pictures to be distributed.
[0067] Based on any of the above embodiments, in this embodiment, step S10 includes:
[0068] Obtain the capacity length of other column containers parallel to the current column container;
[0069] Based on the capacity lengths of the other column containers, an average value of the lengths of the other column containers is calculated, and the average value of the lengths of the other column containers is used as the average value of the capacity length of the current column container.
[0070] In combination with the above embodiments, the present embodiment is exemplarily described below in combination with specific application scenarios. It can be understood that the above embodiments are not limited to the following examples.
[0071] An online photo sharing social platform where users can upload and browse a large number of photos. In order to provide a better user experience, the platform uses a waterfall layout to display photos, making the page layout more dynamic and beautiful. However, with the increase in the number of photos and the increase in users' requirements for loading speed, the existing waterfall layout algorithm has encountered challenges in image loading and layout optimization.
[0072] During the image loading process, the existing waterfall algorithm causes the page to be frequently re-layouted, which results in a poor browsing experience for users. In addition, the re-layout after the image loading is complete also makes the page display less smooth, especially in the lazy loading scenario, that is, new images are loaded only when the user scrolls the page.
[0073] This embodiment adopts a waterfall flow algorithm based on the idea of dynamic programming, and optimizes the distribution and layout of pictures by calculating the average capacity length of the column container and the sum of the current picture lengths, as well as the preset first length value.
[0074] Specifically, a capacity is assigned to each column container, that is, the maximum total length of the displayed images, and the average of the capacities of all column containers is calculated to obtain the capacity length mean. When the user starts browsing images, the system starts loading images, and for each column container, the sum of the lengths of the loaded images is calculated. The sum of the current image lengths is compared with the capacity length mean, as well as the relationship between the first length sum (the current image length sum plus the preset first length value) and the capacity length mean.
[0075] If the sum of the current image lengths is less than the mean of the capacity lengths, and the sum of the first lengths is greater than the mean of the capacity lengths, determine that the sum of the current image lengths is close to the mean of the capacity lengths, and select a target image from the list of images to be distributed. Distribute the target image to the current column container, and update the list of distributed images and the sum of the current image lengths to generate a waterfall flow planning solution:
[0076] See also Figure 4 , Figure 4 The embodiment of the present application provides a schematic block diagram of a picture waterfall flow planning device based on dynamic planning, and the picture waterfall flow planning device based on dynamic planning is used to execute the aforementioned picture waterfall flow planning method based on dynamic planning. Among them, the picture waterfall flow planning device based on dynamic planning can be configured on a server.
[0077] like Figure 4 As shown, the image waterfall flow planning device 400 based on dynamic programming includes:
[0078] The capacity length mean value calculation module 410 is used to calculate the capacity length mean value of the current column container;
[0079] The current picture length sum calculation module 420 is used to take each preset picture distributed to the current column container as a distributed picture, and calculate the current picture length sum of the distributed pictures;
[0080] The picture waterfall flow planning scheme generating module 430 is used to determine the target picture from the list of pictures to be distributed when the sum of the current picture lengths is close to the mean value of the capacity lengths, distribute the target picture to the current column container, and generate a picture waterfall flow planning scheme;
[0081] The preset pictures include the pictures to be distributed and the pictures that have been distributed.
[0082] Furthermore, the image waterfall flow planning device 400 based on dynamic programming further includes:
[0083] A first length sum calculation module, used to obtain a preset first length value, and calculate a first length sum of the current picture length sum and the preset first length value;
[0084] The capacity length mean judgment module is used to judge whether the current picture length sum is close to the capacity length mean based on the first length sum, the current picture length sum and the capacity length mean.
[0085] Furthermore, the capacity length mean value judgment module includes:
[0086] The unit for determining the close-to-capacity length mean is used to determine that the current picture length sum is close to the capacity length mean when the current picture length sum is less than the capacity length mean and the first length sum is greater than the capacity length mean.
[0087] Furthermore, the picture waterfall flow planning scheme generating module 430 includes:
[0088] A first difference calculation unit, configured to calculate a first difference between the first length sum and the capacity length mean;
[0089] A second length sum calculation unit, configured to search for a to-be-distributed picture whose length is a preset second length value from the to-be-distributed picture list, and calculate a second length sum between the preset second length value and the sum of the current picture lengths;
[0090] A second difference calculation unit, used for calculating a second difference between the second length sum and the capacity length mean;
[0091] A target picture determining unit is used to determine the to-be-distributed picture whose length is the preset second length value as the target picture when the second difference is smaller than the first difference.
[0092] Furthermore, the picture waterfall flow planning scheme generating module 430 further includes:
[0093] The adjacent column container distribution unit is used to distribute the to-be-distributed picture with a length equal to the preset second length value to the adjacent column container of the current column container when the second difference is greater than the first difference.
[0094] Furthermore, the image waterfall flow planning device 400 based on dynamic programming further includes:
[0095] A single picture length acquisition module, used to acquire the single picture length of each of the preset pictures;
[0096] A module for generating a list of all pictures, used to arrange the preset pictures in descending order according to the length of the single picture, and generate a list of all pictures;
[0097] The module for generating a list of pictures to be distributed is used to remove all the distributed pictures from the list of all pictures to generate the list of pictures to be distributed.
[0098] Furthermore, the capacity length mean value calculation module 410 includes:
[0099] Another column container capacity length acquisition unit, used to acquire the capacity length of another column container parallel to the current column container;
[0100] The capacity length average determination unit is used to calculate the average of the lengths of the other column containers based on the capacity lengths of the other column containers, and use the average of the lengths of the other column containers as the average of the capacity length of the current column container.
[0101] It should be noted that those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the above-described device and each module can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
[0102] The above-mentioned device can be implemented in the form of a computer program. Figure 5 Runs on the computer device shown.
[0103] See also Figure 5 , Figure 5 1 is a schematic block diagram of a computer device provided in an embodiment of the present application. The computer device may be a server.
[0104] See also Figure 5 The computer device includes a processor, a memory and a network interface connected through a system bus, wherein the memory may include a non-volatile storage medium and an internal memory.
[0105] The non-volatile storage medium can store an operating system and a computer program. The computer program includes program instructions, and when the program instructions are executed, the processor can execute any one of the image waterfall flow planning methods based on dynamic planning.
[0106] The processor is used to provide computing and control capabilities and support the operation of the entire computer equipment.
[0107] The internal memory provides an environment for the operation of the computer program in the non-volatile storage medium. When the computer program is executed by the processor, the processor can execute any image waterfall flow planning method based on dynamic programming.
[0108] The network interface is used for network communication, such as sending assigned tasks, etc. Those skilled in the art will understand that Figure 5 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0109] It should be understood that the processor may be a central processing unit (CPU), and the processor may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0110] In one embodiment, the processor is used to run a computer program stored in the memory to implement the following steps:
[0111] Calculate the mean capacity length of the current column container;
[0112] Taking each preset picture distributed to the current column container as a distributed picture, and calculating the sum of current picture lengths of the distributed pictures;
[0113] When the sum of the current picture lengths is close to the mean value of the capacity lengths, determining a target picture from the list of pictures to be distributed, distributing the target picture to the current column container, and generating a picture waterfall flow planning scheme;
[0114] The preset pictures include the pictures to be distributed and the pictures that have been distributed.
[0115] In one embodiment, when the sum of the current picture lengths is close to the mean value of the capacity lengths, a target picture is determined from the list of pictures to be distributed, and the target picture is distributed to the current column container, before the picture waterfall flow planning scheme is generated, for implementing:
[0116] Obtain a preset first length value, and calculate a first length sum of the sum of the current image lengths and the preset first length value;
[0117] Based on the first length sum, the current picture length sum and the capacity length mean, it is determined whether the current picture length sum is close to the capacity length mean.
[0118] In one embodiment, based on the first length sum, the current picture length sum and the capacity length mean, it is determined whether the current picture length sum is close to the capacity length mean, so as to implement:
[0119] When the sum of the current picture lengths is smaller than the capacity length mean and the first length sum is larger than the capacity length mean, it is determined that the sum of the current picture lengths is close to the capacity length mean.
[0120] In one embodiment, when the sum of the current picture lengths is close to the mean value of the capacity lengths, a target picture is determined from the list of pictures to be distributed, so as to achieve:
[0121] Calculating a first difference between the first length sum and the capacity length mean;
[0122] Searching for a to-be-distributed picture whose length is a preset second length value from the to-be-distributed picture list, and calculating a second length sum between the preset second length value and the sum of the current picture lengths;
[0123] Calculating a second difference between the second length sum and the capacity length mean;
[0124] When the second difference is smaller than the first difference, the to-be-distributed picture having a length equal to the preset second length value is determined as the target picture.
[0125] In one embodiment, when the second difference is less than the first difference, before determining the to-be-distributed picture having a length equal to the preset second length value as the target picture, it is used to implement:
[0126] When the second difference is greater than the first difference, the to-be-distributed picture having a length equal to the preset second length value is distributed to a column container adjacent to the current column container.
[0127] In one embodiment, when the sum of the current picture lengths is close to the mean value of the capacity lengths, a target picture is determined from the list of pictures to be distributed, and the target picture is distributed to the current column container, before the picture waterfall flow planning scheme is generated, for implementing:
[0128] Obtaining the length of each of the preset pictures;
[0129] Arrange the preset pictures in descending order according to the length of the single picture to generate a list of all pictures;
[0130] All the distributed pictures are removed from the list of all pictures to generate the list of pictures to be distributed.
[0131] In one embodiment, the average capacity length of the current column container is calculated to achieve:
[0132] Obtain the capacity length of other column containers parallel to the current column container;
[0133] Based on the capacity lengths of the other column containers, an average value of the lengths of the other column containers is calculated, and the average value of the lengths of the other column containers is used as the average value of the capacity length of the current column container.
[0134] A computer-readable storage medium is also provided in an embodiment of the present application, wherein the computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and the processor executes the program instructions to implement any one of the dynamic programming-based image waterfall flow planning methods provided in the embodiments of the present application.
[0135] The computer-readable storage medium may be an internal storage unit of the computer device described in the foregoing embodiment, such as a hard disk or memory of the computer device. The computer-readable storage medium may also be an external storage device of the computer device, such as a plug-in hard disk, a smart memory card (Smart Medi a Card, SMC), a secure digital (Secure Digital, SD) card, a flash memory card (Flash Card), etc., equipped on the computer device.
[0136] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in the present application, and these modifications or replacements should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.
Claims
1. A method for planning a picture waterfall flow based on dynamic programming, characterized in that: include: Calculate the mean capacity length of the current column container; Taking each preset picture distributed to the current column container as a distributed picture, and calculating the sum of current picture lengths of the distributed pictures; When the sum of the current picture lengths is close to the mean value of the capacity lengths, determining a target picture from the list of pictures to be distributed, distributing the target picture to the current column container, and generating a picture waterfall flow planning scheme; The preset pictures include the pictures to be distributed and the pictures that have been distributed.
2. The image waterfall flow planning method based on dynamic programming according to claim 1 is characterized in that: In the case where the sum of the current picture lengths is close to the mean value of the capacity lengths, determining a target picture from the list of pictures to be distributed, distributing the target picture to the current column container, and generating a picture waterfall flow planning scheme, before the process includes: Obtain a preset first length value, and calculate a first length sum of the sum of the current image lengths and the preset first length value; Based on the first length sum, the current picture length sum and the capacity length mean, it is determined whether the current picture length sum is close to the capacity length mean.
3. The image waterfall flow planning method based on dynamic programming according to claim 2 is characterized in that: The determining, based on the first length sum, the current picture length sum and the capacity length mean, whether the current picture length sum is close to the capacity length mean, includes: When the sum of the current picture lengths is smaller than the capacity length mean and the first length sum is larger than the capacity length mean, it is determined that the sum of the current picture lengths is close to the capacity length mean.
4. The method for planning a picture waterfall flow based on dynamic programming according to claim 3, characterized in that: The step of determining a target picture from a list of pictures to be distributed when the sum of the current picture lengths is close to the mean value of the capacity lengths includes: Calculating a first difference between the first length sum and the capacity length mean; Searching for a to-be-distributed picture whose length is a preset second length value from the to-be-distributed picture list, and calculating a second length sum between the preset second length value and the sum of the current picture lengths; Calculating a second difference between the second length sum and the capacity length mean; When the second difference is smaller than the first difference, the to-be-distributed picture having a length equal to the preset second length value is determined as the target picture.
5. The method for planning a picture waterfall flow based on dynamic programming according to claim 4, characterized in that: Before determining the to-be-distributed picture having a length equal to the preset second length value as the target picture when the second difference value is smaller than the first difference, the method includes: When the second difference is greater than the first difference, the to-be-distributed picture having a length equal to the preset second length value is distributed to a column container adjacent to the current column container.
6. The method for planning a picture waterfall flow based on dynamic programming according to claim 1, characterized in that: In the case where the sum of the current picture lengths is close to the mean value of the capacity lengths, determining a target picture from the list of pictures to be distributed, distributing the target picture to the current column container, and generating a picture waterfall flow planning scheme, before the process includes: Obtaining the length of each of the preset pictures; Arrange the preset pictures in descending order according to the length of the single picture to generate a list of all pictures; All the distributed pictures are removed from the list of all pictures to generate the list of pictures to be distributed.
7. The image waterfall flow planning method based on dynamic programming according to any one of claims 1 to 6, characterized in that: The calculating the mean value of the capacity length of the current column container includes: Obtain the capacity length of other column containers parallel to the current column container; Based on the capacity lengths of the other column containers, an average value of the lengths of the other column containers is calculated, and the average value of the lengths of the other column containers is used as the average value of the capacity length of the current column container.
8. A picture waterfall flow planning device based on dynamic programming, characterized in that: include: The capacity length mean calculation module is used to calculate the capacity length mean of the current column container; A current picture length sum calculation module, used for taking each preset picture distributed to the current column container as a distributed picture, and calculating the current picture length sum of the distributed pictures; A picture waterfall flow planning scheme generating module, used for determining a target picture from a list of pictures to be distributed when the sum of the current picture lengths is close to the mean value of the capacity lengths, distributing the target picture to the current column container, and generating a picture waterfall flow planning scheme; The preset pictures include the pictures to be distributed and the pictures that have been distributed.
9. A computer device, characterized in that: The computer device includes a memory and a processor; The memory is used to store computer programs; The processor is used to execute the computer program and implement the image waterfall flow planning method based on dynamic programming as described in any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the processor implements the image waterfall flow planning method based on dynamic planning as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Picture display method and device
CN108874257A
Method and system for displaying picture in waterfall flow comparison mode
CN114385295A
Method for realizing tidy arrangement of double-column elements through dynamic programming
CN117742872A
Multi-view display method and apparatus, and device and medium
WO2023005104A1