# US 2023/0410380 A1 · Method and apparatus for generating page

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2023/0410380 A1
- Document ID: US20230410380A1
- Status: Published application
- Kind: A1
- Application number: 18/037,634
- Filed: 2021-10-22
- Published: 2023-12-21
- Earliest claimed: 2020-11-18
- Assignees: Beijing Wodong Tianjun Information Technology Co., Ltd.; Beijing Jingdong Century Trading Co., Ltd.
- Applicants: Beijing Wodong Tianjun Information Technology Co. Ltd.; Beijing Jingdong Century Trading Co. Ltd.
- Inventors: Wuyu ZHOU; Haoxin SU; Yue ZHAO
- Web page: https://patentgrep.com/patent/US20230410380A1

## CPC

- G06T 11/00: Two-dimensional [2D] image generation
- G06F 40/103: Formatting, i.e. changing of presentation of documents (automatic justification G06F40/189; automatic line break hyphenation G06F40/191)
- G06F 40/154: Tree transformation for tree-structured or markup documents, e.g. XSLT, XSL-FO or stylesheets
- G06T: IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A method and apparatus for generating a page are provided. The method comprises: obtaining initial color information and size information of a target element in a window of an initial page; based on the initial color information, using a first color transformation strategy to generate simulated color information of the target element; in response to determining that the simulated color information of the target element satisfies a preset condition, on the basis of the initial color information of the target element, using a second color transformation strategy to generate target color information of the target element, the present condition representing the degree of friendliness of a simulated color to the characteristic population; and redrawing the target element on the basis of the target color information and size information to obtain a target page.

## Claims

### Claim 1

A method for generating a page, the method comprising:
acquiring initial color information and size information of a target element in a window of an initial page;
generating simulated color information of the target element using a first color transformation strategy, based on the initial color information, color indicated in the simulated color information representing a visual effect of an initial color of the target element in eyes of a characteristic population;
generating, in response to determining that the simulated color information of the target element satisfies a preset condition, target color information of the target element using a second color transformation strategy, based on the initial color information of the target element, the present condition representing a degree of friendliness of the simulated color to the characteristic population; and
redrawing the target element based on the target color information and the size information to obtain a target page.

### Claim 2 (depends on 1)

The method according to claim 1, wherein the target element is determined through following steps:
using an intersection observe API to asynchronously acquire intersection states of elements in the initial page with the window of the initial page; and
determining, in response to determining that an intersection ratio of an element in the initial page to the window of the initial page reaches a preset intersection threshold, the element as the target element.

### Claim 3 (depends on 2)

The method according to claim 2, wherein the method further comprises:
using the intersection observe API to asynchronously acquire the simulated color information of target elements in the initial page, and performing following steps on each target element:
comparing the simulated color information of the target element with a preset color interval, to determine whether the simulated color information is in the color range to obtain a first comparison result;
based on the simulated color information of the target element and the simulated color information of an adjacent target element, determining a difference between the simulated color information of the target element in a contiguous area of the target element and the adjacent target element and simulated color information of the adjacent target element in the contiguous area, and comparing the difference with a preset color difference threshold to determine whether the difference is less than the color difference threshold, to obtain a second comparison result, wherein the adjacent target element is another target element that is adjacent to a boundary of the target element in the initial page;
determining, in response to the target element comprising a plurality of pieces of simulated color information, a difference between each two pieces of simulated color information of the target element, and comparing the difference with the color difference threshold to determine whether the difference is less than the color difference threshold, to obtain a third comparison result; and
determining, in response to determining that not all of the first comparison result, the second comparison result and the third comparison result of the target element are NO, that the target element satisfies the preset condition.

### Claim 4 (depends on 1)

The method according to claim 1, wherein the initial color information and the size information of the target element are acquired through following steps: using an intersection observe API to asynchronously acquire a text object model of the initial page; extracting a cascading style sheet of the target element from the text object model; and extracting the initial color information and the size information of the target element from the cascading style sheet;
the simulated color information of the target element is acquired through a following step: adjusting the initial color information according to the first color transformation strategy using the intersection observe API, to obtain the simulated color information;
the target color information of the target element is generated through a following step: adjusting the initial color information according to the second color transformation strategy using the intersection observe API, to obtain the target color information; and
redrawing the target element based on the target color information and the size information, comprises: updating a color style of the target element using the text object model, based on the target color information and the size information of the target element, to obtain a redrawn target element.

### Claim 5 (depends on 1)

The method according to claim 1, wherein the target color information of the target element is generated through following steps:
determining initial values of color components R (red), G (green), B (blue), based on the initial color information of the target element; and
updating a target value of a color component R to an initial value of a color component G, updating a target value of the color component G to an initial value of a color component B, updating a target value of the color component B to an initial value of the color component R, to obtain the target color information of the target element.

### Claim 6

An apparatus for generating a page, the apparatus comprising:
at least one processor; and
a memory storing instructions, wherein the instructions when executed by the at least one processor, cause the at least one processor to perform operations, the operations comprising:
acquiring initial color information and size information of a target element in a window of an initial page;
generating simulated color information of the target element using a first color transformation strategy, based on the initial color information, color indicated in the simulated color information representing a visual effect of an initial color of the target element in eyes of a characteristic population;
generating, in response to determining that the simulated color information of the target element satisfies a preset condition, target color information of the target element using a second color transformation strategy, based on the initial color information of the target element, the present condition representing a degree of friendliness of the simulated color to the characteristic population; and
redrawing the target element based on the target color information and the size information to obtain a target page.

### Claim 7 (depends on 6)

The apparatus according to claim 6, wherein the operations further comprise:
using an intersection observe API to asynchronously acquire intersection states of elements in the initial page with the window of the initial page; and
determining, in response to determining that an intersection ratio of an element in the initial page to the window of the initial page reaches a preset intersection threshold, the element as the target element.

