Browser jumps to the method for data synchronization and device of application program
Technical field
The present invention relates to the data sides of synchronization that field of computer technology more particularly to a kind of browser jump to application program
Method and device.
Background technique
Browser is and to allow user and these file interactions for showing the file in Website server or file system
A kind of application software, it may be displayed on text, image and other information in WWW or local area network etc., these texts or figure
The hyperlink of other network address is connected as can be, user can browse rapidly and easily various information.
When user is when carrying out web page browsing, if terminal is mounted with application program corresponding with the website browsed,
Terminal can leave browser interface and jump opening application program automatically, for example, when accessing Taobao in a browser, terminal inspection
Measure it is locally-installed have mobile phone Taobao software, the client of mobile phone Taobao can be automatic jumped to.
In this case, the statistical server of access record of browser is counted in counting user flow, Zhi Nengtong
The access record of user on a web browser before jumping to the APP such as Taobao is counted, and is continued in user enterprising in APP such as Taobaos
When row shopping, the access record for clicking button or link generation can not then be obtained by statistical server, this allows for statistical fractals
The access incomplete recording face that device counts causes the accuracy rate of statistics lower.
Summary of the invention
The embodiment of the present invention proposes the method for data synchronization that a kind of browser jumps to application program, can solve terminal
Application program jumps the technical issues of causing browser data statistics accuracy rate to reduce automatically.
A kind of browser jumps to the method for data synchronization of application program, comprising:
The the first web page resources request initiated in a browser is detected, when detecting first web page resources request,
It obtains first web page resources and requests corresponding first URL;
Local application list is read, is searched in the local application list corresponding with the first URL
Application program is as destination application;
If finding, application interface corresponding with the first URL in the destination application is jumped to;
It obtains the second web page resources initiated in the destination application and requests corresponding 2nd URL, according to described
2nd URL generates behavior record;
The behavior record is sent in the browser according to preset synchronizing cycle and is stored, the browser
For the behavior record of the storage to be reported to server.
It is described in one of the embodiments, to obtain the second web page resources request initiated in the destination application
Corresponding 2nd URL further include:
Obtain the initiation timestamp of the second web page resources request corresponding with the 2nd URL;
It is described that behavior record is generated according to the 2nd URL further include:
The initiation timestamp of the second web page resources request corresponding with the 2nd URL is added in the behavior record.
It is described in one of the embodiments, that the behavior record is sent to by the browsing according to preset synchronizing cycle
Before being stored in device further include:
Obtain target URL corresponding to the first object webpage of the destination application current presentation;
The target URL is sent to the browser, the browser is for showing corresponding with the target URL the
Two target webpages.
In one of the embodiments, before the generation behavior record according to the 2nd URL further include:
Obtain search key corresponding with the second web page resources request initiated in the destination application;
Obtain webpage thumbnail corresponding with the second web page resources request initiated in the destination application;
It is described that behavior record is generated according to the 2nd URL further include:
Described search keyword and/or the webpage thumbnail are added in the behavior record.
It is described in one of the embodiments, to jump to corresponding with the first URL in the destination application answer
Before interface further include:
Judge whether the destination application belongs to the preset white list for jumping application program, if so,
Application interface corresponding with the first URL in the destination application is jumped to described in execution.
Furthermore, it is also proposed that a kind of browser jumps to the data synchronization unit of application program.
A kind of browser jumps to the data synchronization unit of application program, comprising:
Network resource request detection module is being detected for detecting the first web page resources initiated in a browser request
To when first web page resources request, obtains first web page resources and request corresponding first URL;
Destination application determining module, for reading local application list, in the local application list
It is middle to search application program corresponding with the first URL as destination application;
Interface jump module, for jumping to application interface corresponding with the first URL in the destination application;
Behavior record generation module, for obtaining the second web page resources initiated in destination application request pair
The 2nd URL answered generates behavior record according to the 2nd URL;
Data simultaneous module, for according to preset synchronizing cycle by the behavior record be sent in the browser into
Row storage, the browser are used to the behavior record of the storage reporting to server.
The behavior record generation module is also used to obtain corresponding with the 2nd URL in one of the embodiments,
The initiation timestamp of second web page resources request;The second webpage corresponding with the 2nd URL is added in the behavior record
The initiation timestamp of resource request.
The data simultaneous module is also used to obtain the destination application current presentation in one of the embodiments,
First object webpage corresponding to target URL;The target URL is sent to the browser, the browser is for opening up
Show the second target webpage corresponding with the target URL.
In one of the embodiments, the behavior record generation module be also used to obtain with it is described in the target application
The second web page resources initiated in program request corresponding search key;Acquisition is sent out in the destination application with described
The second web page resources risen request corresponding webpage thumbnail;In the behavior record be added described search keyword and/or
The webpage thumbnail.
Described device further includes white list judgment module in one of the embodiments, for judging the target application
Whether program belongs to the preset white list for jumping application program, belongs in the destination application described preset
When can jump the white list of application program, the interface jump module is called.
It is jumped to using above-mentioned browser after the method for data synchronization and device of application program, in user in browser
When middle progress web page browsing, the address information of accessed webpage is parsed, if the application journey installed in the address information and terminal
Sequence be it is matched, then jump in corresponding application program continue webpage browsing;Also, continue to dig webpage in the application
During browsing, be recorded in the application program carry out web page browsing caused by access record, and timing or in real time will
The access record of record is sent to browser, so that the access data on browser are synchronous with the access data in application program
, and together report access record in the application when reporting access to record.Although that is, in a browser
Jump to during access webpage and carry out web page browsing in application program, but because statistical server counting user visit
When asking record, access record of the user in application program is also counted, there is no cause because application server is jumped to
Complete access record can not be counted, i.e., statistical server statistics is that user completely accesses record, improves user's access
Record statistical accuracy.
Detailed description of the invention
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below
There is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this
Some embodiments of invention for those of ordinary skill in the art without creative efforts, can be with
It obtains other drawings based on these drawings.
Wherein:
Fig. 1 jumps to the flow diagram of the method for data synchronization of application program for browser a kind of in one embodiment;
Fig. 2 jumps to the structural schematic diagram of the data synchronization unit of application program for browser a kind of in one embodiment;
Fig. 3 sets to run the computer for the method for data synchronization that aforementioned browser jumps to application program in one embodiment
Standby structural schematic diagram.
Specific embodiment
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete
Site preparation description, it is clear that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.It is based on
Embodiment in the present invention, it is obtained by those of ordinary skill in the art without making creative efforts every other
Embodiment shall fall within the protection scope of the present invention.
In the present embodiment, the method for data synchronization that a kind of browser jumps to application program, the reality of this method are proposed
It now can be dependent on computer program, which can run on the computer system based on von Neumann system, should
Computer program can be the application program of starting management or being associated with for browser and other application of the application program in terminal
The management application program of starting.The computer system can be such as smart phone, the plate electricity for running above-mentioned computer program
The servers such as brain, PC or terminal.
Specifically, as shown in Figure 1, the method for data synchronization that above-mentioned browser jumps to application program includes the following steps:
Step S102: the first web page resources request that detection is initiated in a browser is detecting the first webpage money
When source is requested, obtains first web page resources and request corresponding first URL.
During carrying out web page access, user inputs the web page address that will be accessed in address field, or clicks
The web page address for other websites for including on website, browser is depending on the user's operation and corresponding web page address generates accordingly
HTTP request, and be sent to Web server, that is to say, that user initiates the request of the first web page resources in a browser, and
And the request corresponds to above-mentioned web page address.
Scripting language, such as JavaScript etc., the behaviour of detection web page resources request can be pre-defined in a browser
Make, such as click event, the click event of button control of hyperlink control, so that obtaining web page resources requests corresponding URL,
That is network address.
It should be noted that in the present embodiment, detecting that user initiates first network resource request in a browser
When, network address corresponding with the request is obtained, that is, obtains URL (Uniform Resource corresponding with the request
Locator)。
Step S104: reading local application list, searches and described first in the local application list
The corresponding application program of URL, if finding, thens follow the steps S1060 as destination application: jumping to the target application
Application interface corresponding with the first URL in program;If not finding, S1062 is thened follow the steps: opening up in the browser
Show the page corresponding with the first URL.
When carrying out website visiting, browser extracts keyword from acquired URL, and passes through keyword and local peace
The application information of dress is compared, and has searched whether application program corresponding with the website information.For example, in terminal access
When Taobao, obtaining its web page address is " https: //www.taobao.com/ ", and terminal extracts keyword therein and is
" taobao ", terminal inquire the application journey that registration information includes keyword " taobao " in local the application list
Sequence, i.e. judgement website information is corresponding with local application, and the local application is identified as destination application, should
Destination application is the application program jumped.
In the present embodiment, if in the presence of destination application, in order to guarantee that user is good in browsing pages
Good applicable experience jumps in destination application and continues to browse and operate.Specifically, browser is finding local
When there is application program corresponding with web page address in the application list, i.e., sent the commands to application program management software
Jump to corresponding application program;The transmission of the instruction can be straight by the plug-in unit of built-in application program management in a browser
It connects to send to application program management software and instruct.It in another embodiment, can also be by browser to terminal control center
Transmission instruction, then send and instruct from terminal control center to application program management software, to realize from browser to using journey
Sequence jumps.
It should be noted that when jumping to destination application by browser, also by it is above-mentioned detect in browser
First web page resources of middle initiation are requested and corresponding first URL is also sent to destination application, target application journey together
Sequence after start-up, is shown corresponding with the first URL using boundary according to the request of the first web page resources and corresponding first URL
Face initiates web page resources request in a browser and shows Client-initiated web page resources in destination application to realize
Request corresponding interface.
Optionally, in one embodiment, not all operation in a browser jumps to corresponding application
Program is operated, for example, it is A in application, without jumping, alternatively, may be used also that user, which can be set in the application for needing to jump,
It is B in application, being jumped so that the application for needing to jump is arranged in.Further, the white name that can jump application can also be set
Blacklist single and that application can not be jumped.
Specifically, in one embodiment, it is above-mentioned jump to it is corresponding with the first URL in the destination application
Before application interface further include: judge whether the destination application belongs to the preset white name for jumping application program
It is single, if so, jumping to application interface corresponding with the first URL in the destination application described in executing.
That is, application program white list can be jumped by being preset in browser or terminal, that is, detecting terminal
In local application list in include application program when being present in the white list, the application program management software of terminal
Allow the starting of the application program.For example, in the application program white list being arranged in a browser include Alipay software, when with
Family is when accessing website, and comprising " alipay " keyword in the web page interlinkage that is accessed, it is corresponding using journey that browser detects its
Sequence is Alipay software, and finds in the local application list of terminal that there are Alipay softwares, also, the Alipay
Software belongs on the above-mentioned white list for jumping application, then executes corresponding skip operation.
For another example the blacklist that can not jump application is additionally provided in a browser, in the target application journey that needs jump
When sequence belongs to the blacklist, no matter it whether is already installed with the application program at the terminal, without skip operation.
Step S108: obtaining the second web page resources initiated in the destination application and request corresponding 2nd URL,
Behavior record is generated according to the 2nd URL.
The behavior record: being sent in the browser according to preset synchronizing cycle and store by step S110,
The browser is used to the behavior record of the storage reporting to server.
After jumping to destination application, a process is opened in destination application and is used to record user in mesh
The historical data generated during browsing data is carried out in mark application program.For example, user passes through in destination application
The historical data for the web data browsing that the operations such as search operation, link clicks operation generate.Specifically, above-mentioned process is in user
During carrying out web data browsing, obtains all web page resources initiated in destination application and request corresponding net
Page address (or URL), and behavior record is generated according to all URL got.It include that user makes in behavior record
With all access records during target application browsing data data.
In order to enable in a browser including all access records of user, and it is reported to web server
The complete access record of user when access record, therefore, after user completes the access of data in destination application,
Access record of the user in destination application is sent to browser, so that browser obtains the access completed record.
It should be noted that in the present embodiment, the time that access record is sent to browser by destination application can
To be real-time, that is to say, that access request of the process detection generally described above into destination application then updates access note
Record, and updated access record is sent to browser, so that browser obtains access data in real time, i.e. realization browser
Real-time data between destination application are synchronous.
Further, in another embodiment, a synchronizing cycle can also be set, that is to say, that target application journey
Access record is sent to browser according to above-mentioned timing synchronizing cycle by sequence, reduces synchronization during data synchronization
Number, and the occupancy to terminal resource.
That is, in a browser not only include user's corresponding behavior record or access record in a browser,
Further comprise behavior record or access record that user carries out data access in destination application.So that browser exists
When behavior record or access record are reported to web server, the data cover that reports user completely accesses record, raising
The integrality of reported data.
It should be noted that in the present embodiment, the behavior record that browser reports is sent to clear for destination application
It lookes at the behavior record of device, can also include the behavior that browser is generated according to the record of the browsing data carried out on a web browser
Record.
Optionally, after user terminates browsing, browser is by the access record storage of user into browser rs cache.It is clear
Device of looking at caching, commonly referred to as Cookie, sometimes also with its plural form Cookies, refer to certain websites in order to distinguish user identity,
The data (generally going through encryption) for carrying out session tracking and being stored on user local terminal.Cookie is by server end
It generates, is sent to User-Agent (usually browser), the key key/ value value of Cookie can be saved in some by browser
In text file under catalogue, request next time just to send the Cookie when same website to server (on condition that browser is arranged
To enable Cookie).Cookie name claims and is worth can be developed oneself definition by server end, can also be direct for JSP
Jsessionid is written, such server is known that whether the user is legitimate user and whether needs to log in again,
Server can be set or read comprising information in Cookies, safeguard user with the state in server session whereby.In user
After carrying out data access in destination application, corresponding behavior record is also stored in the Cookie of browser together
In.
It should be noted that in the present embodiment, while generating behavior record, not only by web page address or URL packet
It is contained in behavior record, is stored with timestamp corresponding with each single item behavior record, in behavior record also for distinguishing net
The sequencing of page browsing.
Specifically, described obtain the second web page resources request corresponding second initiated in the destination application
URL further include: obtain the initiation timestamp of the second web page resources request corresponding with the 2nd URL;It is described according to described
Two URL generate behavior record further include: the second web page resources corresponding with the 2nd URL are added in the behavior record and ask
The initiation timestamp asked.
It further, can also include the search key of user's input when carrying out Webpage search in behavior record
Equal search record, the search record the preference information that may be used to determine user;Also, can also include in behavior record
The related datas such as the webpage thumbnail that user generates when browsing webpage.
Specifically, before the above-mentioned generation behavior record according to the 2nd URL further include: obtain and described in the target
The second web page resources initiated in application program request corresponding search key;It obtains and described in the destination application
Second web page resources of middle initiation request corresponding webpage thumbnail;It is described also to be wrapped according to the 2nd URL generation behavior record
It includes: described search keyword and/or the webpage thumbnail being added in the behavior record.
That is, not only obtaining the webpage institute of user's access when user accesses network by destination application
Corresponding web page address or corresponding URL, it is also necessary to obtain user during the browsing of webpage caused by search and webpage
The search histories such as search official foundation, and above-mentioned search history is added in behavior record, so that web server counts use again
The preference information of user is determined when the preference information at family according to search history.
It should be noted that in the present embodiment, what destination application was synchronized to browser is not only access record,
The page that can also show destination application is also together as the synchronized of access record is into browser.
Specifically, the described behavior record is sent in the browser according to preset synchronizing cycle stores
Before further include: obtain target URL corresponding to the first object webpage of the destination application current presentation;By the mesh
Mark URL is sent to the browser, and the browser is for showing the second target webpage corresponding with the target URL.
It, will also be currently in target while behavior record is sent to browser by destination application in specific implementation
The corresponding URL of the webpage shown on the displayed page of application program is also sent to browser together, and browser is receiving the URL
Later, the corresponding webpage of the URL is loaded, and shows webpage corresponding with the URL on the corresponding displayed page of browser.
In another embodiment, synchronizing for above-mentioned webpage can also be that destination application obtains currently in displayed page
The corresponding script file of the target webpage of upper displaying, is then sent to browser for the script text together, and browser is receiving
To after script file, target webpage is shown by load script file.
In addition, in one embodiment, as shown in Figure 2, it is also proposed that a kind of browser jumps to the data of application program
Synchronizing device, including network resource request detection module 102, destination application determining module 104, interface jump module 106,
Behavior record generation module 108 and data simultaneous module 110, in which:
Network resource request detection module 102 is being examined for detecting the first web page resources initiated in a browser request
When measuring first web page resources request, obtains first web page resources and request corresponding first URL;
Destination application determining module 104 is arranged for reading local application list in the local application
Application program corresponding with the first URL is searched in table as destination application;
Interface jump module 106, it is corresponding with the first URL using boundary in the destination application for jumping to
Face;
Behavior record generation module 108 is asked for obtaining the second web page resources initiated in the destination application
Corresponding 2nd URL is sought, behavior record is generated according to the 2nd URL;
Data simultaneous module 110, for the behavior record to be sent to the browser according to preset synchronizing cycle
In stored, the browser is used to the behavior record of the storage reporting to server.
Optionally, in one embodiment, behavior record generation module 108 is also used to obtain corresponding with the 2nd URL
The second web page resources request initiation timestamp;The second net corresponding with the 2nd URL is added in the behavior record
The initiation timestamp of page resource request.
Optionally, in one embodiment, data simultaneous module 110 is also used to obtain the destination application and currently opens up
Target URL corresponding to the first object webpage shown;The target URL is sent to the browser, the browser is used for
Show the second target webpage corresponding with the target URL.
Optionally, in one embodiment, behavior record generation module 108 is also used to obtain and answer with described in the target
Corresponding search key is requested with the second web page resources initiated in program;It obtains and described in the destination application
The second web page resources initiated request corresponding webpage thumbnail;In the behavior record be added described search keyword and/
Or the webpage thumbnail.
Optionally, in one embodiment, it as shown in Fig. 2, above-mentioned apparatus further includes white list judgment module 112, is used for
Judge whether the destination application belongs to the preset white list for jumping application program, in the target application journey
When sequence belongs to the preset white list for jumping application program, the interface jump module 106 is called.
It is jumped to using above-mentioned browser after the method for data synchronization and device of application program, in user in browser
When middle progress web page browsing, the address information of accessed webpage is parsed, if the application journey installed in the address information and terminal
Sequence be it is matched, then jump in corresponding application program continue webpage browsing;Also, continue to dig webpage in the application
During browsing, be recorded in the application program carry out web page browsing caused by access record, and timing or in real time will
The access record of record is sent to browser, so that the access data on browser are synchronous with the access data in application program
, and together report access record in the application when reporting access to record.Although that is, in a browser
Jump to during access webpage and carry out web page browsing in application program, but because statistical server counting user visit
When asking record, access record of the user in application program is also counted, there is no cause because application server is jumped to
Complete access record can not be counted, i.e., statistical server statistics is that user completely accesses record, improves user's access
Record statistical accuracy.
In one embodiment, as shown in figure 3, Fig. 3 is illustrated and a kind of run above-mentioned browser and jump to application program
The terminal of the computer system based on von Neumann system of method of data synchronization.The computer system can be smart phone,
The terminal devices such as tablet computer, palm PC, laptop or PC.Specifically, may include being connected by system bus
Outer input interface 1001, processor 1002, memory 1003 and the output interface 1004 connect.Wherein, outer input interface
1001 can optionally include at least network interface 10012.Memory 1003 may include external memory 10032 (such as hard disk, CD
Or floppy disk etc.) and built-in storage 10034.Output interface 1004 can include at least the equipment such as display screen 10042.
In the present embodiment, the operation of this method is based on computer program, and the program file of the computer program is stored in
In the external memory 10032 of the aforementioned computer system based on von Neumann system, it is loaded into built-in storage at runtime
It in 10034, is then compiled as being transferred in processor 1002 after machine code executing, so that being based on von Neumann system
Computer system in form network resource request detection module 102 in logic, destination application determining module 104, boundary
Face jump module 106, behavior record generation module 108, data simultaneous module 110 and white list judgment module 112.And upper
It states browser to jump in the method for data synchronization implementation procedure of application program, the parameter of input passes through outer input interface
1001 receive, and are transferred in memory 1003 and cache, and are then input in processor 1002 and are handled, the number of results of processing
According to or be cached in memory 1003 and subsequently handled, or be passed to output interface 1004 and exported.
Specifically, in one embodiment, above-mentioned processor 1002 is for detecting the first webpage initiated in a browser
Resource request obtains the first web page resources request corresponding first when detecting first web page resources request
URL;Local application list is read, application corresponding with the first URL is searched in the local application list
Program is as destination application;If finding, corresponding with the first URL in the destination application answer is jumped to
Use interface;It obtains the second web page resources for initiating in the destination application and requests corresponding 2nd URL, according to described the
Two URL generate behavior record;The behavior record is sent in the browser according to preset synchronizing cycle and is stored,
The browser is used to the behavior record of the storage reporting to server.
In an alternate embodiment of the invention, processor 1002 is also used to obtain the second web page resources corresponding with the 2nd URL
The initiation timestamp of request;The hair of the second web page resources request corresponding with the 2nd URL is added in the behavior record
Play timestamp.
In an alternate embodiment of the invention, the behavior record is sent to described by processor 1002 according to preset synchronizing cycle
Before being stored in browser, processor 1002 is also used to obtain the first object net of the destination application current presentation
Target URL corresponding to page;The target URL is sent to the browser, the browser is for showing and the target
Corresponding second target webpage of URL.
In an alternate embodiment of the invention, before processor 1002 generates behavior record according to the 2nd URL, processor 1002
It is also used to obtain search key corresponding with the second web page resources request initiated in the destination application;It obtains
Take webpage thumbnail corresponding with the second web page resources request initiated in the destination application;Further,
Processor 1002 is also used to that described search keyword and/or the webpage thumbnail are added in the behavior record.
In an alternate embodiment of the invention, processor 1002 jumps to corresponding with the first URL in the destination application
Application interface before, processor is also used to judge whether the destination application belongs to described preset jump using journey
The white list of sequence, when belonging to the preset white list for jumping application program, processor 1002 jumps to the target application
Application interface corresponding with the first URL in program, and output interface 1004 is for showing the destination application after jumping
In application interface corresponding with the first URL.
The above disclosure is only the preferred embodiments of the present invention, cannot limit the right model of the present invention with this certainly
It encloses, therefore equivalent changes made in accordance with the claims of the present invention, is still within the scope of the present invention.