CN113760738A - Skeleton screen generation method and device, electronic equipment and computer storage medium - Google Patents
Skeleton screen generation method and device, electronic equipment and computer storage medium Download PDFInfo
- Publication number
- CN113760738A CN113760738A CN202110215267.2A CN202110215267A CN113760738A CN 113760738 A CN113760738 A CN 113760738A CN 202110215267 A CN202110215267 A CN 202110215267A CN 113760738 A CN113760738 A CN 113760738A
- Authority
- CN
- China
- Prior art keywords
- skeleton screen
- generating
- html file
- browser page
- skeleton
- Prior art date
- Legal status (The legal status 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 status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 54
- 238000013515 script Methods 0.000 claims abstract description 29
- 238000012360 testing method Methods 0.000 claims abstract description 23
- 230000003068 static effect Effects 0.000 claims description 69
- 238000012545 processing Methods 0.000 claims description 31
- 238000012544 monitoring process Methods 0.000 claims description 12
- 238000004806 packaging method and process Methods 0.000 claims description 11
- 238000004590 computer program Methods 0.000 claims description 10
- 239000000243 solution Substances 0.000 description 16
- 230000006870 function Effects 0.000 description 7
- 238000011161 development Methods 0.000 description 6
- 238000012423 maintenance Methods 0.000 description 5
- BUGBHKTXTAQXES-UHFFFAOYSA-N Selenium Chemical compound [Se] BUGBHKTXTAQXES-UHFFFAOYSA-N 0.000 description 4
- 229910052711 selenium Inorganic materials 0.000 description 4
- 239000011669 selenium Substances 0.000 description 4
- KLDZYURQCUYZBL-UHFFFAOYSA-N 2-[3-[(2-hydroxyphenyl)methylideneamino]propyliminomethyl]phenol Chemical compound OC1=CC=CC=C1C=NCCCN=CC1=CC=CC=C1O KLDZYURQCUYZBL-UHFFFAOYSA-N 0.000 description 3
- 201000001098 delayed sleep phase syndrome Diseases 0.000 description 3
- 208000033921 delayed sleep phase type circadian rhythm sleep disease Diseases 0.000 description 3
- 238000010586 diagram Methods 0.000 description 3
- 238000005516 engineering process Methods 0.000 description 3
- 230000009286 beneficial effect Effects 0.000 description 2
- 230000008901 benefit Effects 0.000 description 2
- 239000000203 mixture Substances 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 230000008569 process Effects 0.000 description 2
- VYZAMTAEIAYCRO-UHFFFAOYSA-N Chromium Chemical compound [Cr] VYZAMTAEIAYCRO-UHFFFAOYSA-N 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 239000003086 colorant Substances 0.000 description 1
- 238000004891 communication Methods 0.000 description 1
- 230000008878 coupling Effects 0.000 description 1
- 238000010168 coupling process Methods 0.000 description 1
- 238000005859 coupling reaction Methods 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000002347 injection Methods 0.000 description 1
- 239000007924 injection Substances 0.000 description 1
- 238000005457 optimization Methods 0.000 description 1
- 238000012546 transfer Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/95—Retrieval from the web
- G06F16/958—Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
- G06F16/986—Document structures and storage, e.g. HTML extensions
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Prevention of errors by analysis, debugging or testing of software
- G06F11/3668—Testing of software
- G06F11/3672—Test management
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/445—Program loading or initiating
- G06F9/44521—Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
- G06F9/44526—Plug-ins; Add-ons
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Software Systems (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Databases & Information Systems (AREA)
- Data Mining & Analysis (AREA)
- Computer Hardware Design (AREA)
- Quality & Reliability (AREA)
- Information Transfer Between Computers (AREA)
- Debugging And Monitoring (AREA)
Abstract
Description
技术领域technical field
本发明涉及计算机技术领域,涉及但不限于一种骨架屏(Skeleton Screen)生成方法、装置、电子设备和计算机存储介质。The present invention relates to the field of computer technology, and relates to, but is not limited to, a method, device, electronic device and computer storage medium for generating a Skeleton Screen.
背景技术Background technique
近年来,网络(WEB)技术正在向各种工程化,大型化方向发展,诸如Vue、React等框架的功能越来越强大,WEB的功能越来越复杂,所以导致项目会越来越大,导致加载速度会越来越慢,这样就会导致一些用户体验的问题,比如页面出现之前会出现长时间的白屏问题等。In recent years, network (WEB) technology is developing in various engineering and large-scale directions. The functions of frameworks such as Vue and React are becoming more and more powerful, and the functions of WEB are becoming more and more complex, so the project will become larger and larger. As a result, the loading speed will become slower and slower, which will lead to some user experience problems, such as a long white screen problem before the page appears.
为了解决页面加载前白屏时间过长而产生的体验问题,骨架屏就是其中一种优化方案,骨架屏是在页面加载完成之前,给用户呈现一个和页面的结构相似的占位结构,给用户以页面快要加载好的感觉。骨架屏也称为加载占位图。它是在页面数据尚未加载完成时先给用户展示出页面的大致结构,进而等到数据请求返回后再显示页面的数据内容,从而替换骨架屏。然而,在相关技术中,生成骨架屏的方案的人力成本和时间成本较高。In order to solve the experience problem caused by the long white screen time before the page is loaded, the skeleton screen is one of the optimization solutions. It feels like the page is about to load. Skeleton screens are also known as loading placeholders. It shows the general structure of the page to the user when the page data has not been loaded, and then waits for the data request to return before displaying the data content of the page, thereby replacing the skeleton screen. However, in the related art, the solution of generating the skeleton screen has high labor cost and time cost.
发明内容SUMMARY OF THE INVENTION
本发明实施例期望提供骨架屏生成的技术方案,可以解决生成骨架屏的方案的人力成本和时间成本较高的问题。The embodiments of the present invention are expected to provide a technical solution for generating a skeleton screen, which can solve the problem of high labor cost and time cost of the solution for generating a skeleton screen.
本发明实施例提供了一种骨架屏生成方法,所述方法包括:An embodiment of the present invention provides a method for generating a skeleton screen, the method comprising:
在利用自动化测试工具访问浏览器页面时,将生成骨架屏的脚本注入到所述浏览器页面中;When using the automated testing tool to access the browser page, the script for generating the skeleton screen is injected into the browser page;
通过调用所述脚本执行以下步骤:获取所述浏览器页面对应的文档对象模型(Document Object Model,DOM)元素和所述骨架屏对应的层叠样式表(Cascading StyleSheets,CSS),根据所述DOM元素和所述CSS,得到骨架屏的超文本标记语言(Hyper TextMarkup Language,HTML)文件;By invoking the script, the following steps are performed: obtaining a Document Object Model (DOM) element corresponding to the browser page and a Cascading Style Sheet (CSS) corresponding to the skeleton screen, according to the DOM element and described CSS, obtain the hypertext markup language (Hyper TextMarkup Language, HTML) file of skeleton screen;
根据所述HTML文件,生成骨架屏。According to the HTML file, a skeleton screen is generated.
在一些实施例中,所述获取所述浏览器页面对应的DOM元素,包括:In some embodiments, the acquiring the DOM element corresponding to the browser page includes:
通过遍历所述浏览器页面获取用于生成骨架屏的DOM元素,将所述用于生成骨架屏的DOM元素作为所述浏览器页面对应的DOM元素。The DOM element used for generating the skeleton screen is acquired by traversing the browser page, and the DOM element used for generating the skeleton screen is used as the DOM element corresponding to the browser page.
在一些实施例中,所述根据所述DOM元素和所述CSS,得到骨架屏的HTML文件,包括:In some embodiments, the HTML file of the skeleton screen is obtained according to the DOM element and the CSS, including:
将所述CSS插入到所述HTML文件的头部(head)标签中,并将所述DOM元素插入到所述HTML文件的主体(body)标签中,以得到所述骨架屏的HTML文件。The CSS is inserted into the head tag of the HTML file, and the DOM element is inserted into the body tag of the HTML file, so as to obtain the HTML file of the skeleton screen.
在一些实施例中,所述方法还包括:In some embodiments, the method further includes:
监听用于访问HTML文件的静态资源服务器;在监听到所述静态资源服务器启动时,利用自动化测试工具访问浏览器页面;Monitor the static resource server for accessing the HTML file; when monitoring the startup of the static resource server, use an automated testing tool to access the browser page;
相应地,所述根据所述HTML文件,生成骨架屏,包括:在所述静态资源服务器访问所述HTML文件后,根据所述静态资源服务器访问得到的HTML文件生成所述骨架屏。Correspondingly, generating the skeleton screen according to the HTML file includes: after the static resource server accesses the HTML file, generating the skeleton screen according to the HTML file accessed by the static resource server.
在一些实施例中,所述监听用于访问HTML文件的静态资源服务器,包括:在得到用于表征骨架屏显示参数的插件后,监听用于访问HTML文件的静态资源服务器;In some embodiments, the monitoring of the static resource server for accessing the HTML file includes: after obtaining the plug-in for representing the display parameters of the skeleton screen, monitoring the static resource server for accessing the HTML file;
相应地,所述方法还包括:在所述静态资源服务器启动后,利用所述插件将所述骨架屏显示参数传入至所述静态资源服务器中;Correspondingly, the method further includes: after the static resource server is started, using the plug-in to transmit the skeleton screen display parameters to the static resource server;
所述根据所述静态资源服务器访问得到的HTML文件生成所述骨架屏,包括:根据所述静态资源服务器中的所述骨架屏显示参数以及所述静态资源服务器访问得到的HTML文件生成所述骨架屏。The generating the skeleton screen according to the HTML file accessed by the static resource server includes: generating the skeleton according to the display parameters of the skeleton screen in the static resource server and the HTML file accessed by the static resource server Screen.
在一些实施例中,所述插件为结合打包工具打包而成的自定义插件。In some embodiments, the plug-in is a custom plug-in packaged with a packaging tool.
本发明实施例还提供了一种骨架屏生成装置,所述装置包括:An embodiment of the present invention also provides a device for generating a skeleton screen, the device comprising:
第一处理模块,用于在利用自动化测试工具访问浏览器页面时,将生成骨架屏的脚本注入到所述浏览器页面中;The first processing module is used to inject the script for generating the skeleton screen into the browser page when the automated test tool is used to access the browser page;
第二处理模块,用于通过调用所述脚本执行以下步骤:获取所述浏览器页面对应的DOM元素和所述骨架屏对应的CSS,根据所述DOM元素和所述CSS,得到骨架屏的HTML文件;The second processing module is configured to perform the following steps by invoking the script: acquiring the DOM element corresponding to the browser page and the CSS corresponding to the skeleton screen, and obtaining the HTML of the skeleton screen according to the DOM element and the CSS document;
生成模块,用于根据所述HTML文件,生成骨架屏。A generating module is used for generating a skeleton screen according to the HTML file.
在一些实施例中,所述第二处理模块,用于获取所述浏览器页面对应的DOM元素,包括:In some embodiments, the second processing module, configured to obtain the DOM element corresponding to the browser page, includes:
通过遍历所述浏览器页面获取用于生成骨架屏的DOM元素,将所述用于生成骨架屏的DOM元素作为所述浏览器页面对应的DOM元素。The DOM element used for generating the skeleton screen is acquired by traversing the browser page, and the DOM element used for generating the skeleton screen is used as the DOM element corresponding to the browser page.
在一些实施例中,所述第二处理模块,用于根据所述DOM元素和所述CSS,得到骨架屏的HTML文件,包括:In some embodiments, the second processing module is configured to obtain the HTML file of the skeleton screen according to the DOM element and the CSS, including:
将所述CSS插入到所述HTML文件的head标签中,并将所述DOM元素插入到所述HTML文件的body标签中,以得到所述骨架屏的HTML文件。Insert the CSS into the head tag of the HTML file, and insert the DOM element into the body tag of the HTML file, so as to obtain the HTML file of the skeleton screen.
在一些实施例中,所述第一处理模块,还用于监听用于访问HTML文件的静态资源服务器;在监听到所述静态资源服务器启动时,利用自动化测试工具访问浏览器页面;In some embodiments, the first processing module is further configured to monitor a static resource server for accessing HTML files; when monitoring the startup of the static resource server, use an automated testing tool to access a browser page;
相应地,所述生成模块,用于根据所述HTML文件,生成骨架屏,包括:在所述静态资源服务器访问所述HTML文件后,根据所述静态资源服务器访问得到的HTML文件生成所述骨架屏。Correspondingly, the generating module, configured to generate the skeleton screen according to the HTML file, includes: after the static resource server accesses the HTML file, generating the skeleton according to the HTML file accessed by the static resource server Screen.
在一些实施例中,所述第一处理模块,用于监听用于访问HTML文件的静态资源服务器,包括:在得到用于表征骨架屏显示参数的插件后,监听用于访问HTML文件的静态资源服务器;In some embodiments, the first processing module, configured to monitor the static resource server for accessing the HTML file, includes: after obtaining the plug-in for representing the display parameters of the skeleton screen, monitoring the static resource for accessing the HTML file server;
相应地,所述第一处理模块,还用于在所述静态资源服务器启动后,利用所述插件将所述骨架屏显示参数传入至所述静态资源服务器中;Correspondingly, the first processing module is further configured to use the plug-in to transmit the skeleton screen display parameters to the static resource server after the static resource server is started;
所述生成模块,用于根据所述静态资源服务器访问得到的HTML文件生成所述骨架屏,包括:根据所述静态资源服务器中的所述骨架屏显示参数以及所述静态资源服务器访问得到的HTML文件生成所述骨架屏。The generating module is used to generate the skeleton screen according to the HTML file accessed by the static resource server, including: according to the skeleton screen display parameters in the static resource server and the HTML obtained by accessing the static resource server file to generate the skeleton screen.
在一些实施例中,所述插件为结合打包工具打包而成的自定义插件。In some embodiments, the plug-in is a custom plug-in packaged with a packaging tool.
本发明实施例还提供了一种电子设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述程序时实现上述任意一种骨架屏生成方法。An embodiment of the present invention further provides an electronic device, including a memory, a processor, and a computer program stored in the memory and running on the processor, where the processor implements any one of the above-mentioned skeleton screen generation when executing the program method.
本发明实施例还提供了一种计算机存储介质,其上存储有计算机程序,该计算机程序被处理器执行时实现上述任意一种骨架屏生成方法。Embodiments of the present invention also provide a computer storage medium, on which a computer program is stored, and when the computer program is executed by a processor, any one of the above-mentioned methods for generating a skeleton screen is implemented.
本发明实施例提出的骨架屏生成方法、装置、电子设备和计算机存储介质中,在利用自动化测试工具访问浏览器页面时,将生成骨架屏的脚本注入到所述浏览器页面中;通过调用所述脚本执行以下步骤:获取所述浏览器页面对应的DOM元素和所述骨架屏对应的CSS,根据所述DOM元素和所述CSS,得到骨架屏的HTML文件;根据所述HTML文件,生成骨架屏。In the method, device, electronic device, and computer storage medium for generating a skeleton screen proposed in the embodiments of the present invention, when an automated testing tool is used to access a browser page, a script for generating a skeleton screen is injected into the browser page; The script performs the following steps: obtaining the DOM element corresponding to the browser page and the CSS corresponding to the skeleton screen, obtaining the HTML file of the skeleton screen according to the DOM element and the CSS; generating the skeleton according to the HTML file Screen.
可以看出,在本发明实施例中,可以在利用自动化测试工具访问浏览器页面时,利用脚本执行生成骨架屏的HTML文件的流程,即,通过脚本的执行,有利于自动化地生成骨架屏,有利于节省生成骨架屏所耗费的人力成本和时间成本。It can be seen that, in this embodiment of the present invention, when an automated testing tool is used to access a browser page, a script can be used to execute the process of generating the HTML file of the skeleton screen, that is, the execution of the script is conducive to the automatic generation of the skeleton screen, It is beneficial to save the labor cost and time cost for generating the skeleton screen.
应当理解的是,以上的一般描述和后文的细节描述仅是示例性和解释性的,而非限制本发明。It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the invention.
附图说明Description of drawings
此处的附图被并入说明书中并构成本说明书的一部分,这些附图示出了符合本发明的实施例,并与说明书一起用于说明本发明的技术方案。The accompanying drawings, which are incorporated into and constitute a part of this specification, illustrate embodiments consistent with the present invention, and together with the description, serve to explain the technical solutions of the present invention.
图1为本发明实施例的骨架屏生成方法的一个流程图;1 is a flowchart of a method for generating a skeleton screen according to an embodiment of the present invention;
图2为本发明实施例的骨架屏生成方法的另一个流程图;2 is another flowchart of a method for generating a skeleton screen according to an embodiment of the present invention;
图3为本发明实施例的骨架屏生成装置的组成结构示意图;FIG. 3 is a schematic diagram of a composition structure of a skeleton screen generation device according to an embodiment of the present invention;
图4为本发明实施例的电子设备的结构示意图。FIG. 4 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
具体实施方式Detailed ways
以下结合附图及实施例,对本发明进行进一步详细说明。应当理解,此处所提供的实施例仅仅用以解释本发明,并不用于限定本发明。另外,以下所提供的实施例是用于实施本发明的部分实施例,而非提供实施本发明的全部实施例,在不冲突的情况下,本发明实施例记载的技术方案可以任意组合的方式实施。The present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the embodiments provided herein are only used to explain the present invention, and are not intended to limit the present invention. In addition, the embodiments provided below are part of the embodiments for implementing the present invention, rather than providing all the embodiments for implementing the present invention. In the case of no conflict, the technical solutions described in the embodiments of the present invention can be combined arbitrarily. implement.
需要说明的是,在本发明实施例中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的方法或者装置不仅包括所明确记载的要素,而且还包括没有明确列出的其他要素,或者是还包括为实施方法或者装置所固有的要素。在没有更多限制的情况下,由语句“包括一个......”限定的要素,并不排除在包括该要素的方法或者装置中还存在另外的相关要素(例如方法中的步骤或者装置中的单元,例如的单元可以是部分电路、部分处理器、部分程序或软件等等)。It should be noted that, in the embodiments of the present invention, the terms "comprising", "comprising" or any other variations thereof are intended to cover non-exclusive inclusion, so that a method or device including a series of elements not only includes the explicitly stated elements, but also other elements not expressly listed or inherent to the implementation of the method or apparatus. Without further limitation, an element defined by the phrase "comprises a..." does not preclude the presence of additional related elements (eg, steps in a method or a device) in which the element is included. A unit in an apparatus, for example, a unit may be part of a circuit, part of a processor, part of a program or software, etc.).
例如,本发明实施例提供的骨架屏生成方法包含了一系列的步骤,但是本发明实施例提供的骨架屏生成方法不限于所记载的步骤,同样地,本发明实施例提供的骨架屏生成装置包括了一系列模块,但是本发明实施例提供的骨架屏生成装置不限于包括所明确记载的模块,还可以包括为获取相关信息、或基于信息进行处理时所需要设置的模块。For example, the method for generating a skeleton screen provided by the embodiment of the present invention includes a series of steps, but the method for generating a skeleton screen provided by the embodiment of the present invention is not limited to the described steps. Similarly, the device for generating a skeleton screen provided by the embodiment of the present invention A series of modules are included, but the apparatus for generating a skeleton screen provided by the embodiment of the present invention is not limited to including the modules explicitly described, and may also include modules that need to be set for obtaining relevant information or processing based on the information.
本文中术语“和/或”,仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,C和/或D,可以表示:单独存在C,同时存在C和D,单独存在D这三种情况。另外,本文中术语“至少一种”表示多种中的任意一种或多种中的至少两种的任意组合。The term "and/or" in this article is only an association relationship to describe associated objects, indicating that there can be three kinds of relationships, for example, C and/or D, which can mean: C alone exists, C and D exist simultaneously, and C and D exist alone D these three cases. Additionally, the term "at least one" herein refers to any one of a plurality or any combination of at least two of a plurality.
在相关技术中,生成骨架屏的方案主要有两种,第一种方案:完全设计一套跟页面一样结构的骨架屏,通过手写实现HTML文件和CSS,实现一套高度呈现页面结构的骨架屏结构;第二种方案:就是通过DOM伪元素实现骨架样式,通过操作样式实现骨架和页面的动态切换。In the related art, there are mainly two schemes for generating a skeleton screen. The first scheme is to completely design a set of skeleton screens with the same structure as a page, implement HTML files and CSS by handwriting, and realize a set of skeleton screens that highly present the page structure. Structure; the second solution: the skeleton style is implemented through DOM pseudo-elements, and the dynamic switching between the skeleton and the page is realized by manipulating the style.
第一种方案的优点在于:还原程度高,用户体验好,但是缺点是灵活性比较差,当页面的样式或者布局发生变化时,同时也需要修改骨架屏的样式和布局,导致重复的机械劳动工作而且后期改动维护成本比较大。The advantages of the first solution are: high degree of restoration and good user experience, but the disadvantage is that the flexibility is relatively poor. When the style or layout of the page changes, it is also necessary to modify the style and layout of the skeleton screen, resulting in repeated mechanical labor. Work and later changes and maintenance costs are relatively large.
第二种方案的优点在于:开发简单,定制程度高,不臃肿;缺点是:自动化程度低,需要较高的协同要求。The advantage of the second scheme is that it is simple to develop, has a high degree of customization, and is not bloated; the disadvantage is that it has a low degree of automation and requires higher coordination requirements.
另外,在相关技术中生成骨架屏的方案多数依附于Vue或者React等前端框架,即,与Vue或者React等前端框架的耦合程度比较高,通用性比较低。In addition, most schemes for generating skeleton screens in the related art depend on front-end frameworks such as Vue or React, that is, the degree of coupling with front-end frameworks such as Vue or React is relatively high, and the versatility is relatively low.
针对上述技术问题,本发明实施例提出了一种骨架屏生成方法、装置、电子设备和计算机存储介质。本发明实施例可以基于终端和/或服务器实现,终端可以是瘦客户机、厚客户机、手持或膝上设备、基于微处理器的系统、机顶盒、可编程消费电子产品、网络个人电脑、小型计算机系统,等等。服务器可以是小型计算机系统﹑大型计算机系统和包括上述任何系统的分布式云计算技术环境,等等。In view of the above technical problems, embodiments of the present invention provide a method, device, electronic device, and computer storage medium for generating a skeleton screen. Embodiments of the present invention may be implemented based on terminals and/or servers, which may be thin clients, thick clients, handheld or laptop devices, microprocessor-based systems, set-top boxes, programmable consumer electronics, network personal computers, small computer systems, etc. The server can be a small computer system, a large computer system, a distributed cloud computing technology environment including any of the above, and the like.
服务器等电子设备可以在由计算机系统执行的计算机系统可执行指令(诸如程序模块)的一般语境下描述。通常,程序模块可以包括例程、程序、目标程序、组件、逻辑、数据结构等等,它们执行特定的任务或者实现特定的抽象数据类型。计算机系统/服务器可以在分布式云计算环境中实施,分布式云计算环境中,任务是由通过通信网络链接的远程处理设备执行的。在分布式云计算环境中,程序模块可以位于包括存储设备的本地或远程计算系统存储介质上。Electronic devices, such as servers, may be described in the general context of computer system-executable instructions, such as program modules, being executed by a computer system. Generally, program modules may include routines, programs, object programs, components, logic, data structures, etc. that perform particular tasks or implement particular abstract data types. Computer systems/servers may be implemented in distributed cloud computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed cloud computing environment, program modules may be located on local or remote computing system storage media including storage devices.
图1为本发明实施例的骨架屏生成方法的一个流程图,如图1所示,该流程可以包括:FIG. 1 is a flowchart of a method for generating a skeleton screen according to an embodiment of the present invention. As shown in FIG. 1 , the flowchart may include:
步骤101:在利用自动化测试工具访问浏览器页面时,将生成骨架屏的脚本注入到浏览器页面中。Step 101: When using the automated testing tool to access the browser page, inject the script for generating the skeleton screen into the browser page.
在一些实施例中,上述自动化测试工具可以是Puppeteer、Selenium或其它自动化测试工具。In some embodiments, the above-mentioned automated testing tool may be Puppeteer, Selenium or other automated testing tools.
Puppeteer是一个节点(Node)库,它使用了工具DevTools,提供了强大的应用程序编程接口(Application Programming Interface,API)来控制无头浏览器,也可以设置为控制完整的浏览器(非无头模式)。Puppeteer is a Node library that uses the tool DevTools to provide a powerful Application Programming Interface (API) to control headless browsers, or it can be set to control a full browser (non-headless) model).
Selenium属于Web应用程序的自动化测试工具,Selenium可以直接运行在浏览器中,Selenium的主要功能包括:测试与浏览器的兼容性、创建回归测试检验软件功能和用户需求。Selenium is an automated testing tool for web applications. Selenium can run directly in the browser. The main functions of Selenium include: testing compatibility with browsers, creating regression tests to verify software functions and user requirements.
在一些实施例中,浏览器页面可以是无头浏览器的页面或非无头模式的浏览器的页面,这里,无头浏览器是一种没有操作界面的浏览器,常用于网页自动化测试,利用其提供的API,可以自动执行操作指令。In some embodiments, the browser page may be a page of a headless browser or a page of a browser in non-headless mode. Here, a headless browser is a browser without an operation interface, which is often used for automated testing of web pages, Using the API it provides, operation instructions can be executed automatically.
在一些实施例中,生成骨架屏的脚本可以是js(javascript)脚本或其它类型的脚本;在一些实施例中,在生成骨架屏的脚本为js脚本时,可以利用page.addScriptTag方法将js脚本注入到浏览器页面。In some embodiments, the script for generating the skeleton screen may be a js (javascript) script or other types of scripts; in some embodiments, when the script for generating the skeleton screen is a js script, the page.addScriptTag method may be used to add the js script Injected into the browser page.
步骤102:通过调用脚本执行以下步骤:获取浏览器页面对应的DOM元素和骨架屏对应的CSS,根据DOM元素和CSS,得到骨架屏的HTML文件。Step 102: Execute the following steps by calling the script: obtain the DOM element corresponding to the browser page and the CSS corresponding to the skeleton screen, and obtain the HTML file of the skeleton screen according to the DOM element and the CSS.
本发明实施例中,DOM是处理可扩展置标语言的标准编程接口,是一种与平台和语言无关的API,它可以动态地访问程序和脚本,更新其内容、结构和文档的风格。DOM是一种基于树的API文档,它要求在处理过程中整个文档都表示在存储器中。In this embodiment of the present invention, the DOM is a standard programming interface for processing extensible markup languages, and is a platform- and language-independent API that can dynamically access programs and scripts to update their content, structure, and document style. The DOM is a tree-based API document that requires the entire document to be represented in memory during processing.
CSS是一种用来表现HTML或可扩展标记语言(Extensible Markup Language,XML)等文件样式的计算机语言,CSS不仅可以静态地修饰网页,还可以配合各种脚本语言动态地对网页各元素进行格式化。CSS能够对网页中元素位置的排版进行像素级精确控制,支持几乎所有的字体字号样式,拥有对网页对象和模型样式编辑的能力。CSS is a computer language used to express HTML or Extensible Markup Language (Extensible Markup Language, XML) and other file styles. CSS can not only statically modify web pages, but also dynamically format various elements of web pages with various scripting languages. change. CSS can perform pixel-level precise control over the layout of element positions in web pages, supports almost all font size styles, and has the ability to edit web page objects and model styles.
在一些实施例中,骨架屏对应的CSS可以是访问的浏览器页面的CSS。In some embodiments, the CSS corresponding to the skeleton screen may be the CSS of the accessed browser page.
在一些实施例中,可以通过遍历浏览器页面获取用于生成骨架屏的DOM元素,将用于生成骨架屏的DOM元素作为浏览器页面对应的DOM元素。In some embodiments, the DOM elements used for generating the skeleton screen may be obtained by traversing the browser page, and the DOM elements used for generating the skeleton screen may be used as DOM elements corresponding to the browser page.
示例性地,可以在浏览器页面中通过执行page.evaluate方法得到用于生成骨架屏的DOM元素,这里,page.evaluate方法会通过递归遍历获取浏览器页面中要用骨架替代的元素(即用于生成骨架屏的DOM元素),然后会给这些元素添加类名的方式进行样式覆盖,从而替换为骨架屏元素。Exemplarily, the DOM elements used to generate the skeleton screen can be obtained by executing the page.evaluate method in the browser page. Here, the page.evaluate method will recursively traverse to obtain the elements to be replaced by the skeleton in the browser page (that is, use DOM elements for generating skeleton screens), and then add class names to these elements for style coverage, thereby replacing them with skeleton screen elements.
可以看出,本发明实施例可以通过遍历浏览器页面,较为容易且全面地获取到浏览器页面对应的DOM元素。It can be seen that, in the embodiment of the present invention, the DOM elements corresponding to the browser page can be obtained relatively easily and comprehensively by traversing the browser page.
本发明实施例中,骨架屏的HTML文件为静态的HTML文件。In the embodiment of the present invention, the HTML file of the skeleton screen is a static HTML file.
在一些实施例中,可以将上述CSS插入到HTML文件的head标签中,并将DOM元素插入到HTML文件的body标签中,以得到所述骨架屏的HTML文件。In some embodiments, the above CSS may be inserted into the head tag of the HTML file, and DOM elements may be inserted into the body tag of the HTML file, so as to obtain the HTML file of the skeleton screen.
示例性地,可以将上述CSS通过style标签的方式插入到HTML文件的head标签中。Exemplarily, the above CSS can be inserted into the head tag of the HTML file by means of a style tag.
可以看出,本发明实施例可以通过向HTML文件的head标签和body标签中插入相应的信息,从而直接得到骨架屏的HTML文件,易于实现。It can be seen that the embodiment of the present invention can directly obtain the HTML file of the skeleton screen by inserting corresponding information into the head tag and the body tag of the HTML file, which is easy to implement.
步骤103:根据HTML文件,生成骨架屏。Step 103: Generate a skeleton screen according to the HTML file.
本发明实施例中,在获取到骨架屏的HTML文件后,可以在浏览器页面中加载完成之前,基于骨架屏的HTML文件在浏览器页面中呈现骨架屏。In the embodiment of the present invention, after the HTML file of the skeleton screen is acquired, the skeleton screen may be presented in the browser page based on the HTML file of the skeleton screen before the loading in the browser page is completed.
在实际应用中,步骤101至步骤103可以基于电子设备的处理器实现,上述处理器可以为特定用途集成电路(Application Specific Integrated Circuit,ASIC)、数字信号处理器(Digital Signal Processor,DSP)、数字信号处理装置(Digital SignalProcessing Device,DSPD)、可编程逻辑装置(Programmable Logic Device,PLD)、现场可编程门阵列(Field Programmable Gate Array,FPGA)、中央处理器(Central ProcessingUnit,CPU)、控制器、微控制器、微处理器中的至少一种。In practical applications, steps 101 to 103 may be implemented based on a processor of an electronic device, and the above-mentioned processor may be an application specific integrated circuit (ASIC), a digital signal processor (DSP), a digital Signal processing device (Digital Signal Processing Device, DSPD), Programmable Logic Device (Programmable Logic Device, PLD), Field Programmable Gate Array (Field Programmable Gate Array, FPGA), Central Processing Unit (Central Processing Unit, CPU), controller, At least one of a microcontroller and a microprocessor.
可以看出,在本发明实施例中,可以在利用自动化测试工具访问浏览器页面时,利用脚本执行生成骨架屏的HTML文件的流程,即,通过脚本的执行,有利于自动化地生成骨架屏,有利于节省生成骨架屏所耗费的人力成本和时间成本。It can be seen that, in this embodiment of the present invention, when an automated testing tool is used to access a browser page, a script can be used to execute the process of generating the HTML file of the skeleton screen, that is, the execution of the script is conducive to the automatic generation of the skeleton screen, It is beneficial to save the labor cost and time cost for generating the skeleton screen.
本发明实施例可以结合Puppeteer等自动化测试工具实现自动注入生成高质量的骨架屏,可以降低开发和后期维护骨架屏所带来的时间和人力成本,并且又能够生成能够媲美手写骨架屏的效果;与相关技术中的上述第一种方案相比,提高了骨架屏的开发效率,减少了一些无意义的机械劳动,例如,根据统计数据,本发明实施例的骨架屏生成方法与上述第一种方案相比可以节约约70%的工时;本发明实施例的骨架屏生成方法几乎不存在后期维护成本,与上述第一种方案相比,后期维护效率提升接近100%。The embodiment of the present invention can realize automatic injection to generate a high-quality skeleton screen in combination with automated testing tools such as Puppeteer, which can reduce the time and labor costs brought by the development and later maintenance of the skeleton screen, and can generate an effect comparable to the handwritten skeleton screen; Compared with the above-mentioned first solution in the related art, the development efficiency of the skeleton screen is improved, and some meaningless mechanical labor is reduced. Compared with the solution, about 70% of man-hours can be saved; the skeleton screen generation method of the embodiment of the present invention has almost no post-maintenance cost, and compared with the above-mentioned first solution, the post-maintenance efficiency is improved by nearly 100%.
进一步地,本发明实施例能够适用于h5(HTML5)和微信小程序等多端应用,不依附于单一的前端框架,提高了通用性,可以减少不同框架使用者的人力和时间等开发成本,便于维护和升级。Further, the embodiment of the present invention can be applied to multi-terminal applications such as h5 (HTML5) and WeChat applet, is not attached to a single front-end framework, improves versatility, can reduce development costs such as manpower and time for users of different frameworks, and is convenient Maintenance and upgrades.
在一些实施例中,还可以监听用于访问HTML文件的静态资源服务器;在监听到静态资源服务器启动时,利用自动化测试工具访问浏览器页面;In some embodiments, a static resource server for accessing HTML files can also be monitored; when the startup of the static resource server is monitored, an automated testing tool is used to access the browser page;
相应地,根据所述HTML文件,生成骨架屏的实现方式可以包括:在静态资源服务器访问HTML文件后,根据静态资源服务器访问得到的HTML文件生成骨架屏。Correspondingly, according to the HTML file, an implementation manner of generating the skeleton screen may include: after the static resource server accesses the HTML file, generating the skeleton screen according to the HTML file accessed by the static resource server.
本发明实施例中,静态资源服务器可以是执行本地node服务的服务器。In this embodiment of the present invention, the static resource server may be a server that executes a local node service.
可以看出,本发明实施例通过监听静态资源服务器,在静态资源服务器启动时,利用自动化测试工具实现浏览器页面的自动访问,进而,可以在静态资源服务器启动时,通过执行脚本自动化地生成骨架屏;即,在静态资源服务器启动时,可以自动化地生成骨架屏,提高了骨架屏生成方法的自动化程度。It can be seen that in the embodiment of the present invention, by monitoring the static resource server, when the static resource server is started, an automated test tool is used to realize automatic access to the browser page, and further, when the static resource server is started, the skeleton can be automatically generated by executing a script That is, when the static resource server is started, the skeleton screen can be automatically generated, which improves the automation degree of the method for generating the skeleton screen.
在一些实施例中,上述监听用于访问HTML文件的静态资源服务器的实现方式可以包括:在得到用于表征骨架屏显示参数的插件后,监听用于访问HTML文件的静态资源服务器。In some embodiments, the implementation manner of monitoring the static resource server for accessing the HTML file may include: after obtaining the plug-in for representing the display parameters of the skeleton screen, monitoring the static resource server for accessing the HTML file.
这里,骨架屏显示参数可以是骨架屏的元素的背景颜色或其它参数;用于表征骨架屏显示参数的插件可以是plugin插件。Here, the display parameters of the skeleton screen may be background colors or other parameters of elements of the skeleton screen; the plug-in used to represent the display parameters of the skeleton screen may be a plugin plug-in.
在一些实施例中,在静态资源服务器启动后,可以利用上述插件将骨架屏显示参数传入至静态资源服务器中;In some embodiments, after the static resource server is started, the above-mentioned plug-in can be used to transfer the display parameters of the skeleton screen to the static resource server;
相应地,据静态资源服务器访问得到的HTML文件生成所述骨架屏,可以包括:根据静态资源服务器中的骨架屏显示参数以及静态资源服务器访问得到的HTML文件生成骨架屏。Correspondingly, generating the skeleton screen according to the HTML file accessed by the static resource server may include: generating the skeleton screen according to the display parameters of the skeleton screen in the static resource server and the HTML file accessed by the static resource server.
可以看出,本发明实施例可以通过插件将骨架屏显示参数传入至静态资源服务器中,从而按照骨架屏显示参数显示骨架屏,由于骨架屏显示参数可以根据用户需求预先设置,因而,本发明实施例可以按照用户需求显示骨架屏。It can be seen that in this embodiment of the present invention, the skeleton screen display parameters can be transferred to the static resource server through a plug-in, so that the skeleton screen can be displayed according to the skeleton screen display parameters. Since the skeleton screen display parameters can be preset according to user requirements, the present invention The embodiment may display the skeleton screen according to user requirements.
在一些实施例中,上述插件为结合打包工具打包而成的自定义插件。In some embodiments, the above plug-in is a custom plug-in packaged in combination with a packaging tool.
示例性地,打包工具可以是Webpack、gulp、rollup等工具。Webpack的核心概念是一个javaScript的静态资源打包器,它的主要目标是将js文件打包在一起,打包后的文件用于在浏览器中使用,它也能胜任转换、打包等功能。Gulp是一个自动化构建工具,开发者可以使用它在项目开发过程中自动执行常见任务。rollup是一个JavaScript模块打包器,可以将小块代码编译成大块复杂的代Exemplarily, the packaging tool can be Webpack, gulp, rollup and other tools. The core concept of Webpack is a JavaScript static resource bundler. Its main goal is to bundle js files together. The bundled files are used in browsers. It is also capable of converting, packaging and other functions. Gulp is an automated build tool that developers can use to automate common tasks during project development. rollup is a JavaScript module bundler that compiles small blocks of code into large, complex code
本发明实施例可以通过结合打包工具自定义扩展插件的方式,达到生成骨架屏方案的工程化和可配置化,降低了实现难度和配置成本;本发明实施例可以在通过打包形成插件后,通过监听静态资源服务器,自动生成骨架屏,与上述第二种方案相比,提高了生成骨架屏的方案的自动化程度。The embodiment of the present invention can achieve the engineering and configurability of generating a skeleton screen scheme by combining a packaging tool to customize an extension plug-in, thereby reducing the implementation difficulty and configuration cost; the embodiment of the present invention can form a plug-in through packaging, Compared with the second solution above, the skeleton screen is automatically generated by monitoring the static resource server, which improves the automation degree of the solution for generating the skeleton screen.
下面通过附图对本发明实施例的骨架屏生成方法进行进一步说明。The method for generating a skeleton screen according to an embodiment of the present invention will be further described below with reference to the accompanying drawings.
图2为本发明实施例的骨架屏生成方法的另一个流程图,如图2所示,该流程可以包括:Fig. 2 is another flowchart of a method for generating a skeleton screen according to an embodiment of the present invention. As shown in Fig. 2, the flowchart may include:
步骤201:启动静态资源服务器。Step 201: Start the static resource server.
示例性地,为了更好地与实际应用开发项目或网页开发项目结合,本发明实施例中可以利用webpack在页面中打包自定义的plugin插件,监听页面打包完事件,例如,可以通过监听页面打包完成事件compiler.hooks.done.tap进行监听注册;在页面打包完成后,启动静态资源服务器;这里的静态资源服务器用于执行本地node服务。Exemplarily, in order to better integrate with an actual application development project or a web page development project, in this embodiment of the present invention, webpack can be used to package a custom plugin in the page, and the page packaging event can be monitored. For example, the page packaging event can be monitored. Complete the event compiler.hooks.done.tap to monitor and register; after the page is packaged, start the static resource server; the static resource server here is used to execute the local node service.
本发明实施例中,可以通过启动静态资源服务器来访问打包后的文件,此时,可以通过plugin将骨架屏显示参数传入到启动的node服务中。In the embodiment of the present invention, the packaged file can be accessed by starting the static resource server, and at this time, the skeleton screen display parameters can be passed into the started node service through the plugin.
步骤202:利用Puppeteer访问浏览器页面。Step 202: Use Puppeteer to access the browser page.
示例性地,在启动静态资源服务器后,可以通过Puppeteer启动一个chrome无头浏览器,并通过打开新的标签页来实现浏览器页面的访问;在一种实现方式中,还需要配置需要适配生成的骨架屏的大小,如此,在获取骨架屏的HTML文件后,可以根据HTML文件和配置的骨架屏的大小呈现骨架屏。Exemplarily, after starting the static resource server, a chrome headless browser can be started through Puppeteer, and the browser page can be accessed by opening a new tab; in one implementation, it is also necessary to configure and adapt The size of the generated skeleton screen. In this way, after acquiring the HTML file of the skeleton screen, the skeleton screen can be presented according to the HTML file and the size of the configured skeleton screen.
步骤203:将成骨架屏的脚本注入到浏览器页面中,以便于调用。Step 203: Inject the script of the skeleton screen into the browser page for easy invocation.
步骤204:遍历获取浏览器页面中要用骨架替代的元素,将这些元素替换为骨架屏元素。Step 204 : traverse and obtain the elements in the browser page to be replaced by the skeleton, and replace these elements with the skeleton screen elements.
步骤205:将骨架屏元素的DOM元素和骨架屏对应的CSS插入到HTML文件中,得到骨架屏的HTML文件。Step 205: Insert the DOM element of the skeleton screen element and the CSS corresponding to the skeleton screen into the HTML file to obtain the HTML file of the skeleton screen.
这里,骨架屏元素的DOM元素为上述浏览器页面对应的DOM元素。Here, the DOM element of the skeleton screen element is the DOM element corresponding to the above browser page.
步骤206:在浏览器页面中加载完成之前,基于骨架屏的HTML文件在浏览器页面中呈现骨架屏。Step 206: Before the loading in the browser page is completed, the skeleton screen is presented in the browser page based on the HTML file of the skeleton screen.
步骤203至步骤206的实现方式已经在前述实施例中作出说明,这里不再赘述。The implementation manners of
在前述实施例提出的骨架屏生成方法的基础上,本发明实施例还提出了一种骨架屏生成装置。On the basis of the method for generating a skeleton screen proposed in the foregoing embodiments, an embodiment of the present invention further provides a device for generating a skeleton screen.
图3为本发明实施例的骨架屏生成装置的组成结构示意图,如图3所示,该装置可以包括:FIG. 3 is a schematic diagram of the composition structure of a device for generating a skeleton screen according to an embodiment of the present invention. As shown in FIG. 3 , the device may include:
第一处理模块301,用于在利用自动化测试工具访问浏览器页面时,将生成骨架屏的脚本注入到所述浏览器页面中;The
第二处理模块302,用于通过调用所述脚本执行以下步骤:获取所述浏览器页面对应的DOM元素和所述骨架屏对应的CSS,根据所述DOM元素和所述CSS,得到骨架屏的HTML文件;The
生成模块303,用于根据所述HTML文件,生成骨架屏。The
在一些实施例中,所述第二处理模块302,用于获取所述浏览器页面对应的DOM元素,包括:In some embodiments, the
通过遍历所述浏览器页面获取用于生成骨架屏的DOM元素,将所述用于生成骨架屏的DOM元素作为所述浏览器页面对应的DOM元素。The DOM element used for generating the skeleton screen is acquired by traversing the browser page, and the DOM element used for generating the skeleton screen is used as the DOM element corresponding to the browser page.
在一些实施例中,所述第二处理模块302,用于根据所述DOM元素和所述CSS,得到骨架屏的HTML文件,包括:In some embodiments, the
将所述CSS插入到所述HTML文件的head标签中,并将所述DOM元素插入到所述HTML文件的body标签中,以得到所述骨架屏的HTML文件。Insert the CSS into the head tag of the HTML file, and insert the DOM element into the body tag of the HTML file, so as to obtain the HTML file of the skeleton screen.
在一些实施例中,所述第一处理模块301,还用于监听用于访问HTML文件的静态资源服务器;在监听到所述静态资源服务器启动时,利用自动化测试工具访问浏览器页面;In some embodiments, the
相应地,所述生成模块303,用于根据所述HTML文件,生成骨架屏,包括:在所述静态资源服务器访问所述HTML文件后,根据所述静态资源服务器访问得到的HTML文件生成所述骨架屏。Correspondingly, the
在一些实施例中,所述第一处理模块301,用于监听用于访问HTML文件的静态资源服务器,包括:在得到用于表征骨架屏显示参数的插件后,监听用于访问HTML文件的静态资源服务器;In some embodiments, the
相应地,所述第一处理模块301,还用于在所述静态资源服务器启动后,利用所述插件将所述骨架屏显示参数传入至所述静态资源服务器中;Correspondingly, the
所述生成模块303,用于根据所述静态资源服务器访问得到的HTML文件生成所述骨架屏,包括:根据所述静态资源服务器中的所述骨架屏显示参数以及所述静态资源服务器访问得到的HTML文件生成所述骨架屏。The
在一些实施例中,所述插件为结合打包工具打包而成的自定义插件。In some embodiments, the plug-in is a custom plug-in packaged with a packaging tool.
上述第一处理模块301、第二处理模块302和生成模块303均可由位于电子设备中的处理器实现,上述处理器为ASIC、DSP、DSPD、PLD、FPGA、CPU、控制器、微控制器、微处理器中的至少一种。The above-mentioned
另外,在本实施例中的各功能模块可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。In addition, each functional module in this embodiment may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit. The above-mentioned integrated units can be implemented in the form of hardware, or can be implemented in the form of software function modules.
所述集成的单元如果以软件功能模块的形式实现并非作为独立的产品进行销售或使用时,可以存储在一个计算机可读取存储介质中,基于这样的理解,本实施例的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)或processor(处理器)执行本实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(Read Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。If the integrated unit is implemented in the form of a software functional module and is not 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 this embodiment is essentially or The part that contributes to the prior art or the whole or part of the technical solution can be embodied in the form of a software product, the computer software product is stored in a storage medium, and includes several instructions for making a computer device (which can be It is a personal computer, a server, or a network device, etc.) or a processor (processor) that executes all or part of the steps of the method described in this embodiment. The aforementioned storage medium includes: U disk, removable hard disk, Read Only Memory (ROM), Random Access Memory (Random Access Memory, RAM), magnetic disk or optical disk and other media that can store program codes.
具体来讲,本实施例中的一种骨架屏生成方法对应的计算机程序指令可以被存储在光盘,硬盘,U盘等存储介质上,当存储介质中的与一种骨架屏生成方法对应的计算机程序指令被一电子设备读取或被执行时,实现前述实施例的任意一种骨架屏生成方法。Specifically, the computer program instructions corresponding to a method for generating a skeleton screen in this embodiment can be stored on a storage medium such as an optical disk, a hard disk, a U disk, etc. When the computer corresponding to a method for generating a skeleton screen in the storage medium When the program instructions are read or executed by an electronic device, any one of the skeleton screen generation methods in the foregoing embodiments is implemented.
基于前述实施例相同的技术构思,参见图4,其示出了本发明实施例提供的一种电子设备40,可以包括:存储器401、处理器402及存储在存储器401上并可在处理器402上运行的计算机程序;其中,Based on the same technical idea of the foregoing embodiments, see FIG. 4 , which shows an
存储器401,用于存储计算机程序和数据;
处理器402,用于执行所述存储器中存储的计算机程序,以实现前述实施例的任意一种骨架屏生成方法。The
在实际应用中,上述存储器401可以是易失性存储器(volatile memory),例如RAM;或者非易失性存储器(non-volatile memory),例如ROM,快闪存储器(flash memory),硬盘(Hard Disk Drive,HDD)或固态硬盘(Solid-State Drive,SSD);或者上述种类的存储器的组合,并向处理器402提供指令和数据。In practical applications, the above-mentioned
上述处理器402可以为ASIC、DSP、DSPD、PLD、FPGA、CPU、控制器、微控制器、微处理器中的至少一种。The above-mentioned
在一些实施例中,本发明实施例提供的装置具有的功能或包含的模块可以用于执行上文方法实施例描述的方法,其具体实现可以参照上文方法实施例的描述,为了简洁,这里不再赘述。In some embodiments, the functions or modules included in the apparatus provided in the embodiments of the present invention may be used to execute the methods described in the above method embodiments. For specific implementation, reference may be made to the above method embodiments. For brevity, here No longer.
上文对各个实施例的描述倾向于强调各个实施例之间的不同之处,其相同或相似之处可以互相参考,为了简洁,本文不再赘述The above description of the various embodiments tends to emphasize the differences between the various embodiments, and the similarities or similarities can be referred to each other. For the sake of brevity, details are not repeated herein.
本申请所提供的各方法实施例中所揭露的方法,在不冲突的情况下可以任意组合,得到新的方法实施例。The methods disclosed in each method embodiment provided in this application can be combined arbitrarily without conflict to obtain a new method embodiment.
本申请所提供的各产品实施例中所揭露的特征,在不冲突的情况下可以任意组合,得到新的产品实施例。The features disclosed in each product embodiment provided in this application can be combined arbitrarily without conflict to obtain a new product embodiment.
本申请所提供的各方法或设备实施例中所揭露的特征,在不冲突的情况下可以任意组合,得到新的方法实施例或设备实施例。The features disclosed in each method or device embodiment provided in this application can be combined arbitrarily without conflict to obtain a new method embodiment or device embodiment.
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端(可以是手机,计算机,服务器,空调器,或者网络设备等)执行本发明各个实施例所述的方法。From the description of the above embodiments, those skilled in the art can clearly understand that the method of 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 better implementation. Based on this understanding, the technical solutions of the present invention can be embodied in the form of software products in essence or the parts that make contributions to the prior art, and the computer software products are stored in a storage medium (such as ROM/RAM, magnetic disk, CD), including several instructions to make a terminal (which may be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) execute the methods described in the various embodiments of the present invention.
上面结合附图对本发明的实施例进行了描述,但是本发明并不局限于上述的具体实施方式,上述的具体实施方式仅仅是示意性的,而不是限制性的,本领域的普通技术人员在本发明的启示下,在不脱离本发明宗旨和权利要求所保护的范围情况下,还可做出很多形式,这些均属于本发明的保护之内。The embodiments of the present invention have been described above in conjunction with the accompanying drawings, but the present invention is not limited to the above-mentioned specific embodiments, which are merely illustrative rather than restrictive. Under the inspiration of the present invention, without departing from the scope of protection of the present invention and the claims, many forms can be made, which all belong to the protection of the present invention.
Claims (10)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110215267.2A CN113760738A (en) | 2021-02-25 | 2021-02-25 | Skeleton screen generation method and device, electronic equipment and computer storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110215267.2A CN113760738A (en) | 2021-02-25 | 2021-02-25 | Skeleton screen generation method and device, electronic equipment and computer storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN113760738A true CN113760738A (en) | 2021-12-07 |
Family
ID=78786686
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110215267.2A Pending CN113760738A (en) | 2021-02-25 | 2021-02-25 | Skeleton screen generation method and device, electronic equipment and computer storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113760738A (en) |
Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20030177175A1 (en) * | 2001-04-26 | 2003-09-18 | Worley Dale R. | Method and system for display of web pages |
CN103473347A (en) * | 2013-09-24 | 2013-12-25 | 北京大学 | Web page similarity-based browser rendering optimization method |
CN109298864A (en) * | 2018-08-23 | 2019-02-01 | 深圳点猫科技有限公司 | The method and electronic equipment of automation generation project skeleton screen under teaching platform |
CN110187913A (en) * | 2019-05-17 | 2019-08-30 | 北京百度网讯科技有限公司 | Publication, operation method and the device of small routine |
CN110275705A (en) * | 2019-06-19 | 2019-09-24 | 北京三快在线科技有限公司 | Generate method, apparatus, equipment and the storage medium for preloading page code |
CN111552473A (en) * | 2020-04-27 | 2020-08-18 | 腾讯科技(深圳)有限公司 | Application processing method, device and equipment |
CN111625234A (en) * | 2019-02-28 | 2020-09-04 | 北京京东尚科信息技术有限公司 | Page skeleton screen generation method, device, device and readable storage medium |
CN112307385A (en) * | 2020-10-22 | 2021-02-02 | 北京达佳互联信息技术有限公司 | Webpage data loading and processing method and device, electronic equipment and storage medium |
-
2021
- 2021-02-25 CN CN202110215267.2A patent/CN113760738A/en active Pending
Patent Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20030177175A1 (en) * | 2001-04-26 | 2003-09-18 | Worley Dale R. | Method and system for display of web pages |
CN103473347A (en) * | 2013-09-24 | 2013-12-25 | 北京大学 | Web page similarity-based browser rendering optimization method |
CN109298864A (en) * | 2018-08-23 | 2019-02-01 | 深圳点猫科技有限公司 | The method and electronic equipment of automation generation project skeleton screen under teaching platform |
CN111625234A (en) * | 2019-02-28 | 2020-09-04 | 北京京东尚科信息技术有限公司 | Page skeleton screen generation method, device, device and readable storage medium |
CN110187913A (en) * | 2019-05-17 | 2019-08-30 | 北京百度网讯科技有限公司 | Publication, operation method and the device of small routine |
CN110275705A (en) * | 2019-06-19 | 2019-09-24 | 北京三快在线科技有限公司 | Generate method, apparatus, equipment and the storage medium for preloading page code |
CN111552473A (en) * | 2020-04-27 | 2020-08-18 | 腾讯科技(深圳)有限公司 | Application processing method, device and equipment |
CN112307385A (en) * | 2020-10-22 | 2021-02-02 | 北京达佳互联信息技术有限公司 | Webpage data loading and processing method and device, electronic equipment and storage medium |
Non-Patent Citations (3)
Title |
---|
HONDA, S等: "A Collaborative Environment for User-initiated Development of Web Applications", FRONTIERS IN ARTIFICIAL INTELLIGENCE AND APPLICATIONS, 1 January 2007 (2007-01-01) * |
巩晓悦: "基于个性化推荐的在线学习系统研究与实现", 中国优秀硕士学位论文全文数据库, 15 September 2019 (2019-09-15) * |
王欢欢;吴毅坚;赵文耘;: "Web应用界面跨浏览器兼容性的自动检测方法", 计算机科学, no. 2, 15 November 2015 (2015-11-15) * |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US20110167332A1 (en) | System and Method for Generating Web Pages | |
US9286142B2 (en) | Methods and systems for supporting a rendering API using a runtime environment | |
CN104049991A (en) | Method and system for converting network applications into mobile applications | |
CN109445775B (en) | One-key active embedded code method, device and computer readable storage medium | |
CN112114890A (en) | Method, device and equipment for processing small program and storage medium | |
WO2019080796A1 (en) | Method, apparatus and device for separating foreground and background of web system, and storage medium | |
CN110727429B (en) | Front-end page generation method, device and equipment | |
CN114297700B (en) | Dynamic and static combined mobile application privacy protocol extraction method and related equipment | |
CN110059278A (en) | Web page configuration method, server and computer readable storage medium | |
CN111880789A (en) | Page rendering method, device, server and computer-readable storage medium | |
CN113778405A (en) | Cross-platform APP construction method, device, system and medium | |
CN110580174A (en) | Application component generation method, server and terminal | |
CN112882703A (en) | Online design method and device for user-defined chart plug-in | |
CN111736834A (en) | A DSL-based user interface generation method, device and storage medium | |
CN114116443A (en) | A page data transfer method, device, system and medium | |
CN111078217A (en) | Brain graph generation method, apparatus and computer-readable storage medium | |
CN112559026A (en) | API interface-based native capability expansion method, device and storage medium | |
CN107038117A (en) | It is a kind of based on the web automated testing methods that reference is defined between event handling function | |
CN111399836B (en) | Method and device for modifying page attribute | |
CN107918587A (en) | The adjustment method and system of a kind of application program | |
CN113760738A (en) | Skeleton screen generation method and device, electronic equipment and computer storage medium | |
CN107506299B (en) | Code analysis method and terminal equipment | |
CN107133046B (en) | Page construction method and device and electronic terminal | |
CN113010159B (en) | A script-based task processing method and device | |
US11843679B2 (en) | Automated dependency management based on page components |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |