CN102360392A - Method and device for determining webpage encoding mode - Google Patents

Method and device for determining webpage encoding mode Download PDF

Info

Publication number
CN102360392A
CN102360392A CN2011103261404A CN201110326140A CN102360392A CN 102360392 A CN102360392 A CN 102360392A CN 2011103261404 A CN2011103261404 A CN 2011103261404A CN 201110326140 A CN201110326140 A CN 201110326140A CN 102360392 A CN102360392 A CN 102360392A
Authority
CN
China
Prior art keywords
coded system
array
webpage
alternative
reference encoder
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN2011103261404A
Other languages
Chinese (zh)
Other versions
CN102360392B (en
Inventor
朱宏浩
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hisense Mobile Communications Technology Co Ltd
Original Assignee
Hisense Mobile Communications Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hisense Mobile Communications Technology Co Ltd filed Critical Hisense Mobile Communications Technology Co Ltd
Priority to CN201110326140.4A priority Critical patent/CN102360392B/en
Publication of CN102360392A publication Critical patent/CN102360392A/en
Application granted granted Critical
Publication of CN102360392B publication Critical patent/CN102360392B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Information Transfer Between Computers (AREA)

Abstract

The embodiment of the invention relates to the field of network techniques, in particular to a method and device for determining a webpage encoding mode, which are used for solving the problem that in the prior art, the method for determining the webpage encoding mode has low accuracy, so that a webpage is easy to generate illegible characters after encoding process. The method for determining the webpage encoding mode provided by the embodiment of the invention comprises the following steps of: determining a reference coding mode array of a webpage to be encoded; and determining an encoding mode contained in the reference coding mode array and an alternative encoding mode array to be used as an encoding mode of the webpage to be encoded according to the reference coding mode array and the alternative encoding mode array preset locally. Since the embodiment of the invention does not completely depend on a statement encoding mode or the reference coding mode of the webpage to be encoded, the determined encoding mode of the webpage to be encoded is more accurate, and thus the probability of occurrence of the illegible characters on the webpage after encoding process is effectively reduced.

Description

A kind of method and apparatus of definite web page coding mode
Technical field
The present invention relates to networking technology area, particularly a kind of method and apparatus of definite web page coding mode.
Background technology
Along with development of internet technology; More and more users selects to use terminal device (like mobile phone, computing machine, panel computer etc.) online; Need use browser (Browser) to realize that browser commonly used at present comprises the IE browser (Microsoft Internet Explorer) of Microsoft, FireFox browser etc. to the browsing of webpage during online; At present, browser is following to the identifying of webpage:
According to http protocol (HyperText Transfer Protocol; HTTP); Obtain the statement coded system in the META label in statement coded system or the webpage source code to be encoded in the webpage http response head to be encoded (Response headers); And call corresponding character set according to this statement coded system and encode, finally demonstrate the particular content of this webpage; If obtain the statement coded system failure of webpage, then adopt the coded system of this browser acquiescence that this webpage is encoded, and demonstrate the particular content of this webpage.
But in practical application; When especially adopting the browser browsing page in the mobile phone terminal; Generally be through WAP (Wireless Application Protocol; WAP) agency to be to realize the webpage of view Internet, promptly by the server of internet the information (like http response head or this webpage source code of this webpage) of webpage is sent to the WAP agency earlier, and handled by the WAP agency; The information of this webpage after will being handled by the WAP agency again is sent to browser, by browser webpage is discerned; Following situation might appear:
First kind of situation is the statement coded system that browser can successfully get access to this webpage; But what browser obtained is the statement coded system after the WAP agent processes; It might be inconsistent with the statement coded system of original this webpage, thereby cause webpage mess code phenomenon easily; Second kind of situation is the statement coded system that browser can't get access to this webpage, then because browser adopts the coded system of acquiescence to handle, webpage mess code phenomenon very likely occurs.
In sum, the accuracy of the method for existing definite web page coding mode is low, thereby makes webpage carry out occurring the mess code phenomenon easily after the encoding process.
Summary of the invention
The embodiment of the invention provides a kind of method and apparatus of definite web page coding mode, and the accuracy of method that is used for solving definite web page coding mode that prior art exists is low, thereby makes webpage carry out occurring easily after the encoding process problem of mess code phenomenon.
The embodiment of the invention provides a kind of method of definite web page coding mode, comprising:
Confirm the reference encoder mode array of webpage to be encoded, comprise at least a reference encoder mode in the said reference encoder mode array;
According to said reference encoder mode array and the local preset alternative coded system array that comprises at least a alternative coded system, determine a kind of coded system of being included in said reference encoder mode array and the said alternative coded system array coded system as said webpage to be encoded.
Preferably, comprise a kind of alternative coded system in the said alternative coded system array;
The coded system of confirming said webpage to be encoded comprises:
If comprise this alternative coded system in the said reference encoder mode array, then confirm the coded system that this alternative coded system is said webpage to be encoded.
Preferably, comprise multiple alternative coded system in the said alternative coded system array;
The coded system of confirming said webpage to be encoded comprises:
From said alternative coded system array, select to be included in the said reference encoder mode array, and the highest alternative coded system of priority level is as the coded system of said webpage to be encoded.
Preferably, confirm that the method for the embodiment of the invention also comprises after the reference encoder mode array of webpage to be encoded:
When in said reference encoder mode array, not comprising in the said alternative coded system array arbitrary alternative coded system, confirm that the highest reference encoder mode of said reference encoder mode array medium priority is the coded system of said webpage to be encoded.
Preferably, said method also comprises:
The counter that the alternative coded system of selecting is corresponding increases a preset increment;
During numerical value in the corresponding counter of the alternative coded system that the numerical value in the corresponding counter of the low alternative coded system of priority is high greater than priority, upgrade the priority of alternative coded system in the said alternative coded system array.
Preferably, said method also comprises:
The reference encoder mode that the reference encoder mode array medium priority of selecting is the highest is as new alternative coded system in the said alternative coded system array, and it is minimum that the priority of said new alternative coded system is set.
Preferably, confirm said reference encoder mode array according to the following step:
Obtain the part web data among each framework frame of said webpage to be encoded;
Confirm this web data corresponding reference coded system array according to the web data that gets access to.
The embodiment of the invention provides a kind of equipment of definite web page coding mode, and said equipment comprises:
Determination module is used for confirming the reference encoder mode array of webpage to be encoded comprising at least a reference encoder mode in the said reference encoder mode array;
Processing module; Be used for according to said reference encoder mode array and the local preset alternative coded system array that comprises at least a alternative coded system, determine a kind of coded system of being included in said reference encoder mode array and the said alternative coded system array coded system as said webpage to be encoded.
Preferably, said processing module specifically is used for:
From said alternative coded system array, be chosen in alternative coded system in the said reference encoder mode array as the coded system of said webpage to be encoded.
Preferably, said processing module specifically is used for:
Comprise a kind of alternative coded system in the said alternative coded system array,, then confirm the coded system that this alternative coded system is said webpage to be encoded if comprise this alternative coded system in the said reference encoder mode array.
Preferably, said processing module specifically is used for:
Comprise multiple alternative coded system in the said alternative coded system array, from said alternative coded system array, select to be included in the said reference encoder mode array, and the highest alternative coded system of priority level is as the coded system of said webpage to be encoded.
Preferably, said processing module also is used for:
When in said reference encoder mode array, not comprising in the said alternative coded system array arbitrary alternative coded system, confirm that the highest reference encoder mode of said reference encoder mode array medium priority is the coded system of said webpage to be encoded.
Preferably, said equipment also comprises:
First update module, being used for the counter that the alternative coded system of selecting is corresponding increases a preset increment; During numerical value in the corresponding counter of the alternative coded system that the numerical value in the corresponding counter of the low alternative coded system of priority is high greater than priority, upgrade the priority of alternative coded system in the said alternative coded system array.
Preferably, said equipment also comprises:
Second update module is used for the reference encoder mode that the reference encoder mode array medium priority of selecting is the highest as the new alternative coded system of said alternative coded system array, and it is minimum that the priority of said new alternative coded system is set.
The embodiment of the invention is according to the alternative coded system in reference encoder mode in the reference encoder mode array of confirming and the local alternative coded system array of presetting; Confirm the coded system of webpage to be encoded; Owing to not exclusively depend on the statement coded system and the highest reference encoder mode of priority of webpage to be encoded; Actual coding mode at statement coded system and webpage to be encoded is inconsistent; Or the actual coding mode of the highest reference encoder mode of the priority in reference encoder mode array and webpage to be encoded is when inconsistent; The coded system of the webpage of confirming to be encoded is more accurate, thereby effectively reduces the Webpage generation mess code probability of phenomena after the encoding process.
Description of drawings
Fig. 1 is the method flow diagram of first kind of definite web page coding mode of the embodiment of the invention;
Fig. 2 is the method flow diagram of second kind of definite web page coding mode of the embodiment of the invention;
Fig. 3 confirms the method flow diagram of web page coding mode for the third of the embodiment of the invention;
Fig. 4 A is the device structure synoptic diagram of first kind of definite web page coding mode of the embodiment of the invention;
Fig. 4 B is the device structure synoptic diagram of second kind of definite web page coding mode of the embodiment of the invention.
Embodiment
The present invention is according to the alternative coded system in reference encoder mode in the reference encoder mode array of confirming and the local alternative coded system array of presetting; Confirm the mode of the coded system of webpage to be encoded; Make the coded system of definite webpage to be encoded more accurate, effectively reduce Webpage generation mess code probability of phenomena.
Below in conjunction with accompanying drawing the embodiment of the invention is described in detail.Need to prove, be that example describes the embodiment of the invention with the Chinese text coded system all in following examples, confirms that the method for coded system of other spoken and written languages (like Japanese, Korean etc.) webpage is similar with it, repeats no more here.
The coded system of existing Chinese text mainly comprises: UTF-8 (a kind of elongated character code of UNICODE is claimed ten thousand country codes again), GBK (Chinese character code expansion national standard), GB2312 (Chinese Character Set Code for Informati), BIG-5 (Big5), ISO-8859-1 (byte coding); In actual the use, the coded system that utilization rate is high has UTF-8, GBK and BIG-5.
The embodiment of the invention is applicable to all portable terminals, is particularly useful for cell phone apparatus.
Preferably, the embodiment of the invention is applicable to the intrasystem browser based on WebKit of Android.
Before the method for definite web page coding mode of carrying out the embodiment of the invention,, start the automatic detection literal code of WebKit (browser engine of increasing income) earlier according to the enabled instruction that receives; Literal code during soon the browser in the cell phone apparatus will be provided with is set to detect automatically literal code;
Concrete, increase " detecting literal code automatically " option in the literal code mode in the setup menu of browser, supply the user to select; If the user selects this option, then adopt the method for the embodiment of the invention to confirm the coded system of webpage to be encoded; The user is after selecting to be somebody's turn to do " detecting literal code automatically " option, and browser is through calling the method that following program realizes definite web page coding mode of the startup embodiment of the invention:
Settings::setUsesEncodingDetector(true)。
The embodiment of the invention provides a kind of method of definite web page coding mode, and is as shown in Figure 1, may further comprise the steps:
S101, confirm the reference encoder mode array of webpage to be encoded to comprise at least a reference encoder mode in this reference encoder mode array;
S102, according to reference encoder mode array and the local preset alternative coded system array that comprises at least a alternative coded system, determine a kind of coded system of being included in this reference encoder mode array and this alternative coded system array coded system as webpage to be encoded.
Among the step S101, reference encoder mode array is to confirm according to the web data of webpage to be encoded;
Preferably, reference encoder mode array is definite through a third party software ICU (International Componets for Unicode, internationalization assembly); Concrete, confirm the reference encoder mode array of webpage to be encoded according to following steps:
The interface that the web data of webpage to be encoded is provided through ICU is sent to ICU and handles; Wherein, ICU is a Software Development Library of increasing income.
ICU confirms this web data corresponding reference coded system array according to the web data of the webpage of receiving to be encoded; Wherein, The priority of the reference encoder mode in the reference encoder mode array is to confirm according to the height of the actual coding mode of this web data and the matching degree between the reference encoder mode; It is the high more reference encoder mode of matching degree; Its priority is also just high more, and its arrangement position in this reference encoder mode array is also just forward more, and the rest may be inferred; Be that the highest reference encoder mode of priority comes on the position of the matches [0] in this reference encoder mode array.
Be that example describes with the intrasystem browser based on WebKit of Android below, other situation are similar with it, repeat no more here.
Existing Web Kit is that decode method through the TextResourceDecoder class realizes for the coding of the web data of the webpage of receiving to be encoded; Under the situation of having launched automatic detection literal code function, about every buffer memory 4KB web data all calls a decode method and carries out encoding process; Because the literal code mode in each Webpage framework (frame) generally all is unified, therefore, in order to improve the efficient of webpage to be encoded being carried out encoding process, preferably, the embodiment of the invention is obtained the web data of webpage to be encoded according to the following step:
Obtain the part web data in each framework of webpage to be encoded;
The reference encoder mode array of then confirming webpage to be encoded comprises: according to the part web data in each framework of webpage to be encoded, confirm each framework corresponding reference coded system array.
Need to prove; The encoding process of just can carrying out each how many web datas of buffer memory depends on when transplanting WebKit; The treatment mechanism of the HTTP that provides for WebKit; Because WebKit self does not have HTTP data transmit-receive mechanism, need, the installation system of portable terminal the data transmit-receive function be provided when transplanting for it.Wherein, in the Android system, just can submit to WebKit after about every buffer memory 4KB data and handle.
Preferably, in the Android system, obtain the 4KB web data of first buffer memory in each framework of webpage to be encoded,, confirm each framework corresponding reference coded system array according to the 4KB web data of first buffer memory in each framework; The embodiment of the invention is called the number of times of decode method through minimizing, to improve the efficient of encoding process.
After the coded system of confirming webpage to be encoded, the embodiment of the invention also comprises: adopt the coded system of confirming that webpage to be encoded is carried out encoding process, to show the word content of this webpage to be encoded.
Local preset alternative coded system array comprises following two kinds of situation:
First kind of situation: only comprise a kind of alternative coded system in the local preset alternative coded system array, then confirm the coded system of webpage to be encoded according to following steps:
If comprise this alternative coded system in the reference encoder mode array of confirming, then confirm the coded system that this alternative coded system is a webpage to be encoded;
If do not comprise this alternative coded system in the reference encoder mode array of confirming; The reference encoder mode of then confirming to give tacit consent in this reference encoder mode array (be generally in the reference encoder mode array sorting position in primary reference encoder mode, the reference encoder mode that promptly matching degree is the highest) is the coded system of webpage to be encoded;
Need to prove; If the coded system of the webpage of confirming to be encoded is the reference encoder mode of giving tacit consent in the reference encoder mode array; The interface that then provides through ICU calls the coded system of this webpage of confirming to be encoded from ICU; Webpage to be encoded is carried out encoding process, with the word content of display web page.
Illustrate, as shown in Figure 2, if only comprise UTF-8 alternative coded system in the local preset alternative coded system array, confirm that then the coded system of webpage to be encoded may further comprise the steps:
Whether comprise UTF-8 in the reference encoder mode array that S201, judgement are confirmed; If then carry out S202; If not, then carry out S203;
S202, confirm that UTF-8 is the coded system of webpage to be encoded; And process ends;
S203, confirm that the reference encoder mode of giving tacit consent in the reference encoder mode array is the coded system of webpage to be encoded;
S204, the interface that provides through ICU call the coded system of definite webpage to be encoded from ICU.
Second kind of situation: when comprising multiple alternative coded system in the local preset alternative coded system array, then confirm the coded system of webpage to be encoded according to following steps:
If when in reference encoder mode array, comprising in the alternative coded system array at least one alternative coded system; Confirm that alternative coded system array medium priority is not the highest, and be included in alternative coded system in the reference encoder mode as the coded system of webpage to be encoded;
Wherein, The priority of the alternative coded system in the local alternative coded system array of presetting can be set according to the height of alternative coded system utilization rate in actual use; The instream factor of general alternative coded system is high more, and then the priority level in this alternative coded system array is just high more;
If when in reference encoder mode array, not comprising in the alternative coded system array arbitrary alternative coded system, confirm the coded system of the not highest reference encoder mode of reference encoder mode array medium priority as webpage to be encoded.
To comprise that three alternative coded systems are that example describes in the preset alternative coded system array in this locality, other situation are similar with it, repeat no more here below.
As shown in Figure 3, if comprise UTF-8, GBK and three kinds of alternative coded systems of BIG-5 in the local preset alternative coded system array, these three kinds of alternative coded systems are followed successively by in the priority of this alternative coded system array from high to low: UTF-8, GBK, BIG-5;
The coded system of then confirming webpage to be encoded may further comprise the steps:
Whether comprise UTF-8 in the reference encoder mode array that S301, judgement are confirmed; If then carry out S302; If not, then carry out S303;
S302, confirm that UTF-8 is the coded system of webpage to be encoded, and process ends;
Whether comprise GBK in the reference encoder mode array that S303, judgement are confirmed; If then carry out S304; If not, then carry out S305;
S304, confirm that GBK is the coded system of webpage to be encoded, and process ends;
Whether comprise BIG-5 in the reference encoder mode array that S305, judgement are confirmed; If then carry out S306; If not, then carry out S307;
S306, confirm that BIG-5 is the coded system of webpage to be encoded, and process ends;
S307, confirm that the reference encoder mode that matching degree is the highest in the reference encoder mode array (being first reference encoder mode matches [0] in the reference encoder mode array) is the coded system of webpage to be encoded;
S308, the interface that provides through ICU call definite coded system from ICU.
Preferably, the coded system of definite webpage to be encoded of the embodiment of the invention can realize through following program:
Figure BDA0000101488610000091
Wherein, shouldAutoDetect () is used to judge whether to start the automatic detection literal code mode mechanism of WebKit, promptly whether starts the method for definite web page coding mode of the embodiment of the invention;
In said procedure; Japanese and other Languages literal are handled respectively, that is to say, for the coded system of confirming day web page text; WebKit does not use ICU to detect its literal code mode, and is to use detactJapaneseEncoding () to realize that Japanese web page coding mode detects;
And for non-japanese type, especially Chinese text then adopts detectTextEncoding () to detect evaluation algorithm, and realizes the judgement of literal code mode through ICU;
The embodiment of the invention is that the decode method of TextResourceDecoder class is improved, and m_codec is the member variable of TextResourceDecoder class, when first web data of the page framework of receiving webpage to be encoded, constructs this object; The embodiment of the invention is only judged the web data corresponding coding manner when receiving first web data.
In the method for the coded system of definite webpage to be encoded, when getting access to the statement coded system of this webpage to be encoded, confirm that the statement coded system of obtaining is the coded system of webpage to be encoded in the background technology; The statement coded system of webpage owing to when getting access to the statement coded system of this webpage to be encoded, place one's entire reliance upon; Again because mobile phone terminal generally all is to act on behalf of the view Internet webpage through WAP; So; The coded system of the webpage to be encoded that causes easily confirming and the actual coding mode of webpage to be encoded are inconsistent, thereby the phenomenon of page mess code occurs; And the embodiment of the invention is confirmed the coded system of webpage to be encoded through reference encoder mode array and local preset alternative coded system array; Owing to do not consider whether can get access to the statement coded system of this webpage to be encoded, so can effectively reduce page generation mess code phenomenon;
Generally can select first reference encoder mode matches [0] in the reference encoder mode array that the intrasystem ICU of Android confirms as the coded system of webpage to be encoded; But in the practical application, the matches [0] of the reference encoder mode array that the actual coding mode of webpage to be encoded is usually returned with ICU is inconsistent, thereby after causing adopting matches [0] that webpage to be encoded is carried out encoding process, the mess code phenomenon appears in the page; The embodiment of the invention is through comparing the reference encoder mode and the local alternative coded system of presetting in the alternative coded system array in the reference encoder mode array; The coded system of the webpage of confirming to be encoded; Owing to not exclusively depend on the reference encoder mode array that ICU returns; Thereby make the coded system of definite webpage to be encoded more accurate, and then can effectively reduce page generation mess code phenomenon.
The method of the embodiment of the invention also comprises: in alternative coded system array, increase new alternative coded system; And the priority of current alternative coded system in the alternative coded system array is upgraded.
Concrete, the new alternative coded system of the increase of the embodiment of the invention comprises:
When in reference encoder mode array, not comprising alternative coded system arbitrary in the alternative coded system array; The reference encoder mode that the reference encoder mode array medium priority of selecting is the highest is as new alternative coded system in this alternative coded system array, and it is minimum that the priority of this new alternative coded system is set.
With method shown in Figure 2 is example, and the reference encoder mode among the matches [0] of hypothetical reference coded system array is GBK;
When in reference encoder mode array, not comprising UTF-8, confirm that the matches [0] in the reference encoder mode array is that GBK is the coded system of webpage to be encoded;
GBK is added in the alternative coded system array, and it is minimum that the priority of GBK is set; This moment, alternative coded system array comprised two kinds of alternative coded systems, according to priority was followed successively by UTF-8, GBK from high to low.
The priority to current alternative coded system in the alternative coded system array of the embodiment of the invention is upgraded, and comprising:
From alternative coded system array, be chosen in after the alternative coded system in the reference encoder mode array, the counter that the alternative coded system of selecting is corresponding increases a preset increment; Wherein preset increment is an empirical value, is generally 1;
During numerical value in the corresponding counter of the alternative coded system that the numerical value in the corresponding counter of the low alternative coded system of priority is high greater than priority, upgrade the priority of alternative coded system in this alternative coded system array;
With method shown in Figure 3 is example, supposes that raw value is 0 in the corresponding counter of UTF-8, GBK, BIG-5;
If the coded system of the webpage of confirming to be encoded is UTF-8, the numerical value in the counter that then UTF-8 is corresponding adds 1;
If the coded system of the webpage of confirming to be encoded is GBK, the numerical value in the counter that then GBK is corresponding adds 1;
If the coded system of the webpage of confirming to be encoded is BIG-5, the numerical value in the counter that then BIG-5 is corresponding adds 1;
Current numerical value at the corresponding counter of UTF-8 is 10, and the current numerical value of the counter that GBK is corresponding is 11; The current numerical value of the counter that BIG-5 is corresponding is 8 o'clock; Be the current numerical value of the current numerical value of the corresponding counter of the low GBK of priority greater than the corresponding counter of the high UTF-8 of priority; Then upgrade the priority of the alternative coded system in this alternative coded system array, the priority of the reference encoder mode after the renewal is followed successively by GBK, UTF-8, BIG-5 from high to low.
Based on same inventive concept; A kind of equipment of definite web page coding mode also is provided in the embodiment of the invention; Because the principle that this equipment is dealt with problems is similar with the method for above-mentioned definite web page coding mode, so the enforcement of this equipment can repeat part and repeat no more referring to the enforcement of method.
The embodiment of the invention provides a kind of equipment of definite web page coding mode, and shown in Fig. 4 A, equipment comprises:
Determination module 40 is used for confirming the reference encoder mode array of webpage to be encoded comprising at least a reference encoder mode in this reference encoder mode array;
Processing module 41; Be used for according to reference encoder mode array and the local preset alternative coded system array that comprises at least a alternative coded system, determine a kind of coded system of being included in this reference encoder mode array and this alternative coded system array coded system as webpage to be encoded.
Preferably, processing module 41 specifically is used for: alternative coded system array comprises a kind of alternative coded system, if comprise this alternative coded system in the reference encoder mode array, then confirms the coded system that this alternative coded system is a webpage to be encoded.
Preferably, processing module 41 specifically is used for:
Comprise multiple alternative coded system in the alternative coded system array, from this alternative coded system array, select to be included in the reference encoder mode array, and the highest alternative coded system of priority level is as the coded system of webpage to be encoded.
Preferably, processing module 41 also is used for:
When in reference encoder mode array, not comprising in the alternative coded system array arbitrary alternative coded system, confirm reference encoder mode array medium priority not the highest reference encoder mode be the coded system of webpage to be encoded.
Preferably, shown in Fig. 4 B, the equipment of the embodiment of the invention also comprises:
First update module 42, being used for the counter that the alternative coded system of selecting is corresponding increases a preset increment; During numerical value in the corresponding counter of the alternative coded system that the numerical value in the corresponding counter of the low alternative coded system of priority is high greater than priority, upgrade the priority of alternative coded system in this alternative coded system array.
Preferably, shown in Fig. 4 B, the equipment of the embodiment of the invention also comprises:
Second update module 43 is used for the reference encoder mode that the reference encoder mode array medium priority of selecting is the highest as the new alternative coded system of this alternative coded system array, and it is minimum that the priority of this new alternative coded system is set.
The embodiment of the invention is according to the alternative coded system in reference encoder mode in the reference encoder mode array of confirming and the local predefined alternative coded system array; Confirm the coded system of webpage to be encoded; Owing to not exclusively depend on the statement coded system and the highest reference encoder mode of priority level of webpage to be encoded; Actual coding mode at statement coded system and webpage to be encoded is inconsistent; Or the actual coding mode of the highest reference encoder mode of the priority in reference encoder mode array and webpage to be encoded is when inconsistent; The coded system of the webpage of confirming to be encoded is more accurate, thereby effectively reduces the Webpage generation mess code probability of phenomena after the encoding process.
Those skilled in the art should understand that embodiments of the invention can be provided as method, system or computer program.Therefore, the present invention can adopt the form of the embodiment of complete hardware embodiment, complete software implementation example or combination software and hardware aspect.And the present invention can be employed in the form that one or more computer-usable storage medium (including but not limited to magnetic disk memory, CD-ROM, optical memory etc.) that wherein include computer usable program code go up the computer program of implementing.
The present invention is that reference is described according to the process flow diagram and/or the block scheme of method, equipment (system) and the computer program of the embodiment of the invention.Should understand can be by the flow process in each flow process in computer program instructions realization flow figure and/or the block scheme and/or square frame and process flow diagram and/or the block scheme and/or the combination of square frame.Can provide these computer program instructions to the processor of multi-purpose computer, special purpose computer, Embedded Processor or other programmable data processing device to produce a machine, make the instruction of carrying out through the processor of computing machine or other programmable data processing device produce to be used for the device of the function that is implemented in flow process of process flow diagram or a plurality of flow process and/or square frame of block scheme or a plurality of square frame appointments.
These computer program instructions also can be stored in ability vectoring computer or the computer-readable memory of other programmable data processing device with ad hoc fashion work; Make the instruction that is stored in this computer-readable memory produce the manufacture that comprises command device, this command device is implemented in the function of appointment in flow process of process flow diagram or a plurality of flow process and/or square frame of block scheme or a plurality of square frame.
These computer program instructions also can be loaded on computing machine or other programmable data processing device; Make on computing machine or other programmable devices and to carry out the sequence of operations step producing computer implemented processing, thereby the instruction of on computing machine or other programmable devices, carrying out is provided for being implemented in the step of the function of appointment in flow process of process flow diagram or a plurality of flow process and/or square frame of block scheme or a plurality of square frame.
Although described the preferred embodiments of the present invention, in a single day those skilled in the art get the basic inventive concept could of cicada, then can make other change and modification to these embodiment.So accompanying claims is intended to be interpreted as all changes and the modification that comprises preferred embodiment and fall into the scope of the invention.
Obviously, those skilled in the art can carry out various changes and modification to the present invention and not break away from the spirit and scope of the present invention.Like this, belong within the scope of claim of the present invention and equivalent technologies thereof if of the present invention these are revised with modification, then the present invention also is intended to comprise these changes and modification interior.

Claims (13)

1. the method for a definite web page coding mode is characterized in that, said method comprises:
Confirm the reference encoder mode array of webpage to be encoded, comprise at least a reference encoder mode in the said reference encoder mode array;
According to said reference encoder mode array and the local preset alternative coded system array that comprises at least a alternative coded system, determine a kind of coded system of being included in said reference encoder mode array and the said alternative coded system array coded system as said webpage to be encoded.
2. the method for claim 1 is characterized in that, comprises a kind of alternative coded system in the said alternative coded system array;
The coded system of confirming said webpage to be encoded comprises:
If comprise this alternative coded system in the said reference encoder mode array, then confirm the coded system that this alternative coded system is said webpage to be encoded.
3. the method for claim 1 is characterized in that, comprises multiple alternative coded system in the said alternative coded system array;
The coded system of confirming said webpage to be encoded comprises:
From said alternative coded system array, select to be included in the said reference encoder mode array, and the highest alternative coded system of priority level is as the coded system of said webpage to be encoded.
4. the method for claim 1 is characterized in that, confirms also to comprise after the reference encoder mode array of webpage to be encoded:
When in said reference encoder mode array, not comprising in the said alternative coded system array arbitrary alternative coded system, confirm that the highest reference encoder mode of said reference encoder mode array medium priority is the coded system of said webpage to be encoded.
5. like the arbitrary described method of claim 1~3, it is characterized in that said method also comprises:
The counter that the alternative coded system of selecting is corresponding increases a preset increment;
During numerical value in the corresponding counter of the alternative coded system that the numerical value in the corresponding counter of the low alternative coded system of priority is high greater than priority, upgrade the priority of alternative coded system in the said alternative coded system array.
6. like claim 1 or 4 described methods, it is characterized in that said method also comprises:
The reference encoder mode that the reference encoder mode array medium priority of selecting is the highest is as new alternative coded system in the said alternative coded system array, and it is minimum that the priority of said new alternative coded system is set.
7. like the arbitrary described method of claim 1~4, it is characterized in that,
Confirm said reference encoder mode array according to the following step:
Obtain the part web data among each framework frame of said webpage to be encoded;
Confirm this web data corresponding reference coded system array according to the web data that gets access to.
8. the equipment of a definite web page coding mode is characterized in that, said equipment comprises:
Determination module is used for confirming the reference encoder mode array of webpage to be encoded comprising at least a reference encoder mode in the said reference encoder mode array;
Processing module; Be used for according to said reference encoder mode array and the local preset alternative coded system array that comprises at least a alternative coded system, determine a kind of coded system of being included in said reference encoder mode array and the said alternative coded system array coded system as said webpage to be encoded.
9. equipment as claimed in claim 8 is characterized in that, said processing module specifically is used for:
Comprise a kind of alternative coded system in the said alternative coded system array,, then confirm the coded system that this alternative coded system is said webpage to be encoded if comprise this alternative coded system in the said reference encoder mode array.
10. equipment as claimed in claim 8 is characterized in that, said processing module specifically is used for:
Comprise multiple alternative coded system in the said alternative coded system array, from said alternative coded system array, be chosen in the said reference encoder mode array, and the highest alternative coded system of priority level is as the coded system of said webpage to be encoded.
11. equipment as claimed in claim 8 is characterized in that, said processing module also is used for:
When in said reference encoder mode array, not comprising in the said alternative coded system array arbitrary alternative coded system, confirm that the highest reference encoder mode of said reference encoder mode array medium priority is the coded system of said webpage to be encoded.
12., it is characterized in that said equipment also comprises like the arbitrary described equipment of claim 8~10:
First update module, being used for the counter that the alternative coded system of selecting is corresponding increases a preset increment; During numerical value in the corresponding counter of the alternative coded system that the numerical value in the corresponding counter of the low alternative coded system of priority is high greater than priority, upgrade the priority of alternative coded system in the said alternative coded system array.
13., it is characterized in that said equipment also comprises like claim 8 or 11 described equipment:
Second update module is used for the reference encoder mode that the reference encoder mode array medium priority of selecting is the highest as the new alternative coded system of said alternative coded system array, and it is minimum that the priority of said new alternative coded system is set.
CN201110326140.4A 2011-10-24 2011-10-24 Method and device for determining webpage encoding mode Active CN102360392B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201110326140.4A CN102360392B (en) 2011-10-24 2011-10-24 Method and device for determining webpage encoding mode

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201110326140.4A CN102360392B (en) 2011-10-24 2011-10-24 Method and device for determining webpage encoding mode

Publications (2)

Publication Number Publication Date
CN102360392A true CN102360392A (en) 2012-02-22
CN102360392B CN102360392B (en) 2014-03-12

Family

ID=45585720

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201110326140.4A Active CN102360392B (en) 2011-10-24 2011-10-24 Method and device for determining webpage encoding mode

Country Status (1)

Country Link
CN (1) CN102360392B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103246565A (en) * 2012-02-02 2013-08-14 中兴通讯股份有限公司 Resource assess arbitration method and device
WO2015043072A1 (en) * 2013-09-29 2015-04-02 北大方正集团有限公司 Method and system for selecting an encoding format for reading a target document
CN110020343A (en) * 2017-09-01 2019-07-16 北京国双科技有限公司 The determination method and apparatus of web page coding format

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101179575A (en) * 2007-09-30 2008-05-14 珠海博睿科技有限公司 Method, device and system for providing code

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101179575A (en) * 2007-09-30 2008-05-14 珠海博睿科技有限公司 Method, device and system for providing code

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103246565A (en) * 2012-02-02 2013-08-14 中兴通讯股份有限公司 Resource assess arbitration method and device
WO2015043072A1 (en) * 2013-09-29 2015-04-02 北大方正集团有限公司 Method and system for selecting an encoding format for reading a target document
US10366143B2 (en) 2013-09-29 2019-07-30 Peking University Founder Group Co., Ltd. Method and system for selecting encoding format for reading target document
CN110020343A (en) * 2017-09-01 2019-07-16 北京国双科技有限公司 The determination method and apparatus of web page coding format
CN110020343B (en) * 2017-09-01 2021-03-30 北京国双科技有限公司 Method and device for determining webpage coding format

Also Published As

Publication number Publication date
CN102360392B (en) 2014-03-12

Similar Documents

Publication Publication Date Title
CN102693280B (en) Webpage browsing method, WebApp framework, method and device for executing JavaScript, and mobile terminal
EP2732380B1 (en) Mobile web browser for pre-loading web pages
CN107832099B (en) Method and device for client version compatibility and storage medium
CN105843815B (en) Page comment processing method and device and browser
CN105472035A (en) File transmission method and device
CN102567485B (en) The special parsing of provider for content retrieval
CN111666497A (en) Application program loading method and device, electronic equipment and readable storage medium
CN107291481B (en) Component updating method, device and system
CN102368248B (en) Page downloading control method and system of IE kernel browser
CN108647032B (en) Application loading method and device, computer device and computer readable storage medium
CN105302802A (en) Picture uploading method and system and browser
CN112256296A (en) Express delivery service APP updating method, device, equipment and storage medium based on Weex
US20140136967A1 (en) Method of providing predictive text
CN112685671A (en) Page display method, device, equipment and storage medium
US20180365032A1 (en) Method for Interface Refresh Synchronization, Terminal Device, and Non-Transitory Computer-Readable Storage Medium
JP2009259124A (en) System and method for providing application update information
CN102360392B (en) Method and device for determining webpage encoding mode
AU2016101498B4 (en) Data Interchange System
CN107526730B (en) Translation data management method, storage medium and electronic device
CN113778581A (en) Page loading method, electronic equipment and storage medium
CN106502707B (en) Code generation method and device
CN106033364B (en) Web application program upgrading method and system
CN105095303B (en) Quick link pushing method and quick link pushing device
US20150154314A1 (en) Method, apparatus and terminal for webpage content browsing
CN111124627A (en) Method, device, terminal and storage medium for determining application program caller

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant