Detailed Description
Example embodiments will now be described more fully with reference to the accompanying drawings. Example embodiments may, however, be embodied in many different forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.
Furthermore, the drawings are merely schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and thus their repetitive description will be omitted. Some of the block diagrams shown in the figures are functional entities and do not necessarily correspond to physically or logically separate entities. These functional entities may be implemented in the form of software, or in one or more hardware modules or integrated circuits, or in different networks and/or processor devices and/or microcontroller devices.
Fig. 1 shows a schematic diagram of an exemplary system architecture to which the skeletal screen generation method of the disclosed embodiments may be applied.
As shown in fig. 1, the system architecture may include a client 110, a server 120, and a headless browser 130.
The client 110 may be, but is not limited to, a smart phone, a tablet, a laptop, a desktop, a smart speaker, a wearable smart device, a virtual reality device, an augmented reality device, etc.
The server 120 may be an independent server, a server cluster or a distributed system formed by a plurality of servers, or a cloud server providing basic cloud computing services such as a cloud service, a cloud database, cloud computing, a cloud function, cloud storage, a web service, cloud communication, middleware service, a domain name service, a security service, a CDN (Content Delivery Network), a big data and artificial intelligence platform, and the like.
The headless browser 130 may be a browser without an operation interface, and the developer may control the headless browser to automatically perform various tasks, such as executing JS (JavaScript, a high-level scripting language belonging to a web) script, screen capturing, and the like, through programming.
In the embodiment of the present disclosure, the client 110 may establish a network transport protocol connection with the server 120, the server 120 may return an operation page to the client 110, the client 110 may display the operation page, the operation page may include an input frame of a configuration element of the skeleton screen and an input frame of a target website, and a user may input the configuration element of the skeleton screen through the input frame of the configuration element of the skeleton screen of the operation page of the client 110 and may input the target website through the input frame of the target website.
In the embodiment of the present disclosure, as shown in fig. 1, a client 110 may establish a network socket connection with a server 120, the client 110 may obtain a skeleton screen generation request, where the skeleton screen generation request may include a configuration element of a skeleton screen and a target website, and the client 110 may send the skeleton screen generation request to the server 120; the server 120 may receive the skeleton screen generation request, the server 120 may control to start the headless browser 130, and send the target website to the headless browser 130, the headless browser 130 may open the target website, render the target page of the target website, and the headless browser 130 may obtain the page element of the target page and the position information thereof; the browser 120 may insert a script for generating the skeleton screen into the headless browser 130 according to the configuration elements of the skeleton screen, and the headless browser 130 may execute the script according to the page elements of the target page and the position information thereof, generate the skeleton screen, and generate the associated information of the skeleton screen; headless browser 130 may return information associated with the skeleton screen to browser 120; the browser 120 may receive the associated information of the skeleton screen returned by the headless browser 130, and may return the associated information of the skeleton screen to the client 110; client 110 may receive the association information for the skeletal screen and may display the association information for the skeletal screen.
It should be understood that the number of terminal devices and servers in fig. 1 is merely illustrative, and that any number of terminal devices and servers may be provided, as desired.
It should be noted that the above application scenarios are merely illustrated for the convenience of understanding the spirit and principles of the present disclosure, and the embodiments of the present disclosure are not limited in this respect. Rather, embodiments of the present disclosure may be applied to any scenario where applicable.
Hereinafter, each step of the skeleton screen generation method in the exemplary embodiment of the present disclosure will be described in more detail with reference to the drawings and the embodiments.
FIG. 2 is a flow chart illustrating a method for generating a skeletal screen in accordance with an exemplary embodiment. The method provided by the embodiment of the present disclosure may be executed by a server as shown in fig. 1, but the present disclosure is not limited thereto.
As shown in fig. 2, a skeleton screen generation method provided by an embodiment of the present disclosure may include the following steps.
In step S202, a network socket connection is established with the client.
In the embodiment of the disclosure, the server may establish a web socket (WebSocket) connection with the client, so that the server may mainly push data to the client.
The WebSocket is a full duplex communication Protocol connection based on a TCP (Transmission Control Protocol).
The network socket connection can make data exchange between the client and the server simpler, and allow the server to actively push data to the client. The browser and the server only need to complete one handshake, and persistent connection can be directly established between the browser and the server, and bidirectional data transmission is carried out.
In the embodiment of the disclosure, a period of time is required for generating the skeleton screen, and after the server establishes network socket connection with the client, the server can actively send the relevant information of the skeleton screen to the client after the skeleton screen is generated.
In step S204, a skeleton screen generation request is received from the client, where the skeleton screen generation request carries the configuration elements of the skeleton screen and the target website.
The Skeleton Screen (skeletton Screen) may refer to a bitmap which shows a user a rough structure of a page before the page data is loaded.
In an exemplary embodiment, the configuration elements of the skeletal screen include preset colors and preset shapes.
Wherein the preset color may be gray, for example, and the preset shape may be a circle, a rectangle, a rounded rectangle, etc., for example, which is not limited by the present disclosure.
In the embodiment of the disclosure, the configuration elements and the target website of the skeleton screen can be input by a user through a client. The target page can be obtained by opening the target website, and the target page can be a page designed by a user.
In the embodiment of the disclosure, the client may generate a skeleton screen generation request according to the input configuration element of the skeleton screen and the target website, and the server may receive the skeleton screen generation request from the client.
In step S206, the headless browser is controlled to start, and the target website is sent to the headless browser, so that the headless browser opens the target website, renders the target page of the target website, and obtains the page elements and the location information of the target page.
In the embodiment of the present disclosure, the headless browser may be Puppeteer, where Puppeteer is a node. The server can start and render a page through an interface provided by Puppeneer, insert a custom script, capture a screenshot of the page and the like.
In the embodiment of the disclosure, the server may control to start the headless browser and send the target website to the headless browser, and after the headless browser receives the target website, the target website may be opened and a target page of the target website may be rendered.
In the embodiment of the disclosure, the headless browser can acquire the page elements and the position information thereof of the target page.
The page elements may include text elements, picture elements, and button elements, and the position information of the page elements may include horizontal and vertical coordinates of the page elements, for example, the horizontal and vertical coordinates of the text elements, the horizontal and vertical coordinates of the outlines of the picture elements, and the horizontal and vertical coordinates of the outlines of the button elements.
In step S208, a script for generating the skeleton screen is inserted into the headless browser according to the configuration elements of the skeleton screen, so that the headless browser is controlled to execute the script according to the page elements of the target page and the position information thereof, the skeleton screen is generated, and the associated information of the skeleton screen is generated.
In the embodiment of the disclosure, the server may insert the custom script according to an interface provided by the headless browser. The self-defined script can be a script for generating the skeleton screen, the headless browser can execute the script for generating the skeleton screen, the skeleton screen is generated according to the page elements of the target page and the position information of the page elements, and the associated information of the skeleton screen is generated.
In an exemplary embodiment, executing the script according to the page element of the target page and the position information thereof may include: and covering the page elements of the target page by using a color block with a preset shape and preset colors according to the position information of the page elements of the target page.
For example, the text elements, the picture elements, and the button elements may be overlaid with a gray rounded rectangle patch according to the horizontal and vertical coordinates of the text elements, the picture elements, and the button elements.
In an exemplary embodiment, the related information of the skeleton screen includes a page screenshot of the skeleton screen and a skeleton screen generation code of the target page, where the skeleton screen generation code is generated by the headless browser according to a preset shape of a preset color in the skeleton screen and a position where the preset shape is located.
In the embodiment of the disclosure, the headless browser can capture the page of the skeleton screen, obtain the page capture of the skeleton screen, and return the page capture of the skeleton screen to the server. The headless browser can generate skeleton screen generation codes according to preset shapes of preset colors in the skeleton screen and positions of the preset shapes, the skeleton screen generation codes are returned to the server, and the subsequent server can execute the skeleton screen generation codes to generate the skeleton screen.
In step S210, the associated information of the skeleton screen returned by the headless browser is received.
In the embodiment of the disclosure, the server may receive the associated information of the skeleton screen returned by the headless browser, and the server may close the headless browser after receiving the associated information of the skeleton screen returned by the headless browser.
In step S212, the associated information of the skeleton screen is returned to the client.
In the embodiment of the disclosure, the server may return the associated information of the skeleton screen to the client, the client may display the page screenshot of the skeleton screen and the skeleton screen generation code in the associated information of the skeleton screen after receiving the associated information of the skeleton screen returned by the server, and the user may copy the page screenshot of the skeleton screen and the skeleton screen generation code through the client.
According to the skeleton screen generation method provided by the embodiment of the disclosure, the network socket connection is established with the client, and the associated information of the skeleton screen can be actively returned to the client; according to the configuration element and the target website of the skeleton screen, the headless browser can be controlled to automatically open the target website, render the target page, acquire the page element and the position information of the target page, execute the script according to the page element and the position information of the target page, and automatically generate the associated information of the skeleton screen and the skeleton screen; according to the method, a designer does not need to design the skeleton screen picture, and a developer does not need to develop the skeleton screen page independently, so that a large amount of repetitive work is avoided, the skeleton screen can be generated quickly and automatically, and the generation efficiency of the skeleton screen is improved. In addition, the method has lower use threshold and lower requirement on technicians.
FIG. 3 is a flow chart illustrating another method of skeletal screen generation in accordance with an exemplary embodiment.
In the embodiment of the present disclosure, different from the skeleton screen generating method shown in fig. 2, the skeleton screen generating method shown in fig. 3 further provides how to execute a script according to the page element of the target page and the position information thereof to generate the skeleton screen, that is, an embodiment of the step S208 is provided.
In an exemplary embodiment, the page elements include text elements, picture elements, and button elements, and the configuration elements of the skeleton screen include a preset text color, a preset text shape, a preset picture color, a preset picture shape, a preset button color, a preset button shape, and a hidden element identifier.
In the disclosed embodiment, the page elements include, but are not limited to, text elements, picture elements, button elements, control elements, and floating window elements. The configuration elements of the skeleton screen can be set to have different colors and shapes for different page elements, for example, the color of the text element can be set to be gray, and the shape of the text element can be set to be rectangular; the color of the picture element can be set to be light gray, and the shape of the picture element is a rounded rectangle; the color of the button element may be set to red, the shape of the button element may be set to circular, and the color and shape of the control element and the floating window element may also be set, which is not limited by this disclosure.
In this embodiment of the disclosure, the configuration elements of the skeleton screen may further include hidden element identifiers, and the hidden element identifiers may be used to represent elements that need to be hidden, for example, the hidden element identifiers are button elements, and then when the skeleton screen is generated, the button elements in the target page may be hidden.
As shown in fig. 3, step S208 may include the following steps.
In step S302, the text elements of the target page are covered with a color block of a preset text shape of a preset text color according to the position information of the text elements of the target page.
For example, a gray rectangular color block may be placed at the position of the text elements of the target page, covering the text elements of the target page.
In step S304, the picture elements of the target page are covered with a color block of a preset picture shape of a preset picture color according to the position information of the picture elements of the target page.
For example, a light gray rounded rectangle color block may be placed at the position of the picture element of the target page, covering the picture element of the target page.
In step S306, the button elements of the target page are overlaid with the color patches of the preset button shapes of the preset button colors according to the position information of the button elements of the target page.
For example, a red circular patch may be placed at the position of the button element of the target page, covering the button element of the target page.
In step S308, the page element corresponding to the hidden element identifier in the target page is hidden according to the hidden element identifier.
For example, the hidden element identifier may be a button element, and the button element in the page element may be hidden.
In the embodiment of the disclosure, the corresponding page elements can be covered by the preset shapes of the preset colors according to the page elements and the position information thereof and the configuration elements of the skeleton screen, so that the skeleton screen corresponding to the page elements is automatically generated, and a user does not need to manually design the skeleton screen for each target page.
FIG. 4 is a flow chart illustrating another method of skeletal screen generation in accordance with an exemplary embodiment.
In this embodiment of the disclosure, in the skeleton screen generation method shown in fig. 2, before establishing a network socket connection with a client, the skeleton screen generation method shown in fig. 4 may further include the following steps.
In step S402, a network transport protocol connection is established with the client.
In the embodiment of the disclosure, the server may establish a network transport protocol connection with the client.
For example, the server may establish an HTTP (Hypertext Transfer Protocol) connection with the client. The HTTP is a network Transmission Protocol for transmitting data (HTML (HyperText Markup Language) files, picture files, query results, and the like) based on a TCP/IP (Transmission Control Protocol/Internet Protocol) communication Protocol.
In step S404, returning the operation page to the client so as to display the operation page at the client, where the operation page includes an input frame of the configuration element of the skeleton screen and an input frame of the target website, and the configuration element of the skeleton screen is input through the input frame of the configuration element of the skeleton screen and the target website is input through the input frame of the target website.
In the embodiment of the present disclosure, the server may return an operation page to the client, and the client may display the operation page.
FIG. 5 is a diagram illustrating an operations page in accordance with an exemplary embodiment.
As shown in fig. 5, the operation page may include input frames of configuration elements of the skeleton screen and input frames of the target website, for example, the input frames of the configuration elements of the skeleton screen may include, but are not limited to, a picture occupancy color value, a text occupancy color value, a hidden element id (Identity), a button occupancy color value, css (Cascading Style Sheets) units, a picture occupancy shape, and the like. The user can input the configuration elements of the skeleton screen through the configuration element input box of the skeleton screen, and can input the target website through the input box of the target website. Wherein, the picture occupying color value, the character occupying color value and the button occupying color value can be set to # EFEFEF (gray shade of extreme brightness), the hidden element id can be set to # banner (banner), the picture occupying shape can be set to a circle, the css unit can be set to rem (font size of the root element, unit relative to the font size of the root element); the target web address may be http:// XXX.
As shown in fig. 5, the operation page may further include a "generate page skeleton screen picture" button, the user may click the "generate page skeleton screen picture" button after inputting the configuration element and the target website of the skeleton screen, the client may generate a skeleton screen generation request, and send the skeleton screen generation request to the server, and the server may operate the headless browser to generate the associated information of the skeleton screen and the skeleton screen according to the skeleton screen generation request, and return the associated information of the skeleton screen to the client.
In the embodiment of the disclosure, a user can obtain the page screenshot of the skeleton screen and the generation code of the skeleton screen at any time and any place by operating the configuration elements and the target website of the skeleton screen input by the page.
FIG. 6 is a flow chart illustrating a method for generating a skeletal screen in accordance with an exemplary embodiment. The method provided by the embodiment of the present disclosure may be executed by a client as shown in fig. 1, but the present disclosure is not limited thereto.
As shown in fig. 6, a skeleton screen generation method provided by an embodiment of the present disclosure may include the following steps.
In step S602, a network socket connection is established with the server.
In the embodiment of the disclosure, the client may establish a network socket connection with the server.
In step S604, the configuration elements and the target website of the skeleton screen are acquired.
In the embodiment of the present disclosure, a user may input a configuration element and a target website of a skeleton screen through an operation page of a client, where the operation page of the client may be as shown in fig. 5. The client can acquire the configuration elements and the target website of the skeleton screen through the operation page.
In step S606, a skeleton screen generation request is generated according to the configuration elements of the skeleton screen and the target website.
In the embodiment of the disclosure, a user can click a button for generating a page skeleton screen picture of an operation page, and a client can respond to the action of clicking the button by the user and generate a skeleton screen generation request according to configuration elements and a target website of a skeleton screen.
In step S608, the skeleton screen generation request is sent to the server, so as to generate the skeleton screen according to the configuration elements of the skeleton screen and the target website, and generate the associated information of the skeleton screen.
In the embodiment of the disclosure, the client may send the skeleton screen generation request to the server, the skeleton screen generation request may carry the configuration elements and the target website of the skeleton screen, and the server may operate the headless browser to generate the skeleton screen according to the configuration elements and the target website of the skeleton screen, and may generate the associated information of the skeleton screen.
The related information of the skeleton screen may include a page screenshot of the skeleton screen and a skeleton screen generation code of the target page.
In step S610, the association information of the skeleton screen returned by the server is received.
In the embodiment of the disclosure, the client may receive the associated information of the skeleton screen returned by the server.
In an exemplary embodiment, the association information of the skeleton screen returned by the server can be received through a preset mailbox.
The preset mailbox can be a mailbox input by a user on an operation page of the client.
In step S612, the associated information of the skeleton screen is displayed.
In the embodiment of the disclosure, the client may display the associated information of the skeleton screen.
FIG. 7 is a schematic diagram illustrating a skeletal screen generation page in accordance with an exemplary embodiment.
The user inputs the configuration elements and the target website of the skeleton screen on the operation page shown in fig. 5, and may enter the skeleton screen generation page shown in fig. 7 after clicking the "generate page skeleton screen picture" button. As shown in fig. 7, a screenshot of the skeleton screen may be displayed on the left side, and a skeleton screen generation code of the target page may be displayed on the right side.
In an exemplary embodiment, the skeleton screen generating method shown in fig. 6 may further include: and receiving a request for copying the associated information of the skeleton screen.
The request for copying the skeleton screen associated information may include a request for copying a skeleton screen page screenshot, a request for copying a skeleton screen generation code, or a request for copying both the skeleton screen page screenshot and the skeleton screen generation code.
In an exemplary embodiment, the skeleton screen generating method shown in fig. 6 may further include: and copying the associated information of the skeleton screen according to the request for copying the associated information of the skeleton screen.
For example, the client may copy the page screenshot of the skeleton screen according to the request for copying the page screenshot of the skeleton screen, or the client may copy the code generated by the skeleton screen according to the request for copying the code generated by the skeleton screen, or the client may copy the page screenshot of the skeleton screen and the code generated by the skeleton screen simultaneously according to the request for copying the page screenshot of the skeleton screen and the code generated by the skeleton screen.
In the embodiment of the present disclosure, a user may click a "copy picture code" button in fig. 7, a client may copy a page screenshot of a skeleton screen and a skeleton screen generation code, and the user may copy the page screenshot of the skeleton screen and the skeleton screen generation code to a required place, for example, copy the skeleton screen generation code to a project code, and subsequently run the skeleton screen generation code in the project code, thereby automatically generating the skeleton screen.
It is noted that the above-mentioned figures are merely schematic illustrations of processes involved in methods according to exemplary embodiments of the present disclosure, and are not intended to be limiting. It will be readily understood that the processes shown in the above figures are not intended to indicate or limit the chronological order of the processes. In addition, it is also readily understood that these processes may be performed synchronously or asynchronously, e.g., in multiple modules.
The following are embodiments of the disclosed apparatus that may be used to perform embodiments of the disclosed methods. For details not disclosed in the embodiments of the apparatus of the present disclosure, refer to the embodiments of the method of the present disclosure.
FIG. 8 is a block diagram illustrating another skeletal screen generation apparatus in accordance with an exemplary embodiment.
As shown in fig. 8, the skeleton screen generating apparatus 800 may include: a first connection establishing module 802, a request receiving module 804, a target website sending module 806, a script inserting module 808 and an associated information receiving module 810.
The first connection establishing module 802 may be configured to establish a network socket connection with a client; the request receiving module 804 may be configured to receive a skeleton screen generation request from a client, where the skeleton screen generation request carries a configuration element of a skeleton screen and a target website; the target website sending module 806 may be configured to control to start the headless browser and send the target website to the headless browser, so that the headless browser opens the target website, renders a target page of the target website, and obtains page elements of the target page and location information thereof; the script insertion module 808 may be configured to insert a script for generating the skeleton screen into the headless browser according to the configuration elements of the skeleton screen, so as to control the headless browser to execute the script according to the page elements of the target page and the position information thereof, generate the skeleton screen, and generate the associated information of the skeleton screen; the associated information receiving module 810 may be configured to receive associated information of the skeleton screen returned by the headless browser; the association information returning module 812 may be configured to return association information of the skeletal screen to the client.
In an exemplary embodiment, the configuration elements of the skeletal screen include preset colors and preset shapes, wherein the script insertion module 808 may include: the element covering unit may be configured to cover the page elements of the target page with a color patch of a preset shape of a preset color according to the position information of the page elements of the target page.
In an exemplary embodiment, the related information of the skeleton screen includes a page screenshot of the skeleton screen and a skeleton screen generation code of the target page, where the skeleton screen generation code is generated by the headless browser according to a preset shape of a preset color in the skeleton screen and a position where the preset shape is located.
In an exemplary embodiment, the page elements include text elements, picture elements, and button elements, and the configuration elements of the skeleton screen include a preset text color, a preset text shape, a preset picture color, a preset picture shape, a preset button color, a preset button shape, and a hidden element identifier; the script insertion module 808 may include: the first covering unit can be used for covering the character elements of the target page by using the color blocks of the preset character shapes of the preset character colors according to the position information of the character elements of the target page; the second covering unit can be used for covering the picture elements of the target page by using color blocks with preset picture shapes of preset picture colors according to the position information of the picture elements of the target page; a third covering unit, configured to cover the button elements of the target page with a color patch of a preset button shape of a preset button color according to the position information of the button elements of the target page; and the element hiding unit can be used for hiding the page elements corresponding to the hidden element identifiers in the target page according to the hidden element identifiers.
In an exemplary embodiment, the apparatus 800 may further include: the third connection establishing module can be used for establishing network transmission protocol connection with the client; the operation page returning module can be used for returning the operation page to the client so as to display the operation page at the client, wherein the operation page comprises an input frame of the configuration elements of the skeleton screen and an input frame of the target website, the configuration elements of the skeleton screen are input through the input frame of the configuration elements of the skeleton screen, and the target website is input through the input frame of the target website.
FIG. 9 is a block diagram illustrating another skeletal screen generation apparatus in accordance with an exemplary embodiment.
As shown in fig. 9, the skeleton screen generating apparatus 900 may include: a second connection establishing module 902, an element obtaining module 904, a request generating module 906, a request sending module 908, an association information receiving module 910, and an association information presenting module 912.
The second connection establishing module 902 may be configured to establish a network socket connection with the server; the element obtaining module 904 may be configured to obtain a configuration element and a target website of the skeleton screen; the request generation module 906 may be configured to generate a skeleton screen generation request according to the configuration element of the skeleton screen and the target website; the request sending module 908 may be configured to send a skeleton screen generation request to a server, so as to generate a skeleton screen according to the configuration elements of the skeleton screen and the target website, and generate associated information of the skeleton screen; the association information receiving module 910 may be configured to receive association information of the skeleton screen returned by the server; the associated information presentation module 912 can be used to display associated information of the skeletal screen.
In an exemplary embodiment, the association information receiving module 910 may include: and the associated information receiving unit can be used for receiving the associated information of the skeleton screen returned by the server through a preset mailbox.
In an exemplary embodiment, the apparatus 900 may further include: the copying request receiving module can be used for receiving a request for copying the associated information of the skeleton screen; and the information copying module can be used for copying the associated information of the skeleton screen according to the request for copying the associated information of the skeleton screen.
It is noted that the block diagrams shown in the above figures are functional entities and do not necessarily correspond to physically or logically separate entities. These functional entities may be implemented in the form of software, or in one or more hardware modules or integrated circuits, or in different networks and/or processor devices and/or microcontroller devices.
Fig. 10 is a schematic diagram illustrating a structure of an electronic device according to an example embodiment. It should be noted that the electronic device shown in fig. 10 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiment of the present invention.
As shown in fig. 10, the electronic apparatus 1000 includes a Central Processing Unit (CPU)1001 that can perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)1002 or a program loaded from a storage section 1008 into a Random Access Memory (RAM) 1003. In the RAM 1003, various programs and data necessary for the operation of the system 1000 are also stored. The CPU 1001, ROM 1002, and RAM 1003 are connected to each other via a bus 1004. An input/output (I/O) interface 1005 is also connected to bus 1004.
The following components are connected to the I/O interface 1005: an input section 1006 including a keyboard, a mouse, and the like; an output section 1007 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage portion 1008 including a hard disk and the like; and a communication section 1009 including a network interface card such as a LAN card, a modem, or the like. The communication section 1009 performs communication processing via a network such as the internet. The driver 1010 is also connected to the I/O interface 1005 as necessary. A removable medium 1010 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 1010 as necessary, so that a computer program read out therefrom is mounted into the storage section 1008 as necessary.
In particular, according to an embodiment of the present invention, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the invention include a computer program product comprising a computer program embodied on a computer-readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication part 1009 and/or installed from the removable medium 1011. The computer program executes the above-described functions defined in the system of the present invention when executed by the Central Processing Unit (CPU) 1001.
It should be noted that the computer readable medium shown in the present invention can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present invention, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present invention, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present invention may be implemented by software or hardware. The described units may also be provided in a processor, and may be described as: a processor includes a transmitting unit, an obtaining unit, a determining unit, and a first processing unit. The names of these units do not in some cases constitute a limitation to the unit itself, and for example, the sending unit may also be described as a "unit sending a picture acquisition request to a connected server".
As another aspect, the present invention also provides a computer-readable medium that may be contained in the apparatus described in the above embodiments; or may be separate and not incorporated into the device. The computer readable medium carries one or more programs which, when executed by a device, cause the device to comprise: establishing a network socket connection with a client; receiving a skeleton screen generation request from a client, wherein the skeleton screen generation request carries a configuration element and a target website of a skeleton screen; controlling to start a headless browser, sending a target website to the headless browser, so that the headless browser opens the target website, renders a target page of the target website, and acquires page elements and position information of the target page; inserting a script for generating the skeleton screen into the headless browser according to the configuration elements of the skeleton screen so as to control the headless browser to execute the script according to the page elements and the position information of the target page, generate the skeleton screen and generate the associated information of the skeleton screen; receiving the related information of the skeleton screen returned by the headless browser; and returning the associated information of the skeleton screen to the client.
Exemplary embodiments of the present invention are specifically illustrated and described above. It is to be understood that the invention is not limited to the precise construction, arrangements, or instrumentalities described herein; on the contrary, the invention is intended to cover various modifications and equivalent arrangements included within the spirit and scope of the appended claims.