### Claim 8 (depends on 6)

The apparatus according to claim 6, wherein the operations further comprise: using an intersection observe API to asynchronously acquire the simulated color information of target elements in the initial page, and performing following steps on each target element:
comparing the simulated color information of the target element with a preset color interval, to determine whether the simulated color information is in the color range to obtain a first comparison result;
based on the simulated color information of the target element and the simulated color information of an adjacent target element, determining a difference between the simulated color information of the target element in a contiguous area of the target element and the adjacent target element and simulated color information of the adjacent target element in the contiguous area, and comparing the difference with a preset color difference threshold to determine whether the difference is less than the color difference threshold, to obtain a second comparison result, wherein the adjacent target element is another target element that is adjacent to a boundary of the target element in the initial page;
determining, in response to the target element comprising a plurality of pieces of simulated color information, a difference between each two pieces of simulated color information of the target element, and comparing the difference with the color difference threshold to determine whether the difference is less than the color difference threshold, to obtain a third comparison result; and
determining, in response to determining that not all of the first comparison result, the second comparison result and the third comparison result of the target element are NO, that the target element satisfies the preset condition.

### Claim 9 (depends on 6)

The apparatus according to claim 6, wherein the initial color information and the size information of the target element are acquired through following steps: using an intersection observe API to asynchronously acquire a text object model of the initial page; extracting a cascading style sheet of the target element from the text object model; and extracting the initial color information and the size information of the target element from the cascading style sheet;
the simulated color information of the target element is acquired through a following step: adjusting the initial color information according to the first color transformation strategy using the intersection observe API, to obtain the simulated color information;
the target color information of the target element is generated through a following step: adjusting the initial color information according to the second color transformation strategy using the intersection observe API, to obtain the target color information; and
redrawing the target element based on the target color information and the size information, comprises: updating a color style of the target element using the text object model, based on the target color information and the size information of the target element, to obtain a redrawn target element.

### Claim 10 (depends on 6)

The apparatus according to claim 6, wherein the target color information of the target element is generated through following steps:
determining initial values of color components R (red), G (green), B (blue), based on the initial color information of the target element; and
updating a target value of a color component R to an initial value of a color component G, updating a target value of the color component G to an initial value of a color component B, updating a target value of the color component B to an initial value of the color component R, to obtain the target color information of the target element.

### Claim 11

(canceled)

### Claim 12

A non-transitory computer readable medium, storing a computer program thereon, the program, when executed by a processor, implements operations comprising:
acquiring initial color information and size information of a target element in a window of an initial page;
generating simulated color information of the target element using a first color transformation strategy, based on the initial color information, color indicated in the simulated color information representing a visual effect of an initial color of the target element in eyes of a characteristic population;
generating, in response to determining that the simulated color information of the target element satisfies a preset condition, target color information of the target element using a second color transformation strategy, based on the initial color information of the target element, the present condition representing a degree of friendliness of the simulated color to the characteristic population; and
redrawing the target element based on the target color information and the size information to obtain a target page.

### Claim 13 (depends on 11)

The non-transitory computer readable medium according to claim 11, wherein the target element is determined through following steps:
using an intersection observe API to asynchronously acquire intersection states of elements in the initial page with the window of the initial page; and
determining, in response to determining that an intersection ratio of an element in the initial page to the window of the initial page reaches a preset intersection threshold, the element as the target element.

### Claim 14 (depends on 12)

The non-transitory computer readable medium according to claim 12, wherein the operations further comprise:
using the intersection observe API to asynchronously acquire the simulated color information of target elements in the initial page, and performing following steps on each target element:
comparing the simulated color information of the target element with a preset color interval, to determine whether the simulated color information is in the color range to obtain a first comparison result;
based on the simulated color information of the target element and the simulated color information of an adjacent target element, determining a difference between the simulated color information of the target element in a contiguous area of the target element and the adjacent target element and simulated color information of the adjacent target element in the contiguous area, and comparing the difference with a preset color difference threshold to determine whether the difference is less than the color difference threshold, to obtain a second comparison result, wherein the adjacent target element is another target element that is adjacent to a boundary of the target element in the initial page;
determining, in response to the target element comprising a plurality of pieces of simulated color information, a difference between each two pieces of simulated color information of the target element, and comparing the difference with the color difference threshold to determine whether the difference is less than the color difference threshold, to obtain a third comparison result; and
determining, in response to determining that not all of the first comparison result, the second comparison result and the third comparison result of the target element are NO, that the target element satisfies the preset condition.

### Claim 15 (depends on 11)

The non-transitory computer readable medium according to claim 11, wherein the initial color information and the size information of the target element are acquired through following steps: using an intersection observe API to asynchronously acquire a text object model of the initial page; extracting a cascading style sheet of the target element from the text object model; and extracting the initial color information and the size information of the target element from the cascading style sheet;
the simulated color information of the target element is acquired through a following step: adjusting the initial color information according to the first color transformation strategy using the intersection observe API, to obtain the simulated color information;
the target color information of the target element is generated through a following step: adjusting the initial color information according to the second color transformation strategy using the intersection observe API, to obtain the target color information; and
redrawing the target element based on the target color information and the size information, comprises: updating a color style of the target element using the text object model, based on the target color information and the size information of the target element, to obtain a redrawn target element.

### Claim 16 (depends on 11)

The non-transitory computer readable medium according to claim 11, wherein the target color information of the target element is generated through following steps:
determining initial values of color components R (red), G (green), B (blue), based on the initial color information of the target element; and
updating a target value of a color component R to an initial value of a color component G, updating a target value of the color component G to an initial value of a color component B, updating a target value of the color component B to an initial value of the color component R, to obtain the target color information of the target element.
