IP Library Granted Patent US 9,542,373
Granted Patent B2
US 9,542,373 · App. 14/388,529 · Granted Jan 10, 2017

Method and apparatus for compressing webpage text

Inventors: Jie Liang (Guangzhou, CN); Xiaopeng He (Guangzhou, CN); Yongfu Yu (Guangzhou, CN); Shunyan Zhu (Guangzhhou, CN); Xing Yang (Guangzhou, CN)
Assignee: GUANGZHOU UCWEB COMPUTER TECHNOLOGY CO., LTD
G06F17/2252G06F17/2217G06F17/272
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 9,542,373
App. No.
14/388,529
Granted
Jan 10, 2017
Kind
B2
Abstract

Methods and apparatus for compressing webpage text are provided. According to a webpage-opening request of a mobile terminal browser, a current language environment of the terminal is obtained. According to the language environment, a character container corresponding to the language environment is initialized. Requested webpage data are received. The received webpage data are parsed. The webpage data are merged and stored using the corresponding character container. During the initializing of the corresponding character container according to the language environment, it is determined whether the language environment belongs to Latin languages. When the language environment belongs to Latin languages, the character container is initialized to store utf-8 encoded data. Otherwise, the character container is initialized to store utf-16 encoded data. The present disclosure can intelligently determine a storage method according to the language environment, optimize and adapt stored content, and effectively reduce the browser memory occupied by the webpage data.

Claims (46)

1. A method for compressing webpage text, comprising: according to a webpage-opening request of a mobile terminal browser, obtaining a current language environment of a terminal;

according to the language environment, initializing a character container corresponding to the language environment, wherein:

the character container is a storage space for storing related webpage data, and is implemented by applying for a “type” in software code to store the webpage data,

when the language environment belongs to Latin languages, the character container is initialized to store utf-8 encoded data, and

when the language environment does not belong to Latin languages, the character container is initialized to store utf-16 encoded data; and

receiving webpage data that are requested, parsing the webpage data, and merging and storing the webpage data by using the corresponding character container, including:

merging a plurality of text objects in source code of the webpage data that are originally stored in multiple character containers, and storing the merged plurality of text objects in the initialized character container, wherein the merged plurality of text objects are connected end to end, and

adding an adapting index for the initialized character container, such that each of the plurality of text object is able to be retrieved in the initialized character container according to a corresponding index value of the adapting index

wherein each of the plurality of text object is able to be retrieved in the initialized character container according to a corresponding index value of the adapting index without using the utf-8 encoded data or the utf-16 encoded data.

2. The method according to claim 1 , wherein the language environment belonging to Latin languages comprises English, German, or French.

3. The method according to claim 1 , wherein during a process of applying for the “type” in software code to store the webpage data, the method further comprises:

first, applying for an extra space in order to store a head of the type for indicating additional descriptive information; and

next, applying for an actual space in order to store the webpage data.

4. The method according to claim 1 , wherein the character container is implemented by applying for a String type in Java language to store the webpage text.

5. An apparatus for compressing webpage text, comprising one or more processors, memory, and one or more program units stored in the memory and to be executed by the one or more processors, the one or more program units comprising:

a language-environment-determining unit configured to, according to a webpage-opening request of a mobile terminal browser, obtain a current language environment of a terminal;

a character-container-initializing unit configured to, according to the language environment, initialize a character container corresponding to the language environment, wherein:

the character container is a storage space for storing related webpage data, and is implemented by applying for a “type” in software code to store the webpage data,

when the language environment belongs to Latin languages, the character container is initialized to store utf-8 encoded data, and

when the language environment does not belong to Latin languages, the character container is initialized to store utf-16 encoded data;

a data-transmitting unit configured to receive webpage data that are requested; and

a data-parsing-storing unit configured to parse the received webpage data, and merge and store the webpage data by using the corresponding character container, wherein the data-parsing-storing unit comprises:

a content-optimized-storage unit configured to merge a plurality of text objects in source code of the webpage data that are originally stored in multiple character containers, and storing the merged plurality of text objects in the initialized character container, wherein the merged plurality of text objects are connected end to end, and

an adapting unit configured to add an adapting index for the initialized character container, such that each of the plurality of text object is able to be retrieved in the initialized character container according to a corresponding index value of the adapting index

wherein each of the plurality of text object is able to be retrieved in the initialized character container according to a corresponding index value of the adapting index without using the utf-8 encoded data or the utf-16 encoded data.

6. The apparatus according to claim 5 , wherein, during a process of applying for the “type” in software code to store the webpage data:

an extra space is applied for first, in order to store a head of the type for indicating additional descriptive information; and

an actual space is applied for next, in order to store the webpage data.

7. The apparatus according to claim 5 , wherein the language environment belonging to Latin languages comprises English, German, or French.

8. The apparatus according to claim 5 , wherein the character container is implemented by applying for a String type in Java language to store the webpage text.

9. A non-transitory computer-readable storage medium having a program stored thereon, the program being executed by a processor, wherein, when executed by the processor, the program causes the processor to perform a process for compressing webpage text, the process comprising:

according to a webpage-opening request of a mobile terminal browser, obtaining a current language environment of a terminal;

according to the language environment, initializing a character container corresponding to the language environment, wherein:

the character container is a storage space for storing related webpage data, and is implemented by applying for a “type” in software code to store the webpage data,

when the language environment belongs to Latin languages, the character container is initialized to store utf-8 encoded data, and

when the language environment does not belong to Latin languages, the character container is initialized to store utf-16 encoded data; and

receiving webpage data that are requested, parsing the webpage data, and merging and storing the webpage data by using the corresponding character container, including:

merging a plurality of text objects in source code of the webpage data that are originally stored in multiple character containers, and storing the merged plurality of text objects in the initialized character container, wherein the merged plurality of text objects are connected end to end, and

adding an adapting index for the initialized character container, such that each of the plurality of text object is able to be retrieved in the initialized character container according to a corresponding index value of the adapting index

wherein each of the plurality of text object is able to be retrieved in the initialized character container according to a corresponding index value of the adapting index without using the utf-8 encoded data or the utf-16 encoded data.

10. The non-transitory computer-readable storage medium according to claim 9 , wherein the language environment belonging to Latin languages comprises English, German, or French.

11. The non-transitory computer-readable storage medium according to claim 9 , wherein the program further causes the processor the process comprising:

during a process of applying for the “type” in software code to store the webpage data,

first, applying for an extra space in order to store a head of the type for indicating additional descriptive information; and

next, applying for an actual space in order to store the webpage data.

12. The non-transitory computer-readable storage medium according to claim 9 , wherein the character container is implemented by applying for a String type in Java language to store the webpage text.

Assignments (2)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded May 28, 2020
From: GUANGZHOU UCWEB COMPUTER TECHNOLOGY CO., LTD
To: ALIBABA GROUP HOLDING LIMITED
Reel/Frame 052771/0562 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Sep 26, 2014
From: LIANG, JIE; HE, XIAOPENG; YU, YONGFU; ZHU, SHUNYAN; YANG, XING
To: GUANGZHOU UCWEB COMPUTER TECHNOLOGY CO., LTD
Reel/Frame 033829/0374 →
Priority Claims (1)
CN 2012 1 0593915 · Dec 31, 2012 · national
Continuity (1)
Related Publication 20150058715A1 · Feb 26, 2015