Summary of the invention
The application provides a kind of user profile to share method and system, can solve user profile record excessive occupied system resources, and the problem that cannot share.
In order to solve the problem, this application discloses a kind of user profile and sharing method, comprising the following steps:
The Fully-Qualified Domain Name of current web page is obtained from URL(uniform resource locator);
From described Fully-Qualified Domain Name, extract the Main Domain of current web page, described Main Domain comprises the network name of TLD and current web page;
The webpage identical to Main Domain realizes user profile and shares.
Further, the Main Domain extracting current web page from described Fully-Qualified Domain Name comprises:
Character string fractionation is carried out to described Fully-Qualified Domain Name;
The TLD that it comprises is obtained from described Fully-Qualified Domain Name, judge in TLD, whether to comprise IC domain name and ground area-name simultaneously, if, then determine that the Main Domain of current page is made up of three sections of character strings rear in described Fully-Qualified Domain Name, otherwise, then determine that the Main Domain of current page is made up of two sections of character strings rear in described Fully-Qualified Domain Name.
Further, describedly judge whether to comprise in TLD IC domain name and ground area-name comprises simultaneously:
TLD is mated with the IC domain name prestored and ground area-name, if can mate, then determines in TLD, to include IC domain name and/or ground area-name.
Further, the described webpage identical to Main Domain realize user profile share comprise:
Record the Main Domain of user profile in a certain webpage and this webpage;
Judge that whether the Main Domain of user current place webpage is identical with the described Main Domain recording the webpage of user profile, if so, then reads described user profile and is applied in the webpage of user current place.
Further, described user profile comprises login account and the password of user.
Further, the described user profile of described reading be applied in user current place webpage and comprise:
The user profile of reading is imported in current web page; And/or
The user profile of reading is sent to server end.
Further, described character string fractionation is carried out to described Fully-Qualified Domain Name after also comprise:
Character string quantity after statistics splits, if be less than two, then terminates subsequent operation, otherwise, then continue subsequent operation.
Further, also comprised before the Main Domain extracting current web page from described Fully-Qualified Domain Name:
Judge whether described Fully-Qualified Domain Name belongs to special domain name, if so, then determine that described Fully-Qualified Domain Name is Main Domain.
Further, describedly judge whether described Fully-Qualified Domain Name belongs to special domain name and comprise:
Current Fully-Qualified Domain Name is mated with the special domain name information table prestored, if can mate, then determines that current Fully-Qualified Domain Name belongs to special domain name, if can not mate, then determine that current Fully-Qualified Domain Name does not belong to special domain name.
In order to solve the problem, disclosed herein as well is a kind of user information sharing system, comprising:
Fully-Qualified Domain Name acquisition module, for obtaining the Fully-Qualified Domain Name of current web page from URL(uniform resource locator);
Main Domain determination module, for extracting the Main Domain of current web page from described Fully-Qualified Domain Name, described Main Domain comprises the network name of TLD and current web page;
Information sharing module, realizes user profile for the webpage identical to Main Domain and shares.
Further, described Main Domain determination module comprises:
Split cells, for carrying out character string fractionation to described Fully-Qualified Domain Name;
Main Domain assembled unit, for obtaining its TLD comprised from described Fully-Qualified Domain Name, judge in TLD, whether to comprise IC domain name and ground area-name simultaneously, if, then determine that the Main Domain of current web page is made up of three sections of character strings rear in described Fully-Qualified Domain Name, otherwise, then determine that the Main Domain of current web page is made up of two sections of character strings rear in described Fully-Qualified Domain Name.
Further, described Main Domain determination module also comprises:
TLD matching unit, for being mated with the IC domain name prestored and ground area-name by TLD, if can mate, then determines to include IC domain name and/or ground area-name in TLD.
Further, described information sharing module comprises:
Information recording unit, for recording the Main Domain of user profile in a certain webpage and this webpage; With
Main Domain judging unit, for judging that whether the Main Domain of user current place webpage is identical with the described Main Domain recording the webpage of user profile, if so, then reads described user profile and is applied in the webpage of user current place.
Further, described information sharing module also comprises:
Information imports unit, for importing in current web page by the user profile of reading; And/or
Information transmitting unit, for sending to server end by the user profile of reading.
Further, described system also comprises:
Character string quantity statistics module, for adding up the character string quantity after fractionation, if be less than two, then terminates subsequent operation, otherwise, then continue subsequent operation.
Further, described system also comprises:
Special domain name determination module, for judging whether described Fully-Qualified Domain Name belongs to special domain name, if so, then determines that described Fully-Qualified Domain Name is Main Domain.
Further, described special domain name determination module comprises:
Special domain name matching unit, for being mated with the special domain name information table prestored by current Fully-Qualified Domain Name, if can mate, then determining that current Fully-Qualified Domain Name belongs to special domain name, if can not mate, then determining that current Fully-Qualified Domain Name does not belong to special domain name.
Compared with prior art, the application comprises following advantage:
The application have employed specific Main Domain deterministic process, by the treatment and analysis to URL(uniform resource locator), can determine whether two URL(uniform resource locator) have identical Main Domain.And thus realize sharing of user profile.Namely can't carry out independent storing subscriber information for a Fully-Qualified Domain Name, but carry out the storage of user profile for Main Domain, that is, the Fully-Qualified Domain Name sharing users information be associated.Share except user profile can be realized, and greatly can save the memory space of user profile and reduce taking server end or local client memory space and system resource.
In addition, for user, for when logging in the different web pages with identical Main Domain, without the need to inputting user profile one by one, only need to input user profile in a webpage wherein, just can share method by the user profile of the application and realize the quick registration of other webpages or the quick importing of user profile.
Certainly, the arbitrary product implementing the application not necessarily needs to reach above-described all advantages simultaneously.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present application, be clearly and completely described the technical scheme in the embodiment of the present application, obviously, described embodiment is only some embodiments of the present application, instead of whole embodiments.Based on the embodiment in the application, the every other embodiment that those of ordinary skill in the art obtain, all belongs to the scope of the application's protection.
With reference to Fig. 1, illustrate that a kind of user profile of the application shares embodiment of the method one, comprise the following steps:
Step 101, obtains the Fully-Qualified Domain Name of current web page from URL(uniform resource locator).
URL(uniform resource locator) (URL, Uniform Resource Locator), i.e. the network address of webpage.In general, comprise Fully-Qualified Domain Name and the agreement (type of the file that will access) of current web page in URL(uniform resource locator) to I haven't seen you for ages, different according to actual conditions, in some page, also can comprise other information of port or access path etc.For the URL(uniform resource locator) of certain page " http://news.sina.com.cn/ ", comprise the Fully-Qualified Domain Name " news.sina.com.cn " of http agreement and server.When in this page of click, certain link enters another page, such as " http://news.sina.com.cn/c/2012-03-21..... ", in the URL(uniform resource locator) of so this page except agreement and Fully-Qualified Domain Name, further comprises other information " c/2012-03-21..... ".
Fully-Qualified Domain Name refers to by the English fullstop ". " of a string use, i.e. a certain computer or calculate the title of unit on the Internet of character string composition separated of round dot, for the position of the mark computer when transfer of data.At least comprise the network name of TLD and webpage, in some cases, also comprise a point domain name.
Because URL(uniform resource locator) adopts unalterable rules composition, by function corresponding in calling system, the Fully-Qualified Domain Name of server wherein just can be obtained according to its composition rule.
Step 102, extracts the Main Domain of current web page from described Fully-Qualified Domain Name, and described Main Domain comprises the network name of TLD and current web page.
Wherein, can extract according to the composition rule of Fully-Qualified Domain Name for the Main Domain extracting current web page from Fully-Qualified Domain Name, such as, determine the network name in Fully-Qualified Domain Name, then the domain name combination at different levels on the right of network name and network name are defined as Main Domain together.
Being appreciated that with reference to Fig. 2, in order to ensure the accuracy that Main Domain is determined, Main Domain can also being determined in the following way:
Step 201, carries out character string fractionation to described Fully-Qualified Domain Name.
According to domain name composition rule, Fully-Qualified Domain Name is made up of two or more character string, and adopt English fullstop ". " between character string, namely round dot separates, so can carry out character string fractionation according to round dot wherein to it.Still for aforementioned " news.sina.com.cn ", the character string number one obtained after fractionation has four, is respectively news, sina, com and cn.
Be appreciated that, when carrying out character string fractionation, the character string quantity after fractionation can also be added up further, if character string quantity is less than two, according to domain name composition rule, then can determine, Fully-Qualified Domain Name is wrong domain name, so without the need to carrying out subsequent operation, thus reduce judgement time, saving system resource.Only have when character string quantity is more than or equal to two, just need the judgement carrying out subsequent step.
Step 202, the TLD that it comprises is obtained from described Fully-Qualified Domain Name, judge in TLD, whether to comprise IC domain name and ground area-name simultaneously, if, then determine that the Main Domain of current web page is made up of three sections of character strings rear in described Fully-Qualified Domain Name, otherwise, then determine that the Main Domain of current web page is made up of two sections of character strings rear in described Fully-Qualified Domain Name.
According to domain name composition rule, the TLD in a Fully-Qualified Domain Name refers to IC domain name and ground area-name, and both can exist simultaneously, also can only have one.IC domain name refers to the domain name of expression different industries general in the world, and such as, com represents commercial undertaking, and net represents network organization, and org represents various tissue, as non-profit organization etc.Ground area-name refers to the domain name for distinguishing the country one belongs to or area, and such as, cn represents China, and uk represents Hong Kong etc.Except TLD, in Fully-Qualified Domain Name, also can comprise other domain names, such as, the network name (as baidu, sina, 163), point domain name (as tieba, news, zhidao) etc. of webpage.In general, Fully-Qualified Domain Name, according to round dot classification, is followed successively by top-level domain, second level domain, three grades of domain names ... from right to left.For " news.sina.com.cn ", top-level domain is " cn ", and second level domain is " com ", and three grades of domain names are " sina ", and level Four domain name is " news ".Because TLD comprises IC domain name and ground area-name, so the network name of webpage " sina " is three grades of domain names simultaneously.And for example, for " baidu.com ", top-level domain is " com ", and second level domain is " baidu ".Because TLD only comprises IC domain name " com ", so the network name of webpage " baidu " is second level domain.Correspondingly, for " tieba.baidu.com ", except top-level domain for " com " and second level domain also comprise three grades of domain names " tieba " for " baidu ".
According to noted earlier, if comprise IC domain name and ground area-name in TLD simultaneously, so the application can using the combination of three character strings below in Fully-Qualified Domain Name as Main Domain, one of if both only comprising in TLD, so the application can using the combination of two character strings below in Fully-Qualified Domain Name as Main Domain.That is, according to the method for the application, the Main Domain in " news.sina.com.cn " is " sina.com.cn ", and the Main Domain in " baidu.com " is " baidu.com ", and the Main Domain in " tieba.baidu.com " is also " baidu.com ".
During specific implementation, judge that whether comprising IC domain name in TLD can adopt with the following method with ground area-name:
TLD is mated with the IC domain name prestored and ground area-name, if can mate, then determines in TLD, to include IC domain name and/or ground area-name.
Because the IC domain name in TLD and ground area-name are fixing existence, so can gather in advance, and are stored in server end or local client, when needed, directly carry out mating.Concrete matching process can adopt string matching etc., and the application does not limit this.
Step 103, the webpage identical to Main Domain realizes user profile and shares.
According to the Main Domain defining method of the application, Main Domain only comprises network name and the TLD of webpage, and ignores the difference of Fully-Qualified Domain Name.Such as, for " tieba.baidu.com ", " zhidao.baidu.com " and " baidu.com " this three, although Fully-Qualified Domain Name is not identical, but determine that three has identical Main Domain according to the method for the application, namely be all " baidu.com " so just to realize the information sharing of the corresponding webpage of three domain names.
User profile can be the various information for identifying user, such as username and password, user preference, user's selection information etc., and it is as follows that user profile shares concrete implementation procedure:
Record the Main Domain of user profile in a certain webpage and this webpage;
Judge that whether the Main Domain of user current place webpage is identical with the described Main Domain recording the webpage of user profile, if so, then reads described user profile and is applied in the webpage of user current place.
Wherein user profile is shared can be the login account of user and sharing of password.Such as, when user have input login account and password in " tieba.baidu.com ", the user information sharing system of the application can store it, also can determine that its Main Domain is for " baidu.com " according to preceding method simultaneously.When user needs to log at " zhidao.baidu.com " page, first the user information sharing system of the application can be then " baidu.com " according to preceding method determination Main Domain, now, can determine that the Main Domain of the two is identical, can information sharing be realized.So, just can read login account and the password of the user be associated with this Main Domain from record, and be applied in current " zhidao.baidu.com " page.
Concrete, user profile is applied in the application of indication in the webpage of user current place, can automatically log in, to be automatically imported in current web page by user profile and to send to server end to realize automatically logging in, or do not import in current page, but directly user profile sent to server end to realize automatically logging in by the mode of running background.Also can only user profile be automatically imported in current web page, manually be selected whether will log in by user.Because in some cases, under same webpage, have login account and the password of multiple user in identical client, and in login interface, often can only show one group of user profile, which the group user profile that user can manually select oneself to need, thus avoid the situation of erroneous logons.
The application have employed specific Main Domain deterministic process, by the treatment and analysis to URL(uniform resource locator), can determine whether two URL(uniform resource locator) have identical Main Domain.And thus realize sharing of user profile.Namely can't carry out independent storing subscriber information for a Fully-Qualified Domain Name, but carry out the storage of user profile for Main Domain, that is, the Fully-Qualified Domain Name sharing users information be associated.Share except user profile can be realized, and greatly can save the memory space of user profile and reduce taking server end or local client memory space and system resource.In addition, for user, for when logging in the different web pages with identical Main Domain, without the need to inputting user profile one by one, only need to input user profile in a webpage wherein, just can share method by the user profile of the application and realize the quick registration of other webpages or the quick importing of user profile.
For this reason, with reference to Fig. 3, illustrate that the user profile of the application shares embodiment of the method two, before the step 102 of embodiment one, further comprising the steps of:
Step 301, judges whether the Fully-Qualified Domain Name of current web page belongs to special domain name, if so, determines that described Fully-Qualified Domain Name is Main Domain, otherwise, then carry out step 102.
Judge whether the Fully-Qualified Domain Name of current web page belongs to special domain name and comprise: mated with the special domain name information table prestored by current Fully-Qualified Domain Name, if can mate, then determine that current Fully-Qualified Domain Name belongs to special domain name, if can not mate, then determine that current Fully-Qualified Domain Name does not belong to special domain name.
Special domain name information table can be determined by the artificial mode collected, and is stored in local client or server end, such as, as configuration information etc.Because special domain name does not have unified pattern, so need artificial collection to determine.Such as, for some website, what its forum and mailbox adopted is same username and password, and namely identical user profile, now, forum and the mailbox domain name of these websites do not belong to special domain name, do not need to carry out special processing.But, for some website, what its forum and mailbox adopted is different username and passwords, such as, the login account form in the user profile of the mailbox Page-saving of certain website is xxxxx@xxx, and the login account form in the user profile of other Page-savings of certain website is xxxxx, there is no@xxx, so, even if the two has identical Main Domain, also cannot sharing users information.Therefore, now, using the domain name of the mailbox page of this website as special domain name, and user profile wherein can be preserved separately.
In the process of the application's determination Main Domain, only considered the network name of TLD and webpage, share so user profile can be realized in the webpage that Fully-Qualified Domain Name is different but Main Domain is identical.This realizes under being based on the identical prerequisite of the user profile used required in these webpages.For the webpage that some is special, although determine to have identical Main Domain according to preceding method, the user profile used required for different webpages is different, now without the need to sharing users information, just needs to carry out special process.Such as, for forum and mailbox two webpages with identical Main Domain, when user logs in forum, the user profile needing input is forum's register account number and password.When user logs in mailbox, the user profile needing input is mailbox register account number and password.Because, in general mailbox is relatively independent, namely mailbox register account number and password are not identical with password with forum register account number yet, now, although both have identical Main Domain, but required user profile is not identical, share without the need to realizing user profile, but need to record respective user profile respectively.Therefore, by preceding method, special domain name can be identified in time, thus carry out special processing, ensure the accuracy that user profile is shared.
With reference to Fig. 4, a kind of user information sharing system embodiment one of the application is shown, comprises Fully-Qualified Domain Name acquisition module 10, Main Domain determination module 30 and information sharing module 40.
Fully-Qualified Domain Name acquisition module 10, for obtaining the Fully-Qualified Domain Name of current web page from URL(uniform resource locator).
Main Domain determination module 30, for extracting the Main Domain of current web page from described Fully-Qualified Domain Name, described Main Domain comprises the network name of TLD and current web page.Concrete, Main Domain determination module 30
Preferably, Main Domain determination module 30 can also comprise split cells and Main Domain assembled unit.Split cells, for carrying out character string fractionation to described Fully-Qualified Domain Name.Preferably, split cells comprises round dot recognin unit, for carrying out character string fractionation according to the round dot in Fully-Qualified Domain Name to Fully-Qualified Domain Name.Because be separated by round dot between each section of character string comprised in Fully-Qualified Domain Name, just character string fractionation can be carried out to Fully-Qualified Domain Name accurately by round dot.Main Domain assembled unit, for obtaining its TLD comprised from described Fully-Qualified Domain Name, judge in TLD, whether to comprise IC domain name and ground area-name simultaneously, if, then determine that the Main Domain of current web page is made up of three sections of character strings rear in described Fully-Qualified Domain Name, otherwise, then determine that the Main Domain of current web page is made up of two sections of character strings rear in described Fully-Qualified Domain Name.Preferably, Main Domain determination module 30 also comprises TLD matching unit, for TLD is mated with the IC domain name prestored and ground area-name, if can mate, then determine in TLD, to include IC domain name and/or ground area-name.Concrete coupling can adopt string matching.
Information sharing module 40, realizes user profile for the webpage identical to Main Domain and shares.
Preferably, information sharing module 40 comprises information recording unit and Main Domain judging unit.Information recording unit, for recording the Main Domain of user profile in a certain webpage and this webpage.Main Domain judging unit, for judging that whether the Main Domain of user current place webpage is identical with the described Main Domain recording the webpage of user profile, if so, then reads described user profile and is applied in the webpage of user current place.
Further, information sharing module 40 also comprises information and imports unit and/or information transmitting unit.Information imports unit, for the user profile of reading being imported in current web page.Information transmitting unit, for sending to server end by the user profile of reading.Also namely, information sharing module 40 sends to server after can importing user profile again, also can only importing user profile and not send, directly the user of reading can also being sent to server, without the need to importing in current web page.Which kind of specifically choose mode can determine according to actual needs.
Preferably, described system also comprises character string quantity statistics module, for adding up the character string quantity after fractionation, if be less than two, then terminates subsequent operation, otherwise, then continue subsequent operation.Continue subsequent operation, that is, directly trigger the work of Main Domain determination module.
Preferably, with reference to Fig. 5, the user information sharing system embodiment two of the application is shown, this system also comprises special domain name determination module 70, for judging whether described Fully-Qualified Domain Name belongs to special domain name, if so, then determines that described Fully-Qualified Domain Name is Main Domain.
Special domain name determination module 70 comprises special domain name matching unit, for being mated with the special domain name information table prestored by current Fully-Qualified Domain Name, if can mate, then determine that current Fully-Qualified Domain Name belongs to special domain name, if can not mate, then determine that current Fully-Qualified Domain Name does not belong to special domain name.
The user information sharing system of the application can be attached in application software as the functional module of certain application software or plug-in unit, also can as an independently application software, the user profile used required in certain client is carried out preserving and sharing.Such as, can as the plug-in unit of browser, also can as the application software of such as login assistant.
The application have employed specific Main Domain deterministic process, by the treatment and analysis to URL(uniform resource locator), can determine whether two URL(uniform resource locator) have identical Main Domain.And thus realize sharing of user profile.Namely can't carry out independent storing subscriber information for a Fully-Qualified Domain Name, but carry out the storage of user profile for Main Domain, that is, the Fully-Qualified Domain Name sharing users information be associated.Share except user profile can be realized, and greatly can save the memory space of user profile and reduce taking server end or local client memory space and system resource.In addition, for user, for when logging in the different web pages with identical Main Domain, without the need to inputting user profile one by one, only need to input user profile in a webpage wherein, just can realize the quick registration of other webpages or the quick importing of user profile by the user information sharing system of the application.
As seen through the above description of the embodiments, those skilled in the art can be well understood to the mode that the application can add required general hardware platform by software and realizes.Based on such understanding, the technical scheme of the application can embody with the form of software product the part that prior art contributes in essence in other words, this computer software product can be stored in storage medium, as ROM/RAM, magnetic disc, CD etc., comprising some instructions in order to make a computer equipment (can be personal computer, server, or the network equipment etc.) perform the method described in some part of each embodiment of the application or embodiment.
Each embodiment in this specification all adopts the mode of going forward one by one to describe, between each embodiment identical similar part mutually see, what each embodiment stressed is the difference with other embodiments.Especially, for device or system embodiment, because it is substantially similar to embodiment of the method, so describe fairly simple, relevant part illustrates see the part of embodiment of the method.Apparatus and system embodiment described above is only schematic, the wherein said unit illustrated as separating component or can may not be and physically separates, parts as unit display can be or may not be physical location, namely can be positioned at a place, or also can be distributed in multiple network element.Some or all of module wherein can be selected according to the actual needs to realize the object of the present embodiment scheme.Those of ordinary skill in the art, when not paying creative work, are namely appreciated that and implement.
The user profile provided the application is above shared method and system and is described in detail, apply specific case herein to set forth the principle of the application and execution mode, the explanation of above embodiment is just for helping method and the core concept thereof of understanding the application; Meanwhile, for one of ordinary skill in the art, according to the thought of the application, all will change in specific embodiments and applications, in sum, this description should not be construed as the restriction to the application.