Data interactive method, apparatus and system
Technical field
The present invention relates to internet arena, in particular to a kind of data interactive method, apparatus and system.
Background technology
With the development of network, front page optimization becomes the concern technology of major portal websites and company's site, wherein,
A/B tests are a kind of emerging front page optimization methods, can be used for the webpage indexs such as increase conversion ratio registration rate.A/B tests are originally
It is experiment between a separate type group in matter, the technical costs and resources costs that A/B tests were carried out in the past are of a relatively high, but present one is
The appearance of the visualized experiment instrument of specialty is arranged, A/B tests have increasingly becomed the conventional method of web information flow.
There is substantial amounts of demand to be to be controlled by a third-party script to web page contents in above-mentioned A/B tests
System, and collect user behavior data.Yet with the limitation of the cross-domain securities of script javascript, cause and third party's service
The data interaction of device largely, the mode dependent on the indirect transfer information of the resource files such as script, picture, i.e. server
Performed and fed back one by one according to the request message received.
Lack association for the data received in the prior art and the data sent out in server end and cause data to pass
The problem of defeated efficiency is reduced, not yet proposes effective solution at present.
The content of the invention
It is a primary object of the present invention to provide a kind of data interactive method, apparatus and system, to solve the number received
Cause the problem of data transmission efficiency is reduced according to association is lacked in server end with the data sent out.
To achieve these goals, there is provided a kind of data interactive method for one side according to embodiments of the present invention.Root
Data interactive method according to the present invention includes:The data request information for carrying index coding, index coding are sent to server
For indicating server after corresponding data are obtained according to data request information, to Data Matching correspondence script information;Receive
The data that server is returned according to data request information;The script request information for carrying index coding, pin are sent to server
This solicited message is used to indicate that server is encoded according to index, obtains the script information of corresponding data;The reception server is according to pin
The script information for the data that this solicited message is returned;According to script information display data.
To achieve these goals, there is provided a kind of data interaction device for another aspect according to embodiments of the present invention.Root
Data interaction device according to the present invention includes:First sending module, the data of index coding are carried for being sent to server
Solicited message, index coding is used to indicate server after corresponding data are obtained according to data request information, to Data Matching
Correspondence script information;First receiving module, the data returned for the reception server according to data request information;Second sends mould
Block, for server send carry index coding script request information, script request information be used for indicate server according to
According to index coding, the script information of corresponding data is obtained;Second receiving module, for the reception server according to script request information
The script information of the data of return;Display module, the script information for being received according to the second receiving module shows the first reception
The data that module is received.
To achieve these goals, there is provided a kind of data interaction system, root for another aspect according to embodiments of the present invention
Data interaction system according to the present invention includes:Server and terminal, server are set up with terminal and communicated to connect, wherein, terminal is
Above-mentioned data interaction device.
According to inventive embodiments, the data request information of index coding, index coding are carried by being sent to server
For indicating server according to the corresponding data of data request information acquisition;The reception server is returned according to data request information
Data;The script request information for carrying index coding is sent to server, script request information is used to indicate server foundation
Index coding, obtains the script information of corresponding data;The script letter for the data that the reception server is returned according to script request information
Breath;According to script information display data, solve the data received and the data sent out lacks association in server end and led
The problem of data transmission efficiency is reduced is caused, the effect of improving data transmission efficiency has been reached.
Brief description of the drawings
The accompanying drawing for constituting the part of the application is used for providing a further understanding of the present invention, schematic reality of the invention
Apply example and its illustrate to be used to explain the present invention, do not constitute inappropriate limitation of the present invention.In the accompanying drawings:
Fig. 1 is the flow chart of data interactive method according to embodiments of the present invention;
Fig. 2 is the schematic diagram of data interaction device according to embodiments of the present invention;
Fig. 3 is the schematic diagram of data interaction device according to the preferred embodiment of the invention;
Fig. 4 is the schematic diagram of data interaction device according to the preferred embodiment of the invention;
Fig. 5 is the schematic diagram of data interaction device according to the preferred embodiment of the invention;
Fig. 6 is the schematic diagram of data interaction device according to the preferred embodiment of the invention;And,
Fig. 7 is the schematic diagram of data interaction system according to embodiments of the present invention.
Embodiment
It should be noted that in the case where not conflicting, the feature in embodiment and embodiment in the application can phase
Mutually combination.Describe the present invention in detail below with reference to the accompanying drawings and in conjunction with the embodiments.
In order that those skilled in the art more fully understand the present invention program, below in conjunction with the embodiment of the present invention
Accompanying drawing, the technical scheme in the embodiment of the present invention is clearly and completely described, it is clear that described embodiment is only
The embodiment of a part of the invention, rather than whole embodiments.Based on the embodiment in the present invention, ordinary skill people
The every other embodiment that member is obtained under the premise of creative work is not made, should all belong to the model that the present invention is protected
Enclose.
It should be noted that term " first " in description and claims of this specification and above-mentioned accompanying drawing, "
Two " etc. be for distinguishing similar object, without for describing specific order or precedence.It should be appreciated that so using
Data can exchange in the appropriate case, so as to embodiments of the invention described herein.In addition, term " comprising " and " tool
Have " and their any deformation, it is intended that covering is non-exclusive to be included, for example, containing series of steps or unit
Process, method, system, product or equipment are not necessarily limited to those steps clearly listed or unit, but may include without clear
It is listing to Chu or for the intrinsic other steps of these processes, method, product or equipment or unit.
Embodiment one
The embodiments of the invention provide a kind of data interactive method.
Fig. 1 is the flow chart of data interactive method according to embodiments of the present invention.As shown in figure 1, the data interactive method
It is as follows including step:
Step S102, the data request information for carrying index coding is sent to server, and index coding is used to indicate clothes
Device be engaged in after corresponding data are obtained according to data request information, to Data Matching correspondence script information;
Specifically, data interactive method provided in an embodiment of the present invention goes for terminal device, the terminal device can
Think:Any one in smart mobile phone, tablet personal computer, notebook computer, desktop computer, palm PC.Wherein, the present invention is real
Apply the data interactive method provided in example one to illustrate exemplified by applied to desktop computer, be applied particularly to A/B tests or net
Request of data during page browsing, wherein request of data can be request image data, request voice data, request video counts
One or more in.
For example, user using desktop computer during webpage is browsed, desktop computer is by receiving pair that user sends
The selection instruction of picture in current display interface, sends to the solicited message of the picture to the server of network, wherein to
Server is sent to addition index coding in the solicited message of the picture, to cause server to believe in reception the request of the picture
After breath, according to the index codes match to should picture script information.
Step S104, the data that the reception server is returned according to data request information;
Specifically, still exemplified by being illustrated in step S102, desktop computer the reception server is to tackling the request of the picture
The image data of feedback of the information.
Step S106, the script request information for carrying index coding is sent to server, and script request information is used to refer to
Show that server is encoded according to index, obtain the script information of corresponding data;
Specifically, still by taking the distance in step S102 as an example, step S104 receive to should picture image data
When, desktop computer sends the script for showing the picture to server, wherein, send the script request for showing the picture
During information, encoded by carrying with unified index in step S102, to enable image data and pin in server end
This information association is got up.
Step S108, the script information for the data that the reception server is returned according to script request information;
Specifically, still exemplified by being illustrated in step S106, desktop computer the reception server is to applied to the display picture
Script request feedback of the information corresponding script information.
Step S110, according to script information display data.
Specifically, by taking the citing that above-mentioned steps are provided as an example, according to the step S104 image datas received and step
The script information that S108 is received, image data is shown according to the script information.
Data interactive method provided in an embodiment of the present invention, the data that index coding is carried by being sent to server please
Information is sought, index coding is used to indicate that server obtains corresponding data according to data request information;The reception server is according to number
The data returned according to solicited message;The script request information for carrying index coding is sent to server, script request information is used
In indicating server foundation index coding, the script information of corresponding data is obtained;The reception server is returned according to script request information
The script information for the data returned;According to script information display data, the data received and the data sent out are solved in clothes
Business device end, which lacks association, causes the problem of data transmission efficiency is reduced, and has reached the effect of improving data transmission efficiency.
It is preferred that, in step S102, sent to server before the data request information for carrying index coding, method is also
Including:
Step S100, obtains index coding;
Step S101, by index coding encapsulation into data request information and script request information.
Specifically, with reference to step S100 and step S101, by being encapsulated in data request information and script request information
Index coding, is used to show this in server end to enable according to the Data Matching asked in corresponding data request information
The script information of data, i.e. set up the data of request and the corresponding relation of corresponding script according to index coding in server end.
For example, still exemplified by being illustrated in step S102~step S110, server end is encoded according to index, sets up desk-top
Computer ask image data with for showing the corresponding relation between the corresponding script of the picture.
It is preferred that, in above-mentioned steps S100, index coding is obtained, including:
Step1. indexing parameter is obtained, indexing parameter includes at least one of:URL, browser
UserAgent information, current time;
Specifically, the indexing parameter obtained includes at least one of:Source URL url, browser
UserAgent information UserAgent, current time.UserAgent refers to the information at user browser end, i.e. server can
UserAgent in index code knows browser type used in active user, and to should browser type match
Corresponding data type.
Step2. first kind coding is carried out to URL and browser UserAgent information, obtained after coding
The first kind code;
Specifically, source url and userAgent is carried out into string-concatenation, and obtain Hash codes hashcode.
The embodiment of the present invention is illustrated using Hash codes as the first kind exemplified by code, to realize that data interactive method is defined,
Specific coded system is not limited.
Step3. first kind code and current time are encoded by pre-arranged code, obtains index coding.
Specifically, the Hash codes got in Step2 are spliced by the current time with being got in Step1,
Obtain index coding.
For example, how the Hash codes got in Step2 to be spelled by the current time with being got in Step1
Connect, obtain index coding, illustrated according to following citing:
From the foregoing, it will be observed that from above-mentioned code it will be seen that final index coding be by:+ 6 random words of current time
The hashCode compositions of the browser UserAgent information of symbol string+2.
It is preferred that, in above-mentioned steps Step2, first is carried out to URL and browser UserAgent information
Class is encoded, the first kind code after being encoded, including:
A, URL by preset function obtained into corresponding first numerical value;
B, browser UserAgent information by preset function obtained into corresponding second value;
Specifically, with reference to A and B, corresponding first numerical value is being obtained to URL and to browser
When UserAgent information obtains corresponding second value, used preset function can be same function, or correspond to respectively
URL and browser UserAgent information provide corresponding preset function.In order to obtain in step Step2
One class code, it is necessary to by being calculated to meet Hash coding method in Hash coding needed for each code bit before step C is carried out
Numerical value, i.e. calculate corresponding first numerical value of URL and corresponding second number of browser UserAgent information
Value.
For example, how to respectively obtain corresponding first numerical value and second value by A and B, illustrated according to following
It is bright:
From the foregoing, it will be observed that as can be seen that being positioned in the embodiment of the present invention for the unified resource in A and B from above-mentioned code
Symbol and browser UserAgent information are exactly to take an each character of character string corresponding numerical value in a mapping.
C, the first numerical value and second value encoded by Hash, obtain first kind code.
Specifically, the first numerical value and second value that are obtained with reference to A and B, are encoded by Hash, first kind code is obtained.
It is preferred that, in the Step3 in above-mentioned steps S100, first kind code and current time are compiled by pre-arranged code
Code, obtains index coding, including:
First kind code, the random number obtained in advance and current time are encoded, index coding is obtained.
Specifically, the first kind code obtained with reference to above-described embodiment, passes through the numeral being randomly derived and the index got
Current time in parameter, index coding is obtained by further encoding, wherein, first kind code is in step S100
The Hash codes obtained in Step2.The embodiment of the present invention so that the numeral that is randomly derived is six random digit as an example, current time with
Illustrated exemplified by last 6 digit of the millisecond number of current time.
For example, it is assumed that obtained Hash codes are A, six bit digitals being randomly derived are 214536, the millisecond number of current time
6, end be 452163, by the way that above-mentioned alphanumeric is spliced, obtain index and encode A214536452163.
Wherein, encoded with generating a globally unique index for being designated standard generation, at the same time, foundation is big
Measure the multiple browsers accessed and carry out origin url, 6 different random strings can be generated.Therefore index coding is handed in data
Mutually during possess unique mark so that server can according to the mark by script information and to should script information number
According to being associated.
The embodiment of the present invention by index coding A214536452163 exemplified by illustrate, using realize data interactive method as
Standard, is not limited specifically.
Data interactive method provided in an embodiment of the present invention, carrying out the corresponding script end of data correlation using index coding is
Safety, for only needing to store a key-value pair for rear end, and server:Index coding and userid, you can had
The analysis of effect.And because index coding is small relative to the memory data output in existing cookie, it will not produce extra
Cookie, will not excessively be interfered the website of user, i.e. be less than existing data storage in cookie data storage.
Embodiment two
The embodiment of the present invention additionally provides a kind of data interaction device.The device can realize it by data interactive method
Function.It should be noted that the data interaction device of the embodiment of the present invention can be used for performing what the embodiment of the present invention was provided
Data interactive method, the data interaction that the data interactive method of the embodiment of the present invention can also be provided by the embodiment of the present invention
Device is performed.Fig. 2 is the schematic diagram of data interaction device according to embodiments of the present invention.As shown in Fig. 2 the data interaction is filled
Put including:First sending module 22, the first receiving module 24, the second sending module 26, the second receiving module 28 and display module
30, wherein,
First sending module 22, the data request information of index coding, index coding are carried for being sent to server
For indicating server after corresponding data are obtained according to data request information, to Data Matching correspondence script information;
First receiving module 24, the data returned for the reception server according to data request information;
Second sending module 26, the script request information of index coding, script request are carried for being sent to server
Information is used to indicate that server is encoded according to index, obtains the script information of corresponding data;
Second receiving module 28, the script information of the data returned for the reception server according to script request information;
Display module 30, the script information for being received according to the second receiving module 28 shows that the first receiving module 24 is received
Data.
It is preferred that, Fig. 3 is the schematic diagram of data interaction device according to the preferred embodiment of the invention.As shown in figure 3, device
Also include:Acquisition module 20 and package module 21, wherein,
Acquisition module 20, for before the data request information for carrying index coding is sent to server, obtaining rope
Draw coding;
Package module 21, is set up with acquisition module 20 and electrically connects, and the index coding for acquisition module to be obtained is encapsulated extremely
In data request information and script request information.
It is preferred that, Fig. 4 is the schematic diagram of data interaction device according to the preferred embodiment of the invention.As shown in figure 4, obtaining
Module 20, including:Acquiring unit 201, the first coding unit 202 and the second coding unit 203, wherein
Acquiring unit 201, for obtaining indexing parameter, indexing parameter includes at least one of:URL,
Browser UserAgent information, current time;
First coding unit 202, sets up with acquiring unit 201 and electrically connects, for the unified money obtained to acquiring unit 201
Source finger URL and browser UserAgent information carry out first kind coding, the first kind code after being encoded;
Second coding unit 203, sets up with the first coding unit 202 and electrically connects, for being compiled by pre-arranged code to first
The first kind code and current time that code unit 202 is obtained are encoded, and obtain index coding.
It is preferred that, Fig. 5 is the schematic diagram of data interaction device according to the preferred embodiment of the invention.As shown in figure 5, first
Coding unit 202, including:First computation subunit 2021, the second computation subunit 2022 and coded sub-units 2023, wherein,
First computation subunit 2021, for URL to be obtained into corresponding first number by preset function
Value;
Second computation subunit 2022, sets up with the first computation subunit 2021 and electrically connects, for by browser
UserAgent information obtains corresponding second value by preset function;
Coded sub-units 2023, set up with the second computation subunit 2022 and electrically connect, for the first numerical value and second to be counted
Value is encoded by Hash, obtains first kind code.
It is preferred that, Fig. 6 is the schematic diagram of data interaction device according to the preferred embodiment of the invention.As shown in fig. 6, second
Coding unit 203, including:
Second coded sub-units 2031, for first kind code, the random number obtained in advance and current time to be encoded,
Obtain index coding.
Embodiment three
Fig. 7 is the schematic diagram of data interaction system according to embodiments of the present invention.As shown in fig. 7, the data interaction system
Including:Server 72 and terminal 74, server 72 are set up with terminal 74 and communicated to connect, wherein, terminal 74 is that Fig. 2 to Fig. 6 is any
Shown data interaction device.
It should be noted that for foregoing each method embodiment, in order to be briefly described, therefore it is all expressed as a series of
Combination of actions, but those skilled in the art should know, the present invention is not limited by described sequence of movement because
According to the present invention, some steps can be carried out sequentially or simultaneously using other.Secondly, those skilled in the art should also know
Know, embodiment described in this description belongs to preferred embodiment, involved action and module is not necessarily of the invention
It is necessary.
In the above-described embodiments, the description to each embodiment all emphasizes particularly on different fields, and does not have the portion being described in detail in some embodiment
Point, it may refer to the associated description of other embodiment.
, can be by another way in several embodiments provided herein, it should be understood that disclosed device
Realize.For example, device embodiment described above is only schematical, such as the division of described unit is only one kind
Division of logic function, can there is other dividing mode when actually realizing, such as multiple units or component can combine or can
To be integrated into another system, or some features can be ignored, or not perform.It is another, it is shown or discussed each other
Coupling direct-coupling or communication connection can be by some interfaces, the INDIRECT COUPLING or communication connection of device or unit,
Can be electrical or other forms.
The unit illustrated as separating component can be or may not be it is physically separate, it is aobvious as unit
The part shown can be or may not be physical location, you can with positioned at a place, or can also be distributed to multiple
On NE.Some or all of unit therein can be selected to realize the mesh of this embodiment scheme according to the actual needs
's.
In addition, each functional unit in each embodiment of the invention can be integrated in a processing unit, can also
That unit is individually physically present, can also two or more units it is integrated in a unit.Above-mentioned integrated list
Member can both be realized in the form of hardware, it would however also be possible to employ the form of SFU software functional unit is realized.
If the integrated unit is realized using in the form of SFU software functional unit and as independent production marketing or used
When, it can be stored in a computer read/write memory medium.Understood based on such, technical scheme is substantially
The part contributed in other words to prior art or all or part of the technical scheme can be in the form of software products
Embody, the computer software product is stored in a storage medium, including some instructions are to cause a computer
Equipment (can be personal computer, mobile terminal, server or network equipment etc.) performs side described in each embodiment of the invention
The all or part of step of method.And foregoing storage medium includes:USB flash disk, read-only storage (ROM, Read-Only Memory),
Random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disc or CD etc. are various to be stored
The medium of program code.
The preferred embodiments of the present invention are the foregoing is only, are not intended to limit the invention, for the skill of this area
For art personnel, the present invention can have various modifications and variations.Within the spirit and principles of the invention, that is made any repaiies
Change, equivalent substitution, improvement etc., should be included in the scope of the protection.