Drop-down box display method, device and storage medium
By detecting the memory capacity on the terminal device and only requesting to display some data items, the memory leakage and page lag caused by too many data items in the drop-down box control is solved, and a smoother page display is achieved.
Patent Information
- Application Number
- CN202111597607.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-24
- Publication Date
- 2024-11-26
- Estimated Expiration
- 2041-12-24
AI Technical Summary
In the case of multiple drop-down box controls, the user clicking the drop-down box control will cause the terminal device to continuously obtain data items from the remote server, resulting in memory leakage and page display stuttering.
By detecting the remaining memory capacity on the terminal device, only requesting and displaying some data items of the drop-down box control from the server, avoiding memory leakage caused by excessive data items, and optimizing page display.
It effectively avoids memory leakage and page lag, and improves the display fluency of the drop-down box controls.
Smart Images

Figure CN114443993B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of web page display, and in particular to a drop-down box display method, device and storage medium. Background Art
[0002] The page displayed on the terminal device usually includes a drop-down box control. When the user clicks the drop-down box control on the page, the terminal device obtains all data items corresponding to the drop-down box control from the remote server and loads the obtained data items into the cache. The terminal device then loads the data items in the cache into the drop-down box control, thereby displaying all data items at the location of the drop-down box control. If there are too many data items, the user can view each data item by dragging the scroll bar.
[0003] However, when there are multiple drop-down box controls in the page (web) provided to the terminal device, since the user clicks the drop-down box control, it will trigger the terminal device to obtain the data item corresponding to the drop-down box control from the remote server and load it into the cache. Therefore, as the user clicks each drop-down box control on the page, it will trigger the terminal device to continuously obtain the corresponding data item from the server and load it into the cache. Therefore, when there are many data items in the drop-down box control, or when there are many drop-down box controls, it is easy to cause memory leaks and cause the page display to freeze.
[0004] There is no effective solution to the technical problems of memory leakage and page display jamming caused by a large number of data items in the drop-down box control or a large number of drop-down box controls in the above-mentioned prior art. Summary of the invention
[0005] The embodiments of the present application provide a drop-down box display method, device and storage medium to at least solve the technical problems of memory leakage and page display jamming caused by a large number of data items in a drop-down box control or a large number of drop-down box controls in the prior art.
[0006] According to one aspect of an embodiment of the present application, a drop-down box display method is provided, including: sending a target web page for display to a terminal device; determining the number of data items in the drop-down box in the target web page based on the remaining memory capacity of the terminal device; and displaying the data items in the drop-down box based on the number of data items in the drop-down box.
[0007] According to another aspect of an embodiment of the present application, a storage medium is further provided, the storage medium including a stored program, wherein when the program is running, a processor executes any one of the methods described above.
[0008] According to another aspect of an embodiment of the present application, a drop-down box display device is also provided, including: a first sending module, used to send a target web page for display to a terminal device; a first determination module, used to determine the number of data items in the drop-down box in the target web page based on the remaining memory capacity of the terminal device; and a first display module, used to display the data items in the drop-down box according to the number of data items in the drop-down box.
[0009] According to another aspect of an embodiment of the present application, a drop-down box display device is also provided, including: a processor; and a memory, connected to the processor, for providing the processor with instructions for processing the following processing steps: sending a target web page for display to a terminal device; determining the number of data items in the drop-down box in the target web page based on the remaining memory capacity of the terminal device; and displaying the data items in the drop-down box based on the number of data items in the drop-down box.
[0010] In the embodiment of the present application, when the user clicks the drop-down box control on the page, the server sends the data items related to the drop-down box control to the terminal device through the network, and only displays part of the data items in the drop-down box control, so that the data items that can be displayed can be controlled, avoiding memory leakage caused by excessive data items displayed by the drop-down box control, making the page display smoother. This solves the technical problems of memory leakage and page display jamming caused by the large number of data items in the drop-down box control or the large number of drop-down box controls in the existing technology. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0012] Figure 1 is a hardware structure block diagram of a computing device for implementing the method according to Embodiment 1 of the present application;
[0013] Figure 2 is a schematic diagram of a drop-down box display system according to Embodiment 1 of the present application;
[0014] Figure 3 is a flowchart of the drop-down box display method according to the first aspect of Embodiment 1 of the present application;
[0015] Figure 4 is a schematic diagram of the interface of the drop-down box according to the first aspect of Embodiment 1 of the present application;
[0016] Figure 5 is a schematic diagram of a drop-down box and a data table according to the first aspect of Embodiment 1 of the present application;
[0017] Figure 6 is another interface schematic diagram of the drop-down box according to the first aspect of Embodiment 1 of the present application;
[0018] Figure 7 is a schematic diagram of the cache of the drop-down box according to the first aspect of Embodiment 1 of the present application;
[0019] Figure 8 is a schematic diagram of the drop-down box display device according to Embodiment 2 of the present application; and
[0020] Fig. 9 It is a schematic diagram of the drop-down box display device described in Example 3 of the present application. DETAILED DESCRIPTION
[0021] In order to enable those skilled in the art to better understand the technical solutions of the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only embodiments of a part of the present application, not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without creative work should fall within the scope of protection of the present application.
[0022] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0023] Example 1
[0024] According to this embodiment, a method embodiment of a drop-down box display method is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0025] The method embodiment provided in this embodiment can be executed in a mobile terminal, a computer terminal, a server or a similar computing device. Figure 1FIG. 1 shows a hardware structure block diagram of a computing device for implementing a method for displaying a drop-down box. Figure 1 As shown, the computing device may include one or more processors (the processor may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory for storing data, and a transmission device for communication functions. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of the I / O interface), a network interface, a power supply and / or a camera. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above electronic device. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.
[0026] It should be noted that the one or more processors and / or other data processing circuits described above may generally be referred to herein as "data processing circuitry". The data processing circuitry may be embodied in whole or in part as software, hardware, firmware, or any other combination thereof. In addition, the data processing circuitry may be a single independent processing module, or may be incorporated in whole or in part into any of the other components in the computing device. As described in the embodiments of the present application, the data processing circuitry serves as a processor control (e.g., selection of a variable resistor terminal path connected to an interface).
[0027] The memory can be used to store software programs and modules of application software, such as program instructions / data storage devices corresponding to the drop-down box display method in the embodiment of the present application, and the processor executes various functional applications and data processing by running the software programs and modules stored in the memory, that is, realizing the drop-down box display method of the above-mentioned application. The memory may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory may further include a memory remotely arranged relative to the processor, and these remote memories may be connected to a computing device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0028] The transmission device is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the computing device. In one example, the transmission device includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device can be a radio frequency (Radio Frequency, RF) module, which is used to communicate with the Internet wirelessly.
[0029] The display may be, for example, a touch screen liquid crystal display (LCD) that may enable a user to interact with a user interface of the computing device.
[0030] It should be noted that, in some optional embodiments, the above Figure 1 The computing device shown may include hardware elements (including circuits), software elements (including computer code stored on a computer-readable medium), or a combination of both hardware elements and software elements. Figure 1 This is merely one example of a particular embodiment and is intended to illustrate the types of components that may be present in the computing devices described above.
[0031] Figure 2 is a schematic diagram of the drop-down box display system according to this embodiment. Figure 2 As shown, the system includes: a terminal device 100 and a server 200. The terminal device 100 interacts with the server 200 via a network. The server 200 can send a page containing multiple drop-down box controls to the terminal device 100 via the network, and the terminal device 100 can display the page, for example, via a display after receiving the page. Moreover, when the user 300 clicks the drop-down box control on the page, the server 200 sends the data items related to the drop-down box control to the terminal device 100 via the network. It should be noted that the terminal device 100 and the server 200 in the system can both be applied to the hardware structure described above.
[0032] In the above operating environment, according to the first aspect of this embodiment, a method for displaying a drop-down box is provided. The method comprises: Figure 2 The server 200 shown in FIG. Figure 3 A schematic diagram showing the process of the method is shown in FIG. Figure 3 As shown, the method includes:
[0033] S302: Sending a target web page for display to a terminal device;
[0034] S304: Determine the number of data items in the drop-down box in the target webpage according to the remaining memory capacity of the terminal device; and
[0035] S306: Display the data items in the drop-down box according to the number of data items in the drop-down box.
[0036] Specifically, refer to Figure 4 As shown, when the user triggers the link of the target web page 300 on the terminal device 100, the terminal device 100, in response to the trigger, remotely sends a web page acquisition request to the server 200 to acquire the target web page 300. After receiving the web page acquisition request, the server 200 sends the target web page 300 to the terminal device 100. After acquiring the target web page 300, the terminal device 100 detects whether there is a drop-down box control on the target web page 300.
[0037] Furthermore, when the terminal device 100 detects that there is a drop-down box control on the web page 300, the terminal device 100 determines the remaining memory capacity MR of the terminal device 100, and determines the memory capacity MD of the data items of all the drop-down box controls 311~31n allocated to the target web page 300 based on the remaining memory capacity MR of the terminal device 100.
[0038] The specific method for determining MR is not limited. For example, based on the log data of the normal operation of the terminal device 100, it is determined that only the memory space capacity MN needs to be reserved to ensure the normal display of the current web page 300. Then MD can be determined according to the following formula:
[0039] MD=MR-MN
[0040] In addition, the content capacity MD of the data items allocated to the drop-down box controls 311 ˜ 31 n may also be determined in other ways, which will not be described in detail here.
[0041] Further, refer to Figure 5 As shown, the terminal device 100 sends the determined memory capacity MD for the data items allocated to the drop-down box controls 311-31n to the server 200, so that the server 200 receives the memory capacity MD. The server 200 determines the number NE1-NEn of data items allocated to each drop-down box control 311-31n according to the received memory capacity MD. For example, the server 200 can determine the number NE1-NEn of data items allocated to the drop-down box controls 311-31n according to the proportion according to the number of data items in the data tables 211-21n.
[0042] Specifically, when the user clicks a drop-down box control (e.g., drop-down box control 311) on the web page 300 on the terminal device 100, the terminal device 100 sends a data acquisition request to the server 200 for acquiring the data item corresponding to the drop-down box control 311. After receiving the data acquisition request from the terminal device 100, the server 200 selects NE1 data items from the data table 211 corresponding to the drop-down box control 311.
[0043] More specifically, when NE1<NET1, the server 200 may determine the data items to be sent to the terminal device 100 from the data table 211 in the following manner:
[0044] The server 200 sorts each data item in the data table 211 according to the number of times each data item has been actually selected in the past history, and the server 200 sends NE1 data items with the highest sorting to the terminal device 100 .
[0045] In addition, the server 200 may also send the top NE1 data items to the terminal device 100 in the order of indexes.
[0046] Further, after receiving the NE1 data items from the server 200 , the terminal device 100 loads the NE1 data items into a cache and displays a list including the NE1 data items at the location of the drop-down box control 311 .
[0047] Similarly, when the user clicks on other drop-down box controls, such as the drop-down box control 312, the server 200 selects NE2 data items from the corresponding data table 212 and sends them to the terminal device 100. Therefore, after receiving the NE2 data items from the server 200, the terminal device 100 loads the NE2 data items into the cache and displays a list containing the NE2 data items at the location of the drop-down box control 311.
[0048] As described in the background technology, when multiple drop-down box controls appear in a page (web) provided to a terminal device, since a user clicking a drop-down box control triggers the terminal device to obtain the data item corresponding to the drop-down box control from a remote server and load it into a cache, each drop-down box control clicked by the user on the page triggers the terminal device to continuously obtain the corresponding data item from the server and load it into a cache. Therefore, when there are many data items in the drop-down box control, or when there are many drop-down box controls, memory leaks are likely to occur, resulting in page display freezes.
[0049] In view of the technical problems described above, through the technical solutions of the embodiments of the present application, after the terminal device 100 obtains the target web page 300 from the server 200, it will check the target web page 300 to determine whether there is a drop-down box control on the target web page 300. And when the terminal device 100 detects that there are drop-down box controls 311-31n on the web page 300, the terminal device 100 further detects the current memory usage and determines the remaining memory capacity MR of the terminal device 100. Then the terminal device 100 determines the memory capacity MD for the data items allocated to the drop-down box controls 311-31n according to the remaining memory capacity MR. Thereby ensuring that when the memory space of the terminal device 100 with a capacity of MD is filled with the data items of the drop-down box controls 311-31n, the terminal device 100 still has enough memory space to avoid the jamming of the target web page 300.
[0050] When the user 300 clicks on the drop-down box control on the page, the server 200 sends the data items related to the drop-down box control to the terminal device 100 through the network, and only displays some of the data items in the drop-down box control, so that the data items that can be displayed can be controlled, avoiding memory leakage caused by excessive data items displayed by the drop-down box control, making the page display smoother. This solves the technical problems of memory leakage and page display jamming caused by a large number of data items in the drop-down box control or a large number of drop-down box controls in the prior art.
[0051] In addition, the server 200 obtains the sizes (ie, the number of bytes) BET1 to BETn of the data items of the data tables 211 to 21n, wherein BET1 is the size of the data item of the data table 211, BET2 is the size of the data item of the data table 212, ..., and BETn is the size of the data item of the data table 21n.
[0052] Specifically, for example, the server 200 can read the attribute information of each data table 211-21n, and then obtain the above information from the attribute information. In addition, when the data of the data tables 211-21n is updated, its attribute information (such as the size of the data item, etc.) is also updated accordingly.
[0053] The server 200 determines the number NE1 to NEn of data items corresponding to the respective drop-down box controls 311 to 31n and sent to the terminal device 100 according to the following formula, so that NE1 to NEn meet the following conditions:
[0054] NEi=MD / BETi
[0055] In this way, the data items of each drop-down box control can be loaded to the maximum extent.
[0056] Optionally, the operation of determining the number of data items in the drop-down box in the target web page based on the remaining memory capacity of the terminal device includes: obtaining the remaining memory capacity of the terminal device; obtaining the number of data items in the data table corresponding to the drop-down box; and when the memory capacity is greater than the memory capacity occupied by the data items in the drop-down box, determining the number of data items in the drop-down box based on the number of data items in the data table corresponding to the drop-down box.
[0057] Specifically, refer to Figure 6 As shown, for example, the server 200 may determine the number NE1 -NEn of data items allocated to the drop-down box controls 311 - 31n in proportion according to the number of data items in the data tables 211 - 21n.
[0058] The server 200 obtains the number of data items NET1 to NETn of the data tables 211 to 21n and the size (i.e., the number of bytes) of each data item BET1 to BETn. NET1 is the number of data items in the data table 211, NET2 is the number of data items in the data table 212, ..., NETn is the number of data items in the data table 21n. BET1 is the size of the data items in the data table 211, BET2 is the size of the data items in the data table 212, ..., BETn is the size of the data items in the data table 21n.
[0059] For example, the server 200 can read the attribute information of each data table 211-21n, and then obtain the above information from the attribute information. Moreover, when the data of the data table 211-21n is updated, its attribute information (such as the number of data items and the size of data items, etc.) is also updated accordingly.
[0060] Further, the server 200 determines the number NE1 to NEn of data items corresponding to the respective drop-down box controls 311 to 31n and sent to the terminal device 100 according to the acquired information, so that NE1 to NEn meet the following conditions:
[0061] NE1:NE2:......:NEn=NET1:NET2:......:NETn
[0062] Among them, the proportional relationship between NE1~NEn is equal to the proportional relationship between NET1~NETn.
[0063] NE1*BET1+NE2*BET2+......+NEn*BETn≤MD
[0064] The total capacity of the data items corresponding to the respective drop-down box controls 311 - 31 n sent to the terminal device 100 is less than or equal to MD.
[0065] Alternatively, the server 200 may determine the number NE1 -NEn of data items allocated to the drop-down box controls 211 - 31n in proportion to the size of the storage space actually occupied by each data item in the data tables 211 - 21n .
[0066] Specifically, the server 200 obtains the sizes MT1 to MTn of the storage spaces occupied by the data items of the data tables 211 to 21n and the sizes (i.e., the number of bytes) of the respective data items BET1 to BETn. MT1 is the size of the capacity occupied by the data items of the data table 211, MT2 is the size of the storage space occupied by the data items of the data table 212, ..., MTn is the size of the storage space occupied by the data items of the data table 21n. BET1 is the size of the data items of the data table 211, BET2 is the size of the data items of the data table 212, ..., BETn is the size of the data items of the data table 21n.
[0067] As described above, the server 200 may read the attribute information of each data table 211 ˜ 21 n and then obtain the above information from the attribute information.
[0068] Further, the server 200 determines the number NE1 to NEn of data items corresponding to the respective drop-down box controls 311 to 31n and sent to the terminal device 100 according to the acquired information, so that NE1 to NEn meet the following conditions:
[0069] (NE1*BET1):(NE2*BET2):......:(NEn*BETn)=MT1:MT2:......:MTn
[0070] The proportional relationship between the capacities of the data items corresponding to the respective drop-down box controls 311 to 31 n sent to the terminal device 100 is equal to the proportional relationship between the capacities MT1 to MTn occupied by the data items of the respective data tables 211 to 21 n.
[0071] NE1*BET1+NE2*BET2+......+NEn*BETn≤MD
[0072] The total capacity of the data items corresponding to the respective drop-down box controls 311 - 31 n sent to the terminal device 100 is less than or equal to MD.
[0073] Therefore, the present technical solution determines the appropriate number of data items to be displayed based on the remaining memory capacity of the terminal device 100 and the number of data items, thereby effectively controlling the displayed data items within the memory capacity allowed by the terminal device 100, avoiding the problem of memory leakage caused by displaying too many data items in the drop-down box control, and ensuring the security and integrity of the data.
[0074] Optionally, the method also includes: receiving search information sent by the terminal device, wherein the search information is data information entered in a drop-down box; searching in a data table corresponding to the drop-down box based on the search information; and sending the searched data items corresponding to the search information to the terminal device.
[0075] Specifically, when the user does not find the data item he wants in the displayed list, he can directly enter the search term for searching the data item in the drop-down box control (e.g., the drop-down box control 311), so that the terminal device 100 sends the search term to the server 200, and the server 200 searches the data table 211 for the data item corresponding to the search term according to the search term, and sends the data item to the terminal device 100. After receiving the above data item, the terminal device 100 loads it into the cache and displays the data item in the list of the drop-down box control.
[0076] Therefore, the technical solution can directly obtain data from the data table by searching, and ensure the integrity of the data while controlling the displayed data items.
[0077] Optionally, the method further includes: when the drop-down box is closed, clearing cached data of the data items in the drop-down box via the terminal device.
[0078] Specifically, when a user selects a data item in a list corresponding to a drop-down box control (eg, drop-down box control 311 ), the terminal device 100 temporarily stores the data item in a cache area corresponding to the drop-down box control 311 .
[0079] More specifically, refer to Figure 7 As shown, after detecting that there are drop-down box controls 311-31n in the target webpage 300, the terminal device 100 can set a buffer area 410 and buffer areas 411-41n in the memory 400. The buffer area 410 is used to temporarily store all data items received from the server 200, and its capacity is greater than the aforementioned capacity MD with appropriate redundancy. The buffer areas 411-41n are used to temporarily store the data items selected by the user in each drop-down box control 311-31n.
[0080] For example, when the user clicks the drop-down box control 311, the terminal device 100 receives NE1 data items corresponding thereto and loads them into the buffer area 410. In addition, the data items received by the terminal device 100 from the server 200 are also loaded into the buffer area 410. Thus, the terminal device 100 obtains the data items from the buffer area 410 and displays them in the list corresponding to the drop-down box control.
[0081] And when the user selects a data item in the drop-down box control (eg, the drop-down box control 311 ), the terminal device 100 temporarily stores the data item selected by the user in the cache area 411 corresponding to the drop-down box control 311 .
[0082] When the capacity occupied by the data item loaded into the cache of the terminal device 100 is greater than MD, the terminal device 100 clears the loaded data item from the cache.
[0083] Specifically, when the capacity of the data items loaded into the buffer area 410 of the terminal device 100 is greater than MD, the terminal device 100 clears the temporarily stored data in the buffer area 410, thereby avoiding memory leaks.
[0084] Therefore, the technical solution can save space for data items in other drop-down boxes without opening the drop-down box by temporarily storing the data items in the cache area, thereby balancing the memory space and preventing memory leaks by scheduling.
[0085] In addition, when the user closes the drop-down box control, the data item corresponding to the drop-down box is cleared from the cache.
[0086] Specifically, when a user clicks a drop-down box control (such as the drop-down box control 311), the terminal device 100 will load the received NE1 data items into the cache 410. When the user closes the drop-down box control 311, the terminal device 100 will simultaneously clear the cache 410. Thus, when the user opens a drop-down box control next time, memory leaks are avoided. In addition, this method can also reduce the memory usage of the terminal device 100.
[0087] On this basis, when the server 200 sends the web page 300 to the terminal device 100, the attribute information of the data tables 211-21n corresponding to each drop-down box control 311-31n of the web page 300 can be sent to the terminal device 100. Therefore, the terminal device 100 can determine the maximum value of the data item capacity MT1-MTn of each data table 211-21n in step S103. And the terminal device 100 will compare the maximum value with the MD calculated according to the formula MD=MR-MN, and take the smaller value as the final MD. In this way, the memory usage of the terminal device 100 is reduced.
[0088] Optionally, the method further includes: each time the user obtains the corresponding data item from the server 200 by searching, the terminal device 100 re-determines the memory capacity of the data items of the remaining drop-down box controls 312-31n allocated to the target webpage 300, and sends it to the server 200. The server 200 re-determines the number NE2-NEn of data items corresponding to the remaining drop-down box controls 312-31n and sent to the terminal device 100 according to the received memory capacity.
[0089] Specifically, whenever the user obtains the corresponding data item from the server 200 by searching, and the terminal device 100 loads it into the cache area 410, the terminal device 100 will re-detect the remaining capacity of the cache area 410 and send it to the server 200. Thus, the server 200 will re-determine the number of data items NE2 to NEn corresponding to the remaining drop-down box controls 312 to 31n sent to the terminal device 100 according to the remaining capacity of the cache area 410. Thus, the searched data items are loaded into the cache area, so that the memory space can be utilized, and the operation efficiency is improved.
[0090] In addition, reference Figure 1 As shown, according to the second aspect of this embodiment, a storage medium is provided, wherein the storage medium includes a stored program, wherein when the program is run, a processor executes any one of the above methods.
[0091] Thus, according to this embodiment, when the user 300 clicks on the drop-down box control on the page, the server 200 sends the data items related to the drop-down box control to the terminal device 100 through the network, and only displays part of the data items in the drop-down box control, so that the data items that can be displayed can be controlled, and the memory leak caused by the drop-down box control displaying too many data items can be avoided, so that the page display is smoother. In addition, the technical problems of memory leak and page display jamming caused by the large number of data items in the drop-down box control or the large number of drop-down box controls in the prior art are solved.
[0092] It should be noted that, for the above-mentioned method embodiments, for the sake of simplicity, they are all described as a series of action combinations, but those skilled in the art should know that the present invention is not limited by the described action sequence, because according to the present invention, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present invention.
[0093] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for enabling a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present invention.
[0094] Example 2
[0095] Figure 8 The drop-down box display device 800 according to this embodiment is shown, and the device 800 corresponds to the method according to the first aspect of embodiment 1. Figure 8 As shown, the apparatus 800 includes: a first sending module 810, for sending a target web page for display to a terminal device; a first determining module 820, for determining the number of data items in a drop-down box in the target web page according to the remaining memory capacity of the terminal device; and a first display module 830, for displaying the data items in the drop-down box according to the number of data items in the drop-down box.
[0096] Optionally, the first determination module 820 includes: a first acquisition sub-module, used to obtain the remaining memory capacity of the terminal device; a second acquisition sub-module, used to obtain the number of data items in the data table corresponding to the drop-down box; and a first determination sub-module, used to determine the number of data items in the drop-down box according to the number of data items in the data table corresponding to the drop-down box when the memory capacity is greater than the memory capacity occupied by the data items in the drop-down box.
[0097] Optionally, the device 800 also includes: a first receiving module, used to receive search information sent by the terminal device, wherein the search information is data information entered in the drop-down box; an information search module, used to search in a data table corresponding to the drop-down box based on the search information; and a second sending module, used to send the searched data items corresponding to the search information to the terminal device.
[0098] Optionally, the apparatus 800 further includes: a data clearing module, configured to clear cached data of data items in the drop-down box through the terminal device when the drop-down box is closed.
[0099] Thus, according to this embodiment, when the user 300 clicks on the drop-down box control on the page, the server 200 sends the data items related to the drop-down box control to the terminal device 100 through the network, and only displays part of the data items in the drop-down box control, so that the data items that can be displayed can be controlled, and the memory leak caused by the drop-down box control displaying too many data items can be avoided, so that the page display is smoother. In addition, the technical problems of memory leak and page display jamming caused by the large number of data items in the drop-down box control or the large number of drop-down box controls in the prior art are solved.
[0100] Example 3
[0101] Fig. 9 The drop-down box display device 900 according to this embodiment is shown, and the device 900 corresponds to the method according to the first aspect of embodiment 1. Fig. 9 As shown, the device 900 includes: a processor 910; and a memory 920, which is connected to the processor 910 and is used to provide instructions for the processor 910 to process the following processing steps: sending a target web page for display to a terminal device; determining the number of data items in a drop-down box in the target web page based on the remaining memory capacity of the terminal device; and displaying the data items in the drop-down box based on the number of data items in the drop-down box.
[0102] Optionally, the operation of determining the number of data items in the drop-down box in the target web page based on the remaining memory capacity of the terminal device includes: obtaining the remaining memory capacity of the terminal device; obtaining the number of data items in the data table corresponding to the drop-down box; and when the memory capacity is greater than the memory capacity occupied by the data items in the drop-down box, determining the number of data items in the drop-down box based on the number of data items in the data table corresponding to the drop-down box.
[0103] Optionally, the apparatus 900 further includes: receiving search information sent by a terminal device, wherein the search information is data information input in a drop-down box; searching in a data table corresponding to the drop-down box according to the search information; and sending the searched data items corresponding to the search information to the terminal device.
[0104] Optionally, the apparatus 900 further includes: when the drop-down box is closed, clearing cached data of the data items in the drop-down box through the terminal device.
[0105] Thus, according to this embodiment, when the user 300 clicks on the drop-down box control on the page, the server 200 sends the data items related to the drop-down box control to the terminal device 100 through the network, and only displays part of the data items in the drop-down box control, so that the data items that can be displayed can be controlled, and the memory leak caused by the drop-down box control displaying too many data items can be avoided, so that the page display is smoother. In addition, the technical problems of memory leak and page display jamming caused by the large number of data items in the drop-down box control or the large number of drop-down box controls in the prior art are solved.
[0106] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0107] In the above embodiments of the present invention, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0108] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0109] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0110] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0111] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, RandomAccess Memory), mobile hard disk, magnetic disk or optical disk and other media that can store program codes.
[0112] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A method for displaying a drop-down box, characterized in that: include: The server sends a target web page for display to the terminal device; The server determines the number of data items in the drop-down box in the target webpage according to the remaining memory capacity of the terminal device; as well as The server displays the data items in the drop-down box according to the number of data items in the drop-down box, wherein The operation of the server determining the number of data items in the drop-down box in the target webpage according to the remaining memory capacity of the terminal device includes: the server obtaining the remaining memory capacity of the terminal device; the server obtaining the number of data items in the data table corresponding to the drop-down box; and the server determining the number of data items in the drop-down box according to the number of data items in the data table corresponding to the drop-down box when the memory capacity is greater than the memory capacity occupied by the data items in the drop-down box, and The method further includes: the server receiving search information sent by the terminal device, wherein the search information is data information input in the drop-down box; the server searching in a data table corresponding to the drop-down box according to the search information; and the server sending the searched data items corresponding to the search information to the terminal device, and When the user selects a data item in the drop-down box, the terminal device temporarily stores the data item selected by the user in a cache area corresponding to the drop-down box; When the capacity occupied by the data items loaded into the cache of the terminal device is greater than the memory capacity, the terminal device clears the loaded data items in the cache area; When the user selects a data item in the list corresponding to the drop-down box, the terminal device temporarily stores the data item in the buffer area corresponding to the drop-down box, wherein After detecting that there is a drop-down box in the target web page, the terminal device sets a first cache area and a second cache area in the memory, wherein the first cache area is used to temporarily store all data items received from the server, and the capacity of the data items is greater than the memory capacity, and the second cache area is used to temporarily store the data items selected by the user in each drop-down box, so that when the user clicks the drop-down box, the terminal device receives multiple data items corresponding to the drop-down box and loads the multiple data items into the first cache area, and the data items received by the terminal device from the server are also loaded into the first cache area, so that the terminal device obtains the data items from the first cache area and displays the data items in a list corresponding to the drop-down box, and The method further includes: when the drop-down box is closed, the cached data of the data items in the drop-down box are cleared through the terminal device, and when the server sends a web page to the terminal device, the attribute information of the data table corresponding to each drop-down box of the web page is sent to the terminal device, so that the terminal device determines the maximum value of the data item capacity of each data table, and the terminal device compares the maximum value with the memory capacity, so as to use the minimum value obtained by comparison as the final memory capacity, and The method also includes: each time the user obtains the corresponding data items from the server by searching, the terminal device redetermines the memory capacity of the data items of the remaining drop-down box allocated to the target web page and sends it to the server; the server redetermines the number of data items corresponding to the remaining drop-down box to be sent to the terminal device based on the received memory capacity.
2. A storage medium, characterized in that: The storage medium includes a stored program, wherein when the program is executed, the method of claim 1 is executed by a processor.
3. A drop-down box display device, characterized in that: include: A first sending module, used for sending a target web page for display to a terminal device; A first determination module, configured to determine the number of data items in the drop-down box in the target webpage according to the remaining memory capacity of the terminal device; as well as The first display module is used to display the data items in the drop-down box according to the number of data items in the drop-down box, wherein The first determination module includes: a first acquisition submodule for acquiring the remaining memory capacity of the terminal device; a second acquisition submodule for acquiring the number of data items in the data table corresponding to the drop-down box; and a first determination submodule for determining the number of data items in the drop-down box according to the number of data items in the data table corresponding to the drop-down box when the memory capacity is greater than the memory capacity occupied by the data items in the drop-down box, and The device further includes: a first receiving module, configured to receive search information sent by the terminal device, wherein the search information is data information input in the drop-down box; an information search module, configured to search in a data table corresponding to the drop-down box according to the search information; and a second sending module, configured to send the searched data item corresponding to the search information to the terminal device, and When the user selects a data item in the drop-down box, the terminal device temporarily stores the data item selected by the user in a cache area corresponding to the drop-down box; When the capacity occupied by the data items loaded into the cache of the terminal device is greater than the memory capacity, the terminal device clears the loaded data items in the cache area; When the user selects a data item in the list corresponding to the drop-down box, the terminal device temporarily stores the data item in the buffer area corresponding to the drop-down box, wherein After detecting that there is a drop-down box in the target web page, the terminal device sets a first cache area and a second cache area in the memory, wherein the first cache area is used to temporarily store all data items received from the server, and the capacity of the data items is greater than the memory capacity, and the second cache area is used to temporarily store the data items selected by the user in each drop-down box, so that when the user clicks the drop-down box, the terminal device receives multiple data items corresponding to the drop-down box and loads the multiple data items into the first cache area, and the data items received by the terminal device from the server are also loaded into the first cache area, so that the terminal device obtains the data items from the first cache area and displays the data items in a list corresponding to the drop-down box, and The device further comprises: a data clearing module, which is used to clear the cached data of the data items in the drop-down box through the terminal device when the drop-down box is closed, and when the server sends a web page to the terminal device, the attribute information of the data table corresponding to each drop-down box of the web page is sent to the terminal device, so that the terminal device determines the maximum value of the data item capacity of each data table, and the terminal device compares the maximum value with the memory capacity, so as to use the minimum value obtained by comparison as the final memory capacity, and The apparatus also includes: each time the user obtains the corresponding data item from the server by searching, the terminal device redetermines the memory capacity of the data items of the remaining drop-down box allocated to the target web page and sends it to the server; the server redetermines the number of data items corresponding to the remaining drop-down box to be sent to the terminal device based on the received memory capacity.
4. A drop-down box display device, characterized in that: include: processor; as well as A memory, connected to the processor, configured to provide the processor with instructions for processing the following processing steps: Sending a target web page for display to a terminal device; Determining the number of data items in the drop-down box in the target webpage according to the remaining memory capacity of the terminal device; as well as The data items of the drop-down box are displayed according to the number of data items of the drop-down box, wherein The operation of the server determining the number of data items in the drop-down box in the target webpage according to the remaining memory capacity of the terminal device includes: the server obtaining the remaining memory capacity of the terminal device; the server obtaining the number of data items in the data table corresponding to the drop-down box; and the server determining the number of data items in the drop-down box according to the number of data items in the data table corresponding to the drop-down box when the memory capacity is greater than the memory capacity occupied by the data items in the drop-down box, and The method further includes: the server receiving search information sent by the terminal device, wherein the search information is data information input in the drop-down box; the server searching in a data table corresponding to the drop-down box according to the search information; and the server sending the searched data items corresponding to the search information to the terminal device, and When the user selects a data item in the drop-down box, the terminal device temporarily stores the data item selected by the user in a cache area corresponding to the drop-down box; When the capacity occupied by the data items loaded into the cache of the terminal device is greater than the memory capacity, the terminal device clears the loaded data items in the cache area; When the user selects a data item in the list corresponding to the drop-down box, the terminal device temporarily stores the data item in the buffer area corresponding to the drop-down box, wherein After detecting that there is a drop-down box in the target web page, the terminal device sets a first cache area and a second cache area in the memory, wherein the first cache area is used to temporarily store all data items received from the server, and the capacity of the data items is greater than the memory capacity, and the second cache area is used to temporarily store the data items selected by the user in each drop-down box, so that when the user clicks the drop-down box, the terminal device receives multiple data items corresponding to the drop-down box and loads the multiple data items into the first cache area, and the data items received by the terminal device from the server are also loaded into the first cache area, so that the terminal device obtains the data items from the first cache area and displays the data items in a list corresponding to the drop-down box, and The method further includes: when the drop-down box is closed, the cached data of the data items in the drop-down box are cleared through the terminal device, and when the server sends a web page to the terminal device, the attribute information of the data table corresponding to each drop-down box of the web page is sent to the terminal device, so that the terminal device determines the maximum value of the data item capacity of each data table, and the terminal device compares the maximum value with the memory capacity, so as to use the minimum value obtained by comparison as the final memory capacity, and The method also includes: each time the user obtains the corresponding data items from the server by searching, the terminal device redetermines the memory capacity of the data items of the remaining drop-down box allocated to the target web page and sends it to the server; the server redetermines the number of data items corresponding to the remaining drop-down box to be sent to the terminal device based on the received memory capacity.
Citation Information
Patent Citations
Method and device for managing webpage display in big data system
CN108804660A
Pull-down choice box input method and device, equipment and medium
CN112464130A
Offline data management method and device, terminal equipment, system and readable medium
CN112800074A
Label display method and device
CN113721822A
Systems and methods for evaluating and storing data items
US10713235B1
