Method, device and electronic device for processing application page
By automatically intercepting and splicing images on the application page, and using the scrolling distance of fixed elements to calculate position information, it solves the problem of long image page compatibility and low efficiency of manual screenshots in the existing technology, and achieves efficient page preview processing.
Patent Information
- Application Number
- CN202011186007.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-10-30
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2040-10-30
AI Technical Summary
The existing technology has compatibility issues when processing application pages, especially long image pages, resulting in deviations between the page design and the actual display style, and the manual screenshot generation preview is inefficient and the operation is cumbersome.
By providing long image page information to the client, generate and display a page with a fixed area and a scrolling area, intercept the page image and configure the position information, obtain the scrolling distance after the page scroll event, automatically splice the images to generate a long image to be previewed, and use fixed The scrolling distance of the element is used to calculate the position information of each image for splicing.
It realizes efficient preview of automatic processing application pages, improves processing efficiency, reduces the tediousness of manual operations, and ensures compatibility between page design and actual display.
Smart Images

Figure CN112288635B
Abstract
Description
Technical Field
[0001] The present application relates to the field of computers, and in particular to a method, device and electronic device for processing application pages. Background Art
[0002] During the development phase of an application, page design is required. During development, the page design draft should be restored as much as possible. However, due to issues such as the compatibility of the terminal models on which the application is installed, the page style actually displayed may deviate from development expectations. Therefore, it is often necessary to preview the actual page after development to determine the compatibility effect.
[0003] However, the current processing method in the industry is to manually take screenshots to generate application pages for preview. This method is inefficient, especially when encountering long images, the operation process is cumbersome. Therefore, it is necessary to provide a new application page processing method to improve the processing efficiency of application pages. Summary of the invention
[0004] The embodiments of the present specification provide a method, device, and electronic device for processing an application page, so as to improve the processing efficiency of the application page.
[0005] The embodiment of this specification provides a method for processing an application page, including:
[0006] Providing long image page information to a client, so that the client generates and displays a first page based on the long image page information, wherein the first page has a fixed area and a scrolling area, and the fixed area has fixed elements;
[0007] Intercepting the picture displayed on the first page to generate first picture information, and configuring location information for the first picture;
[0008] After a page scrolling event occurs and a second page is displayed, the scrolling distance of the fixed element is obtained, a picture displayed on the second page is intercepted to generate second picture information, and position information is configured for the second picture based on the scrolling distance;
[0009] The first picture and the second picture are spliced according to the position information corresponding to the first picture and the second picture and the distance from the fixed element to the border of the scrolling area to generate a long picture to be previewed.
[0010] Optionally, it also includes:
[0011] Get the length of the long image, and determine whether the image capture task is completed based on the length of the long image and the image location information.
[0012] Optionally, it also includes:
[0013] Reporting the location information corresponding to the first picture and the second picture to the preview system;
[0014] The step of splicing the first picture and the second picture according to the position information corresponding to the first picture and the second picture and the distance from the fixed element to the border of the scrolling area to generate a long picture to be previewed includes:
[0015] The preview system calculates the effective area of each picture according to the reported position information of the picture and the distance from the fixed element to the border of the scrolling area;
[0016] Use the effective areas of each image to stitch together and generate a long image to be previewed.
[0017] Optionally, it also includes:
[0018] If the image capture task is not completed, calculating the position information of the missing area of the long image to be previewed according to the length of the long image, the first image information, the position information corresponding to the second image information, and the distance from the fixed element to the border of the scrolling area;
[0019] The target distance is calculated based on the position information of the missing area, and when the fixed element scrolling target distance is detected, the page image is intercepted to generate third image information for splicing.
[0020] Optionally, the intercepting a page image to generate third image information for splicing upon detecting the fixed element scrolling target distance includes:
[0021] Inputting the target distance into a page scrolling event model, the page scrolling event model controls the page in the client to scroll until the fixed element scrolls the target distance;
[0022] After a page scrolling event, a page image is captured to generate third image information for splicing.
[0023] Optionally, the intercepting the page image to generate third image information for splicing upon monitoring the fixed element scrolling target distance further includes:
[0024] If multiple target distances are calculated, multiple third picture information for splicing are generated by sequentially capturing page pictures.
[0025] Optionally, the capturing the picture displayed on the first page to generate first picture information includes:
[0026] If the distance between the movable element in the scrolling area of the first page and the fixed element in the fixed area is a maximum value in a preset range, the scrolling area and the fixed area including the fixed element are intercepted to generate first picture information.
[0027] Optionally, it also includes:
[0028] Creating a recorder in the preview system, the recorder being used to store location information of the reported pictures;
[0029] The step of judging whether the image capture task is completed according to the length of the long image and the position information of the image includes:
[0030] Traverse the location information in the recorder.
[0031] Optionally, the distance from the fixed element to the border of the scrolling area includes: the distance from the fixed element to the upper and lower borders of the scrolling area.
[0032] Optionally, it also includes:
[0033] Determine the preview category based on the client terminal model, operating system, page entry and user status;
[0034] The providing the long image page information to the client includes:
[0035] The long image page information is provided to the client currently belonging to the preview category.
[0036] The embodiment of this specification also provides a module for processing application pages, including:
[0037] A page information module, providing long image page information to a client, so that the client generates and displays a first page based on the long image page information, wherein the first page has a fixed area and a scrolling area, and the fixed area has fixed elements;
[0038] A page processing module, intercepting the picture displayed in the first page to generate first picture information, and configuring position information for the first picture;
[0039] After a page scrolling event occurs and a second page is displayed, the scrolling distance of the fixed element is obtained, a picture displayed on the second page is intercepted to generate second picture information, and position information is configured for the second picture based on the scrolling distance;
[0040] The splicing module splices the first picture and the second picture according to the position information corresponding to the first picture and the second picture and the distance from the fixed element to the border of the scrolling area to generate a long picture to be previewed.
[0041] Optionally, the splicing module is further used for:
[0042] Get the length of the long image, and determine whether the image capture task is completed based on the length of the long image and the image location information.
[0043] Optionally, the page processing module is further used to:
[0044] Reporting the location information corresponding to the first picture and the second picture to the preview system;
[0045] The step of splicing the first picture and the second picture according to the position information corresponding to the first picture and the second picture and the distance from the fixed element to the border of the scrolling area to generate a long picture to be previewed includes:
[0046] The preview system calculates the effective area of each picture according to the reported position information of the picture and the distance from the fixed element to the border of the scrolling area;
[0047] Use the effective areas of each image to stitch together and generate a long image to be previewed.
[0048] Optionally, the splicing module is further used for:
[0049] If the image capture task is not completed, calculating the position information of the missing area of the long image to be previewed according to the length of the long image, the first image information, the position information corresponding to the second image information, and the distance from the fixed element to the border of the scrolling area;
[0050] The target distance is calculated based on the position information of the missing area, and when the fixed element scrolling target distance is detected, the page image is intercepted to generate third image information for splicing.
[0051] Optionally, the intercepting a page image to generate third image information for splicing upon detecting the fixed element scrolling target distance includes:
[0052] Inputting the target distance into a page scrolling event model, the page scrolling event model controls the page in the client to scroll until the fixed element scrolls the target distance;
[0053] After a page scrolling event, a page image is captured to generate third image information for splicing.
[0054] Optionally, the intercepting the page image to generate third image information for splicing upon monitoring the fixed element scrolling target distance further includes:
[0055] If multiple target distances are calculated, multiple third picture information for splicing are generated by sequentially capturing page pictures.
[0056] Optionally, the capturing the picture displayed on the first page to generate first picture information includes:
[0057] If the distance between the movable element in the scrolling area of the first page and the fixed element in the fixed area is a maximum value in a preset range, the scrolling area and the fixed area including the fixed element are intercepted to generate first picture information.
[0058] Optionally, the splicing module is further used for:
[0059] Creating a recorder in the preview system, the recorder being used to store location information of the reported pictures;
[0060] The step of judging whether the image capture task is completed according to the length of the long image and the position information of the image includes:
[0061] Traverse the location information in the recorder.
[0062] Optionally, the distance from the fixed element to the border of the scrolling area includes: the distance from the fixed element to the upper and lower borders of the scrolling area.
[0063] Optionally, the page information module is further used to:
[0064] Determine the preview category based on the client terminal model, operating system, page entry and user status;
[0065] The providing the long image page information to the client includes:
[0066] The long image page information is provided to the client currently belonging to the preview category.
[0067] The embodiment of the present specification also provides an electronic device, wherein the electronic device includes:
[0068] processor; and,
[0069] A memory storing computer executable instructions, which when executed cause the processor to perform any of the above methods.
[0070] An embodiment of the present specification also provides a computer-readable storage medium, wherein the computer-readable storage medium stores one or more programs, and when the one or more programs are executed by a processor, any of the above methods is implemented.
[0071] The various technical solutions provided in the embodiments of this specification provide long image page information to the client, and the client displays the first page, the first page has a fixed area and a scrolling area, and the fixed area has a fixed element. The picture displayed in the first page is intercepted to generate the first picture information, and the position information is configured. After the page scrolling event occurs and the second page is displayed, the scrolling distance of the fixed element is obtained and the picture displayed in the second page is intercepted to generate the second picture information, and the position information is configured for the second picture based on the scrolling distance. The first and second pictures are spliced according to the position information corresponding to the picture and the distance from the fixed element to the scrolling area boundary to generate a long picture to be previewed. By automatically intercepting the picture displayed on the page, the scrolling distance of the fixed element in the fixed area is used to configure the position information for the picture, so that the position of each picture in the long picture can be calculated when splicing, and then splicing is performed, automatic processing is achieved, and efficiency is improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0072] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0073] Figure 1 A schematic diagram of the principle of a method for processing an application page provided in an embodiment of this specification;
[0074] Figure 2 A schematic diagram of the structure of a device for processing application pages provided in an embodiment of this specification;
[0075] Figure 3 A schematic diagram of the structure of an electronic device provided in an embodiment of this specification;
[0076] Figure 4 A schematic diagram of a computer-readable medium provided in accordance with an embodiment of the present specification. DETAILED DESCRIPTION
[0077] Exemplary embodiments of the present invention will now be described more fully with reference to the accompanying drawings. However, exemplary embodiments can be implemented in a variety of forms, and should not be construed as limiting the present invention to the embodiments set forth herein. On the contrary, providing these exemplary embodiments enables the present invention to be more comprehensive and complete, and is more convenient for fully conveying the inventive concept to those skilled in the art. The same reference numerals in the figures represent the same or similar elements, components or parts, and thus their repeated description will be omitted.
[0078] Under the premise of being consistent with the technical concept of the present invention, the features, structures, characteristics or other details described in a specific embodiment do not exclude that they can be combined in one or more other embodiments in a suitable manner.
[0079] In the description of specific embodiments, the features, structures, characteristics or other details described in the present invention are intended to enable those skilled in the art to fully understand the embodiments. However, it does not exclude that those skilled in the art can practice the technical solutions of the present invention without one or more of the specific features, structures, characteristics or other details.
[0080] The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps can be decomposed, and some operations / steps can be combined or partially combined, so the actual execution order may change according to actual conditions.
[0081] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities may be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.
[0082] The term "and / or" or "and / or" includes all combinations of any one or more of the associated listed items.
[0083] Figure 1 A schematic diagram of a method for processing an application page provided in an embodiment of this specification, the method may include:
[0084] S101: providing long image page information to a client, so that the client generates and displays a first page based on the long image page information, wherein the first page has a fixed area and a scrolling area, and the fixed area has fixed elements.
[0085] The long images produced during the design phase are provided to developers and will not have compatibility issues. The design draft style will be highly restored during the development phase. Due to the large number of users after the release, compatibility issues with different models may occur. In extreme cases, individual users may request different data returned by the interface, resulting in incomplete content displayed on the page.
[0086] Therefore, it is necessary to obtain the actual display page, browse it and identify whether there are any problems. This can also identify some problems with no script errors.
[0087] In order to take various situations into consideration, the preview category can be determined in advance based on various influencing factors. There are many influencing factors, such as the model of the client terminal, the operating system, the page entry and the user status, which will not be specifically elaborated and limited here.
[0088] Therefore, in an embodiment of this specification, the method may include:
[0089] Determine the preview category based on the client terminal model, operating system, page entry and user status;
[0090] Thus, providing the long image page information to the client may include:
[0091] The long image page information is provided to the client currently belonging to the preview category.
[0092] The long image page information provided to the client may include:
[0093] In response to a page access request from a target client, long image page information and screenshot rules are provided to the client, so that after generating and displaying the page, the client captures the image displayed on the page based on the screenshot rules to generate image information as image configuration location information.
[0094] In specific applications, not all users need to report screenshots. A category of preview users only needs one user's client to report. Of course, for statistics, multiple users can be reported for one category, and there is no limitation here.
[0095] Considering that a single screenshot cannot complete the preview, and the images obtained by multiple screenshots cannot calculate the positional relationship, it is difficult to determine the boundaries of stitching. Therefore, we use the fixed area in the page as a reference, combined with JAVAscript instructions to prepare for stitching images.
[0096] The fixed area refers to an area whose displayed content remains unchanged when the page is scrolled, and is usually a blocked area, such as a header area and a footer area in a page.
[0097] Page elements are often displayed in a fixed area. When the page is scrolled, the page elements in the fixed area are fixed, so they can be called fixed elements.
[0098] In the embodiment of the present specification, a preview system may also be maintained to process the reported images and provide users with preview of the spliced long image.
[0099] S102: intercepting the picture displayed in the first page to generate first picture information, and configuring location information for the first picture.
[0100] When taking screenshots, you can call the local screenshot interface to take screenshots. After taking the screenshots, you can directly use a graphics container (such as Canvas) to crop the image in the valid area, or you can crop it again when stitching.
[0101] In the embodiments of this specification, the JAVAscript script can obtain the position of the fixed element in the fixed area. The JAVAscript script can also obtain the scrolling distance (scrollTop) of the fixed element and the height (scrollHeight) of the long image, and the height (height) of the screen view.
[0102] Therefore, the position of the fixed element in the view can be obtained, and the position information of the captured image can be configured based on this.
[0103] Taking into account the actual scenario, when the page slides to the bottom, it can be intercepted together with the fixed area at the top. In order to describe this rule, a preset range can be set for the distance from the movable element in the scrolling area to the fixed element in the fixed area. In this way, when the distance from the movable element in the scrolling area to the fixed element in the fixed area is the maximum value in the preset range, it means that the page has been scrolled to the end.
[0104] Therefore, in the embodiment of the present specification, the step of intercepting the image displayed on the first page to generate the first image information may include:
[0105] If the distance between the movable element in the scrolling area of the first page and the fixed element in the fixed area is a maximum value in a preset range, the scrolling area and the fixed area including the fixed element are intercepted to generate first picture information.
[0106] When the page has not been scrolled to the end, only the scrolling area in the page is captured.
[0107] Of course, you can also capture the full screen each time, and when stitching, cut off the partial picture of the fixed area according to the height of the fixed area, and then stitch them together.
[0108] The position information may be the height from the upper boundary of the captured image in the view to the lower boundary in the view.
[0109] In specific implementation, you can use: top, bottom to indicate the height of the upper and lower boundaries in the view.
[0110] S103: After a page scrolling event occurs and a second page is displayed, a scrolling distance of the fixed element is obtained and a picture displayed in the second page is intercepted to generate second picture information, and position information is configured for the second picture based on the scrolling distance.
[0111] The page scrolling event may be an event generated by a user operation, or an event automatically controlled according to a preset scrolling rule, which is not limited here.
[0112] In the embodiments of this specification, the following may also be included:
[0113] Report the location information corresponding to the first picture and the second picture to the preview system.
[0114] Considering that stitching a long picture often requires multiple pictures, how to determine whether the intercepted pictures are sufficient for stitching a long picture, therefore, in the embodiment of this specification, the method may further include:
[0115] Get the length of the long image, and determine whether the image capture task is completed based on the length of the long image and the image location information.
[0116] If in one embodiment, a fixed area is captured only when the page slides to the end, then as long as the reported position information of each picture is not interrupted, it indicates that the picture capture task has been completed.
[0117] If the embodiment captures the full screen every time, it is necessary that after the effective area is cropped out, the position information is not interrupted to indicate that the picture capture task has been completed.
[0118] In the embodiments of this specification, the following may also be included:
[0119] Creating a recorder in the preview system, the recorder being used to store location information of the reported pictures;
[0120] The determining whether the image capture task is completed according to the length of the long image and the position information of the image may include:
[0121] Traverse the location information in the recorder.
[0122] Specifically, the recorder can be an array.
[0123] In the embodiment of this specification, the method may further include:
[0124] If the image capture task is not completed, calculating the position information of the missing area of the long image to be previewed according to the length of the long image, the first image information, the position information corresponding to the second image information, and the distance from the fixed element to the border of the scrolling area;
[0125] The target distance is calculated based on the position information of the missing area, and when the fixed element scrolling target distance is detected, the page image is intercepted to generate third image information for splicing.
[0126] The target distance is used to monitor the scrolling distance of the page. If the page scrolls the target distance, it means that a screenshot can be taken at present.
[0127] In order to realize automatic screenshot, we can use the existing event model to handle it.
[0128] Specifically, in the embodiment of the present specification, the intercepting the page image to generate the third image information for splicing upon detecting the fixed element scrolling target distance may include:
[0129] Inputting the target distance into a page scrolling event model, the page scrolling event model controls the page in the client to scroll until the fixed element scrolls the target distance;
[0130] After a page scrolling event, a page image is captured to generate third image information for splicing.
[0131] Considering a scenario where the length of a long image is much higher than the height of the screen, multiple captures are required. Therefore, the calculated target distances may be multiple.
[0132] Therefore, in the embodiment of the present specification, the intercepting the page image to generate the third image information for splicing upon detecting the fixed element scrolling target distance may also include:
[0133] If multiple target distances are calculated, multiple third picture information for splicing are generated by sequentially capturing page pictures.
[0134] S104: splicing the first picture and the second picture according to the position information corresponding to the first picture and the second picture and the distance from the fixed element to the border of the scrolling area to generate a long picture to be previewed.
[0135] By providing the client with the long picture page information, the client displays the first page, which has a fixed area and a scrolling area, and has a fixed element in the fixed area, intercepts the picture displayed in the first page to generate the first picture information, configures the position information, obtains the scrolling distance of the fixed element and intercepts the picture displayed in the second page to generate the second picture information after the page scrolling event occurs and displays the second page, configures the position information for the second picture based on the scrolling distance, and splices the first and second pictures according to the position information corresponding to the picture and the distance from the fixed element to the scrolling area boundary to generate the long picture to be previewed. By automatically intercepting the picture displayed on the page, and using the scrolling distance of the fixed element in the fixed area to configure the position information for the picture, the position of each picture in the long picture can be calculated during splicing, and then spliced, automatic processing is achieved, and efficiency is improved.
[0136] In an embodiment of this specification, if the method includes:
[0137] Reporting the location information corresponding to the first picture and the second picture to the preview system;
[0138] Then, the step of splicing the first picture and the second picture according to the position information corresponding to the first picture and the second picture and the distance from the fixed element to the border of the scrolling area to generate the long picture to be previewed may include:
[0139] The preview system calculates the effective area of each picture according to the reported position information of the picture and the distance from the fixed element to the border of the scrolling area;
[0140] Use the effective areas of each image to stitch together and generate a long image to be previewed.
[0141] In this embodiment of the specification, the distance from the fixed element to the border of the scrolling area includes: the distance from the fixed element to the upper and lower borders of the scrolling area.
[0142] Among them, for a special case, the fixed element is the boundary line between the fixed area and the scrolling area, then, the distance from the fixed element to the upper boundary of the scrolling area is one of zero and the height of the scrolling area, and the distance from the fixed element to the upper boundary of the scrolling area is the other of zero and the height of the scrolling area.
[0143] In one application scenario, the previewer does not need to take screenshots, but only needs to determine the preview category to obtain a spliced long image. Since the image is generated by taking screenshots of the page, it can truly reflect the actual display style, so it can be determined whether there are any problems that were not taken into account during development.
[0144] The embodiment of this specification is a method for specific implementation, which may include:
[0145] The client sends a page request to the server, the request carrying the client's user current status information, page entry, client program version information and terminal system information;
[0146] The server retrieves and determines whether it is necessary to take a screenshot of the currently requested page. If necessary, the screenshot rule is returned to the client.
[0147] After the client displays the page, or after scrolling occurs and the scrolling event stops (300ms can be used as the standard for judging when scrolling stops), take a screenshot;
[0148] The client takes screenshots multiple times and determines whether the task is completed based on the position information of each picture. If it is not completed, the position information of each picture is used to calculate the position information of the missing area of the long picture to be previewed, and the screenshot is taken after scrolling a certain distance;
[0149] The client sends the client's user current status information, page entry, client program version information and mobile phone system information together with the captured image and corresponding location information to the server;
[0150] The server stores the information reported by the client;
[0151] When previewing is needed, you can enter the current status information, page entry, client program version information, mobile phone system information and other information, and the preview system will request the server to query the corresponding image and stitch it together to generate a long image to be previewed.
[0152] Figure 2 A schematic diagram of a structure of a device for processing an application page provided in an embodiment of this specification, the device may include:
[0153] The page information module 201 provides the long image page information to the client, so that the client generates and displays a first page based on the long image page information, wherein the first page has a fixed area and a scrolling area, and the fixed area has fixed elements;
[0154] The page processing module 202 intercepts the picture displayed in the first page to generate first picture information, and configures position information for the first picture;
[0155] After a page scrolling event occurs and a second page is displayed, the scrolling distance of the fixed element is obtained, a picture displayed on the second page is intercepted to generate second picture information, and position information is configured for the second picture based on the scrolling distance;
[0156] The splicing module 203 splices the first picture and the second picture according to the position information corresponding to the first picture and the second picture and the distance from the fixed element to the border of the scrolling area to generate a long picture to be previewed.
[0157] In the embodiments of this specification, the splicing module can also be used for:
[0158] Get the length of the long image, and determine whether the image capture task is completed based on the length of the long image and the image location information.
[0159] In the embodiments of this specification, the page processing module may also be used to:
[0160] Reporting the location information corresponding to the first picture and the second picture to the preview system;
[0161] The step of splicing the first picture and the second picture to generate the long picture to be previewed according to the position information corresponding to the first picture and the second picture and the distance from the fixed element to the border of the scrolling area may include:
[0162] The preview system calculates the effective area of each picture according to the reported position information of the picture and the distance from the fixed element to the border of the scrolling area;
[0163] Use the effective areas of each image to stitch together and generate a long image to be previewed.
[0164] In the embodiments of this specification, the splicing module can also be used for:
[0165] If the image capture task is not completed, calculating the position information of the missing area of the long image to be previewed according to the length of the long image, the first image information, the position information corresponding to the second image information, and the distance from the fixed element to the border of the scrolling area;
[0166] The target distance is calculated based on the position information of the missing area, and when the fixed element scrolling target distance is detected, the page image is intercepted to generate third image information for splicing.
[0167] In the embodiment of the present specification, the intercepting the page image to generate the third image information for splicing upon detecting the fixed element scrolling target distance may include:
[0168] Inputting the target distance into a page scrolling event model, the page scrolling event model controls the page in the client to scroll until the fixed element scrolls the target distance;
[0169] After a page scrolling event, a page image is captured to generate third image information for splicing.
[0170] In the embodiment of the present specification, the intercepting the page image to generate the third image information for splicing upon detecting the fixed element scrolling target distance may further include:
[0171] If multiple target distances are calculated, multiple third picture information for splicing are generated by sequentially capturing page pictures.
[0172] In the embodiment of the present specification, the intercepting the picture displayed on the first page to generate the first picture information may include:
[0173] If the distance between the movable element in the scrolling area of the first page and the fixed element in the fixed area is a maximum value in a preset range, the scrolling area and the fixed area including the fixed element are intercepted to generate first picture information.
[0174] In the embodiments of this specification, the splicing module can also be used for:
[0175] Creating a recorder in the preview system, the recorder being used to store location information of the reported pictures;
[0176] The determining whether the image capture task is completed according to the length of the long image and the position information of the image may include:
[0177] Traverse the location information in the recorder.
[0178] In the embodiment of the present specification, the distance from the fixed element to the border of the scrolling area includes: the distance from the fixed element to the upper and lower borders of the scrolling area.
[0179] In the embodiments of this specification, the page information module may also be used for:
[0180] Determine the preview category based on the client terminal model, operating system, page entry and user status;
[0181] Providing the long image page information to the client may include:
[0182] The long image page information is provided to the client currently belonging to the preview category.
[0183] The device provides long picture page information to the client, and the client displays the first page, which has a fixed area and a scrolling area, and has a fixed element in the fixed area. The image displayed in the first page is intercepted to generate the first picture information, and the position information is configured. After the page scrolling event occurs and the second page is displayed, the scrolling distance of the fixed element is obtained and the image displayed in the second page is intercepted to generate the second picture information, and the position information is configured for the second picture based on the scrolling distance. The first and second pictures are spliced according to the position information corresponding to the picture and the distance from the fixed element to the scrolling area boundary to generate the long picture to be previewed. By automatically intercepting the pictures displayed on the page, and using the scrolling distance of the fixed element in the fixed area to configure the position information for the pictures, the position of each picture in the long picture can be calculated during splicing, and then splicing is performed, thereby realizing automatic processing and improving efficiency.
[0184] Based on the same inventive concept, an embodiment of this specification also provides an electronic device.
[0185] The following describes an electronic device embodiment of the present invention, which can be regarded as a specific physical implementation of the method and device embodiments of the present invention. The details described in the electronic device embodiment of the present invention should be regarded as a supplement to the above method or device embodiments; details not disclosed in the electronic device embodiment of the present invention can be implemented with reference to the above method or device embodiments.
[0186] Figure 3 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this specification. Figure 3 The electronic device 300 according to the embodiment of the present invention is described. Figure 3 The electronic device 300 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0187] like Figure 3As shown, the electronic device 300 is in the form of a general computing device. The components of the electronic device 300 may include, but are not limited to: at least one processing unit 310, at least one storage unit 320, a bus 330 connecting different system components (including the storage unit 320 and the processing unit 310), a display unit 340, etc.
[0188] The storage unit stores program codes, which can be executed by the processing unit 310, so that the processing unit 310 performs the steps according to various exemplary embodiments of the present invention described in the above processing method section of this specification. For example, the processing unit 310 can perform the following steps: Figure 1 Steps shown.
[0189] The storage unit 320 may include a readable medium in the form of a volatile storage unit, such as a random access memory unit (RAM) 3201 and / or a cache memory unit 3202 , and may further include a read-only memory unit (ROM) 3203 .
[0190] The storage unit 320 may also include a program / utility 3204 having a set (at least one) of program modules 3205, such program modules 3205 including but not limited to: an operating system, one or more application programs, other program modules and program data, each of which or some combination may include the implementation of a network environment.
[0191] Bus 330 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
[0192] The electronic device 300 may also communicate with one or more external devices 400 (e.g., keyboards, pointing devices, Bluetooth devices, etc.), one or more devices that enable a user to interact with the electronic device 300, and / or any device that enables the electronic device 300 to communicate with one or more other computing devices (e.g., routers, modems, etc.). Such communication may be performed through an input / output (I / O) interface 350. Furthermore, the electronic device 300 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) through a network adapter 360. The network adapter 360 may communicate with other modules of the electronic device 300 through the bus 330. It should be understood that although Figure 3Not shown, other hardware and / or software modules may be used in conjunction with the electronic device 300, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0193] Through the description of the above implementation methods, it is easy for those skilled in the art to understand that the exemplary embodiments described in the present invention can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation method of the present invention can be embodied in the form of a software product, which can be stored in a computer-readable storage medium (which can be a CD-ROM, USB flash drive, mobile hard disk, etc.) or on a network, including a number of instructions to enable a computing device (which can be a personal computer, server, or network device, etc.) to execute the above method according to the present invention. When the computer program is executed by a data processing device, the computer-readable medium can implement the above method of the present invention, that is: Figure 1 The method shown.
[0194] Figure 4 A schematic diagram of a computer-readable medium provided in accordance with an embodiment of the present specification.
[0195] accomplish Figure 1 The computer program of the method shown can be stored on one or more computer readable media. The computer readable medium can be a readable signal medium or a readable storage medium. The readable storage medium can be, for example, but not limited to, a system, device or device of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination of the above. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, 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 disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0196] The computer readable storage medium may include a data signal propagated in a baseband or as part of a carrier wave, wherein a readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The readable storage medium may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by an instruction execution system, an apparatus, or a device or used in combination with it. The program code contained on the readable storage medium may be transmitted with any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the above.
[0197] Program code for performing the operations of the present invention may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., through the Internet using an Internet service provider).
[0198] In summary, the present invention can be implemented in hardware, or in a software module running on one or more processors, or in a combination thereof. It should be understood by those skilled in the art that general data processing devices such as microprocessors or digital signal processors (DSPs) can be used in practice to implement some or all of the functions of some or all of the components in the embodiments of the present invention. The present invention can also be implemented as a device or apparatus program (e.g., a computer program and a computer program product) for executing part or all of the methods described herein. Such a program implementing the present invention can be stored on a computer-readable medium, or can have the form of one or more signals. Such a signal can be downloaded from an Internet website, or provided on a carrier signal, or provided in any other form.
[0199] The specific embodiments described above further describe the purpose, technical solutions and beneficial effects of the present invention in detail. It should be understood that the present invention is not inherently related to any specific computer, virtual device or electronic device, and various general devices can also implement the present invention. The above description is only a specific embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
[0200] The various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referenced to each other, and each embodiment focuses on the differences from other embodiments.
[0201] The above is only an embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.
Claims
1. A method for processing an application page, characterized in that: include: In response to a page access request from a target client, long image page information and screenshot rules are provided to a client of a target preview category, so that the client generates and displays a page and then captures an image displayed on the page based on the screenshot rules to generate image information, configures position information for the image, obtains long image page information, and generates and displays a first page based on the long image page information, wherein the first page has a fixed area and a scrolling area, and the fixed area has fixed elements; If the distance between the movable element in the scrolling area of the first page and the fixed element in the fixed area is the maximum value in a preset range, intercepting the scrolling area and the fixed area including the fixed element to generate first picture information, and configuring position information for the first picture using a JAVAscript script; After a page scrolling event occurs and a second page is displayed, a JAVAscript script is used to obtain a scrolling distance of the fixed element and intercept a picture displayed on the second page to generate second picture information, and position information is configured for the second picture based on the scrolling distance; Reporting the location information corresponding to the first picture and the second picture to the preview system; Creating a recorder in the preview system, the recorder being used to store location information of the reported pictures; The first picture and the second picture are spliced together to generate a long picture to be previewed according to the position information corresponding to the first picture and the second picture and the distance from the fixed element to the border of the scrolling area, including: the preview system calculates the effective area of each picture according to the reported position information of the picture and the distance from the fixed element to the border of the scrolling area; each effective area is used to splice and generate the long picture to be previewed; the effective area is determined by calling a local screenshot interface to take a screenshot, and directly using Canvas to crop out the effective area after taking the screenshot, or using Canvas to crop out the effective area when splicing; Get the length of the long image, and determine whether the image capture task is completed based on the length of the long image and the image location information; If the image capture task is not completed, the position information of the missing area of the long image to be previewed is calculated according to the length of the long image, the first image information, the position information corresponding to the second image information, and the distance from the fixed element to the border of the scrolling area; the target distance is calculated based on the position information of the missing area, and the target distance is input into the page scrolling event model, and the page scrolling event model controls the page in the client to scroll until the fixed element scrolls to the target distance; after the page scrolling event, the page image is captured to generate the third image information for splicing; If multiple target distances are calculated, multiple third picture information for splicing are generated by sequentially capturing page pictures.
2. A module for processing application pages, characterized in that: include: a page information module, in response to a page access request of a target client, providing long-image page information and screenshot rules to a client of a target preview category, so that the client can capture a picture displayed in the page based on the screenshot rules after generating and displaying the page, and configure position information for the picture to obtain long-image page information, so that the client can generate and display a first page based on the long-image page information, wherein the first page has a fixed area and a scrolling area, and the fixed area has fixed elements; If the distance between the movable element in the scrolling area of the first page and the fixed element in the fixed area is the maximum value in a preset range, intercepting the scrolling area and the fixed area including the fixed element to generate first picture information, and configuring position information for the first picture using a JAVAscript script; After a page scrolling event occurs and a second page is displayed, a JAVAscript script is used to obtain a scrolling distance of the fixed element and intercept a picture displayed on the second page to generate second picture information, and position information is configured for the second picture based on the scrolling distance; Reporting the location information corresponding to the first picture and the second picture to the preview system; Creating a recorder in the preview system, the recorder being used to store location information of the reported pictures; The splicing module splices the first picture and the second picture to generate a long picture to be previewed according to the position information corresponding to the first picture and the second picture and the distance from the fixed element to the border of the scrolling area, including: the preview system calculates the effective area of each picture according to the reported position information of the picture and the distance from the fixed element to the border of the scrolling area; splices the long picture to be previewed using each effective area; the effective area is determined by calling a local screenshot interface to take a screenshot, and directly using Canvas to crop the effective area after taking the screenshot, or using Canvas to crop the effective area during splicing; Get the length of the long image, and determine whether the image capture task is completed based on the length of the long image and the image location information; If the image capture task is not completed, the position information of the missing area of the long image to be previewed is calculated according to the length of the long image, the first image information, the position information corresponding to the second image information, and the distance from the fixed element to the border of the scrolling area; the target distance is calculated based on the position information of the missing area, and the target distance is input into the page scrolling event model, and the page scrolling event model controls the page in the client to scroll until the fixed element scrolls to the target distance; after the page scrolling event, the page image is captured to generate the third image information for splicing; If multiple target distances are calculated, multiple third picture information for splicing are generated by sequentially capturing page pictures.
3. An electronic device, wherein: The electronic device includes: processor; and, A memory storing computer executable instructions which, when executed, cause the processor to perform the method according to any one of claims 1-2.
4. A computer-readable storage medium, wherein: The computer-readable storage medium stores one or more programs, and when the one or more programs are executed by a processor, the method of any one of claims 1-2 is implemented.
