WO2018214684A1 - 页面数据加载方法、装置、电子设备及计算机可读存储介质 - Google Patents

页面数据加载方法、装置、电子设备及计算机可读存储介质 Download PDF

Info

Publication number
WO2018214684A1
WO2018214684A1 PCT/CN2018/083953 CN2018083953W WO2018214684A1 WO 2018214684 A1 WO2018214684 A1 WO 2018214684A1 CN 2018083953 W CN2018083953 W CN 2018083953W WO 2018214684 A1 WO2018214684 A1 WO 2018214684A1
Authority
WO
WIPO (PCT)
Prior art keywords
electronic device
display area
module
modules
height
Prior art date
Application number
PCT/CN2018/083953
Other languages
English (en)
French (fr)
Inventor
任伟杰
Original Assignee
广州阿里巴巴文学信息技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 广州阿里巴巴文学信息技术有限公司 filed Critical 广州阿里巴巴文学信息技术有限公司
Publication of WO2018214684A1 publication Critical patent/WO2018214684A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/957Browsing optimisation, e.g. caching or content distillation
    • G06F16/9577Optimising the visualization of content, e.g. distillation of HTML documents
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor

Definitions

  • the present invention relates to network technologies, and in particular, to a page data loading method, apparatus, electronic device, and computer readable storage medium.
  • the invention provides a page data loading method, device, electronic device and computer readable storage medium, so as to improve page loading efficiency and improve user experience.
  • a first aspect of the embodiments of the present invention provides a page data loading method, including:
  • the obtaining display area information of the electronic device includes:
  • the height of the display area of the electronic device is obtained by JavaScript.
  • the obtaining display area information of the electronic device includes:
  • the height of the display area of the electronic device is obtained by counting the user agent.
  • the obtaining display area information of the electronic device includes:
  • the display area information of the electronic device with the highest frequency is obtained.
  • the determining, according to the display area information and the module style information, the number of modules to be loaded including:
  • the height of the module pattern corresponding to the module of the page to be loaded is sequentially accumulated according to the splicing order of the modules of the page to be loaded, and the cumulative sum is greater than or equal to the height of the display area of the electronic device.
  • the minimum number of modules that have been added is the number of modules to be loaded, including:
  • a second aspect of the embodiments of the present invention provides a page data loading apparatus, including:
  • An obtaining module configured to acquire display area information of the electronic device
  • the obtaining module is further configured to obtain module style information of a page to be loaded;
  • a processing module configured to determine, according to the display area information and the module style information, the number of modules to be loaded
  • a sending module configured to send a data request to the server, where the data request is used to request data of a module corresponding to the number of modules;
  • a receiving module configured to receive a data response corresponding to the data request sent by the server, where the data response includes data of a module corresponding to the number of modules;
  • the loading module is configured to load data of the module corresponding to the number of modules.
  • the acquiring module is specifically configured to acquire a height of a display area of the electronic device by using a jQuery framework; or acquire a height of a display area of the electronic device by using a JavaScript.
  • the acquiring module is specifically configured to acquire a height of a display area of the electronic device by means of a statistical user agent.
  • the acquiring module is specifically configured to obtain display area information of the electronic device with the highest frequency of use according to the frequency of use of the electronic device of each model.
  • the processing module is configured to sequentially accumulate the heights of the module patterns corresponding to the modules of the page to be loaded according to the splicing order of the modules of the page to be loaded, and determine that the cumulative sum is greater than or equal to the electronic device.
  • the minimum number of modules that have been accumulated is the number of modules to be loaded.
  • processing module is specifically configured to:
  • the page data loading method and device, the electronic device, and the computer readable storage medium provided by the embodiment of the present invention determine the to-be-displayed area information and the template style information of the to-be-loaded page according to the display area information and the template style information.
  • the number of modules loaded sending a data request to the server, requesting the data of the module corresponding to the determined number of modules, receiving the data response corresponding to the data request sent by the server, and the data response includes the data of the module corresponding to the number of modules, corresponding to the number of modules
  • the data of the module is loaded. Since the number of modules is determined according to the display area information and the template style information, the number of modules is determined more accurately and reasonably, and the on-demand loading can be realized, thereby improving the efficiency of data loading and improving the user experience.
  • FIG. 1 is a schematic flowchart diagram of a page data loading method according to an embodiment of the present disclosure
  • FIG. 2 is a schematic diagram of a page according to an embodiment of the present invention.
  • FIG. 3 is a schematic diagram of another page according to an embodiment of the present disclosure.
  • FIG. 4 is a schematic diagram of still another page according to an embodiment of the present invention.
  • FIG. 5 is a schematic structural diagram of a page data loading apparatus according to an embodiment of the present invention.
  • FIG. 6 is a block diagram of an electronic device 10 according to a preferred embodiment of the present invention.
  • the embodiment of the present invention determines the number of modules to be loaded according to the display area information and the template style information of the electronic device, and sends a data request to the server to request the determined number of modules.
  • the data of the module receives the data response corresponding to the data request sent by the server, and the data response includes the data of the module corresponding to the number of modules, and loads the data of the module corresponding to the number of modules, because the number of modules is based on the display area information and the template style.
  • the information is determined, therefore, the number of modules is determined more accurately and reasonably, and can be loaded on demand, thereby improving the efficiency of data loading and improving the user experience.
  • FIG. 1 is a schematic flowchart of a page data loading method according to an embodiment of the present invention. As shown in FIG. 1 , the method in this embodiment is as follows:
  • S101 Acquire display area information of the electronic device.
  • the obtaining display area information of the electronic device includes but is not limited to the following implementation manners:
  • One possible implementation manner is to acquire the height of the display area of the electronic device through the jQuery framework.
  • Yet another possible implementation manner is: obtaining display area information of the electronic device with the highest frequency model according to the frequency of use of each type of electronic device.
  • the electronic device is a mobile phone
  • the iPhone operating system (IOS) device has the highest frequency of use, and the resolution of the display area of the Apple operating system device is 1334*750, the width is 750.
  • the pixel has a height of 1334 pixels.
  • Yet another possible implementation manner is: acquiring the height of the largest display area supported by the page as the display area information of the electronic device.
  • the height of the display area of the electronic device is obtained preferentially through the jQuery framework, and if not obtained, the electronic is acquired through avaScript.
  • the height of the display area of the device if not obtained, the height of the display area of the electronic device by means of a user agent (UA), and if not yet obtained, the electronic device according to each model
  • UUA user agent
  • the electronic device according to each model The frequency of use, to obtain the display area information of the electronic device with the highest frequency.
  • the module styles of the various modules of the page are stored, and the storage structure of the module style can be as follows, for example:
  • the module styles of various modules can be stored in various ways.
  • the module styles of various modules can be stored in a database, and for example, the module styles of various modules can be stored in a table or the like.
  • Template style information of various modules can be obtained by accessing a stored module style database, a table, and the like.
  • S103 Determine the number of modules to be loaded according to the display area information and the module style information.
  • One possible implementation manner is: accumulating the heights of the module patterns corresponding to the modules of the page to be loaded in sequence according to the splicing order of the modules to be loaded, and determining that the sum is greater than or equal to the height of the display area of the electronic device. At the time, the minimum number of modules that have been accumulated is the number of modules to be loaded.
  • the splicing order of the modules to be loaded is the banner module, the navigation module, the A module, the B module, the C module, the D module, and the E module from top to bottom; wherein the module module has a module style height of 100, and the navigation module
  • the module style height is 200, the module style height of the A module is 200, the module style height of the B module is 400, the module style height of the C module is 250, the module style height of the D module is 150, and the module style height of the E module is 500.
  • the number of modules to be loaded is determined to be four, corresponding to the banner module, Navigation module, A module and B module, as shown in Figure 2.
  • the units of each height data may be flexibly selected according to different electronic devices.
  • the unit of each height data may be pixels, decimeters (dm), millimeters (mm), and silk meters (dmm). )Wait.
  • S104 Send a data request to the server, where the data request is used to request data of a module corresponding to the number of modules.
  • the data of the module corresponding to the number of modules is requested to improve the efficiency of requesting data.
  • S105 Receive a data response corresponding to the data request sent by the server, where the data response includes data of a module corresponding to the number of modules.
  • the module's data corresponding to the number of modules is fed back to improve the efficiency of data feedback.
  • the display area information of the electronic device and the template style information of the page to be loaded by acquiring the display area information of the electronic device and the template style information of the page to be loaded, determining the number of modules to be loaded according to the display area information and the template style information, and sending a data request to the server, to request the determined number of modules.
  • the data of the module receives the data response corresponding to the data request sent by the server, and the data response includes the data of the module corresponding to the number of modules, and loads the data of the module corresponding to the number of modules, because the number of modules is based on the display area information and the template style.
  • the information is determined, therefore, the number of modules is determined more accurately and reasonably, and can be loaded on demand, thereby improving the efficiency of data loading and improving the user experience.
  • the user's interaction time with the product is shortened, and the retention rate of the user in the page product is improved. It avoids the problem that the number of determined modules is unreasonable, the load module is too long to load, and the load module is in
  • FIG. 5 is a schematic structural diagram of an embodiment of a page data loading apparatus according to an embodiment of the present invention.
  • the device in this embodiment includes an obtaining module 501, a processing module 502, a sending module 503, a receiving module 504, and a loading module 505.
  • the obtaining module 501 is configured to acquire module style information of the page to be loaded; the processing module 502 is configured to determine the number of modules to be loaded according to the display area information and the module style information; Sending a data request to the server, the data request is used to request data of a module corresponding to the number of modules; the receiving module 504 is configured to receive a data response corresponding to the data request sent by the server, where the data response includes data of a module corresponding to the number of modules; 505 is used to load the data of the module corresponding to the number of modules.
  • the obtaining module 501 is specifically configured to acquire the height of the display area of the electronic device through the jQuery framework; or acquire the height of the display area of the electronic device through JavaScript.
  • the obtaining module 501 is specifically configured to acquire the height of the display area of the electronic device by means of a statistical user agent UA.
  • the obtaining module 501 is specifically configured to acquire the height of the largest display area supported by the page as the display area information of the electronic device.
  • the processing module 502 is specifically configured to sequentially accumulate the heights of the module patterns corresponding to the modules of the page to be loaded according to the splicing order of the modules to be loaded, and determine that the cumulative sum is greater than or equal to the height of the display area of the electronic device.
  • the minimum number of modules that have been accumulated is the number of modules to be loaded.
  • the processing module 502 is specifically configured according to a formula Calculating the number of modules to be loaded, where F represents the height of the display area of the electronic device, M i represents the height of the module pattern corresponding to the i-th module, N is an integer greater than or equal to 1, and the minimum value of N is to be The number of modules loaded.
  • the device in this embodiment is correspondingly used to implement the technical solution of the method embodiment shown in FIG. 1 , and the implementation principle and the technical effect are similar, and details are not described herein again.
  • FIG. 6 is a block schematic diagram of an electronic device 10 according to a preferred embodiment of the present invention.
  • the electronic device 10 in the embodiment of the present invention may be a device having data loading, storage, and processing functions, for example, may be a data processing server.
  • the electronic device 10 includes a memory 11, a processor 12, a network module 13, and a page data loading device 20.
  • the memory 11, the processor 12 and the network module 13 are electrically connected directly or indirectly to each other to implement data transmission or interaction.
  • the components can be electrically connected to one another via one or more communication buses or signal lines.
  • a page data loading device 20 is stored in the memory 11, and the page data loading device 20 includes at least one software function module that can be stored in the memory 11 in the form of software or firmware, and the processor 12 runs through the storage.
  • the memory 11 can be, but not limited to, a random access memory (RAM), a read only memory (ROM), and a programmable read-only memory (PROM). Erasable Programmable Read-Only Memory (EPROM), Electric Erasable Programmable Read-Only Memory (EEPROM), and the like.
  • RAM random access memory
  • ROM read only memory
  • PROM programmable read-only memory
  • EPROM Erasable Programmable Read-Only Memory
  • EEPROM Electric Erasable Programmable Read-Only Memory
  • the memory 11 is used to store a program, and the processor 12 executes the program after receiving an execution instruction.
  • the processor 12 may be an integrated circuit chip with data processing capabilities.
  • the processor 12 described above may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), and the like.
  • CPU central processing unit
  • NP network processor
  • the methods, steps, and logic blocks disclosed in the embodiments of the present invention may be implemented or executed.
  • the general purpose processor may be a microprocessor or the processor or any conventional processor or the like.
  • the network module 13 is configured to establish a communication connection between the electronic device 10 and the external communication terminal through the network, and implement the transmission and reception operations of the network signal and the data.
  • the above network signal may include a wireless signal or a wired signal.
  • FIG. 6 is merely illustrative, and the electronic device 10 may further include more or less components than those shown in FIG. 6, or have a different configuration than that shown in FIG.
  • the components shown in Figure 6 can be implemented in hardware, software, or a combination thereof.
  • the embodiment of the invention further provides a computer readable storage medium, the readable storage medium comprising a computer program.
  • the electronic device 10 in which the computer program is controlled to control the readable storage medium, performs the above method.
  • the aforementioned program can be stored in a computer readable storage medium.
  • the program when executed, performs the steps including the foregoing method embodiments; and the foregoing storage medium includes various media that can store program codes, such as a ROM, a RAM, a magnetic disk, or an optical disk.
  • the page data loading method, device, electronic device and computer readable storage medium provided by the embodiments of the present invention determine the number of modules according to the display area information and the template style information, and the number of modules is determined more accurately and reasonably, and can be loaded on demand, thereby improving
  • the efficiency of data loading increases the user experience.
  • the user's interaction time with the product is shortened, and the retention rate of the user in the page product is improved.
  • Various problems caused by the unreasonable number of modules are avoided, such as long load time caused by too many load modules, and insufficient page load blocking caused by insufficient load modules.

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • User Interface Of Digital Computer (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

公开了一种页面数据加载方法、装置、电子设备及计算机可读存储介质,通过获取电子设备的显示区域信息和待加载页面的模板样式信息,根据显示区域信息和模板样式信息,确定待加载的模块数量,向服务器发送数据请求,以请求确定的模块数量对应的模块的数据,接收服务器发送的数据请求对应的数据响应,数据响应中包含模块数量对应的模块的数据,对模块数量对应的模块的数据进行加载,由于模块数量是根据显示区域信息和模板样式信息确定的,因此,模块数量确定的更加准确合理,能够实现按需加载,从而,提高数据加载的效率,提高用户体验。

Description

页面数据加载方法、装置、电子设备及计算机可读存储介质
相关申请的交叉引用
本申请要求于2017年05月25日提交中国专利局的申请号为CN201710380878.6,名称为“页面数据加载方法和装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本发明涉及网络技术,尤其涉及一种页面数据加载方法、装置、电子设备及计算机可读存储介质。
背景技术
为了扩展页面人工运营自由度和实现页面样式的快速迭代,大都在前端页面搭建的过程中采用页面模板拼接加数据获取的方式。现有技术中,页面数据加载的一种方式为,每次请求获取固定个数的模块的数据进行加载,然而,采用该种方法,容易出现页面未加载完全的情况,从而,延缓了页面的加载效率,影响用户体验。
发明内容
本发明提供一种页面数据加载方法、装置、电子设备及计算机可读存储介质,以提高页面的加载效率,提高用户体验。
本发明实施例第一方面,提供一种页面数据加载方法,包括:
获取电子设备的显示区域信息;
获取待加载页面的模块样式信息;
根据所述显示区域信息和所述模块样式信息,确定待加载的模块数量;
向服务器发送数据请求,所述数据请求用于请求所述模块数量对应的模块的数据;
接收所述服务器发送的数据请求对应的数据响应,所述数据响应中包含所述模块数量对应的模块的数据;
加载所述模块数量对应的模块的数据。
可选地,所述获取电子设备的显示区域信息,包括:
通过jQuery框架获取所述电子设备的显示区域的高度;
或者,
通过JavaScript获取所述电子设备的显示区域的高度。
可选地,所述获取电子设备的显示区域信息,包括:
通过统计用户代理的方式获取所述电子设备的显示区域的高度。
可选地,所述获取电子设备的显示区域信息,包括:
根据每个型号的电子设备的使用频率,获取使用频率最高型号的电子设备的显示区域信息。
可选地,所述根据所述显示区域信息和所述模块样式信息,确定待加载的模块数量,包括:
根据所述待加载页面的模块的拼接顺序,依次将所述待加载页面的模块对应的模块样式的高度累加,确定累加和大于等于所述电子设备的显示区域的高度时,已累加的模块的最小数量为所述待加载的模块数量。
可选地,所述根据所述待加载页面的模块的拼接顺序,依次将所述待加载页面的模块对应的模块样式的高度累加,确定累加和大于等于所述电子设备的显示区域的高度时,已累加的模块的最小数量为所述待加载的模块数量,包括:
根据公式
Figure PCTCN2018083953-appb-000001
计算得到所述待加载的模块数量,其中,F表示所述电子设备的显示区域的高度,M i表示第i个模块对应的模块样式的高度,所述N为大于等于1的整数,所述N的最小值为所述待加载的模块数量。
本发明实施例第二方面提供一种页面数据加载装置,包括:
获取模块,用于获取电子设备的显示区域信息;
所述获取模块,还用于获取待加载页面的模块样式信息;
处理模块,用于根据所述显示区域信息和所述模块样式信息,确定待加载的模块数量;
发送模块,用于向服务器发送数据请求,所述数据请求用于请求所述模块数量对应的模块的数据;
接收模块,用于接收所述服务器发送的数据请求对应的数据响应,所述数据响应中包含所述模块数量对应的模块的数据;
加载模块,用于加载所述模块数量对应的模块的数据。
可选地,所述获取模块具体用于通过jQuery框架获取所述电子设备的显示区域的高度;或者,通过JavaScript获取所述电子设备的显示区域的高度。
可选地,所述获取模块具体用于通过统计用户代理的方式获取所述电子设备的显示区域的高度。
可选地,所述获取模块具体用于根据每个型号的电子设备的使用频率,获取使用频率最高型号的电子设备的显示区域信息。
可选地,所述处理模块具体用于根据所述待加载页面的模块的拼接顺序,依次将所述待加载页面的模块对应的模块样式的高度累加,确定累加和大于等于所述电子设备的显示区域的高度时,已累加的模块的最小数量为所述待加载的模块数量。
可选地,所述处理模块具体用于
根据公式
Figure PCTCN2018083953-appb-000002
计算得到所述待加载的模块数量,其中,F表示所述电子设备的显示区域的高度,M i表示第i个模块对应的模块样式的高度,所述N为大于等于1的整数,所述N的最小值为所述 待加载的模块数量。
本发明实施例提供的页面数据加载方法、装置、电子设备及计算机可读存储介质,通过获取电子设备的显示区域信息和待加载页面的模板样式信息,根据显示区域信息和模板样式信息,确定待加载的模块数量,向服务器发送数据请求,以请求确定的模块数量对应的模块的数据,接收服务器发送的数据请求对应的数据响应,数据响应中包含模块数量对应的模块的数据,对模块数量对应的模块的数据进行加载,由于模块数量是根据显示区域信息和模板样式信息确定的,因此,模块数量确定的更加准确合理,能够实现按需加载,从而,提高数据加载的效率,提高用户体验。
附图说明
为了更清楚地说明本发明实施例实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明实施例的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。
图1为本发明实施例提供的一种页面数据加载方法的示例性流程示意图;
图2为本发明实施例提供的一种页面示意图;
图3为本发明实施例提供的另一种页面示意图;
图4为本发明实施例提供的再一种页面示意图;
图5为本发明实施例提供的一种页面数据加载装置的示例性结构示意图。
图6为本发明较佳实施例提供的一种电子设备10的方框示意图。
具体实施方式
下面将结合本发明实施例实施例中的附图,对本发明实施例实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明实施例一部分实施例,而不是全部的实施例。基于本发明实施例中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明实施例保护的范围。
本发明实施例的说明书和权利要求书及上述附图中的术语“第一”、“第二”、“第三”“第四”等(如果存在)是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便这里描述的本发明实施例的实施例例如能够以除了在这里图示或描述的那些以外的顺序实施。此外,术语“包括”和“具有”以及他们的任何变形,意图在于覆盖不排他的包含,例如,包含了一系列步骤或单元的过程、方法、系统、产品或设备不必限于清楚地列出的那些步骤或单元,而是可包括没有清楚地列出的或对于这些过程、方法、产品或设备固有的其它步骤或单元。
本发明实施例通过获取电子设备的显示区域信息和待加载页面的模板样式信息,根据显示区域信息和模板样式信息,确定待加载的模块数量,向服务器发送数据请求,以请求确定的模块数量对应的模块 的数据,接收服务器发送的数据请求对应的数据响应,数据响应中包含模块数量对应的模块的数据,对模块数量对应的模块的数据进行加载,由于模块数量是根据显示区域信息和模板样式信息确定的,因此,模块数量确定的更加准确合理,能够实现按需加载,从而,提高数据加载的效率,提高用户体验。
下面以具体地实施例对本发明实施例的技术方案进行详细说明。下面这几个具体的实施例可以相互结合,对于相同或相似的概念或过程可能在某些实施例不再赘述。
图1为本发明实施例提供的一种页面数据加载方法的流程示意图,如图1所示,本实施例的方法如下:
S101:获取电子设备的显示区域信息。
其中,获取电子设备的显示区域信息包括但不限于如下实现方式:
一种可能的实现方式为:通过jQuery框架获取所述电子设备的显示区域的高度。
例如:
Figure PCTCN2018083953-appb-000003
Figure PCTCN2018083953-appb-000004
又一种可能的实现方式为:根据每个型号的电子设备的使用频率,获取使用频率最高型号的电子设备的显示区域信息。
例如:在电子设备为手机的情况下,若苹果操作系统(iPhone Operating System,IOS)设备的使用频率最高,在苹果操作系统设备的显示区域分辨率为1334*750的情况下,其宽度为750像素,高度为1334像素。
又一种可能的实现方式为:获取所述页面支持的最大的显示区域的高度作为所述电子设备的显示区域信息。
上述几种可能的实现方式可以结合使用,为每种可能的实现方式定义优先级,例如:优先通过jQuery框架获取所述电子设备的显示区域的高度,若未获得则再通过avaScript获取所述电子设备的显示区域的高度,若还未获得则再通过统计用户代理(User Agent,UA)的方式获取所述电子设备的显示区域的高 度,若还未获得则再通过根据每个型号的电子设备的使用频率,获取使用频率最高型号的电子设备的显示区域信息。
S102:获取待加载页面的模块样式信息。
对页面的各类模块的模块样式进行存储,模块样式的存储结构可以如下所示,例如:
Figure PCTCN2018083953-appb-000005
其中,各类模块的模块样式可以通过多种方式进行存储,例如,各类模块的模块样式可以存储在数据库中,又例如,各类模块的模块样式可以存储在表格中等。可以通过访问存储的模块样式的数据库、表格等,获取各类模块的模板样式信息。
S103:根据所述显示区域信息和所述模块样式信息,确定待加载的模块数量。
其中一种可能的实现方式为:根据待加载页面的模块的拼接顺序,依次将所述待加载页面的模块对应的模块样式的高度累加,确定累加和大于等于所述电子设备的显示区域的高度时,已累加的模块的最小数量为所述待加载的模块数量。
可以根据公式
Figure PCTCN2018083953-appb-000006
计算得到所述待加载的模块数量,其中,F表示所述电子设备的显示区域的高度,M i表示第i个模块对应的模块样式的高度,所述N为大于等于1的整数,所述N的最小值为所述待加载的模块数量。
假设:待加载页面的模块的拼接顺序自上而下依次为banner模块、导航模块、A模块、B模块,C模块、D模块、E模块;其中,banner模块的模块样式高度为100,导航模块的模块样式高度为200、A 模块的模块样式高度200、B模块的模块样式高度为400、C模块的模块样式高度为250、D模块的模块样式高度为150、E模块的模块样式高度为500。
若电子设备的显示区域的高度为h1=750,从banner模块的模块样式的高度开始累加,直到B模块,累加的高度为900,则确定待加载的模块数量为4个,分别对应banner模块、导航模块、A模块和B模块,如图2所示。
若电子设备的显示区域的高度为h2=1000,从banner模块的模块样式的高度开始累加,直到C模块,累加的高度为1150,则确定待加载的模块数量为5个,分别对应banner模块、导航模块、A模块、B模块和C模块,如图3所示。
若电子设备的显示区域的高度为h3=1500,从banner模块的模块样式的高度开始累加,直到C模块,累加的高度为1150,则确定待加载的模块数量为7个,分别对应banner模块、导航模块、A模块、B模块,C模块、D模块和E模块,如图4所示。
应当理解,本发明实施例中,根据电子设备的不同,各高度数据的单位可灵活选择,例如,各高度数据的单位可以为像素、分米(dm)、毫米(mm)、丝米(dmm)等。
S104:向服务器发送数据请求,数据请求用于请求所述模块数量对应的模块的数据。
通过一条数据请求,请求模块数量对应的模块的数据,以提高请求数据的效率。
S105:接收服务器发送的数据请求对应的数据响应,所述数据响应中包含所述模块数量对应的模块的数据。
通过一条数据响应,反馈模块数量对应的模块的数据,以提高数据反馈的效率。
S106:加载模块数量对应的模块的数据。
本实施例,通过获取电子设备的显示区域信息和待加载页面的模板样式信息,根据显示区域信息和模板样式信息,确定待加载的模块数量,向服务器发送数据请求,以请求确定的模块数量对应的模块的数据,接收服务器发送的数据请求对应的数据响应,数据响应中包含模块数量对应的模块的数据,对模块数量对应的模块的数据进行加载,由于模块数量是根据显示区域信息和模板样式信息确定的,因此,模块数量确定的更加准确合理,能够实现按需加载,从而,提高数据加载的效率,提高用户体验。缩短了用户与产品的交互等待时间,提升了用户在页面产品中的留存率。避免了因确定的模块数量不合理,加载模块过多加载时间长,加载模块不足页面渲染阻塞等问题。
图5为本发明实施例提供的页面数据加载装置实施例的结构示意图,本实施例的装置包括获取模块501、处理模块502、发送模块503、接收模块504和加载模块505,其中,获取模块501用于获取电子设备的显示区域信息;获取模块501还用于获取待加载页面的模块样式信息;处理模块502用于根据显示区域信息和模块样式信息,确定待加载的模块数量;发送模块503用于向服务器发送数据请求,数据请求用于请求模块数量对应的模块的数据;接收模块504用于接收服务器发送的数据请求对应的数据响 应,数据响应中包含模块数量对应的模块的数据;加载模块505用于加载模块数量对应的模块的数据。
在上述实施例中,获取模块501具体用于通过jQuery框架获取电子设备的显示区域的高度;或者,通过JavaScript获取电子设备的显示区域的高度。
在上述实施例中,获取模块501具体用于通过统计用户代理UA的方式获取电子设备的显示区域的高度。
在上述实施例中,获取模块501具体用于获取页面支持的最大的显示区域的高度作为电子设备的显示区域信息。
在上述实施例中,处理模块502具体用于根据待加载页面的模块的拼接顺序,依次将待加载页面的模块对应的模块样式的高度累加,确定累加和大于等于电子设备的显示区域的高度时,已累加的模块的最小数量为待加载的模块数量。
在上述实施例中,处理模块502具体用于根据公式
Figure PCTCN2018083953-appb-000007
计算得到所述待加载的模块数量,其中,F表示电子设备的显示区域的高度,M i表示第i个模块对应的模块样式的高度,N为大于等于1的整数,N的最小值为待加载的模块数量。
本实施例的装置对应地可用于执行图1所示方法实施例的技术方案,其实现原理和技术效果类似,此处不再赘述。
如图6所示,是本发明较佳实施例提供的电子设备10的方框示意图。本发明实施例中的电子设备10可以为具有数据加载、存储、处理功能的设备,例如,可以为数据处理服务器。如图1所示,电子设备10包括:存储器11、处理器12、网络模块13及页面数据加载装置20。
所述存储器11、处理器12以及网络模块13相互之间直接或间接地电性连接,以实现数据的传输或交互。例如,这些元件相互之间可通过一条或多条通讯总线或信号线实现电性连接。存储器11中存储有页面数据加载装置20,所述页面数据加载装置20包括至少一个可以软件或固件(firmware)的形式存储于所述存储器11中的软件功能模块,所述处理器12通过运行存储在存储器11内的软件程序以及模块,如本发明实施例中的页面数据加载装置20,从而执行各种功能应用以及存储控制,即实现本发明实施例中的页面数据加载方法。
其中,所述存储器11可以是,但不限于,随机存取存储器(Random Access Memory,RAM),只读存储器(Read Only Memory,ROM),可编程只读存储器(Programmable Read-Only Memory,PROM),可擦除只读存储器(Erasable Programmable Read-Only Memory,EPROM),电可擦除只读存储器(Electric Erasable Programmable Read-Only Memory,EEPROM)等。其中,存储器11用于存储程序,所述处理器12在接收到执行指令后,执行所述程序。
所述处理器12可能是一种集成电路芯片,具有数据的处理能力。上述的处理器12可以是通用处理 器,包括中央处理器(Central Processing Unit,CPU)、网络处理器(Network Processor,NP)等。可以实现或者执行本发明实施例中公开的各方法、步骤及逻辑框图。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。
网络模块13用于通过网络建立电子设备10与外部通信终端之间的通信连接,实现网络信号及数据的收发操作。上述网络信号可包括无线信号或者有线信号。
可以理解,图6所示的结构仅为示意,电子设备10还可包括比图6中所示更多或者更少的组件,或者具有与图6所示不同的配置。图6中所示的各组件可以采用硬件、软件或其组合实现。
本发明实施例还提供一种计算机可读存储介质,所述可读存储介质包括计算机程序。所述计算机程序运行时控制所述可读存储介质所在电子设备10执行上述方法。
本领域普通技术人员可以理解:实现上述各方法实施例的全部或部分步骤可以通过程序指令相关的硬件来完成。前述的程序可以存储于一计算机可读取存储介质中。该程序在执行时,执行包括上述各方法实施例的步骤;而前述的存储介质包括:ROM、RAM、磁碟或者光盘等各种可以存储程序代码的介质。
最后应说明的是:以上各实施例仅用以说明本发明实施例的技术方案,而非对其限制;尽管参照前述各实施例对本发明实施例进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分或者全部技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明实施例各实施例技术方案的范围。
工业实用性
本发明实施例提供的页面数据加载方法、装置、电子设备及计算机可读存储介质,根据显示区域信息和模板样式信息确定模块数量,模块数量确定的更加准确合理,能够实现按需加载,从而提高数据加载的效率,提高用户体验。缩短了用户与产品的交互等待时间,提升了用户在页面产品中的留存率。避免了因确定的模块数量不合理所造成的各种问题,如加载模块过多而导致的加载时间长,加载模块不足而导致的页面渲染阻塞等。

Claims (16)

  1. 一种页面数据加载方法,其特征在于,包括:
    获取电子设备的显示区域信息;
    获取待加载页面的模块样式信息;
    根据所述显示区域信息和所述模块样式信息,确定待加载的模块数量;
    向服务器发送数据请求,所述数据请求用于请求所述模块数量对应的模块的数据;
    接收所述服务器发送的数据请求对应的数据响应,所述数据响应中包含所述模块数量对应的模块的数据;
    加载所述模块数量对应的模块的数据。
  2. 根据权利要求1所述的方法,其特征在于,所述获取电子设备的显示区域信息,包括:
    通过jQuery框架获取所述电子设备的显示区域的高度;
    或者,
    通过JavaScript获取所述电子设备的显示区域的高度。
  3. 根据权利要求1所述的方法,其特征在于,所述获取电子设备的显示区域信息,包括:
    通过统计用户代理的方式获取所述电子设备的显示区域的高度。
  4. 根据权利要求1所述的方法,其特征在于,所述获取电子设备的显示区域信息,包括:
    根据每个型号的电子设备的使用频率,获取使用频率最高型号的电子设备的显示区域信息。
  5. 根据权利要求1-4任一项所述的方法,其特征在于,所述根据所述显示区域信息和所述模块样式信息,确定待加载的模块数量,包括:
    根据所述待加载页面中各模块的拼接顺序,依次将所述待加载页面中各模块对应的模块样式的高度累加,确定累加和大于等于所述电子设备的显示区域的高度时,已累加的模块的最小数量为所述待加载的模块数量。
  6. 根据权利要求5所述的方法,其特征在于,所述根据所述待加载页面中各模块的拼接顺序,依次将所述待加载页面中各模块对应的模块样式的高度累加,确定累加和大于等于所述电子设备的显示区域的高度时,已累加的模块的最小数量为所述待加载的模块数量,包括:
    根据公式
    Figure PCTCN2018083953-appb-100001
    计算得到所述待加载的模块数量,其中,F表示所述电子设备的显示区域的高度,M i表示第i个模块对应的模块样式的高度,所述N为大于等于1的整数,所述N的最小值为所述待加载的模块数量。
  7. 根据权利要求1~6任一项所述的方法,其特征在于,所述获取电子设备的显示区域信息,包括:
    通过jQuery框架获取所述电子设备的显示区域的高度,判断是否通过jQuery框架获取到所述电子设备的显示区域的高度,若未获取到所述电子设备的显示区域的高度,则通过avaScript获取所述电子设备的显示区域的高度,判断是否通过avaScript获取到所述电子设备的显示区域的高度,若未获取到所述电子设备的显示区域的高度,则通过统计用户代理的方式获取所述电子设备的显示区域的高度,判断是否通过统计用户代理的方式获取到所述电子设备的显示区域的高度,若未获取到所述电子设备的显示区域的高度,则根据每个型号的电子设备的使用频率,获取使用频率最高型号的电子设备的显示区域信息。
  8. 一种页面数据加载装置,其特征在于,包括:
    获取模块,配置成获取电子设备的显示区域信息;
    所述获取模块,还配置成获取待加载页面的模块样式信息;
    处理模块,配置成根据所述显示区域信息和所述模块样式信息,确定待加载的模块数量;
    发送模块,配置成向服务器发送数据请求,所述数据请求配置成请求所述模块数量对应的模块的数据;
    接收模块,配置成接收所述服务器发送的数据请求对应的数据响应,所述数据响应中包含所述模块数量对应的模块的数据;
    加载模块,配置成加载所述模块数量对应的模块的数据。
  9. 根据权利要求8所述的装置,其特征在于,所述获取模块具体配置成通过jQuery框架获取所述电子设备的显示区域的高度;或者,通过JavaScript获取所述电子设备的显示区域的高度。
  10. 根据权利要求8所述的装置,其特征在于,所述获取模块具体配置成通过统计用户代理UA的方式获取所述电子设备的显示区域的高度。
  11. 根据权利要求8所述的装置,其特征在于,所述获取模块具体配置成根据每个型号的电子设备的使用频率,获取使用频率最高型号的电子设备的显示区域信息。
  12. 根据权利要求8-11任一项所述的装置,其特征在于,所述处理模块具体配置成根据所述待加载页面的模块的拼接顺序,依次将所述待加载页面的模块对应的模块样式的高度累加,确定累加和大于等于所述电子设备的显示区域的高度时,已累加的模块的最小数量为所述待加载的模块数量。
  13. 根据权利要求12所述的装置,其特征在于,所述处理模块具体配置成
    根据公式
    Figure PCTCN2018083953-appb-100002
    计算得到所述待加载的模块数量,其中,F表示所述电子设备的显示区域的高度,M i表示第i个模块对应的模块样式的高度,所述N为大于等于1的整数,所述N的最小值为所述待加载的模块数量。
  14. 根据权利要求8~13任一项所述的装置,其特征在于,所述获取模块配置成通过jQuery框架获 取所述电子设备的显示区域的高度,判断是否通过jQuery框架获取到所述电子设备的显示区域的高度,若未获取到所述电子设备的显示区域的高度,则通过avaScript获取所述电子设备的显示区域的高度,判断是否通过avaScript获取到所述电子设备的显示区域的高度,若未获取到所述电子设备的显示区域的高度,则通过统计用户代理的方式获取所述电子设备的显示区域的高度,判断是否通过统计用户代理的方式获取到所述电子设备的显示区域的高度,若未获取到所述电子设备的显示区域的高度,则根据每个型号的电子设备的使用频率,获取使用频率最高型号的电子设备的显示区域信息。
  15. 一种电子设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,其特征在于,所述处理器执行所述程序时实现权利要求1~7任一项所述的页面数据加载方法。
  16. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质包括计算机程序,所述计算机程序运行时控制所述计算机可读存储介质所在电子设备执行权利要求1至7任一项的方法步骤。
PCT/CN2018/083953 2017-05-25 2018-04-20 页面数据加载方法、装置、电子设备及计算机可读存储介质 WO2018214684A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201710380878.6A CN108932259A (zh) 2017-05-25 2017-05-25 页面数据加载方法和装置
CN201710380878.6 2017-05-25

Publications (1)

Publication Number Publication Date
WO2018214684A1 true WO2018214684A1 (zh) 2018-11-29

Family

ID=64395289

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/083953 WO2018214684A1 (zh) 2017-05-25 2018-04-20 页面数据加载方法、装置、电子设备及计算机可读存储介质

Country Status (2)

Country Link
CN (1) CN108932259A (zh)
WO (1) WO2018214684A1 (zh)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110244993A (zh) * 2018-12-25 2019-09-17 蔚来汽车有限公司 前端页面加载方法、装置、控制器及介质
CN113095894A (zh) * 2021-06-10 2021-07-09 浙江口碑网络技术有限公司 资源位的展示方法、终端、服务器、电子设备及存储介质

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103677538A (zh) * 2012-09-07 2014-03-26 腾讯科技(深圳)有限公司 多窗口显示方法及装置
CN105354203A (zh) * 2014-08-21 2016-02-24 阿里巴巴集团控股有限公司 一种信息展示方法及装置
CN106610974A (zh) * 2015-10-21 2017-05-03 北京国双科技有限公司 网页照片墙的生成方法及装置

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103677538A (zh) * 2012-09-07 2014-03-26 腾讯科技(深圳)有限公司 多窗口显示方法及装置
CN105354203A (zh) * 2014-08-21 2016-02-24 阿里巴巴集团控股有限公司 一种信息展示方法及装置
CN106610974A (zh) * 2015-10-21 2017-05-03 北京国双科技有限公司 网页照片墙的生成方法及装置

Also Published As

Publication number Publication date
CN108932259A (zh) 2018-12-04

Similar Documents

Publication Publication Date Title
US10310850B2 (en) Methods and systems for determining relevant changes in an API
WO2017114116A1 (zh) 一种管理终端应用程序的功能图标的方法及装置、设备
CN107809740B (zh) Wi-Fi热点部署优化方法、服务器及存储介质
WO2018214684A1 (zh) 页面数据加载方法、装置、电子设备及计算机可读存储介质
CN109242801A (zh) 图像处理方法和装置
CN115150024B (zh) 数据处理方法、装置、设备和介质
CN107704253B (zh) 控件的文字颜色变换方法、系统及电子装置
US20160357419A1 (en) Determining suitable values of parameters controlling display characteristics of elements of interactive pages
KR20190017395A (ko) 자동 셀 병합 기능이 구비된 데이터 관리 서비스 제공 방법 및 이를 수행하는 서비스 제공 서버
CN109118370B (zh) 基于模型的产品构建方法、装置、计算机设备及存储介质
CN109634695B (zh) 一种sdk界面自动适配软件横竖屏的方法及装置
CN106682228B (zh) 一种可视化动态绘制机柜排列的方法和装置
CN115408297A (zh) 测试方法、装置、设备及介质
CN108363525B (zh) 一种响应网页中用户手势操作的方法、装置和终端设备
CN110557503B (zh) 屏幕显示方向切换处理方法、装置及终端设备
CN113130076A (zh) 一种视觉疲劳判断方法、系统、设备和存储介质
CN108829840B (zh) 一种电子围栏地图构建方法及装置
CN112804526A (zh) 图像数据存储方法、设备及存储介质、芯片、模组设备
CN111737372A (zh) 地图数据生成方法和装置
CN111104085A (zh) 显示屏适配方法、装置、计算机设备及存储介质
CN109033051A (zh) 一种数据导入方法、装置及计算机可读介质
CN108959542A (zh) 一种新型自定义网页生成方法及装置
US10545726B2 (en) Server device, calculation method and non-transitory recording medium recording program
CN113342337B (zh) 界面处理方法及装置、计算机可读存储介质和处理器
JP6055428B2 (ja) ソフトウェア品質基準計算装置及びソフトウェア品質基準計算方法

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 18806639

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 18806639

Country of ref document: EP

Kind code of ref document: A1