WO2015043455A1 - 数据传输方法、设备及系统 - Google Patents

数据传输方法、设备及系统 Download PDF

Info

Publication number
WO2015043455A1
WO2015043455A1 PCT/CN2014/087203 CN2014087203W WO2015043455A1 WO 2015043455 A1 WO2015043455 A1 WO 2015043455A1 CN 2014087203 W CN2014087203 W CN 2014087203W WO 2015043455 A1 WO2015043455 A1 WO 2015043455A1
Authority
WO
WIPO (PCT)
Prior art keywords
client
data
server
long connection
connection server
Prior art date
Application number
PCT/CN2014/087203
Other languages
English (en)
French (fr)
Inventor
严腾飞
江洋
Original Assignee
北京奇虎科技有限公司
奇智软件(北京)有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Priority claimed from CN201310456279.XA external-priority patent/CN103491184A/zh
Priority claimed from CN201310456454.5A external-priority patent/CN103501335A/zh
Priority claimed from CN201310456173.XA external-priority patent/CN103501331B/zh
Priority claimed from CN201310456451.1A external-priority patent/CN103501334B/zh
Priority claimed from CN2013104561994A external-priority patent/CN103475753A/zh
Application filed by 北京奇虎科技有限公司, 奇智软件(北京)有限公司 filed Critical 北京奇虎科技有限公司
Priority to US15/025,401 priority Critical patent/US20160234307A1/en
Publication of WO2015043455A1 publication Critical patent/WO2015043455A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1095Replication or mirroring of data, e.g. scheduling or transport for data synchronisation between network nodes
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/64Hybrid switching systems
    • H04L12/6418Hybrid transport
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • H04L43/0805Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability
    • H04L43/0811Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability by checking connectivity
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols

Definitions

  • the present invention relates to the field of Internet applications, and in particular, to a data transmission method, device and system
  • the information in the favorites in the browser or the frequently viewed webpage information needs to be repeatedly executed on a browser and executed.
  • the past operation can save some commonly used execution operation data to the browser of another terminal.
  • the present invention has been made in order to provide a data transmission method, apparatus and system that overcomes the above problems or at least partially solves or alleviates the above problems.
  • a data transmission method comprising:
  • the present invention also provides another data method, including:
  • the first terminal After the first terminal is connected to the second terminal, receiving, by the first client, the identifier information of the first client sent by the first client;
  • the second client located in the second terminal uses the identifier information to search for address information of a corresponding long connection server;
  • the present invention also provides a first client, which is disposed on the first terminal, and includes:
  • a first determining module configured to determine that the first terminal is connected to the second terminal
  • the first obtaining module is configured to obtain the identification information of the client
  • a data transmission module configured to transmit the identification information to the second terminal.
  • the present invention also provides a second client, which is disposed on the second terminal, and includes:
  • a second determining module configured to determine that the second terminal is connected to the first terminal
  • the second receiving module is configured to receive the identifier information of the first client that is sent by the first client that is configured by the first terminal;
  • the second obtaining module is configured to obtain the identifier information, and search for address information of the corresponding long connection server according to the identifier information;
  • the connection establishing module is configured to establish a long connection between the client and the persistent connection server according to the obtained address information, so that the client receives data from the persistent connection server.
  • the present invention further provides a data transmission system, comprising the first client according to any one of the preceding claims, and the second client, wherein the first client is disposed in the first terminal,
  • the second client is configured to be connected to the second terminal, where the first terminal is connected to the second terminal, and further includes a first server, a long connection distribution server, and a long connection server corresponding to the first terminal, where
  • the first client is configured to transmit its own identification information to the second client; and transmit data in the first client to the persistent connection server via the first server;
  • the first server is configured to receive data sent by the first client, and forward the data to the persistent connection server;
  • the second client is configured to receive the identifier information sent by the first client, search for address information of the corresponding long connection server by using the long connection distribution server, and establish a long connection with the long connection server; Receiving, by the long connection server, data transmitted by the first client;
  • the long connection distribution server is configured to allocate a long connection server according to the identifier information of the first client, and receive an address request message sent by each client that carries the identifier information of the first client, and the corresponding long connection server The address is fed back to the requesting party;
  • a long connection server configured to establish a long connection with the second client; and receive data from the first client forwarded by the first server, and forward the data to the second client.
  • a data transmission method which is applied to a first client to send data to a second client, including:
  • the invention also provides a second client, comprising:
  • a first connection establisher configured to establish a long connection between the network and the persistent connection server
  • a first data receiver configured to receive data from the first client forwarded by the persistent connection server, wherein the first client sends the data to a first server, and is forwarded by the first server to The long connection server.
  • the invention also provides a first client, comprising:
  • a first data acquirer configured to obtain data of the client
  • the first data transmitter is configured to send the data to the first server, and the first server forwards the data to the second client via the persistent connection server.
  • the present invention also provides a data transmission system, including the first client, the second client, and the first server and the long connection server:
  • the first client is configured to send data of the first client to the first server;
  • the first server is configured to transfer the first client data to the persistent connection server
  • the long connection server is configured to receive data from the first server and forward the data to the second client;
  • the second client is configured to receive data forwarded by the persistent connection server.
  • a data transmission method including:
  • the present invention further provides a first client, which is disposed in the first terminal, and the first terminal establishes a connection with the mobile terminal, including:
  • a third acquiring module configured to obtain first data of the first client running locally
  • the first sending module is configured to send the first data to run in a second client set in the mobile terminal.
  • the present invention further provides a second client, which is disposed in the mobile terminal, and the mobile terminal establishes a connection with the first terminal, including:
  • a fourth acquiring module configured to acquire second data of the client
  • the second sending module is configured to send the second data to the first client running in the first terminal.
  • the present invention further provides a network system, including a first client disposed on the first terminal, and a second client disposed on the mobile terminal, where the first terminal establishes a connection with the mobile terminal:
  • the first client configured to send the first data to the second client
  • the second client is configured to send the second data to the first client.
  • a data transmission method is provided, which is applicable to a case where data transmission can be performed between a first client and a second client, including:
  • the invention also provides a client, which can be applied to the data transmission between the client and other clients, including:
  • a second data acquirer configured to obtain data of the client and identifier information thereof
  • a data transmitter configured to transmit the data in the client and the identification information obtained by the data acquirer to the first server, and forwarded by the first server to the long connection server determined according to the identification information of the client, and Determining whether to forward data in the client to the other client according to the long connection status of the other client and the persistent connection server.
  • the present invention also provides a data transmission system, which is applicable to a situation in which data transmission can be performed between a first client and a second client, including a first client, and a second client, according to the identification information of the first client. Determining the long connection server and the first server, wherein
  • the first client is configured to transmit data in the first client and its identification information to the first server;
  • the first server is configured to receive data sent by the first client and identity information thereof, and forward the data to the persistent connection server;
  • the long connection server is configured to establish a long connection with the second client; and receive data in the first client forwarded by the first server and identifier information thereof, according to the second client Determining whether to forward data of the first client to the second client, in a long connection state with the long connection server;
  • the second client is configured to receive data sent by the persistent connection server.
  • a data transmission method is further provided, where the data transmission between the first client and the second client is applied, including:
  • the invention also provides a client, which is applied to data transmission between the client and other clients, including:
  • a third data transmitter configured to send data in the client and its identification information to a long connection server corresponding to the other client, wherein, according to the long connection server and the other client The long connection state determines whether the data is sent to the other client;
  • a second connection establisher configured to establish a long connection between the client and a long connection server corresponding to the client
  • a third data receiver configured to receive the long connection corresponding to the client by the other client The data in the other clients sent by the server.
  • the present invention also provides a wireless data transmission system, including the first client and the second client, wherein the first client and the second client perform data transmission, and further includes a long connection server. And a long connection distribution server, wherein
  • the first client is configured to send data in the first client via the persistent connection server;
  • the long connection allocation server is configured to allocate a long connection server to each client according to an address request message sent by different clients, and send the allocated address information to each client respectively;
  • the long connection server is configured to receive data of the first client transmitted by the first client; and determine, according to a long connection state between the second client and the persistent connection server, whether the Forwarding data in the first client to the second client;
  • the second client is configured to receive data in the first client forwarded by the persistent connection server.
  • a computer program comprising computer readable code, when the computer readable code is run on a computing device, causing the computing device to perform any of the following 1-7
  • the data transmission method, and/or the data transmission method according to any one of claims 8 to 17, and/or the data transmission method according to any one of claims 21 to 32, and/or The data transmission method according to any one of claims 36 to 55, and/or the data transmission method according to any one of claims 59 to 71, and/or any one of claims 74 to 85 The data transmission method described.
  • a computer readable medium storing the computer program according to claim 88 is provided.
  • any data of the first client can be sent to the second client, so that various operations performed by the user in the first client can be synchronously updated to the second client, thereby avoiding The user performs repeated operations on the new client to obtain duplicate information, further avoiding data redundancy and waste of resources.
  • FIG. 1 shows a process flow diagram of a first method of data transmission in accordance with one embodiment of the present invention
  • FIG. 2 shows a flow chart of transmitting data in accordance with a preferred embodiment of the present invention
  • FIG. 3 is a flowchart showing a second data transmission method according to an embodiment of the present invention.
  • FIG. 4 shows a flow chart of a data transmission method in accordance with a preferred embodiment of the present invention
  • FIG. 5 is a schematic structural diagram of a client according to an embodiment of the present invention.
  • FIG. 6 is a schematic structural diagram of another client according to an embodiment of the present invention.
  • FIG. 7 is a schematic structural diagram of a data transmission system according to an embodiment of the present invention.
  • FIG. 8 is a flowchart showing a process of still another data transmission method according to an embodiment of the present invention.
  • Figure 9 is a flow chart showing a data transmission method in accordance with a preferred embodiment of the present invention.
  • FIG. 10 is a schematic structural diagram of still another client according to an embodiment of the present invention.
  • FIG. 11 is a schematic structural diagram of still another client according to an embodiment of the present invention.
  • FIG. 12 is a schematic structural diagram of still another data transmission system according to an embodiment of the present invention.
  • FIG. 13 is a flowchart showing a process of still another data transmission method according to an embodiment of the present invention.
  • FIG. 14 is a flowchart showing a process of a data transmission method on a first client side according to an embodiment of the present invention
  • Figure 15 illustrates another flow chart of transmitting data in accordance with a preferred embodiment of the present invention.
  • 16 is a flowchart showing a processing method of a data transmission method on a second client side according to an embodiment of the present invention
  • FIG. 17 shows a flow chart of another data transmission method in accordance with a preferred embodiment of the present invention.
  • FIG. 18 is a schematic structural diagram of still another client according to an embodiment of the present invention.
  • FIG. 19 is a schematic structural diagram of still another client according to an embodiment of the present invention.
  • FIG. 20 is a schematic structural diagram of still another data transmission system according to an embodiment of the present invention.
  • FIG. 21 shows a process flow diagram of still another data transmission method according to an embodiment of the present invention.
  • FIG. 22 is a schematic structural diagram of still another client according to an embodiment of the present invention.
  • FIG. 24 is a flowchart showing still another data transmission method according to another preferred embodiment of the present invention.
  • FIG. 25 is a schematic structural diagram of still another data transmission system according to an embodiment of the present invention.
  • FIG. 26 is a flowchart showing a process of still another data transmission method according to an embodiment of the present invention.
  • FIG. 27 is a block diagram showing the structure of a data transmission device according to an embodiment of the present invention.
  • 29 shows a flow chart of still another data transmission method in accordance with a preferred embodiment of the present invention.
  • FIG. 30 is a flow chart showing a data transmission method according to another preferred embodiment of the present invention.
  • Figure 31 is a block diagram schematically showing a computing device for performing a data transmission method according to the present invention.
  • Fig. 32 schematically shows a storage unit for holding or carrying program code implementing the data transmission method according to the present invention.
  • the embodiments of the present invention provide various data transmission methods, and different data transmission methods are now described in detail by using embodiments.
  • This embodiment provides a method for data transmission.
  • 1 shows a process flow diagram of a first method of data transmission in accordance with one embodiment of the present invention.
  • the process starts in step S102, and determines that a connection is established between the first terminal and the second terminal.
  • the first terminal can establish a connection with the second terminal in multiple manners, for example, a wired mode or a wireless mode, wherein the wired mode can be connected through a data line, and the wireless mode can be connected through a wireless network (for example, Bluetooth, wifi, local area network, etc.) .
  • a wireless network for example, Bluetooth, wifi, local area network, etc.
  • the first terminal and the second terminal directly establish a connection through a Universal Serial Bus (USB) data line
  • USB Universal Serial Bus
  • the method of establishing a connection by using a USB data line is simple and easy to operate
  • USB Data lines are currently widely adopted and highly identifiable, enabling fast and efficient data transfer (eg, identification information).
  • step S104 is further triggered to acquire the identification information of the first client set in the first terminal.
  • step S106 is triggered, and the identification information of the first client acquired in step S104 is transmitted to the second client set in the second terminal along the established connection in step S102.
  • the identifier information of the first client can be sent to the second client, and the data transmission by the first client to the second client is implemented, and the data that cannot be performed between the clients mentioned in the prior art is solved.
  • the problem of transmission further solves the problem that the data cannot be transmitted between different clients, and the new client needs to be re-introduced when the new client is enabled, resulting in waste of resources and inefficiency.
  • the identification information can be transmitted between the first client and the second client, that is, a channel capable of data transmission has been established between the first client and the second client. Therefore, after the identification information mentioned in step S106 is transmitted to the second client, the data in the first client may also be transmitted to the second client. The data in the first client is transmitted to the second client and can be forwarded through a server or the like. The transmission process will now be described in detail.
  • the acquired data is transmitted to the first server, where the first server is the server corresponding to the first terminal.
  • the first server is the server corresponding to the first terminal.
  • the first terminal is a personal computer (PC)
  • the first server is a PC server.
  • the first server After receiving the data from the first client, the first server transmits the data to the long connection server having a long connection with the second client, and then the long connection server transmits the data of the first client to the second client.
  • step S201 is first performed, that is, after a channel capable of data transmission has been established between the first client and the second client, The first client sends its own identification information and data to the corresponding first server.
  • the first server after receiving the data of the first client, the first server first performs legality verification on the data of the first client.
  • the first server verifies the identification information of the first client in the data, and determines whether the identifier information of the first client is legal information, for example, whether the identifier information has been registered in the client center. Or whether the identification information is an identifier generated internally by the server. If the identification information is verified as legal information, the first server transmits the identification information to the persistent connection server. If the identification information is not legal information, the first server refuses to send the identification information to the persistent connection server.
  • the first server may also perform legality verification on other data except the identification information in the data, for example, verifying whether the webpage data of the first client is non-malicious data.
  • the malicious data refers to a virus, a Trojan, and the like that steals, destroys, and the like in the user terminal. If the first server verifies that the data of the first client is the malicious data, the first server refuses to transmit the malicious data to the persistent connection server. If the data of the first client is non-malicious data verified by the first server, the first server transmits the data to the persistent connection server.
  • the first server may further encrypt the data of the first client, thereby more effectively improving the security of the data transmission.
  • the security of the transmitted data can be more effectively ensured, and some malicious websites and the like are attached to the transmitted data during the data transmission process, and the user is The terminal or client caused damage.
  • the first validated data is sent to the corresponding long connection server.
  • the first server and the long connection server can communicate through various protocols, such as a transmission control protocol, a user datagram protocol, and the like.
  • the first server and the persistent connection server request communication through a Hypertext Transfer Protocol (HTTP).
  • HTTP supports multiple server modes, which is simple and fast, so communication over HTTP can improve data transmission efficiency.
  • step S203 is performed, and the long connection server will be the first client.
  • the data is sent to the second client.
  • step S204 is triggered.
  • step S204 the second client performs corresponding processing according to the received data of the first client.
  • the address information of the persistent connection server needs to be obtained by the first client according to the identification information of the first client.
  • the manner in which the first client obtains the address information of the corresponding long connection server is introduced. First, the first client sends an address request message carrying its own identification information to the long connection distribution server. After receiving the address request message, the long connection allocation server verifies the identification information carried by the server, and then returns a response message to the first client according to the identification information. The response message returned by the long connection distribution server carries the address information of the long connection server corresponding to the first client.
  • the first client searches for the corresponding long connection server through the long connection allocation server.
  • Address information The long connection distribution server returns different long connection server addresses to the clients according to the identification information of the clients on different terminals, so that the information synchronization between different clients is faster and more timely.
  • the first client and the second client search for the corresponding long connection server by using the same identification information, and ensure that the data of the specified user client is sent to the client of the other terminal of the same user, thereby avoiding confusion of data transmission of the user client.
  • the first client After obtaining the address information of the corresponding long connection server, the first client establishes a long connection with the long connection server according to the address information, and sends the data of the user in the first client to the second client through the long connection server.
  • the identifier information is the identity authentication information of the client, and may be the identity authentication information set by the user, or may be the identity authentication information set by the server for the client, which is not limited by the embodiment of the present invention.
  • the identifier information may be account information of the user login of the first client, and the account information is an account that the user applies for registration at the client center, and the application of the account information is simple and easy, and each account information is You can log in on multiple clients.
  • the identification information in the embodiment of the present invention may also be a string generated by the server as a unique identifier, such as a shadow account.
  • the shadow account may be a unique identifier generated by the server according to time, machine identification, etc.
  • the shadow account may also be an account randomly generated by the server. After the server generates the account, it checks whether the generated shadow account already exists, and if so, The server regenerates a shadow account until the account does not exist before. Shadow accounts are non-repeatable and unique, and each shadow account can only identify one client.
  • the first client and/or the second client may be any client of the same type, such as a browser client, a security guard client, a reader client, a media player client, or the like.
  • the embodiments of the present invention are not limited to the clients of the different types but perform the same functions.
  • the first and second are used to distinguish different clients.
  • the attributes, order, and functions of the client are not limited.
  • the first and second transpositions can be used to refer to different clients.
  • the first client and/or the second client are browser clients.
  • the user usually performs a personalized operation such as collecting a web address and setting a common web page in the browser client.
  • a personalized operation such as collecting a web address and setting a common web page in the browser client.
  • the user is The personalized actions set on the previous client can be automatically synced to the newly enabled client without the user having to repeat the operation.
  • the data of the first client may be data that the user performs any operation in the first client, other data updated by the first client, data stored in the first client, and the like.
  • the data may include each web address stored in the favorites of the first client, a web address currently opened by the first client, a common web address of the first client, and any first client is invoked according to a user instruction.
  • User data, etc. Any data of the first client can be sent to the second client, ensuring that various operations performed by the user in the first client can be synchronously updated to the second client, preventing the user from executing on the new client. Repeat operations to obtain duplicate information to further avoid data redundancy and waste of resources.
  • the client data transmission between the mobile terminal and the terminal can also be implemented. Therefore, in the embodiment of the present invention, the first terminal and the second terminal may be terminals such as a desktop computer and a notebook computer, and may also be mobile terminals such as a mobile phone, a music player, and a tablet computer.
  • the second terminal is a mobile terminal, so as to more clearly and concisely describe data transmission between the terminal and the mobile terminal.
  • FIG. 3 shows a flow chart of a second data transmission method according to an embodiment of the present invention, the data transmission method focusing on the data receiving end.
  • step S302 is performed, that is, after the first terminal establishes a connection with the second terminal, the second client set in the second terminal receives the identifier information sent by the first client.
  • step S304 is performed.
  • the second client searches for the address information of the corresponding long connection server by using the identifier information sent by the first client.
  • step S306 is executed to establish a long connection between the second client and the corresponding long connection server according to the obtained address information of the long connection server, so that the second client is from the corresponding length. Receive data at the connection server.
  • the second client can establish a long connection with the corresponding long connection server by using the identifier information, so that the data of the user in the first client is timely transmitted to the second client, so that the second client can conveniently perform information.
  • Update The embodiment of the invention solves the problem of information sharing between the first client and the second client, so that the user can synchronize the information between the two clients in time, thereby preventing the user from performing repeated operations on the new client. Repeat the information to further avoid data redundancy and waste of resources.
  • step S302 after the second terminal receives the identifier information sent by the first client, the second terminal queries whether the second client exists. If the second client exists, step S304 is performed, and the second client searches for the address of the persistent connection server according to the identification information of the first client. If the second client does not exist, the installation package of the second client needs to be obtained first, and the second client is downloaded and installed in the second terminal. After the installation is completed, step S304 is performed, and the second client searches for the long connection server address according to the identification information of the first client.
  • the specific way for the second client to look up the long connection server address is described.
  • the second client sends an address request message carrying the identification information to the long connection distribution server, and after receiving the address request message, the long connection distribution server determines the corresponding long connection server according to the identification information carried by the address request message, and Returning a response message to the second client carrying the address information of the corresponding long connection server.
  • the second client After receiving the address information of the corresponding persistent connection server sent by the long connection distribution server, the second client performs step S306, and establishes a long connection with the long connection server corresponding to the address information to receive data from the persistent connection server.
  • the long connection server After the second client successfully establishes a long connection with the corresponding long connection server, the long connection server stores an online device list, and the list records identification information of each client that maintains a long connection with the persistent connection server. If the long connection between the client and the persistent connection server is disconnected, the identification information corresponding to the disconnected client is deleted in the online device list of the persistent connection server.
  • the real-time update of the online device list in the long connection server ensures that the long connection server can update the information of the client with which the long connection is established in time. Avoid data transmission to disconnected clients due to inaccurate update of online device list data, resulting in malicious consequences such as packet loss, and improve data transmission security.
  • the long connection server When the long connection server receives the data of the first client sent by the first server, the long connection server searches for the second client according to the identifier information carried in the data of the first client, and determines according to the information recorded in the online device list. A long connection state with the second client. If the status of the long connection is a connection, the long connection server sends the data of the first client to the second client. If the state of the long connection is disconnected, the data of the first client is stored in the persistent connection server, and then the state of the long connection between the persistent connection server and the second client is changed from disconnected to connected. And sending the data of the first client stored in the long connection server to the second client.
  • the second client After receiving the data sent by the long connection server, the second client performs corresponding processing according to the data to ensure information sharing between the first client and the second client, and can continue to execute before the second client performs the first The client did not perform the end operation, such as continuing to read the web content.
  • the identifier information is the identity authentication information of the client, and may be the identity authentication information set by the user, or may be the identity authentication information set by the server for the client, which is not limited by the embodiment of the present invention.
  • the identifier information may be account information of the user login of the first client, and the account information is an account that the user applies for registration at the client center, and the application of the account information is simple and easy, and each account information is You can log in on multiple clients.
  • the identification information in the embodiment of the present invention may also be a string generated by the server as a unique identifier, such as a shadow account.
  • the shadow account may be a unique identifier generated by the server according to time, machine identification, etc.
  • the shadow account may also be an account randomly generated by the server. After the server generates the account, it checks whether the generated shadow account already exists, and if so, The server regenerates a shadow account until the account does not exist before. Shadow accounts are non-repeatable and unique, and each shadow account can only identify one client.
  • the first client and/or the second client may be any client of the same type, such as a browser client, a security guard client, a reader client, a media player client, or the like.
  • the embodiments of the present invention are not limited to the clients of the different types but perform the same functions.
  • the first and second are used to distinguish different clients.
  • the attributes, order, and functions of the client are not limited.
  • the first and second transpositions can be used to refer to different clients.
  • the first client and/or the second client are browser clients.
  • the user usually performs a personalized operation such as collecting a web address and setting a common web page in the browser client.
  • a personalized operation such as collecting a web address and setting a common web page in the browser client.
  • the user is The personalized actions set on the previous client can be automatically synced to the newly enabled client without the user having to repeat the operation.
  • the data of the first client may be data for the user to perform any operation in the first client, other data updated by the first client, data stored in the first client, etc.
  • the data may be The URLs included in the favorites of the first client, the URLs currently opened by the first client, the common URLs of the first client, and user data invoked by any first client according to user instructions are included.
  • the processing performed by the second client according to the received data of the first client may be corresponding to the processing of the second client according to the data of the first client, or may be the first A client's data is processed.
  • the processing performed by the second client according to the data of the first client includes: the second client updates the favorite folder, the second client updates the common web address, and the web page corresponding to the second client opens the web address, etc. Wait.
  • any data of the first client can be sent to the second client, so that various operations performed by the user in the first client can be synchronously updated to the second client, thereby avoiding The user performs repeated operations on the new client to obtain duplicate information, further avoiding data redundancy and waste of resources.
  • the first terminal and the second terminal may be terminals such as a desktop computer and a notebook computer, and may also be mobile terminals such as a mobile phone, a music player, and a tablet computer.
  • the second terminal is a mobile terminal, so as to more clearly and concisely describe data transmission between the terminal and the mobile terminal.
  • FIG. 4 is a flow chart showing a data transmission method according to a preferred embodiment of the present invention for supporting any of the above data transmission methods, and the above data transmission method is explained more clearly.
  • the PC is selected as the first terminal
  • the mobile phone is the second terminal
  • the client is the browser client.
  • the first client is referred to as a PC browser
  • the second client is referred to as a mobile browser.
  • step S401 is first performed to establish a connection between the PC and the mobile phone using a USB data line.
  • the PC browser After receiving the notification that the mobile phone is connected to the PC, the PC browser performs step S402 to send its own identification information to the mobile phone.
  • the PC browser After receiving the above notification, the PC browser performs step S403 to query whether the account information has been logged in at the client, and sends the data of the PC browser to the PC server according to the query result. Specifically, if the existing account information is logged in at the client, the PC browser transmits the account information and the data of the PC browser to the PC server. If no account information is logged in to the client, the PC browser generates a unique identifier as the identification information of the PC browser, and transmits the identification information and the data of the PC browser to the PC server.
  • the step of the PC browser mentioned in step S403 for transmitting data to the PC server can be performed during the entire process of data transmission to ensure that the PC browser can send its own data and real-time updated data in time.
  • the PC browser can transmit the data of the PC browser to the PC server after the PC establishes a connection with the mobile phone, or can transmit data when the PC does not establish a connection with the mobile phone.
  • the PC browser can send the data to the PC server before sending its own identification information to the mobile phone, or send the data to the PC server after the PC browser sends its own identification information to the mobile phone.
  • the PC server After receiving the data of the PC browser, the PC server performs step S404 to verify the validity of the data sent by the PC browser, and sends the data sent by the legality verification to the long connection after being encrypted and processed. server.
  • the validity verification may be to verify whether the identification information sent by the PC browser is legal, or to verify whether the data sent by the PC browser is non-malicious data. If the data of the PC browser cannot be verified by the validity of the PC server, the PC server does not send the data.
  • step S405 the mobile phone performs step S405 to check whether the corresponding mobile phone browser is installed. If the mobile phone browser is not installed in the mobile phone, the mobile phone browser is first downloaded and installed in the mobile phone. After the installation is completed, the mobile phone sends the identification information of the PC browser to the mobile phone browser. If the corresponding mobile phone browser already exists in the mobile phone, the identification information of the PC browser is directly sent to the mobile phone browser.
  • the mobile phone browser After receiving the identification information of the PC browser, the mobile phone browser performs step S406 to send the address request information of the long connection server carrying the identification information to the long connection distribution server.
  • the long connection distribution server After receiving the address request message of the mobile phone browser, the long connection distribution server triggers step S407 to send a response message carrying the address information of the long connection server to the mobile phone browser.
  • the mobile phone browser receives the response message carrying the address information of the persistent connection server, and performs step S408 to establish a long connection with the corresponding long connection server according to the address information of the persistent connection server, so as to receive the PC browser from the persistent connection server. data.
  • the long connection server stores a list of online devices, and the real-time update of the list ensures that the long connection server can update the information of the browser with which the long connection is established in time to avoid sending the disconnected browser to the disconnected browser due to the update of the online device list data.
  • Data resulting in malicious consequences such as packet loss, improve the security of data transmission.
  • the long connection server determines whether to send the data of the PC browser to the mobile phone browsing according to the state of the long connection with the mobile phone browser.
  • Device Specifically, the long connection server queries the status of the long connection between the online device list and the corresponding mobile phone browser according to the online device list, and if the status of the long connection is maintained, sends the data of the PC browser to the mobile phone browser. If the state of the long connection is disconnected, the data of the PC browser is stored, and when the long connection state between the long connection server and the corresponding mobile browser is restored, the data of the PC browser is sent to the mobile browser.
  • step S410 the mobile phone browser performs corresponding processing according to the received data of the PC browser to ensure information sharing between the first client and the second client, and can continue to execute on the second client.
  • a client does not perform an end operation, such as continuing to read web content.
  • an embodiment of the present invention provides a client for data transmission, and a method for implementing the foregoing data transmission.
  • FIG. 5 shows a schematic structural diagram of a client according to an embodiment of the present invention.
  • the client for data transmission is simply referred to as a first client, and is disposed at the first terminal.
  • the first client 500 of the embodiment of the present invention includes at least: a first determining module 510, a first obtaining module 520, and a data transmission module 530.
  • the first determining module 510 determines that the first terminal establishes a connection with the second terminal, and the first acquiring module 520 coupled thereto can acquire the identification information of the first terminal, and then the data transmission coupled with the first acquiring module 520.
  • Module 530 transmits the identification information to the second terminal.
  • the identification information of the first client 500 can be sent to the second client, and the first client 500 can perform data transmission to the second client, which solves the problem between the clients mentioned in the prior art.
  • the problem of data transmission cannot be solved, and the problem that data transmission cannot be performed between different clients and the new client needs to be re-introduced when the new client is enabled may result in waste of resources and inefficiency.
  • the identifier information can be transmitted between the first client 500 and the second client, that is, a channel capable of data transmission has been established between the first client 500 and the second client. Therefore, after the identification information is transmitted to the second client, the first obtaining module 520 can also acquire the data in the first client 500, and then the data in the first client 500 is transmitted to the second by the data transmission module 530. Client. The data in the first client 500 is transmitted to the second client and can be forwarded through a server or the like.
  • the data transmitting module 530 transmits the acquired data to the first server, where the first server is the server corresponding to the first terminal 500.
  • the first server is the server corresponding to the first terminal 500.
  • the first server is a PC server.
  • the first server After receiving the data from the first client 500, the first server transmits the data to the long connection server having a long connection with the second client, and the long connection server transmits the data of the first client 500 to the second. Client.
  • the address information of the long connection server needs to be acquired by the first obtaining module 520 of the first client 500 according to the identification information of the first client 500.
  • the manner in which the first obtaining module 520 obtains the address information of the corresponding long connection server is introduced. First, the first obtaining module 520 sends an address request message carrying the identification information of the first client 500 to the persistent connection allocation server. After receiving the address request message, the long connection allocation server verifies the identification information carried by the server, and then returns a response message to the first obtaining module 520 according to the identification information.
  • the response message returned by the long connection distribution server carries the address information of the long connection server corresponding to the first client 500.
  • the first client 500 searches for the address information of the corresponding long connection server through the long connection allocation server.
  • the long connection distribution server returns different long connection server addresses to the clients according to the identification information of the clients on different terminals, so as to ensure that the information synchronization between different customers is faster and more timely.
  • the first client 500 and the second client search for the corresponding long connection server by using the same identification information, and ensure that the data of the specified user client is sent to the client of the other terminal of the same user, thereby avoiding confusion of data transmission of the user client.
  • the connection establishing module 530 establishes a long connection with the long connection server according to the address information and the data of the user in the first client 500. Send to the second client through this long connection server.
  • the identifier information is the identity authentication information of the client, and may be the identity authentication information set by the user, or may be the identity authentication information set by the server for the client, which is not limited by the embodiment of the present invention.
  • the identifier information may be the user of the first client 500. Recorded account information, the account information is an account that the user applies for registration at the client center, the application of the account information is simple and easy, and each account information can be logged in on multiple clients.
  • the identification information in the embodiment of the present invention may also be a string generated by the server as a unique identifier, such as a shadow account.
  • the shadow account may be a unique identifier generated by the server according to time, machine identification, etc.
  • the shadow account may also be an account randomly generated by the server. After the server generates the account, it checks whether the generated shadow account already exists, and if so, The server regenerates a shadow account until the account does not exist before. Shadow accounts are non-repeatable and unique, and each shadow account can only identify one client.
  • the first client 500 and/or the second client may be any client of the same type, such as a browser client, a security guard client, a reader client, a media player client, and the like.
  • the client may be a different type but performs the same function, which is not limited by the embodiment of the present invention.
  • the first and second are used to distinguish different clients.
  • the attributes, order, and functions of the client are not limited.
  • the first and second transpositions can be used to refer to different clients.
  • the first client 500 and/or the second client are browser clients.
  • the user usually performs a personalized operation such as collecting a web address and setting a common web page in the browser client.
  • a personalized operation such as collecting a web address and setting a common web page in the browser client.
  • the user is The personalized actions set on the previous client can be automatically synced to the newly enabled client without the user having to repeat the operation.
  • the data of the first client 500 may be data for the user to perform any operation in the first client 500, or may be other data updated by the first client 500, and stored in the first client.
  • the data of the terminal 500, and the like are not limited in this embodiment of the present invention.
  • the data may include each website stored in the favorites of the first client 500, the website currently opened by the first client 500, the common website address of the first client 500, and any first client.
  • the terminal 500 calls user data or the like according to a user instruction.
  • Any data of the first client 500 can be sent to the second client, ensuring that various operations performed by the user in the first client 500 can be synchronously updated to the second client, thereby avoiding the user being new.
  • the client performs repeated operations to obtain duplicate information, further avoiding data redundancy and resource waste.
  • the first terminal and the second terminal may be terminals such as a desktop computer and a notebook computer, and may also be mobile terminals such as a mobile phone, a music player, and a tablet computer.
  • the second terminal is a mobile terminal, so as to more clearly and concisely describe data transmission between the terminal and the mobile terminal.
  • FIG. 6 shows a schematic structural diagram of another client according to an embodiment of the present invention.
  • another client for data transmission is simply referred to as a second client, and is disposed in the second terminal.
  • the second client 600 includes at least a second determining module 610 , a second receiving module 620 , a second obtaining module 630 , a connection establishing module 640 , and a data processing module 650 .
  • the second receiving module 620 receives the identifier information sent by the first client. After receiving the identification information of the first client, the second receiving module 620 directly triggers the second obtaining module 630.
  • the second obtaining module 630 searches for the address information of the corresponding long connection server according to the identification information of the first client. After the address information of the corresponding long connection server is found, the second obtaining module 630 triggers the connection establishing module 640.
  • the connection establishing module 640 establishes a long connection between the second client 600 and the corresponding persistent connection server according to the obtained address information of the persistent connection server, so that the second client 600 receives data from the corresponding persistent connection server.
  • the second client 600 can establish a long connection with the corresponding long connection server by using the identification information, so as to receive data from the long connection server, and solve the problem between the first client and the second client 600.
  • the problem of information sharing further solves the duplication of operations for performing user requirements on new clients and the repetition of information acquisition, thereby avoiding the time consuming of different client operations and data redundancy, saving user time and improving user experience.
  • the second obtaining module 630 sends an address request message carrying the identification information to the persistent connection allocation server.
  • the long connection allocation server receives the address request message, and returns a response message to the second obtaining module 630 according to the identification information carried by the long connection.
  • the response message carries address information of a long connection server corresponding to the second client 600.
  • the second obtaining module 630 triggers the connection establishing module 640.
  • the connection establishing module 640 establishes a long connection between the second client 600 and the long connection server corresponding to the address information according to the address information returned by the long connection allocation server to receive data from the persistent connection server.
  • the long connection server When the long connection server receives the data of the first client sent by the first server, the long connection server searches the second client 600 according to the identifier information carried in the data of the first client, and queries the second client 600. The state of the long connection. If the state of the long connection is a connection, the persistent connection server sends the data of the first client to the second client 600. If the state of the long connection is disconnected, the data of the first client is stored in the persistent connection server, and then, when the state of the long connection between the persistent connection server and the second client 600 is restored, the length is longer. The data of the first client stored in the connection server is sent to the second client 600.
  • the second receiving module 620 of the second client 600 receives the data of the first client sent by the persistent connection server, and then triggers the data processor 650.
  • the data processor 650 performs corresponding processing according to the data of the first client to ensure information sharing between the first client and the second client 600, and can be executed on the first client before continuing execution on the second client. The end of the operation, such as continuing to read the content of the web page.
  • the identifier information is the identity authentication information of the client, and may be the identity authentication information set by the user, or may be the identity authentication information set by the server for the client, which is not limited by the embodiment of the present invention.
  • the identifier information may be that the user of the first client logs in.
  • Account information which is the account that the user applies for registration at the client center. The application of the account information is simple and easy, and each account information can be logged in on multiple clients.
  • the identification information in the embodiment of the present invention may also be a string generated by the server as a unique identifier, such as a shadow account.
  • the shadow account may be a unique identifier generated by the server according to time, machine identification, etc.
  • the shadow account may also be an account randomly generated by the server. After the server generates the account, it checks whether the generated shadow account already exists, and if so, The server regenerates a shadow account until the account does not exist before. Shadow accounts are non-repeatable and unique, and each shadow account can only identify one client.
  • the first client and/or the second client 600 may be any client of the same type, such as a browser client, a security guard client, a reader client, a media player client, and the like.
  • the client may be a different type but performs the same function, which is not limited by the embodiment of the present invention.
  • the first and second are used to distinguish different clients.
  • the attributes, order, and functions of the client are not limited.
  • the first and second transpositions can be used to refer to different clients.
  • the first client and/or the second client 600 are browser clients.
  • the user usually performs a personalized operation such as collecting a web address and setting a common web page in the browser client.
  • a personalized operation such as collecting a web address and setting a common web page in the browser client.
  • the user is The personalized actions set on the previous client can be automatically synced to the newly enabled client without the user having to repeat the operation.
  • the data received by the second client 600 may be data that the user performs any operation in the first client, or other data that is updated by the first client, and is stored in the first client.
  • the data, and the like, are not limited in any way by the embodiments of the present invention.
  • the data may include each web address stored in the favorites of the first client, a web address currently opened by the first client, a common web address of the first client, and any first client is invoked according to a user instruction. User data, etc.
  • the processing performed by the second client 600 according to the received data of the first client may be corresponding processing to the second client 600 according to the data of the first client, or may be The first client's data is processed.
  • the processing performed by the second client 600 according to the data of the first client includes: the second client 600 updates the favorites, the second client 600 updates the common website address, and the second client 600 opens the website address. Corresponding web pages and more.
  • any data of the first client may be sent to the second client 600, ensuring that various operations performed by the user in the first client may be synchronously updated to the second client 600.
  • the client data transmission between the mobile terminal and the terminal can be realized.
  • the first terminal and the second terminal may be terminals such as a desktop computer and a notebook computer, and may also be mobile terminals such as a mobile phone, a music player, and a tablet computer.
  • the second terminal is a mobile terminal, so as to explain more clearly and concisely. The data transmission of the client between the terminal and the mobile terminal.
  • FIG. 7 is a block diagram showing the structure of a data transmission system according to an embodiment of the present invention.
  • the data transmission system 700 in the embodiment of the present invention includes a first client 710 disposed at a first terminal, a second client 720 disposed at a second terminal, a long connection distribution server 730, and a long connection server. 740 and a first server 750 corresponding to the first client 710.
  • the first determining module 711 determines that the first terminal has established a connection with the second terminal, and then the first obtaining module 712 coupled with the first determining module 711 obtains its own identification information, and is first and The data transmission module 713 coupled to the acquisition module 712 transmits the identification information to the second terminal.
  • the first obtaining module 712 sends an address request message carrying the identification information to the long connection distribution server 730, and after receiving the address request information, the long connection distribution server 730 verifies the identifier information carried by the address request information, and then returns to carry the long A response message to the address information of the server 740 is connected to the first acquisition module 712.
  • the first obtaining module 712 can acquire data in the first client 710.
  • the data transmission module 713 coupled to the first acquisition module 712 transmits the data acquired by the first acquisition module 712 to the corresponding long connection server 740 via the first server 750.
  • the long connection server 740 has a long connection with the second client 720, and the data in the first client 710 is sent by the persistent connection server 740 to the second client 720 with which the long connection is established.
  • the second acquisition module 723 directly sends an address request message with the above identification information to the long connection distribution server 730 according to the identification information of the first client 710 received by the second receiving module 720.
  • the long connection assignment server 730 returns a response message with address information after receiving the address request message.
  • the second obtaining module 723 receives the response message carrying the address information.
  • the connection establishing module 724 in the second client 720 establishes a connection with the persistent connection server according to the acquired address information of the persistent connection server.
  • first client 710 may transmit the data of the first client 710 to the persistent connection server 740 via the first server 750.
  • the long connection server 740 then transmits the data of the first client to the second client 720.
  • the data processing module 725 of the second client 720 processes the above data.
  • the identifier information of the first client can be sent to the second client, and the data transmission by the first client to the second client is implemented, and the data that cannot be performed between the clients mentioned in the prior art is solved.
  • the problem of transmission further solves the problem that the data cannot be transmitted between different clients, and the new client needs to be re-introduced when the new client is enabled, resulting in waste of resources and inefficiency.
  • the second client can establish a long connection with the corresponding long connection server by using the identification information, so as to receive data from the long connection server, and solve the problem between the first client and the second client.
  • the problem of information sharing further solves the duplication of operations for performing user requirements on new clients and the repetition of information acquisition, thereby avoiding the time consuming of different client operations and data redundancy, saving user time. Improve the user experience.
  • the identifier information is the identity authentication information of the client, and may be the identity authentication information set by the user, or may be the identity authentication information set by the server for the client, which is not limited by the embodiment of the present invention.
  • the identifier information may be account information of the user login of the first client, and the account information is an account that the user applies for registration at the client center, and the application of the account information is simple and easy, and each account information is You can log in on multiple clients.
  • the identification information in the embodiment of the present invention may also be a string generated by the server as a unique identifier, such as a shadow account.
  • the shadow account may be a unique identifier generated by the server according to time, machine identification, etc.
  • the shadow account may also be an account randomly generated by the server. After the server generates the account, it checks whether the generated shadow account already exists, and if so, The server regenerates a shadow account until the account does not exist before. Shadow accounts are non-repeatable and unique, and each shadow account can only identify one client.
  • the first client and/or the second client may be any client of the same type, such as a browser client, a security guard client, a reader client, a media player client, or the like.
  • the embodiments of the present invention are not limited to the clients of the different types but perform the same functions.
  • the first and second are used to distinguish different clients.
  • the attributes, order, and functions of the client are not limited.
  • the first and second transpositions can be used to refer to different clients.
  • the first client and/or the second client are browser clients.
  • the user usually performs a personalized operation such as collecting a web address and setting a common web page in the browser client.
  • a personalized operation such as collecting a web address and setting a common web page in the browser client.
  • the user is The personalized actions set on the previous client can be automatically synced to the newly enabled client without the user having to repeat the operation.
  • the data of the first client may be data for the user to perform any operation in the first client, other data updated by the first client, data stored in the first client, etc.
  • the data may include each web address stored in the favorites of the first client, a web address currently opened by the first client, a common web address of the first client, and any first client is invoked according to a user instruction. User data, etc.
  • the processing performed by the second client according to the received data of the first client may be corresponding to the processing of the second client according to the data of the first client, or may be the first A client's data is processed.
  • the processing performed by the second client according to the data of the first client includes: the second client updates the favorite folder, the second client updates the common web address, and the web page corresponding to the second client opens the web address, etc. Wait.
  • any data of the first client can be sent to the second client, so that various operations performed by the user in the first client can be synchronously updated to the second client, thereby avoiding The user performs repeated operations on the new client to obtain duplicate information, further avoiding data redundancy and waste of resources.
  • the shift can be realized.
  • the first terminal and the second terminal may be terminals such as a desktop computer and a notebook computer, and may also be mobile terminals such as a mobile phone, a music player, and a tablet computer.
  • the second terminal is a mobile terminal, so as to more clearly and concisely describe data transmission between the terminal and the mobile terminal.
  • the embodiment of the present invention can achieve the following beneficial effects:
  • the identifier information of the first client can be sent to the second client, and the data transmission by the first client to the second client is implemented, and the data that cannot be performed between the clients mentioned in the prior art is solved.
  • the problem of transmission further solves the problem that the data cannot be transmitted between different clients, and the new client needs to be re-introduced when the new client is enabled, resulting in waste of resources and inefficiency.
  • the second client can establish a long connection with the corresponding long connection server by using the identification information, so as to receive data from the long connection server, and solve the problem between the first client and the second client.
  • the problem of information sharing further solves the duplication of operations for performing user requirements on new clients and the repetition of information acquisition, thereby avoiding the time consuming of different client operations and data redundancy, saving user time and improving user experience.
  • the second client receives the data of the first client through the persistent connection server, where the second client first requests the corresponding long connection server address information to the persistent connection allocation server.
  • the long connection distribution server returns different long connection server addresses to the clients according to the identification information of different clients, so that the information synchronization between the same clients of different terminals is faster and more timely.
  • the online device list stored in the long connection server can be updated in real time, so that the long connection server can timely update the information of the client that establishes the long connection with the network, so as to prevent the online device list data from being updated in time. Open clients send data, resulting in malicious consequences such as packet loss, improving the security of data transmission.
  • FIG. 8 shows a process flow diagram of still another data transmission method in accordance with one embodiment of the present invention.
  • the flow starts in step S802, and a long connection is established between the second client and the persistent connection server by using the network. After the long connection between the second client and the persistent connection server is successfully established, step S804 is performed to receive data from the first client forwarded by the persistent connection server.
  • the data of the first client can be sent to the second client, which solves the problem that the data transmission cannot be performed between the clients mentioned in the prior art, and further solves the problem that data transmission cannot be performed between different clients.
  • the new client is enabled, the user requirements must be re-introduced, the user needs to perform the repeated operations of the user and the information is duplicated, resulting in waste of resources and inefficiency, avoiding the time consuming of different client operations and data redundancy. Save user time and enhance user experience.
  • the first client sends data to the second client, and needs to be forwarded through a server or the like.
  • the first client sends data to the first server, and the first server will first.
  • the client's data is forwarded to the long connection server.
  • the first server After receiving the data sent by the first client, the first server first performs legality verification on the data of the first client.
  • the first server verifies the identification information of the first client in the data, and determines whether the identifier information of the first client is legal information, for example, whether the identifier information has been registered in the client center. Or whether the identification information is an identifier generated internally by the server. If the identification information is verified as legal information, the first server transmits the identification information to the persistent connection server. If the identification information is not legal information, the first server refuses to send the identification information to the persistent connection server.
  • the first server may also perform legality verification on other data except the identification information in the data, for example, verifying whether the webpage data of the first client is non-malicious data.
  • the malicious data refers to a virus, a Trojan, and the like that steals, destroys, and the like in the user terminal. If the first server verifies that the data of the first client is the malicious data, the first server may refuse to transmit the malicious data to the long connection server, and may also prompt the long connection server to transmit the data to the long connection server, and the data may be malicious. The data, in turn, prompts the user when the long connection server transmits the data to the second client, and the data received by the second client may contain malicious data. The second client selects whether to receive data that may contain malicious data according to a user indication. In addition, if the data of the first client is non-malicious data through the verification by the first server, the first server transmits the data to the persistent connection server.
  • the first server may further encrypt the data of the first client, thereby more effectively improving the security of the data transmission.
  • the security of the transmitted data can be more effectively ensured, and some malicious websites and the like are attached to the transmitted data during the data transmission process, and the user is The terminal or client caused damage.
  • the first validated data is sent to the corresponding long connection server.
  • the first server and the long connection server can communicate through various protocols, such as a transmission control protocol, a user datagram protocol, and the like.
  • the first server and the persistent connection server communicate by HTTP request.
  • HTTP supports multiple server modes, which is simple and fast, so HTTP request notification can improve data transmission efficiency.
  • the long connection server After receiving the data of the first client forwarded by the first server, the long connection server forwards the data to the second client. Before receiving the data of the first client from the persistent connection server, the second client first searches for the address information of the long connection server, and establishes a long connection with the corresponding long connection server according to the address information.
  • the specific way for the second client to find the address information of the long connection server is introduced.
  • the second client sends an address request message carrying the first client identification information to the long connection distribution server, and after receiving the address request message, the long connection distribution server determines the corresponding long connection server according to the identification information carried by the second connection distribution server. And returning to the second client to carry a response message with the address information of the corresponding long connection server.
  • the second client performs step S802 according to the found address information of the persistent connection server, and establishes a long connection with the persistent connection server by using the network. It is worth noting that if the response message returned by the long connection distribution server carries at least two address information, the second client may select one of the address information according to the preset policy.
  • the address information of the long connection server to be connected, and establish a long connection with the corresponding long connection server. Which address information is selected depends on the actual situation.
  • the preset policy here is only a method, a step or a strategy for selecting the address information, for example, a random selection policy or a sequential selection strategy.
  • the predetermined policy may also be determined according to the information related to the second client, and the address information is selected, for example, the address information is selected according to the connection manner with the second client, or according to the data between the second client and the second client.
  • the size of the transmission bandwidth selects the address information, and so on.
  • the network includes a wired network and a wireless network.
  • the wireless network includes a combination of any one or more of Wifi and 2G ⁇ 3G ⁇ 4G.
  • the above wireless networks are currently widely used wireless networks, and are capable of transmitting data (such as identification information or web page addresses) quickly and efficiently.
  • the long connection server After the second client successfully establishes a long connection with the corresponding long connection server, the long connection server stores an online device list, and the list records identification information of each client that maintains a long connection with the persistent connection server. If the long connection between the client and the persistent connection server is disconnected, the identification information corresponding to the disconnected client is deleted in the online device list of the persistent connection server.
  • the real-time update of the online device list in the long connection server ensures that the long connection server can update the information of the client with which the long connection is established in time, so as to avoid sending data to the disconnected client due to the update of the online device list data, resulting in the data packet. Loss and other vicious consequences, improve the security of data transmission.
  • the long connection server When the long connection server receives the data of the first client sent by the first server, the long connection server searches for the second client according to the identifier information carried in the data of the first client, and determines according to the information recorded in the online device list. A long connection state with the second client. If the status of the long connection is a connection, the long connection server sends the data of the first client to the second client. If the state of the long connection is disconnected, the data of the first client is stored in the persistent connection server, and then the state of the long connection between the persistent connection server and the second client is changed from disconnected to connected. And sending the data of the first client stored in the long connection server to the second client.
  • the long connection server stores data that cannot be transmitted to the second client in time, and can also avoid the malicious consequences of packet loss, and ensure that the data of the first client is sent to the second client.
  • the second client After receiving the data sent by the long connection server, the second client performs corresponding processing according to the data. Performing corresponding processing on the received data of the first client by the second client, ensuring information sharing between the first client and the second client, and being able to continue execution on the second client before the first client The end operation is not performed, for example, the web content reading is continued.
  • the identifier information is the identity authentication information of the client, and may be the identity authentication information set by the user, or may be the identity authentication information set by the server for the client, which is not limited by the embodiment of the present invention.
  • the identifier information may be account information of the user login of the first client, and the account information is an account that the user applies for registration at the client center, and the application of the account information is simple and easy, and each account information is You can log in on multiple clients.
  • the identification information in the embodiment of the present invention may also be a string generated by the server as a unique identifier, such as a shadow account.
  • Shadow The account may be a unique identifier generated by the server according to time, machine identification, etc., or may be an account randomly generated by the server. After generating the account, the server checks whether the generated shadow account already exists, and if so, the server regenerates. A shadow account does not exist until this account. Shadow accounts are non-repeatable and unique, and each shadow account can only identify one client.
  • the first client and/or the second client may be any client of the same type, such as a browser client, a security guard client, a reader client, a media player client, or the like.
  • the embodiments of the present invention are not limited to the clients of the different types but perform the same functions.
  • the first and second are used to distinguish different clients.
  • the attributes, order, and functions of the client are not limited.
  • the first and second transpositions can be used to refer to different clients.
  • the first client and/or the second client are browser clients.
  • the user usually performs a personalized operation such as collecting a web address and setting a common web page in the browser client.
  • a personalized operation such as collecting a web address and setting a common web page in the browser client.
  • the user is The personalized actions set on the previous client can be automatically synced to the newly enabled client without the user having to repeat the operation.
  • any data of the first client can be sent to the second client, so that various operations performed by the user in the first client can be synchronously updated to the second client, thereby avoiding The user performs repeated operations on the new client to obtain duplicate information, further avoiding data redundancy and waste of resources.
  • the first terminal and the second terminal may be terminals such as a desktop computer and a notebook computer, and may also be mobile terminals such as a mobile phone, a music player, and a tablet computer.
  • the second client is set in the mobile terminal, so as to more clearly and concisely describe the data transmission of the client between the terminal and the mobile terminal.
  • FIG. 9 is a flowchart of a data transmission method according to a preferred embodiment of the present invention, which is used to support the data transmission method provided in Embodiment 2, and the above data transmission method is explained more clearly.
  • the PC is selected as the terminal
  • the mobile phone is the mobile terminal
  • the client is the browser client.
  • the first client is referred to as a PC browser
  • the second client is referred to as a mobile browser
  • the identification information is referred to as a unique ID.
  • a path for data transmission has been established between the PC browser and the mobile browser, and a unique ID is stored separately.
  • the server is requested to connect to the long connection server to request the address of the long connection server, and the mobile phone browser selects an address information in the address information returned by the long connection distribution server, as shown in FIG.
  • the network automatically establishes a long connection with the corresponding long connection server.
  • the mobile browser sends a unique ID to the persistent connection server when establishing a long connection with the persistent connection server.
  • the online device list in the long connection server identifies the mobile browser user corresponding to the above unique ID as online.
  • the PC browser sends a unique ID and its own data (such as a web page address) to PC server.
  • the PC server After receiving the data of the PC browser, the PC server first verifies the data of the PC browser, including verifying that the unique ID is legal, that is, verifying that the unique ID is an ID that has been registered in the system, and verifying other PC browsers.
  • the data is non-malicious. For example, verify that the URL is a non-mali URL by sending the URL to the NetShield server.
  • the PC server forwards the data verified by the legality to the long connection server through HTTP communication.
  • the long connection server performs step 7 in FIG.
  • the long connection server passes the mobile browser
  • the long connection between the PC sends the data of the PC browser. If it is not online, the long connection server stores the data of the PC server, and after the long connection with the mobile browser is restored, the data is sent to the mobile browser.
  • the mobile phone browser After receiving the data sent by the long connection server, the mobile phone browser performs corresponding processing according to the data to ensure information sharing between the first client and the second client, and can continue to execute on the second client before the second client The end does not perform the end operation, such as continuing to read the web content.
  • the embodiment of the present invention provides a client for data transmission, which is used to implement the data transmission method provided in Embodiment 2.
  • FIG. 10 is a schematic structural diagram of a client according to an embodiment of the present invention.
  • the first client 1000 of the embodiment of the present invention includes at least: a first data acquirer 1010 and a first data transmitter 1020.
  • the first data acquirer 1010 can acquire its own identification information, and then the first data transmitter 1020 coupled with the first data acquirer 1010 transmits the identification information to the second terminal.
  • the data of the first client 1000 can be sent to the second client, which solves the problem that the data transmission cannot be performed between the clients mentioned in the prior art, and further solves the problem that data cannot be performed between different clients.
  • Transmission when the new client is enabled, the user requirements must be re-introduced, the operation of the user's requirements is repeated in the new client, and the information is duplicated, resulting in waste of resources and inefficiency, avoiding time-consuming and data-consuming operations of different clients. Redundancy saves user time and improves user experience.
  • the identifier information can be transmitted between the first client 1000 and the second client, that is, a channel capable of data transmission is established between the first client 1000 and the second client, for example, through data. Wire connection. Therefore, after the identification information is transmitted to the second client, the first data acquirer 1010 can also acquire the data in the first client 1000, and then transmit the data in the first client 1000 by the first data transmitter 1020. To the second client. Different from the direct transmission of the identification information, the data transmitted from the first client 1000 to the second client may be forwarded through a route such as a server.
  • the first data transmitter 1020 transmits the acquired data to the first server, where the first server is the first terminal 1000.
  • the first server is the first terminal 1000.
  • the first server is a PC server.
  • the first server After receiving the data from the first client 1000, the first server transmits the data to the long connection server having a long connection with the second client, and then transmits the data of the first client 1000 to the second by the persistent connection server. Client.
  • the data is transmitted from the first client 1000 to the second client, and needs to pass through the corresponding long connection server.
  • the address information of the long connection server needs to be acquired by the first data acquirer 1010 in the first client 1000 according to the identification information of the first client 1000.
  • the manner in which the first data acquirer 1010 obtains the address information of the corresponding long connection server will now be described.
  • the first data acquirer 1010 transmits an address request message carrying the identification information of the first client 1000 to the long connection distribution server.
  • the long connection distribution server verifies the identification information carried by the server, and then returns a response message to the first data acquirer 1010 according to the identification information.
  • the response message returned by the long connection distribution server carries the address information of the long connection server corresponding to the first client 1000.
  • the first client 1000 searches for the address information of the corresponding long connection server through the long connection allocation server.
  • the long connection distribution server returns different long connection server addresses to the clients according to the identification information of the clients on different terminals, so as to ensure that the information synchronization between different clients is faster and more timely.
  • the first client 1000 and the second client search for the corresponding long connection server by using the same identification information, and ensure that the data of the specified user client is sent to the client of the other terminal of the same user, thereby avoiding confusion of data transmission of the user client.
  • the connection establishment module 10100 establishes a long connection with the long connection server according to the address information and the user is in the first client 1000. Data is sent to the second client through this persistent connection server.
  • the identifier information is the identity authentication information of the client, and may be the identity authentication information set by the user, or may be the identity authentication information set by the server for the client, which is not limited by the embodiment of the present invention.
  • the identifier information may be account information that is logged in by the user of the first client 1000, and the account information is an account that the user applies for registration at the client center, and the application of the account information is simple and easy, and each Account information can be logged in on multiple clients.
  • the identification information in the embodiment of the present invention may also be a string generated by the server as a unique identifier, such as a shadow account.
  • the shadow account may be a unique identifier generated by the server according to time, machine identification, etc., or may be an account randomly generated by the server. After generating the account, the server checks whether the generated shadow account already exists, and if so, the server is re-established. Generate a shadow account until this account does not exist before. Shadow accounts are non-repeatable and unique, and each shadow account can only identify one client.
  • the first client 1000 and/or the second client may be any client of the same type, such as a browser client, a security guard client, a reader client, a media player client, and the like.
  • the client may be a different type but performs the same function, which is not limited by the embodiment of the present invention.
  • the first and second are used to distinguish different clients.
  • the attributes, order, and functions of the client are not limited.
  • the first and second transpositions can be used to refer to different clients.
  • the first client 1000 and/or the second client are browser clients.
  • the user usually performs a personalized operation such as collecting a web address and setting a common web page in the browser client.
  • a personalized operation such as collecting a web address and setting a common web page in the browser client.
  • the user moves from one terminal to another, a new client needs to be newly enabled in another terminal.
  • the user is The personalized actions set on the previous client can be automatically synced to the newly enabled client without the user having to repeat the operation.
  • the data of the first client 1000 may be data for the user to perform any operation in the first client 1000, or may be other data updated by the first client 1000, and stored in the first client.
  • the data of the terminal 1000, and the like are not limited by the embodiment of the present invention.
  • the data may include each web address stored in the favorites of the first client 1000, a web address currently opened by the first client 1000, a common web address of the first client 1000, and any first client.
  • the terminal 1000 calls user data or the like according to a user instruction.
  • Any data of the first client 1000 can be sent to the second client, ensuring that various operations performed by the user in the first client 1000 can be synchronously updated to the second client, thereby avoiding the user being new.
  • the client performs repeated operations to obtain duplicate information, further avoiding data redundancy and resource waste.
  • the first terminal and the second terminal may be terminals such as a desktop computer and a notebook computer, and may also be mobile terminals such as a mobile phone, a music player, and a tablet computer.
  • the second client is set in the mobile terminal, so as to more clearly and concisely describe the data transmission of the client between the terminal and the mobile terminal.
  • FIG. 11 is a block diagram showing another structure of a client according to an embodiment of the present invention.
  • another client for data transmission is simply referred to as a second client.
  • the second client 1100 includes at least: a first connection establisher 1110 and a first data receiver 1120.
  • the first connection establisher 1110 in the second client 1100 establishes a long connection with the persistent connection server using the network.
  • the first data receiver 1120 in the second client 1100 receives the data of the first client forwarded by the persistent connection server.
  • the data of the first client can be sent to the second client 1100, which solves the problem that the data transmission cannot be performed between the clients mentioned in the prior art, and further solves the problem that data transmission cannot be performed between different clients.
  • the new client is enabled, the user requirements must be re-introduced, the user needs to perform the repeated operations of the user and the information is duplicated, resulting in waste of resources and inefficiency, avoiding the time-consuming and redundant data of different client operations. I save user time and improve user experience.
  • the first connection establisher 1110 sends an address request message carrying the first client identification information to the long connection distribution server, and after receiving the address request message, the long connection distribution server determines the corresponding information according to the identification information carried by the long connection distribution server. Long connection server, and returned to the first connection establisher 1110 carrying a pair A response message to the address information of the long connection server.
  • the first connection establisher 1110 receives the response message returned by the long connection distribution server, and establishes a long connection with the corresponding long connection server according to the address information of the long connection server carried in the response message. In particular, if the response message returned by the long connection distribution server carries at least two address information, the first connection establisher 1110 selects one of the address information as the address information of the long connection server to be connected according to the preset policy, and corresponds to The long connection server establishes a long connection.
  • the first connection establisher 1110 successfully establishes a long connection with the persistent connection server by using the network according to the address information of the persistent connection server.
  • the network includes a wired network and a wireless network.
  • the wireless network includes a combination of any one or more of Wifi and 2G ⁇ 3G ⁇ 11G.
  • the above wireless networks are currently widely used wireless networks, and are capable of transmitting data (such as identification information or web page addresses) quickly and efficiently.
  • the long connection server stores an online device list, which records identification information of each client that maintains a long connection with the long connection server. If the long connection between the client and the persistent connection server is disconnected, the identification information corresponding to the disconnected client is deleted in the online device list of the persistent connection server. After the first connection establisher 1110 of the second client 1100 successfully establishes a long connection with the persistent connection server, the second client 1100 is identified as being online in the online device list.
  • the real-time update of the online device list in the long connection server ensures that the long connection server can update the information of the client with which the long connection is established in time, so as to avoid sending data to the disconnected client due to the update of the online device list data, resulting in the data packet. Loss and other vicious consequences, improve the security of data transmission.
  • the long connection server When the long connection server receives the data of the first client sent by the first server, the long connection server searches the second client 1100 according to the identifier information carried in the data of the first client, and according to the information recorded in the online device list. A long connection state with the second client 1100 is determined. If the state of the long connection is a connection, the persistent connection server sends the data of the first client to the second client 1100. If the state of the long connection is disconnected, the data of the first client is stored in the persistent connection server, and then the state of the long connection between the persistent connection server and the second client 1100 is changed from disconnected to connected. At the same time, the data of the first client stored in the persistent connection server is sent to the second client 1100.
  • the first data receiver 1120 in the second client 1100 determines whether to receive data of the first client according to the state of the long connection between the second client 1100 and the persistent connection server. Specifically, if the state of the long connection between the second client 1100 and the persistent connection server is disconnected, the first data receiver 1120 stops receiving data, and the long connection between the second client 1100 and the persistent connection server is performed. After the state is restored, the first data receiver 1120 continues to receive data of the first client from the persistent connection server. If the state of the long connection between the second client 1100 and the persistent connection server is a connection, the first data receiver 1120 is long. The connection server receives the data of the first client.
  • the first server is used to verify the validity of the data of the first client.
  • the first server verifies the identification information of the first client in the data, and determines whether the identification information of the first client is legal information. For example, it is verified whether the identification information has been registered in the client center, or whether the identification information is an identifier generated internally by the server. If the identification information is verified as legal information, the first server transmits the identification information to the persistent connection server. If the identification information is not legal information, the first server refuses to send the identification information to the persistent connection server.
  • the first server may also perform legality verification on other data except the identification information in the data, for example, verifying whether the webpage data of the first client is non-malicious data.
  • the malicious data refers to a virus, a Trojan, and the like that steals, destroys, and the like in the user terminal. If the first server verifies that the data of the first client is the malicious data, the first server refuses to transmit the malicious data to the persistent connection server, and if the data of the first client is non-malicious data, the first data is verified by the first server, The server transmits the data to the long connection server.
  • the long connection server After the long connection server receives the data of the first client verified by the legality, the data of the first client is received by the first data receiver 1120 in the second client 1100.
  • the identifier information is the identity authentication information of the client, and may be the identity authentication information set by the user, or may be the identity authentication information set by the server for the client, which is not limited by the embodiment of the present invention.
  • the identifier information may be account information of the user login of the first client, and the account information is an account that the user applies for registration at the client center, and the application of the account information is simple and easy, and each account information is You can log in on multiple clients.
  • the identification information in the embodiment of the present invention may also be a string generated by the server as a unique identifier, such as a shadow account.
  • the shadow account may be a unique identifier generated by the server according to time, machine identification, etc., or may be an account randomly generated by the server. After generating the account, the server checks whether the generated shadow account already exists, and if so, the server is re-established. Generate a shadow account until this account does not exist before. Shadow accounts are non-repeatable and unique, and each shadow account can only identify one client.
  • the first client and/or the second client 1100 may be any client of the same type, such as a browser client, a security guard client, a reader client, a media player client, and the like.
  • the client may be a different type but performs the same function, which is not limited by the embodiment of the present invention.
  • the first and second are used to distinguish different clients.
  • the attributes, order, and functions of the client are not limited.
  • the first and second transpositions can be used to refer to different clients.
  • the first client and/or the second client 1100 are browser clients.
  • the user usually performs a personalized operation such as collecting a web address and setting a common web page in the browser client.
  • a personalized operation such as collecting a web address and setting a common web page in the browser client.
  • the user moves from one terminal to another, a new client needs to be newly enabled in another terminal.
  • the user is The personalized actions set on the previous client can be automatically synced to the newly enabled client without the user having to repeat the operation.
  • the data received by the second client 1100 may be data that the user performs any operation in the first client, or other data that is updated by the first client, and is stored in the first client.
  • the data, and the like, are not limited in any way by the embodiments of the present invention.
  • the The data may include each of the bookmarked URLs in the favorites of the first client, the web address currently opened by the first client, the common web address of the first client, and user data invoked by any first client according to the user's instruction.
  • the processing performed by the second client 1100 according to the received data of the first client may be corresponding to the processing of the second client 1100 according to the data of the first client, or may be The first client's data is processed.
  • the processing performed by the second client 1100 according to the data of the first client includes: the second client 1100 updates the favorites, the second client 1100 updates the common website address, and the second client 1100 opens the website address. Corresponding web pages and more.
  • any data of the first client may be sent to the second client 1100, and the various operations performed by the user in the first client may be synchronously updated to the second client 1100.
  • the various operations performed by the user in the first client may be synchronously updated to the second client 1100.
  • the first terminal and the second terminal may be terminals such as a desktop computer and a notebook computer, and may also be mobile terminals such as a mobile phone, a music player, and a tablet computer.
  • the second client is set in the mobile terminal, so as to more clearly and concisely describe the data transmission of the client between the terminal and the mobile terminal.
  • Figure 12 is a block diagram showing the structure of a data transmission system in accordance with one embodiment of the present invention.
  • the data transmission system 1200 in the embodiment of the present invention includes a first client 1210, a first server 1220, a persistent connection server 1230, a long connection distribution server 1240, and a second client 1250.
  • the first data acquirer 1211 in the first client 1210 obtains its own data and triggers the first data transmitter 1212.
  • the first data sender 1212 transmits the data in the first client 1210 to the first server 1220.
  • the first server 1220 first performs legality verification on the data in the first client 1210.
  • the first server 1220 verifies the identification information of the first client 1210 in the data, and determines whether the identification information of the first client 1210 is legal information, for example, verifying whether the identification information is already in the The client center registers, or whether the identification information is an identifier generated internally by the server. If the identification information is verified as legal information, the first server 1220 transmits the identification information to the persistent connection server 1230. If the identification information is not legal information, the first server 1220 refuses to send the identification information to the persistent connection server 1230. .
  • the first server 1220 can perform legality verification on other data except the identification information in the data, for example, verifying the webpage data of the first client 1210, etc., whether it is non-malicious data.
  • the malicious data refers to a virus, a Trojan, and the like that steals, destroys, and the like in the user terminal. If the first server 1220 verifies that the data of the first client 1210 is the malicious data, the first server 1220 refuses to transmit the malicious data to the persistent connection server 1230, and if verified by the first server 1220, the first guest The data of the client 1210 is non-malicious data, and the first server 1220 transmits the data to the persistent connection server 1230.
  • the long connection server 1230 When the long connection server 1230 receives the data of the first client 1210 sent by the first server 1220, the long connection server 1230 searches for the second client 1250 according to the identification information carried in the data of the first client 1210, and according to The information recorded in the online device list determines the long connection state with the second client 1250. If the state of the long connection is a connection, the persistent connection server 1230 transmits the data of the first client 1210 to the second client 1250. If the state of the long connection is disconnected, the data of the first client 1210 is stored in the persistent connection server 1230, and then the state of the long connection between the persistent connection server 1230 and the second client 1250 is broken. When the connection is turned on, the data of the first client 1210 stored in the persistent connection server 530 is sent to the second client 1250.
  • the second client 1250 first searches for the address information of the corresponding persistent connection server 1230 through the persistent connection distribution server 1240 before receiving the data of the first client 1210 through the persistent connection server 1230.
  • the first connection establisher 1251 sends an address request message carrying the identifier information of the first client 1210 to the long connection distribution server 1240, and the long connection distribution server receives the address request message according to the identification information carried by the long connection distribution server.
  • the corresponding long connection server 1230 is determined, and a response message to the first connection establisher 1251 carrying the address information of the corresponding persistent connection server 1230 is returned.
  • the first connection establisher 1251 receives the response message returned by the persistent connection distribution server 1240, and establishes a long connection with the corresponding persistent connection server 1230 according to the address information of the persistent connection server carried in the response message. In particular, if the response message returned by the persistent connection distribution server 1240 carries at least two address information, the first connection establisher 1251 selects one of the address information as the address information of the long connection server 1230 to be connected according to the preset policy, and The corresponding long connection server 1230 establishes a long connection.
  • the first connection establisher 1251 successfully establishes a long connection with the persistent connection server 1230 using the network based on the address information of the persistent connection server 1230.
  • the network includes a wired network and a wireless network.
  • the wireless network includes a combination of any one or more of Wifi and 2G ⁇ 3G ⁇ 4G.
  • the above wireless networks are currently widely used wireless networks, and are capable of transmitting data (such as identification information or web page addresses) quickly and efficiently.
  • the first data receiver 1252 in the second client 1250 determines whether to receive the first according to the state of the long connection between the second client 1250 and the persistent connection server 1230.
  • a client 1210 data Specifically, if the state of the long connection between the second client 1250 and the persistent connection server 1230 is disconnected, the first data receiver 1252 stops receiving data, and the long connection between the second client 1250 and the persistent connection server is performed. The state recovery, the first data receiver 1252 continues to receive the data of the first client 1210 from the persistent connection server 1230. If the state of the long connection between the second client 1250 and the persistent connection server 1230 is a connection, the second client The first data receiver 1252 in the terminal 1250 receives data from the persistent connection server 1230.
  • the identifier information is the identity authentication information of the client, and may be the identity authentication information set by the user, or may be the identity authentication information set by the server for the client, which is not in the embodiment of the present invention. This is limited.
  • the identifier information may be account information of the user login of the first client, and the account information is an account that the user applies for registration at the client center, and the application of the account information is simple and easy, and each account information is You can log in on multiple clients.
  • the identification information in the embodiment of the present invention may also be a string generated by the server as a unique identifier, such as a shadow account.
  • the shadow account may be a unique identifier generated by the server according to time, machine identification, etc., or may be an account randomly generated by the server. After generating the account, the server checks whether the generated shadow account already exists, and if so, the server is re-established. Generate a shadow account until this account does not exist before. Shadow accounts are non-repeatable and unique, and each shadow account can only identify one client.
  • the first client and/or the second client may be any client of the same type, such as a browser client, a security guard client, a reader client, a media player client, or the like.
  • the embodiments of the present invention are not limited to the clients of the different types but perform the same functions.
  • the first and second are used to distinguish different clients.
  • the attributes, order, and functions of the client are not limited.
  • the first and second transpositions can be used to refer to different clients.
  • the first client and/or the second client are browser clients.
  • the user usually performs a personalized operation such as collecting a web address and setting a common web page in the browser client.
  • a personalized operation such as collecting a web address and setting a common web page in the browser client.
  • the user is The personalized actions set on the previous client can be automatically synced to the newly enabled client without the user having to repeat the operation.
  • the data of the first client may be data for the user to perform any operation in the first client, other data updated by the first client, data stored in the first client, etc.
  • the data may include each web address stored in the favorites of the first client, a web address currently opened by the first client, a common web address of the first client, and any first client is invoked according to a user instruction. User data, etc.
  • the processing performed by the second client according to the received data of the first client may be corresponding to the processing of the second client according to the data of the first client, or may be the first A client's data is processed.
  • the processing performed by the second client according to the data of the first client includes: the second client updates the favorite folder, the second client updates the common web address, and the web page corresponding to the second client opens the web address, etc. Wait.
  • any data of the first client can be sent to the second client, so that various operations performed by the user in the first client can be synchronously updated to the second client, thereby avoiding The user performs repeated operations on the new client to obtain duplicate information, further avoiding data redundancy and waste of resources.
  • the first terminal and the second terminal may be terminals such as a desktop computer and a notebook computer, and may also be mobile terminals such as a mobile phone, a music player, and a tablet computer. Preferred, this hair
  • the second client is set on the mobile terminal, so as to more clearly and concisely describe the data transmission of the client between the terminal and the mobile terminal.
  • the embodiment of the present invention can achieve the following beneficial effects:
  • the data of the first client can be sent to the second client, which solves the problem that the data transmission cannot be performed between the clients mentioned in the prior art, and further solves the problem that data transmission cannot be performed between different clients.
  • the new client is enabled, the user requirements must be re-introduced, the user needs to perform the repeated operations of the user and the information is duplicated, resulting in waste of resources and inefficiency, avoiding the time consuming of different client operations and data redundancy. Save user time and enhance user experience.
  • the second client receives the data of the first client through the persistent connection server, where the second client first requests the corresponding long connection server address information to the persistent connection allocation server.
  • the long connection distribution server returns different long connection server addresses to the clients according to the identification information of different clients, so that the information synchronization between the same clients of different terminals is faster and more timely.
  • the online device list stored in the long connection server can be updated in real time, so that the long connection server can timely update the information of the client that establishes the long connection with the network, so as to prevent the online device list data from being updated in time. Open clients send data, resulting in malicious consequences such as packet loss, improving the security of data transmission.
  • FIG. 13 shows a process flow diagram of a data transmission method in accordance with one embodiment of the present invention.
  • the first client is disposed in the first terminal
  • the second client is disposed in the mobile terminal.
  • step S1302 in Fig. 13 a connection is first established between the first terminal and the mobile terminal.
  • step S1304 is executed, the first data of the first client is obtained, and the first data is sent to the second client, and/or step S1306 is executed to acquire the second client.
  • the second data of the end, and the second data is sent to the first client.
  • the two-way transmission between the first client and the second client of the two terminals is respectively performed, and the customer mentioned in the prior art is solved.
  • the problem that data transmission cannot be performed between the ends further solves the problem that the data cannot be transmitted between different clients, and the new client needs to be re-introduced when the new client is enabled, resulting in waste of resources and inefficiency.
  • the data transmission method provided by the embodiment of the present invention is a bidirectional data transmission method, that is, the data transmission method provided by the embodiment of the present invention may be that the first client transmits the first data to the second client, or The second client transmits the second data to the first client, wherein the data transmission process in the two directions is similar.
  • the first client sends data to the second client as an example.
  • FIG. 14 is a flowchart showing the processing of a data transmission method on the first client side according to an embodiment of the present invention.
  • the flow starts in step S1402, and determines that a connection is established between the first terminal and the mobile terminal.
  • the first terminal can establish a connection with the mobile terminal in multiple manners, such as a wired mode or a wireless mode.
  • the wired mode can be connected through the data line
  • the wireless mode can be connected through a wireless network (for example, Bluetooth, wifi, local area network, etc.).
  • Step S1402 After the execution of step S1402 ends, a connection is established between the first terminal and the mobile terminal.
  • Step S1404 is further triggered to acquire first data of the first client that is set in the first terminal, and send the first data to the second client.
  • the two-way transmission between the first client and the second client of the two terminals is respectively performed, and the customer mentioned in the prior art is solved.
  • the problem that data transmission cannot be performed between the ends further solves the problem that the data cannot be transmitted between different clients, and the new client needs to be re-introduced when the new client is enabled, resulting in waste of resources and inefficiency.
  • data can be transmitted between the first client and the second client.
  • the data in the first client is transmitted to the second client and needs to be forwarded through a server or the like.
  • the transmission process will now be described in detail.
  • the first data in the first client is obtained.
  • the obtained first data is transmitted to the first server by using the first message as a carrier.
  • the first message here carries the first data and the identification information of the first client.
  • the first server here is a server corresponding to the first terminal. For example, if the first terminal is a PC, the first server is a PC server.
  • the first server After receiving the first message sent by the first client, the first server transmits the first message to the long connection server with a long connection between the second client, and then transmits the first message to the second client by the persistent connection server.
  • Figure 15 shows a flow chart of transmitting data in accordance with a preferred embodiment of the present invention.
  • the first terminal it is first determined whether the first terminal establishes a connection with another mobile terminal. If not, it is determined that a connection is established between the first terminal and the mobile terminal. If so, the mobile terminal that establishes a connection with the first terminal is determined according to the user's selection.
  • the user can ensure that the data of the client of the specified mobile terminal is sent to the first terminal according to the needs of the user, thereby avoiding the user client. The data transmission at the end is confusing.
  • step S1501 is first performed, and the first client sends a first message carrying the first data and the first client's own identification information to the first server.
  • the first message is first verified for legality, and the first message verified by the legality is forwarded.
  • the first server verifies the identification information of the first client in the first message, and determines whether the identifier information of the first client is legal information, for example, whether the identifier information has been registered in the client center. Or whether the identification information is an identifier generated internally by the server. If the identification information is verified as legal information, the first server transmits the identification information to the long connection server, and if the identification information is not legal information, the first service The server refuses to send the identification information to the long connection server.
  • the first server may perform legality verification on other data except the identification information in the first message, for example, verifying that the webpage data of the first client is non-malicious data.
  • the malicious data refers to a virus, a Trojan, and the like that steals, destroys, and the like in the user terminal. If the first server verifies that the data of the first client is the malicious data, the first server refuses to transmit the malicious data to the persistent connection server, and if the data of the first client is non-malicious data, the first data is verified by the first server, The server transmits the data to the long connection server.
  • the first server may further perform encryption processing on the first message, so as to more effectively improve the security of the data transmission.
  • the security verification and processing of the first message by the first server can more effectively ensure the security of the transmitted data, and prevent some malicious websites and the like from being attached to the transmitted data during the data transmission, to the user's terminal or The client caused damage.
  • the first server After the first server performs the validity verification on the first message, the first message that is verified by the legality is sent to the corresponding long connection server.
  • the first server and the long connection server can communicate through various protocols, such as a transmission control protocol, a user datagram protocol, and the like.
  • the first server and the persistent connection server communicate by HTTP request.
  • HTTP supports multiple server modes, which is simple and fast, so HTTP request notification can improve data transmission efficiency.
  • step S1503 is performed.
  • the persistent connection server sends the first message to the second client.
  • step S1504 The second client performs corresponding processing according to the received first message to ensure information sharing between the first client and the second client, and can continue to execute the previous client on the second client. Perform the end of the operation, such as continuing to read the content of the web page.
  • the first message is transmitted from the first client to the second client, and needs to pass through the corresponding long connection server.
  • the address information of the persistent connection server needs to be obtained by the first client according to the identification information of the first client.
  • the manner in which the first client obtains the address information of the corresponding long connection server is introduced. First, the first client sends an address request message carrying its own identification information to the long connection distribution server. After receiving the address request message, the long connection allocation server verifies the identification information carried by the server, and then returns a response message to the first client according to the identification information.
  • the response message returned by the long connection distribution server carries the address information of the long connection server corresponding to the first client.
  • the second client searches for the corresponding long connection server address information through the long connection allocation server.
  • the long connection distribution server returns different long connection server addresses to the clients according to the identification information of the clients on different terminals, so that the information synchronization between different clients is faster and more timely.
  • FIG. 16 is a flow chart showing the processing of the data transmission method on the second client side according to an embodiment of the present invention.
  • step S1602 is performed, that is, a connection is established between the first terminal and the mobile terminal.
  • the second client receives the first data of the first client.
  • the second client can acquire the first data in the first client in time, which is convenient
  • the second client updates the information.
  • the embodiment of the invention solves the problem of information sharing between the first client and the second client, so that the user can synchronize the information between the two clients in time, thereby preventing the user from performing repeated operations on the new client. Repeat the information to further avoid data redundancy and waste of resources.
  • step S1604 the mobile terminal queries whether there is a second client. If there is a second client, step S1604 is directly triggered, and the second client receives the first data of the first client. If the second client does not exist, the installation package of the second client needs to be obtained first, and the second client is downloaded and installed in the second terminal. After the installation is completed, step S1604 is performed, and the second client receives the first data of the first client.
  • the first data In the process of the first client receiving the first data of the first client, the first data needs to be forwarded by a server or the like.
  • the first data is transmitted by using the first message as a carrier, where the first message carries the first Data and identification information of the first client. The transmission process will now be described in detail.
  • the second client first searches for the address information of the long connection server corresponding thereto.
  • the specific way for the second client to look up the long connection server address is described.
  • the second client sends an address request message carrying the identification information to the long connection distribution server, and after receiving the address request message, the long connection distribution server determines the corresponding long connection server according to the identification information carried by the long connection and returns to the first
  • the second client carries a response message with the address information of the corresponding long connection server.
  • the long connection server corresponding to the address information establishes a long connection to receive the first data from the long connection server.
  • the long connection server After the second client successfully establishes a long connection with the corresponding long connection server, the long connection server stores an online device list, and the list records identification information of each client that maintains a long connection with the persistent connection server. If the long connection between the client and the persistent connection server is disconnected, the identification information corresponding to the disconnected client is deleted in the online device list of the persistent connection server.
  • the real-time update of the online device list in the long connection server ensures that the long connection server can update the information of the client with which the long connection is established in time, so as to avoid sending data to the disconnected client due to the update of the online device list data, resulting in the data packet. Loss and other vicious consequences, improve the security of data transmission.
  • the long connection server When the long connection server receives the first data sent by the first server, the long connection server searches for the second client according to the identifier information carried in the first data, and determines the second client according to the information recorded in the online device list. Long connection state between the ends. If the state of the long connection is a connection, the persistent connection server sends the first data to the second client. If the state of the long connection is disconnected, the first data is stored in the persistent connection server, and then, when the state of the long connection between the persistent connection server and the second client is changed from disconnected to connected, Sending the first data stored in the persistent connection server to the second client.
  • the second client After receiving the first data sent by the persistent connection server, the second client performs corresponding processing according to the first data to ensure information sharing between the first client and the second client, and can continue to execute on the second client. Previously, the end operation was not performed on the first client, for example, the web content reading was continued.
  • the identifier information is the identity authentication information of the client, and may be a body set by the user.
  • the authentication information may also be the identity authentication information set by the server for the client, which is not limited by the embodiment of the present invention.
  • the identifier information may be account information of the user login of the first client, and the account information is an account that the user applies for registration at the client center, and the application of the account information is simple and easy, and each account information is You can log in on multiple clients.
  • the identification information in the embodiment of the present invention may also be a string generated by the server as a unique identifier, such as a shadow account.
  • the shadow account may be a unique identifier generated by the server according to time, machine identification, etc.
  • the shadow account may also be an account randomly generated by the server. After the server generates the account, it checks whether the generated shadow account already exists, and if so, The server regenerates a shadow account until the account does not exist before. Shadow accounts are non-repeatable and unique, and each shadow account can only identify one client.
  • the first client and/or the second client may be any client of the same type, such as a browser client, a security guard client, a reader client, a media player client, or the like.
  • the embodiments of the present invention are not limited to the clients of the different types but perform the same functions.
  • the first and second are used to distinguish different clients.
  • the attributes, order, and functions of the client are not limited.
  • the first and second transpositions can be used to refer to different clients.
  • the first client and/or the second client are browser clients.
  • the user usually performs a personalized operation such as collecting a web address and setting a common web page in the browser client.
  • a personalized operation such as collecting a web address and setting a common web page in the browser client.
  • the user is The personalized actions set on the previous client can be automatically synced to the newly enabled client without the user having to repeat the operation.
  • the first data may be data that the user performs any operation in the first client, other data updated by the first client, data stored in the first client, and the like.
  • the data may include each web address stored in the favorites of the first client, a web address currently opened by the first client, a common web address of the first client, and any first client is invoked according to a user instruction. User data, etc.
  • the processing performed by the second client according to the received first data may be corresponding to processing the second client according to the first data, or may be processing the received first data.
  • the processing performed by the second client according to the first data includes: the second client updates the favorite, the second client updates the common web address, and the second client opens the webpage corresponding to the webpage, and the like.
  • any data of the first client can be sent to the second client, so that various operations performed by the user in the first client can be synchronously updated to the second client, thereby avoiding The user performs repeated operations on the new client to obtain duplicate information, further avoiding data redundancy and waste of resources.
  • FIG. 17 is a flow chart showing a data transmission method for supporting any of the above data transmission methods according to a preferred embodiment of the present invention, and the above data transmission method is explained more clearly.
  • the PC is selected as the terminal
  • the mobile phone is the mobile terminal
  • the client is the browser client.
  • the client and the second client in this example, the first client is referred to as a PC browser and the second client is referred to as a mobile browser.
  • step S1701 is first performed to establish a connection between the PC and the mobile phone using a USB data line.
  • the PC browser After receiving the notification that the mobile phone is connected to the PC, the PC browser performs step S1702 to send its own identification information to the mobile phone.
  • the PC browser After receiving the above notification, the PC browser performs step S1703 to query whether the account information has been logged in at the client, and sends the data of the PC browser to the PC server according to the query result. Specifically, if the existing account information is logged in at the client, the PC browser sends the valid data in the account information to the PC server. If no account information is logged in to the client, the PC browser generates a unique identifier, which is the identification information of the PC browser, and sends the identification information and the data of the PC browser itself to the PC server.
  • the step of the PC browser mentioned in step S1703 for transmitting its own data to the PC server can be performed during the entire process of data transmission to ensure that the PC browser can timely update its own data and real-time updated data.
  • Send to the PC server the PC browser can transmit its own data to the PC server after the PC establishes a connection with the mobile phone, or can transmit data when the PC does not establish a connection with the mobile phone.
  • the PC browser can send the data to the PC server before sending its own identification information to the mobile phone, or send the data to the PC server after the PC browser sends its own identification information to the mobile phone.
  • the PC server After receiving the data of the PC browser, the PC server performs step S1704 to verify the validity of the data sent by the PC browser, and sends the data verified by the legality to the long connection server after being encrypted and processed.
  • the validity verification may be to verify whether the identification information sent by the PC browser is legal, or to verify whether the data sent by the PC browser is non-malicious data. If the data of the PC browser cannot be verified by the validity of the PC server, the PC server does not send the data.
  • step S1705 the mobile phone performs step S1705 to check whether the mobile phone browser is installed. If the mobile phone browser is not installed in the mobile phone, the mobile phone browser is first downloaded and installed in the mobile phone. After the installation is completed, the mobile phone sends the identification information of the PC browser to the mobile phone browser. If the mobile phone browser already exists in the mobile phone, the identification information of the PC browser is directly sent to the mobile phone browser.
  • the mobile phone browser After receiving the identification information of the PC browser, the mobile phone browser performs step S1706 to send the address request information of the long connection server carrying the identification information to the long connection distribution server.
  • the long connection distribution server After receiving the address request message of the mobile phone browser, the long connection distribution server performs step S1707 to send a response message carrying the address information of the long connection server to the mobile phone browser.
  • the mobile phone browser receives the response message carrying the address information of the persistent connection server, and performs step S1708 to establish a long connection with the corresponding long connection server according to the address information of the persistent connection server.
  • the long connection server After receiving the data of the PC browser, the long connection server performs step S1709 to determine whether to send the data of the PC browser to the mobile browser according to the state of the long connection between the mobile browser and the persistent connection server.
  • the long connection server stores an online device list, and the real-time update of the list ensures that the long connection server can update the information of the browser with which the long connection is established in time to avoid the disconnection of the online device list data due to the timely update.
  • the browser sends data, causing malicious consequences such as packet loss, improving data transmission. safety.
  • the long connection server After the long connection server receives the data of the PC browser sent by the PC server, the status of the long connection between the online device list and the corresponding mobile phone browser is checked according to the online device list, and if the status of the long connection is the connection, the PC browsing is sent. Data to the mobile browser. If the state of the long connection is disconnected, the data of the PC browser is stored, and when the long connection state between the long connection server and the corresponding mobile browser is restored, the data of the PC browser is sent to the mobile browser.
  • the mobile phone browser After receiving the data sent by the long connection server, the mobile phone browser performs step S1710, and performs corresponding processing according to the received data to ensure information sharing between the first client and the second client, and can be on the second client.
  • the end of the operation is not performed on the first client before proceeding, for example, the web content reading is continued.
  • an embodiment of the present invention provides a client for data transmission, which is used to implement the data transmission method provided in Embodiment 3.
  • FIG. 18 is a schematic structural diagram of a client according to an embodiment of the present invention.
  • a client that is used for data transmission is simply referred to as a first client.
  • the first client 1800 of the embodiment of the present invention includes at least a third obtaining module 1810, a first sending module 1820, a third receiving module 1830, and a first processing module 1840.
  • the third obtaining module 1810 acquires the first data of the first client 1800 running locally. After the third obtaining module 1810 obtains the first data, the first sending module 1820 sends the first data to the second client set in the mobile terminal.
  • the two-way transmission between the first client 1800 and the second client of the two terminals is respectively performed, which solves the problem mentioned in the prior art.
  • the problem of data transmission between the clients is not solved, and the problem that data transmission cannot be performed between different clients and the new client is re-introduced when the new client is enabled may result in waste of resources and inefficiency.
  • the third obtaining module 1810 and the first sending module 1820 in the first client 1800 can complete the data sending function of the first client 1800, and the third receiving module 1830 receives the second data of the second client and trigger the first processing.
  • the module 1840 is processed by the first processing module 1840 according to the second data of the second client to ensure information sharing between the first client 1800 and the second client, and can continue to be executed on the second client. The end of the operation is not performed at the first client 1800, for example, the web content reading is continued.
  • the processing performed by the first client 1800 according to the received second data of the second client may be corresponding to the first client 1800 according to the second data, or may be the received The second data is processed.
  • the processing performed by the first client 1800 according to the second data includes: the first client 1800 updates the favorites, and the first client 1800 updates the frequently used URLs and The first client 1800 opens a web page corresponding to the web address and the like.
  • the first client 1800 and/or the second client may be any client of the same type, and may also be a client of different types but performing the same function, which is not limited by the embodiment of the present invention. .
  • the first and second are used to distinguish different clients.
  • the attributes, order, and functions of the client are not limited.
  • the first and second transpositions can be used to refer to different clients.
  • the first client 1800 and/or the second client are browser clients.
  • the user usually performs a personalized operation such as collecting a web address and setting a common web page in the browser client.
  • a personalized operation such as collecting a web address and setting a common web page in the browser client.
  • the user moves from one terminal to another, a new client needs to be newly enabled in another terminal.
  • the user is The personalized actions set on the previous client can be automatically synced to the newly enabled client without the user having to repeat the operation.
  • FIG. 19 is a block diagram showing another structure of a client according to an embodiment of the present invention.
  • another client for data transmission is simply referred to as a second client.
  • the second client 1900 of the embodiment of the present invention includes at least a fourth obtaining module 1910, a second sending module 1919, a fourth receiving module 1930, and a second processing module 1940.
  • the fourth obtaining module 1910 acquires the second data of the locally running second client 1900. After the fourth obtaining module 1910 obtains the second data, the second sending module 1919 sends the second data to the first client.
  • the second data of the second client 1900 can be sent to the first client, and data transmission between the first client and the second client 1900 is implemented, which solves the problems mentioned in the prior art.
  • the problem of data transmission between the clients is not solved, and the problem that data transmission cannot be performed between different clients and the new client is re-introduced when the new client is enabled may result in waste of resources and inefficiency.
  • the fourth obtaining module 1910 and the second sending module 1919 in the second client 1900 can complete the data sending function of the second client 1900, and the fourth receiving module 1930 receives the first data of the first client, and triggers the second processing.
  • the module 1940 performs corresponding processing according to the first data of the first client by the second processing module 1940 to ensure information sharing between the first client and the second client 1900, and can continue to be executed on the second client 1900. Previously, the end operation was not performed on the first client, for example, the web content reading was continued.
  • the first client and/or the second client 1900 may be any client of the same type, and may also be a client of different types but performing the same function, which is not limited by the embodiment of the present invention. .
  • the first and second are used to distinguish different clients.
  • the attributes, order, and functions of the client are not limited.
  • the first and second transpositions can be used to refer to different clients.
  • the first client and/or the second client 1900 are browser clients.
  • the user usually performs a personalized operation such as collecting a web address and setting a common web page in the browser client.
  • a personalized operation such as collecting a web address and setting a common web page in the browser client.
  • the user moves from one terminal to another, a new client needs to be newly enabled in another terminal.
  • the user is The personalized actions set on the previous client can be automatically synced to the newly enabled client. No user repetitive operations are required.
  • the first data received by the second client 1900 may be data that the user performs any operation in the first client, or may be other data updated by the first client, and is stored in the first.
  • the data of the client, and the like, are not limited in this embodiment of the present invention.
  • the data may include each web address stored in the favorites of the first client, a web address currently opened by the first client, a common web address of the first client, and any first client is invoked according to a user instruction. User data, etc.
  • the processing performed by the second client 1900 according to the received first data may be corresponding processing to the second client 1900 according to the first data, or may be the first data received. Process it.
  • the processing performed by the second client 1900 according to the first data includes: the second client 1900 updates the favorites, the second client 1900 updates the common web address, and the second client 1900 opens the web address corresponding to the second client 1900. Web pages and more.
  • Figure 20 is a block diagram showing the structure of a data transmission system in accordance with one embodiment of the present invention.
  • the data transmission system 2000 in the embodiment of the present invention includes a first client 2010 disposed on the first terminal, a second client 2020 disposed on the mobile terminal, a long connection distribution server 2030, and a long connection server 2040. And a first server 2050 corresponding to the first client.
  • the first client 2010 When the first client 2010 serves as the data transmitting end, it acquires its own first data, and transmits the first data and its own identification information to the first server 2050 using the first message as a carrier. After receiving the first message, the first server 2050 performs legality verification on the first message. Preferably, in the embodiment of the present invention, the first server 2050 verifies the identification information of the first client 2010 in the first message, and determines whether the identifier information of the first client 2010 is legal information, for example, whether the identifier information has been verified. Registered at the client center, or whether the identification information is an identifier generated internally by the server. If the identification information is verified as legal information, the first server 2050 transmits the identification information to the persistent connection server 2040. If the identification information is not legal information, the first server 2050 refuses to send the identification information to the persistent connection server 2040. .
  • the first server 2050 may perform legality verification on other data except the identification information in the first message, for example, verifying webpage data of the first client 2010, etc., whether it is non-malicious data.
  • the malicious data refers to a virus, a Trojan, and the like that steals, destroys, and the like in the user terminal. If the first server 2050 verifies that the data of the first client 2010 is the malicious data, the first server 2050 refuses to transmit the malicious data to the persistent connection server 2040. If the verification by the first server 2050, the first client 2010 The data is non-malicious data, and the first server 2050 transmits the data to the persistent connection server 2040.
  • the first server 2050 may further perform encryption processing on the first message, thereby more effectively improving the security of data transmission.
  • security verification and processing on the first message by the first server 2050 the security of the transmitted data can be more effectively ensured, and some malicious websites and the like are attached to the transmitted data during the data transmission process, and the terminal is applied to the user. Or the client caused damage.
  • the first server 2050 validates the first message
  • the first message verified by the legality is sent to the persistent connection server 2040 through an encryption process.
  • the long connection server 2040 receives the first message, and queries the local online device list for the status of the long connection with the corresponding second client 2020 according to the identification information carried therein. If the state of the long connection is a connection, the persistent connection server 2040 transmits the first data to the second client 2020. If the long connection state is off, the first data is stored in the persistent connection server 2040, and the state of the long connection with the second client 2020 is restored, and then transmitted.
  • the second client 2020 first requests the long connection distribution server 2030 for the address information of the corresponding persistent connection server 2040.
  • the specific manner in which the second client 2020 requests the address information of the persistent connection server 2040 is that the second client 2020 sends an address request message carrying the identification information of the first client 2010 to the persistent connection distribution server 2030.
  • the long connection distribution server 2030 determines the corresponding long connection server 2040 according to the identification information of the first client 2010 in the received address request message, and returns a response message to the second client 2020.
  • the response message carries the address information of the persistent connection server 2040.
  • the second client 2020 After receiving the response message, the second client 2020 establishes a long connection with the corresponding persistent connection server 2040 according to the address information of the persistent connection server 2040 carried in the response message, so as to receive the first client 2010 from the persistent connection server 2040.
  • the first data The first data.
  • the second client 2020 After receiving the first data, the second client 2020 performs corresponding processing according to the first data to ensure information sharing between the first client 2010 and the second client 2020, and can continue to execute on the second client 2020. The end of the operation is not performed at the first client 2010, for example, the web content reading is continued.
  • the two-way transmission between the first client 2010 and the second client 2020 of the two terminals can be performed, which solves the problem mentioned in the prior art.
  • the problem of data transmission between the clients cannot be further solved.
  • the data transmission cannot be performed between different clients, and the new client needs to be re-introduced when the new client is enabled, resulting in waste of resources and inefficiency.
  • the identifier information is the identity authentication information of the client, and may be the identity authentication information set by the user, or may be the identity authentication information set by the server for the client, which is not limited by the embodiment of the present invention.
  • the identifier information may be account information of the user login of the first client 2010, and the account information is an account that the user applies for registration at the client center, and the application of the account information is simple and easy, and each Account information can be logged in on multiple clients.
  • the identification information in the embodiment of the present invention may also be a string generated by the server as a unique identifier, such as a shadow account.
  • the shadow account may be a unique identifier generated by the server according to time, machine identification, etc.
  • the shadow account may also be an account randomly generated by the server. After the server generates the account, it checks whether the generated shadow account already exists, and if so, The server regenerates a shadow account until the account does not exist before. Shadow accounts are non-repeatable and unique, and each shadow account can only identify one client.
  • the first client 2010 and/or the second client 2020 may be any client of the same type, such as a browser client, a security guard client, a reader client, and a media player client.
  • the embodiments of the present invention are not limited to the clients that perform the same functions.
  • the first and second are used to distinguish different clients.
  • the attributes, order, and functions of the client are not limited.
  • the first and second transpositions can be used to refer to different clients.
  • the first client 2010 and/or the second client 2020 are browser clients.
  • the user usually performs a personalized operation such as collecting a web address and setting a common web page in the browser client.
  • a personalized operation such as collecting a web address and setting a common web page in the browser client.
  • the user is The personalized actions set on the previous client can be automatically synced to the newly enabled client without the user having to repeat the operation.
  • the first data may be data that the user performs any operation in the first client 2010, or other data updated by the first client 2010, and the data stored in the first client 2010.
  • the data may include each website stored in the favorites of the first client 2010, the website currently opened by the first client 2010, the common website of the first client 2010, and any first client.
  • the processing performed by the second client 2020 according to the received first data may be corresponding processing to the second client 2020 according to the first data, or may be the first data received. Process it.
  • the processing performed by the second client 2020 according to the first data includes: the second client 2020 updates the favorites, the second client 2020 updates the common website address, and the second client 2020 opens the corresponding website address. Web pages and more.
  • any data of the first client 2010 can be sent to the second client 2020, so that various operations performed by the user in the first client 2010 can be synchronously updated to the second client.
  • the user is prevented from performing repeated operations on the new client, and the repeated information is obtained, thereby further avoiding data redundancy and waste of resources.
  • the long connection server corresponding to the first client and the long connection server corresponding to the second client may be the same or different servers.
  • the first client 2010 and the second client 2020 can perform bidirectional data transmission, that is, the first client 2010 sends the first data of the first client 2010 to the second client. It is also possible that the second client 2020 sends the second data of the second client 2020 to the first client.
  • the specific process of transmitting the first data by the first client 2010 to the second client 2020 in the data transmission system 2000 is described above, and the process of transmitting the second data by the second client 2020 to the first client 2010 is similar thereto. Do not repeat them.
  • the embodiment of the present invention further provides another data transmission method, which is applied to a case where a channel for data transmission has been established between the first client and the second client, that is, the first client and the first client
  • the data transmission can be performed between the two clients.
  • the embodiment of the present invention is directed to a specific process for data transmission between the first client and the second client.
  • FIG. 21 is a flow chart showing the processing of a data transmission method in accordance with one embodiment of the present invention.
  • the processing flow of the data transmission method starts in step S2102, and the data in the first client and its identifier are The information is transmitted to the first server.
  • the first server After receiving the data of the first client and the identification information thereof, the first server triggers step S2104.
  • step S2104 the first server determines a corresponding long connection server according to the identification information of the first client, and forwards the data in the first client and its identification information to the corresponding long connection server.
  • step S2106 is executed to determine whether to forward the data of the first client to the long connection status of the second client and the persistent connection server. Second client.
  • the first client can send data to the second client, and the first client can perform data transmission to the second client, which solves the problem that the client cannot transfer data according to the prior art.
  • the problem is further solved. Because data transmission cannot be performed between different clients, the new client must be re-introduced when it is enabled, resulting in waste of resources and inefficiency.
  • the first client is set to the first terminal
  • the second client is set to the second terminal. It can be seen from the flow shown in FIG. 21 that in the data transmission process, the data in the first client is transmitted to the second client and needs to be forwarded through a server or the like. The transmission process of transmitting data in the first client to the second client by the first client is specifically described.
  • the step S2102 is performed as shown in FIG. 21, the first client sends the data in the first client and the identification information thereof to the first server, where the first server is the server corresponding to the first terminal.
  • the first server is the server corresponding to the first terminal.
  • the first server is a PC server.
  • the first server performs legality verification on the data of the first client.
  • the first server verifies the identification information of the first client in the data, and determines whether the identifier information of the first client is legal information, for example, whether the identifier information has been registered in the client center. Or whether the identification information is an identifier generated internally by the server. If the identification information is verified as legal information, the first server transmits the identification information to the persistent connection server. If the identification information is not legal information, the first server refuses to send the identification information to the persistent connection server.
  • the first server may also perform legality verification on other data except the identification information in the data, for example, verifying whether the webpage data of the first client is non-malicious data.
  • the malicious data refers to a virus, a Trojan, and the like that steals, destroys, and the like in the user terminal. If the first server verifies that the data of the first client is the malicious data, the first server refuses to transmit the malicious data to the persistent connection server, and if the data of the first client is non-malicious data, the first data is verified by the first server, The server transmits the data to the long connection server.
  • the first server may further encrypt the data of the first client, thereby more effectively improving the security of the data transmission.
  • the security of the transmitted data can be more effectively ensured, and some malicious websites and the like are attached to the transmitted data during the data transmission process, and the user is The terminal or client caused damage.
  • the first validated data is sent to the corresponding long connection server.
  • the first server and the long connection server can be implemented by various protocols. Communication, for example, transmission control protocol, user datagram protocol, and the like.
  • the first server and the persistent connection server communicate by HTTP request. HTTP supports multiple server modes, which is simple and fast, so HTTP request notification can improve data transmission efficiency.
  • the long connection server When the long connection server receives the data in the first client and the identifier information sent by the first server, the long connection server determines the corresponding second client according to the identifier information of the first client, and stores the second client according to the long connection server.
  • the information recorded in the online device list determines the status of the long connection with the second client.
  • the online device list stored in the persistent connection server records the identification information of each client that maintains a long connection with the persistent connection server. If the long connection between the client and the persistent connection server is disconnected, the identification information corresponding to the disconnected client is deleted in the online device list of the persistent connection server.
  • the online device list stored in the long connection server can be updated in real time, so that the long connection server can update the information of the client that establishes the long connection with the network, so as to avoid the disconnection of the online device list data.
  • the client sends data, which causes malicious consequences such as packet loss, and improves the security of data transmission.
  • the specific manner of the long connection server determining whether to send the data in the first client to the second client is, if the long connection server and the second client are connected according to the online device list of the persistent connection server, the connection is long.
  • the connection server sends the data of the first client to the second client. If the status of the long connection between the long connection server and the second client is disconnected according to the online device list of the persistent connection server, the data of the first client is stored in the long connection server, and then, the long connection is After the state is restored, the data of the first client stored in the persistent connection server is sent to the second client.
  • a data transmission channel is established between the first client and the second client, and data transmission can be performed.
  • the first client may be sent first.
  • the identification information is such that the server (such as the first server, the long connection server) and the like that pass through the data transmission process can confirm the corresponding data receiving end according to the identification information, and secondly, the first client sends the first client to the second client. Identifying other data than the information, the process of transmitting data from the first client to the second client.
  • the second client establishes a long connection with the persistent connection server to receive the data in the first client from the persistent connection server.
  • the process of establishing a long connection between the second client and the persistent connection server is now specifically described.
  • the second client determines the corresponding long connection server according to the identifier information of the second client, and sends a connection establishment request to the persistent connection server, where the connection establishment request carries the identifier information of the second client.
  • the long connection server authenticates the second client according to the identification information of the second client carried in the connection establishment request.
  • the long connection server may further perform identity verification on the second client according to other device information of the second client, to ensure that the second client is the receiving end of receiving data in the first client.
  • the other device information of the second client may be the device information of the second client, and may be the device information of the second terminal.
  • the other device information includes the international mobile device identity code of the second terminal (International Mobile Equipment Identity (hereinafter referred to as IMEI number), the second terminal The device name and the system version number of the second terminal.
  • IMEI number International Mobile Equipment Identity
  • the persistent connection server In the data transmission process, after the long connection server authenticates the second client according to the identification information of the second client and the device information thereof, if the second client fails to pass the authentication, the persistent connection server refuses to establish a long connection with the second client. If the second client is authenticated, the persistent connection server establishes a long connection with the second client.
  • the second client After the second client successfully establishes a long connection with the persistent connection server, the second client receives the data in the first client from the persistent connection server, and performs corresponding processing according to the data in the first client to ensure the first client.
  • the information sharing is implemented with the second client in the case where the data transmission channel has been established, and the end operation is not performed on the first client before the execution of the second client, for example, the web content reading is continued.
  • the identifier information is the identity authentication information of the client, and may be the identity authentication information set by the user, or may be the identity authentication information set by the server for the client, which is not limited by the embodiment of the present invention.
  • the identifier information may be account information of the user login of the first client, and the account information is an account that the user applies for registration at the client center, and the application of the account information is simple and easy, and each account information is You can log in on multiple clients.
  • the identification information in the embodiment of the present invention may also be a string generated by the server as a unique identifier, such as a shadow account.
  • the shadow account may be a unique identifier generated by the server according to time, machine identification, etc.
  • the shadow account may also be an account randomly generated by the server. After the server generates the account, it checks whether the generated shadow account already exists, and if so, The server regenerates a shadow account until the account does not exist before. Shadow accounts are non-repeatable and unique, and each shadow account can only identify one client.
  • the data of the first client may be data that the user performs any operation in the first client, other data updated by the first client, data stored in the first client, and the like.
  • the data may include each web address stored in the favorites of the first client, a web address currently opened by the first client, a common web address of the first client, and any first client is invoked according to a user instruction. User data, etc.
  • Any data of the first client can be sent to the second client, ensuring that various operations performed by the user in the first client can be synchronously updated to the second client, preventing the user from executing on the new client. Repeat operations to obtain duplicate information to further avoid data redundancy and waste of resources.
  • the user usually performs a personalized operation such as collecting a web address and setting a common web page in the browser client.
  • a personalized operation such as collecting a web address and setting a common web page in the browser client.
  • a new client needs to be enabled in another terminal.
  • the user is once The personalized actions set on the client can be automatically synced to the newly enabled client without the user having to repeat the operation.
  • the first client and/or the second client may be any client of the same type, such as a browser client, a security guard client, a reader client, a media player client, or the like.
  • the embodiments of the present invention are not limited to the clients of the different types but perform the same functions.
  • the second is only used to distinguish different clients. It does not limit the attributes, order, and functions of the client itself.
  • the first and second transpositions can also refer to different clients. That is, in the embodiment of the present invention, the first client disposed in the first terminal may send the data of the first client to the second client set in the second terminal, or may be the second client configured in the second terminal. The terminal sends the data of the second client to the first client set in the first terminal, so as to implement mutual transmission of information between the clients.
  • the first terminal and the second terminal may be terminals such as a desktop computer and a notebook computer, and may also be mobile terminals such as a mobile phone, a music player, and a tablet computer.
  • the first client and/or the second client are disposed on the mobile client, so as to more clearly and concisely describe the data transmission of the client between the terminal and the mobile terminal.
  • an embodiment of the present invention provides a client for data transmission, and a method for implementing the foregoing data transmission.
  • FIG. 22 is a block diagram showing the structure of a client according to an embodiment of the present invention.
  • the data transfer procedure between the first client 2210 and the second client 2220 is shown in FIG.
  • the architecture or composition or structure of the first client and the second client are similar.
  • the embodiment of the present invention only describes the structure of the first client 2210 in detail, and the structure of the second client 2220 is not described in detail in the embodiment of the present invention.
  • the two clients in FIG. 22 are only used to indicate that different clients can perform data transmission, and the parameters such as the transmission process, the transmission path, and the transmitted data between the two clients are not limited.
  • the first client 2210 includes at least: a second data acquirer 2211, a data transmitter 2212, and a second data receiver 2213.
  • the functions of the various components or components of the first client 2210 and the connection relationships between the various components are now described.
  • the second data acquirer 2211 in the first client 2210 acquires data in the first client 2210 and its identification information.
  • the data transmitter 2212 is triggered.
  • the data transmitter 2212 transmits the data in the first client 2210 and its identification information to the first server, and the first server transmits the data to the corresponding second client 2220 via the persistent connection server.
  • the first client 2210 can send data to the second client 2220, and implements data transmission between the first client 2210 and the second client 2220, which solves the problem that the client mentioned in the prior art cannot
  • the problem of data transmission further solves the problem that the data cannot be transmitted between different clients, and the new client needs to be re-introduced when the new client is enabled, resulting in waste of resources and inefficiency.
  • the second data acquirer 2211 in the first client 2210 acquires data in the first client 2210 and its identification information. After the second data acquirer 2211 obtains the data in the first client 2210 and its identification information, the data transmitter 2212 is triggered.
  • the data transmitter 2212 is configured to send the data in the first client 2210 and the identification information thereof to the first server, where the first server is the server corresponding to the first terminal. For example, if the first terminal is a PC, the first server is a PC server.
  • the first server After receiving the data of the first client 2210, the first server performs legality verification on the data of the first client 2210.
  • the first server verifies the identification information of the first client 2210, and determines whether the identification information of the first client 2210 is legal information, for example, whether the identification information has been registered in the client center. Or whether the identification information is an identifier generated internally by the server. If the identification information is verified as legal information, the first server transmits the identification information to the persistent connection server. If the identification information is not legal information, the first server refuses to send the identification information to the persistent connection server.
  • the first server may also perform legality verification on other data except the identification information, for example, verify that the webpage data of the first client 2210, etc., is non-malicious data.
  • the malicious data refers to a virus, a Trojan, and the like that steals, destroys, and the like in the user terminal. If the first server verifies that the data of the first client 2210 is the malicious data, the first server refuses to transmit the malicious data to the persistent connection server, and if the first server verifies, the data of the first client 2210 is non-malicious data. The first server transmits the data to the persistent connection server.
  • the first server may further encrypt the data of the first client 2210, thereby more effectively improving the security of data transmission.
  • the security verification and processing of the data of the first client 2210 by the first server can more effectively ensure the security of the transmitted data, and prevent some malicious websites and the like from being attached to the transmitted data during the data transmission.
  • the user's terminal or client causes damage.
  • the first server After the first server validates the data of the first client 2210, the first server verifies the legally validated data to the corresponding persistent connection server.
  • the first server and the long connection server can communicate through various protocols, such as a transmission control protocol, a user datagram protocol, and the like.
  • the first server and the persistent connection server communicate by HTTP request.
  • HTTP supports multiple server modes, which is simple and fast, so HTTP request notification can improve data transmission efficiency.
  • the long connection server When the long connection server receives the data in the first client 2210 and the identification information sent by the first server, the long connection server determines the corresponding second client 2220 according to the identification information of the first client 2210, and according to the long The information recorded in the list of online devices stored in the connection server determines the state of the long connection with the second client 2220.
  • the online device list stored in the persistent connection server records the identification information of each client that maintains a long connection with the persistent connection server. If the long connection between the client and the persistent connection server is disconnected, the identification information corresponding to the disconnected client is deleted in the online device list of the persistent connection server.
  • the online device list stored in the long connection server can be updated in real time, so that the long connection server can update the information of the client that establishes the long connection with the network, so as to avoid the disconnection of the online device list data.
  • the client sends data, which causes malicious consequences such as packet loss, and improves the security of data transmission.
  • the specific manner of the long connection server determining whether to send the data in the first client 2210 to the second client 2220 is a state in which the long connection server and the second client 2220 are connected according to the online device list of the persistent connection server.
  • the persistent connection server sends the data of the first client 2210 to the second client 2220. If the online device list of the persistent connection server is used, the long connection server and the second client 2220 If the status of the long connection is disconnected, the data of the first client 2210 is stored in the persistent connection server, and then, after the state of the long connection is restored, the first client 2210 stored in the persistent connection server is further connected. The data is sent to the second client 2220.
  • the second data receiver 2213 in the first client 2210 can receive data from the second client 2220 that is forwarded by the persistent connection server.
  • the state of the long connection with the first client 2210 is queried according to the online device list.
  • the persistent connection server sends the data in the second client 2220 to the first client 2210.
  • the second data receiver 2213 in the first client 2210 receives the data in the second client 2220 sent by the persistent connection server.
  • the long connection server stores the data in the second client 2220, and after the state of the long connection with the first client 2210 is restored, The data in the second client 2220 is sent to the first client 2210.
  • the identifier information is the identity authentication information of the client, and may be the identity authentication information set by the user, or may be the identity authentication information set by the server for the client, which is not limited by the embodiment of the present invention.
  • the identifier information may be account information that is logged in by the user of the first client 2210, and the account information is an account that the user applies for registration at the client center, and the application of the account information is simple and easy, and each Account information can be logged in on multiple clients.
  • the identification information in the embodiment of the present invention may also be a string generated by the server as a unique identifier, such as a shadow account.
  • the shadow account may be a unique identifier generated by the server according to time, machine identification, etc.
  • the shadow account may also be an account randomly generated by the server. After the server generates the account, it checks whether the generated shadow account already exists, and if so, The server regenerates a shadow account until the account does not exist before. Shadow accounts are non-repeatable and unique, and each shadow account can only identify one client.
  • the data of the first client 2210 may be data for the user to perform any operation in the first client 2210, or may be other data updated by the first client 2210, and stored in the first client.
  • the data of the terminal 2210, and the like, are not limited by the embodiment of the present invention.
  • the data may include each web address stored in the favorites of the first client 2210, the web address currently opened by the first client 2210, the common web address of the first client 2210, and any first client.
  • the terminal 2210 calls user data or the like according to a user instruction.
  • Any data of the first client 2210 can be sent to the second client 2220, ensuring that various operations performed by the user in the first client 2210 can be synchronously updated to the second client 2220 to avoid users. Perform repeated operations on new clients to obtain duplicate information to further avoid data redundancy and waste of resources.
  • the user usually performs a personalized operation such as collecting a web address and setting a common web page in the browser client. When the user turns from one terminal to another, a new client needs to be enabled in another terminal. According to an embodiment of the present invention, the user is once The personalized actions set on the client can be automatically synced to the newly enabled client without the user having to repeat the operation.
  • the first terminal and the second terminal may be terminals such as a desktop computer and a notebook computer, and may also be mobile terminals such as a mobile phone, a music player, and a tablet computer.
  • the first client 2210 and/or the second client 2220 are disposed on the mobile terminal, so as to more clearly and concisely describe the data transmission of the client between the terminal and the mobile terminal.
  • FIG. 23 is a flowchart of a data transmission method according to a preferred embodiment of the present invention, which is used to support the data transmission method and the data transmission device provided in Embodiment 4, and to clarify the data transmission method and the data transmission device. concise.
  • the PC is selected as the first terminal
  • the mobile phone is the second terminal
  • the client is the browser client.
  • the first client is referred to as a PC browser
  • the second client is referred to as a mobile browser
  • the identification information is a unique ID.
  • the preferred embodiment focuses on the process of how a PC browser sends data to a mobile browser.
  • the steps of the preferred embodiment start at step 1, and the mobile browser establishes a long connection with the persistent connection server.
  • the specific method is that the mobile phone browser determines the corresponding long connection server according to the identity information of the mobile phone, and sends a connection establishment request to the long connection server, where the connection establishment request carries the identification information of the mobile phone browser.
  • the long connection server authenticates the mobile phone browser according to the identification information of the mobile phone browser carried in the connection establishment request.
  • the long connection server may further perform identity verification on the mobile phone browser according to other device information of the mobile phone browser to ensure that the mobile phone browser is a receiving end for receiving data in the PC browser.
  • the other device information of the mobile phone browser may be the information of the mobile phone browser, and may also be the information of the second terminal.
  • the other device information includes the IMEI number of the second terminal and the device name of the second terminal. And the system version number of the second terminal.
  • the long connection server After the long connection server authenticates the mobile browser according to the identification information of the mobile browser and its device information, if the mobile browser fails to authenticate, the long connection server refuses to establish a long connection with the mobile browser, if the mobile browser passes the authentication, The long connection server establishes a long connection with the mobile browser.
  • the mobile browser After the mobile browser successfully establishes a long connection with the long connection server, the mobile browser receives the data in the PC browser from the long connection server, and performs corresponding processing according to the data in the PC browser to ensure the PC browser and the mobile browser.
  • the information sharing is realized, and the end of the operation in the PC browser is not performed before continuing to execute on the mobile browser, for example, the web content reading is continued.
  • the data in the PC browser is sent by the PC browser to the mobile phone browser via the PC server and the long connection server. Now, the process of the PC browser sending the data in the PC browser to the long connection server via the PC server is introduced.
  • the PC browser sends the data and unique ID in the PC browser to the PC server.
  • the PC server After receiving the data of the PC browser, the PC server performs legality verification on the data of the PC browser.
  • the PC server verifies the unique ID of the PC browser in the data, and determines whether the unique ID of the PC browser is legal information, for example, whether the unique ID is already in the center of the client. Book, or whether the unique ID is an identifier generated internally by the server. If the unique ID is verified to be legitimate information, the PC server transmits the unique ID to the persistent connection server. If the unique ID is not legal information, the PC server refuses to send the unique ID to the persistent connection server.
  • the PC server can also verify the validity of the data in the PC browser, for example, verifying the webpage data of the PC browser, etc., whether it is non-malicious data.
  • the malicious data refers to a virus, a Trojan, and the like that steals, destroys, and the like in the user terminal. If the PC server verifies that the data of the PC browser is the malicious data, the PC server refuses to transmit the malicious data to the long connection server. If the data of the PC browser is non-malicious data after being verified by the PC server, the PC server uses the data. Transfer to a long connection server.
  • the PC server can also encrypt the data of the PC browser, thereby more effectively improving the security of the data transmission.
  • the security verification and processing of the data of the PC browser by the PC server can more effectively ensure the security of the transmitted data, and prevent some malicious websites and the like from being attached to the transmitted data in the process of data transmission, to the user's terminal. Or the client caused damage.
  • step 3 in FIG. 23 After the PC server performs legality verification on the data of the PC browser, the process proceeds to step 3 in FIG. 23, and the unique ID verified by the legality and the data in the PC browser are forwarded to the corresponding long connection server.
  • the long connection server When the long connection server receives the data and the unique ID in the PC browser sent by the PC server, the long connection server determines the corresponding mobile phone browser according to the unique ID of the PC browser, and records according to the online device list stored by the long connection server. The information determines the status of the long connection to the mobile browser.
  • the list of online devices stored in the persistent connection server records the unique ID of each browser that maintains a long connection with the persistent connection server. If the long connection between a browser and the persistent connection server is disconnected, the unique ID corresponding to the disconnected browser is deleted in the online device list of the persistent connection server.
  • the online device list stored in the long connection server can be updated in real time, so that the long connection server can update the information of the browser with which the long connection is established in time to avoid the disconnection of the online device list data due to the timely update.
  • the browser sends data, causing malicious consequences such as packet loss, improving the security of data transmission.
  • the persistent connection server determines whether to send data in the PC browser to the mobile browser according to the state of the long connection with the mobile browser.
  • the long connection server determines whether to send data from the PC browser to the mobile browser. If the online connection list of the long connection server is used, the long connection between the long connection server and the mobile browser is connected, and the long connection server is connected. Send the data from your PC browser to your mobile browser. If the status of the long connection between the persistent connection server and the mobile browser is disconnected according to the online device list of the persistent connection server, the data in the PC browser is stored in the long connection server, and then, the long connection is After the status is restored, the data in the PC browser stored in the long connection server is sent to the mobile browser.
  • FIG. 24 is a flowchart of a data transmission method according to another preferred embodiment of the present invention, which is used to support any of the above data transmission methods and data transmission devices, and to clarify the data transmission method and the data transmission device.
  • the PC is selected as the first terminal
  • the mobile phone is the second terminal.
  • the client is a browser client.
  • the first client is referred to as a PC browser
  • the second client is referred to as a mobile browser
  • the identification information is a unique ID.
  • the preferred embodiment focuses on the process of how the mobile browser sends data to the PC browser.
  • the steps of the preferred embodiment begin in step 1, and the PC browser establishes a long connection with the persistent connection server.
  • the PC browser determines the corresponding long connection server according to the unique ID, and sends a connection establishment request to the persistent connection server, where the connection establishment request carries the unique ID of the PC browser.
  • the long connection server authenticates the PC browser according to the unique ID of the PC browser carried in the connection establishment request.
  • the long connection server may further perform identity verification on the PC browser according to other device information of the PC browser to ensure that the PC browser is a receiving end for receiving data in the mobile phone browser.
  • the other device information of the PC browser may be the device information of the PC browser, and may also be the device information of the first terminal.
  • the other device information includes the device name of the first terminal and the first terminal. System version number, etc.
  • the long connection server After the long connection server authenticates the PC browser according to the unique ID of the PC browser and its device information, if the PC browser fails to authenticate, the long connection server refuses to establish a long connection with it, if the PC browser is authenticated, The long connection server establishes a long connection with the PC browser.
  • the PC browser After the PC browser successfully establishes a long connection with the long connection server, the PC browser receives the data in the mobile browser from the long connection server, and performs corresponding processing according to the data in the mobile browser to ensure the mobile browser and the PC browser.
  • the information sharing is realized, and the end of the operation in the mobile browser is not performed before continuing to execute on the PC browser, for example, the web content reading is continued.
  • the data in the mobile browser is sent by the mobile browser to the PC browser via the PC server and the long connection server. Now, the process of the mobile browser sending the data in the mobile browser to the long connection server via the PC server is introduced.
  • the mobile browser sends the data and unique ID in the mobile browser to the PC server.
  • the PC server After receiving the data and unique ID of the mobile phone browser, the PC server performs legality verification on the data and the unique ID of the mobile phone browser.
  • the PC server verifies the unique ID of the mobile phone browser in the data, and determines whether the unique ID of the mobile phone browser is legal information, for example, whether the unique ID is registered in the client center, or Whether the unique ID is an identifier generated internally by the server. If the unique ID is verified to be legitimate information, the PC server transmits the unique ID to the persistent connection server. If the unique ID is not legal information, the PC server refuses to send the unique ID to the persistent connection server.
  • the PC server can also verify the validity of the data in the mobile browser, for example, verifying the webpage data of the mobile browser, etc., whether it is non-malicious data.
  • the malicious data refers to a virus, a Trojan, and the like that steals, destroys, and the like in the user terminal. If the PC server verifies that the data of the mobile browser is the malicious data, the PC server refuses to transmit the malicious data to the long connection server. If the data of the mobile browser is non-malicious data after being verified by the PC server, the PC server uses the data. Transfer to a long connection server.
  • the PC server may further encrypt the data of the mobile phone browser, thereby improving data transmission more effectively.
  • Security The security verification and processing of the data of the mobile phone browser by the PC server can more effectively ensure the security of the transmitted data, and prevent some malicious websites and the like from being attached to the transmitted data during the data transmission process, and the user terminal Or the client caused damage.
  • step 3 in FIG. 24 After the PC server performs the validity verification on the data of the mobile phone browser, the process proceeds to step 3 in FIG. 24, and the unique ID verified by the legality and the data in the mobile browser are forwarded to the corresponding long connection server.
  • the long connection server When the long connection server receives the data and the unique ID in the mobile browser sent by the PC server, the long connection server determines the corresponding PC browser according to the unique ID of the mobile browser, and records according to the online device list stored by the long connection server. The information determines the status of the long connection to the PC browser.
  • the list of online devices stored in the persistent connection server records the unique ID of each browser that maintains a long connection with the persistent connection server. If the long connection between a browser and the persistent connection server is disconnected, the unique ID corresponding to the disconnected browser is deleted in the online device list of the persistent connection server.
  • the online device list stored in the long connection server can be updated in real time, so that the long connection server can update the information of the browser with which the long connection is established in time to avoid the disconnection of the online device list data due to the timely update.
  • the browser sends data, causing malicious consequences such as packet loss, improving the security of data transmission.
  • the persistent connection server determines whether to send data in the mobile browser to the PC browser according to the state of the long connection with the PC browser.
  • the long connection server determines whether to send data in the mobile browser to the PC browser. If the long connection server and the PC browser are connected according to the online device list of the long connection server, the long connection server is connected. Send the data from your mobile browser to your PC browser. If the status of the long connection between the persistent connection server and the PC browser is disconnected according to the online device list of the persistent connection server, the data in the mobile browser is stored in the long connection server, and then, the long connection is After the status is restored, the data in the mobile browser stored in the long connection server is sent to the PC browser.
  • the embodiment of the present invention provides a data transmission system based on the method and device for data transmission provided by the fourth embodiment.
  • Figure 25 is a block diagram showing the structure of a data transmission system in accordance with one embodiment of the present invention.
  • the data transmission system 2500 in the embodiment of the present invention includes at least a first server 2510, a first client 2520, a second client 2530, and a persistent connection server 2540.
  • the first client 2520 is set to the first terminal
  • the second client 2530 is set to the second terminal.
  • the function of each device or component in the data transmission system of the embodiment of the present invention and the connection relationship between the parts will now be described.
  • the second data acquirer 2521 in the first client 2520 acquires the data in the first client 2520 and its identification information, and triggers the data transmitter 2522.
  • the data transmitter 2522 is triggered to transmit the data in the first client 2520 and its identification information to the first server 2510.
  • the first server 2510 After receiving the data of the first client 2520 and the identification information thereof, the first server 2510 performs legality verification on the data of the first client 2520 and its identification information. Preferably, in the embodiment of the present invention, the first server 2510 verifies the identification information of the first client 2520, and determines whether the identification information of the first client 2520 is legal information, for example, whether the identification information is already in the client center. Registration, or the logo Whether the information is an identifier generated internally by the server. If the identification information is verified as legal information, the first server 2510 transmits the identification information to the persistent connection server 2540. If the identification information is not legal information, the first server 2510 refuses to send the identification information to the persistent connection server 2540. .
  • the first server 2510 can also perform legality verification on other data except the identification information, for example, verifying the webpage data of the first client 2520, etc., whether it is non-malicious data.
  • the malicious data refers to a virus, a Trojan, and the like that steals, destroys, and the like in the user terminal. If the first server 2510 verifies that the data of the first client 2520 is the malicious data, the first server 2510 refuses to transmit the malicious data to the persistent connection server 2540, and if verified by the first server 2510, the first client 2520 The data is non-malicious data, and the first server 2510 transmits the data to the persistent connection server 2540.
  • the first server 2510 may further encrypt the data of the first client 2520, thereby more effectively improving the security of data transmission.
  • the security verification and processing of the data of the first client 2520 by the first server 2510 can more effectively ensure the security of the transmitted data, and prevent some malicious websites and the like from being attached to the transmitted data during the data transmission. Damage to the user's terminal or client.
  • the first server 2510 validates the data of the first client 2520 and the identification information thereof, the first server 2510 sends the legally verified data and the identification information of the first client 2520 to the corresponding persistent connection server 2540.
  • the first server 2510 and the persistent connection server 2540 can communicate via a variety of protocols, such as a Transmission Control Protocol, a User Datagram Protocol, and the like.
  • the first server 2510 and the persistent connection server 2540 communicate by HTTP request.
  • HTTP supports multiple server modes, which is simple and fast, so HTTP request notification can improve data transmission efficiency.
  • the long connection server 2540 When the long connection server 2540 receives the data in the first client 2520 and the identification information sent by the first server 2510, the long connection server 2540 determines the corresponding second client 2530 according to the identification information of the first client 2520, And determining the state of the long connection with the second client 2530 based on the information recorded in the online device list stored by the persistent connection server 2540.
  • the online device list stored in the persistent connection server 2540 records the identification information of each client that maintains a long connection with the persistent connection server 2540. If the long connection between the client and the persistent connection server 2540 is disconnected, the identification information corresponding to the disconnected client is deleted in the online device list of the persistent connection server 2540.
  • the online device list stored in the persistent connection server 2540 can be updated in real time, ensuring that the long connection server 2540 can update the information of the client that establishes the long connection with the network in time, so as to avoid the interruption of the online device list data. Open clients send data, resulting in malicious consequences such as packet loss, improving the security of data transmission.
  • the specific manner of the long connection server 2540 determining whether to send the data in the first client 2520 to the second client 2530 is: if the online device list of the persistent connection server 2540 is long, the long connection server 2540 is long between the second client 2530. The status of the connection is a connection, and the long connection server 2540 transmits the data of the first client 2520 to the second client 2530.
  • Long connection if according to the online device list of the long connection server 2540 The state of the long connection between the server 2540 and the second client 2530 is disconnected, and the data of the first client 2520 is stored in the persistent connection server 2540, and then, after the state of the long connection is restored, the length is longer. The data of the first client 2520 stored in the connection server 2540 is sent to the second client 2530.
  • the second client 2530 needs to establish a long connection with the persistent connection server 2540 before receiving the data in the first client 2520 from the persistent connection server 2540.
  • the first client 2520 receives the data in the second client 2530 from the persistent connection server 2540, it also needs to establish a long connection with the persistent connection server 2540.
  • the long connection server corresponding to the first client and the long connection server corresponding to the second client may be the same or different servers, and are represented by 2540 in FIG. 25.
  • the first client may also exist as a data receiving end while being a data transmitting end.
  • the following is a detailed description of the first client as a data receiving end.
  • the first client 2520 determines the corresponding long connection server 2540 according to the identification information of the first client 2520, and sends a connection establishment request to the persistent connection server 2540, where the connection establishment request carries the identification information of the first client 2520.
  • the persistent connection server 2540 authenticates the first client 2520 according to the identification information of the first client 2520 carried in the connection establishment request.
  • the long connection server 2540 can also perform identity verification on the first client 2520 according to other device information of the first client 2520 to ensure that the first client 2520 receives the second client 2530.
  • the data receiver in the middle is not limited to identify the first client 2520, and sends a connection establishment request to the persistent connection server 2540, where the connection establishment request carries the identification information of the first client 2520.
  • the persistent connection server 2540 authenticates the first client 2520 according to the identification information of the first client 2520 carried in the connection establishment request.
  • the long connection server 2540 can also perform identity verification on the first client 2520 according to other device information of the first client 2520
  • the other device information of the first client 2520 may be the device information of the first client, and may also be the device information of the first terminal.
  • the other device information includes the IMEI number of the first terminal, The device name of the first terminal and the system version number of the first terminal.
  • the long connection server 2540 After the long connection server 2540 authenticates the first client 2520 according to the identification information of the first client 2520 and its device information, if the first client 2520 fails to pass the authentication, the persistent connection server 2540 refuses to establish a long connection with the first client 2520. If the first client 2520 is authenticated, the persistent connection server 2540 establishes a long connection with the first client 2520.
  • the first client 2520 After the first client 2520 successfully establishes a long connection with the persistent connection server 2540, the first client 2520 receives the data in the second client 2530 from the persistent connection server 2540 by using the second data receiver 2523, and according to the second client.
  • the data in 2530 is processed accordingly to ensure that information sharing between the first client 2520 and the second client 2530 is achieved, and the operation that was not performed before the second client 2530 is performed on the first client 2520 can be performed. For example, continue to read web content.
  • the first client 2520 can send data to the second client 2530, and implements data transmission between the first client 2520 and the second client 2530, which solves the problem that the client mentioned in the prior art cannot
  • the problem of data transmission is further solved because data transmission cannot be performed between different clients. User requirements must be reintroduced when the client is enabled, resulting in wasted resources and inefficiencies.
  • the embodiment of the present invention can achieve the following beneficial effects:
  • the first client can send data to the second client, and the first client can perform data transmission to the second client, which solves the problem that the client cannot transfer data according to the prior art.
  • the problem is further solved. Because data transmission cannot be performed between different clients, the new client must be re-introduced when it is enabled, resulting in waste of resources and inefficiency.
  • FIG. 26 is a flow chart showing the processing of a data transmission method in accordance with one embodiment of the present invention.
  • S2602 is first executed to send data in the first client to the persistent connection server.
  • the long connection server After receiving the data in the first client, the long connection server performs step S2604 to determine whether to send the data of the first client to the second client according to the state of the long connection between the persistent connection server and the second client.
  • the first client can send data to the second client, and the first client can perform data transmission to the second client, which solves the problem that the client cannot transfer data according to the prior art.
  • the problem is further solved. Because data transmission cannot be performed between different clients, the new client must be re-introduced when it is enabled, resulting in waste of resources and inefficiency.
  • the second client confirms the corresponding long connection server through the long connection allocation server according to the identity information of the second client.
  • the second client first sends an address request message carrying the self-identification information to the long connection distribution server.
  • the long connection allocation server confirms the long connection server corresponding to the second client according to the identification information of the second client in the address request message. Then returning to the second client a response message carrying the address information of at least one long connection server.
  • the second client selects one of the at least two pieces of address information, and determines a corresponding long connection server according to the selected address information, and then establishes a long connection with the long connection server. connection. If the long connection fails to be established, the second client reselects an address information in the remaining address information carried in the response message, and establishes a long connection with the long connection server corresponding to the address information.
  • the second client If the second client still cannot successfully establish a long connection with the address information of the long connection server carried according to the response message, the second client repeatedly performs an operation arbitrarily selected in the remaining address information carried in the response message, and repeatedly performs and selects The long connection server corresponding to the address information establishes a long connection operation until the second client successfully establishes a long connection with the corresponding long connection server.
  • the second client If the second client does not successfully establish a long connection with the long connection server corresponding to any address information carried in the response message returned by the long connection distribution server, the second client resends the address request message to the long connection distribution server. Then, according to the address information of the long connection server returned by the long connection allocation server, a long connection is established with the corresponding long connection server.
  • the second client After the second client successfully establishes a long connection with the corresponding long connection server, the second client is set every second.
  • the network connection detection message is sent to the long connection server at a predetermined time.
  • the network connectivity message is a Packet Internet Groper (Ping Internet), hereinafter referred to as Ping message.
  • Ping message is a widely used message for detecting network connectivity, and the ping message can perform network connectivity detection quickly and efficiently. Therefore, in the embodiment of the present invention, the ping message is preferably used as a detection message sent when detecting network connectivity.
  • the second client continuously monitors the network connection detection message to the long connection server, and if the second client sends the network connectivity detection message timeout or fails to send, disconnects the second client and the corresponding long connection server. Long connection between. After disconnecting the long connection, the second client reselects the address information of the long connection server, and establishes a long connection with the corresponding long connection server according to the reselected address information of the long connection server.
  • the second client can timely monitor the state of the long connection between the second client and the persistent connection server, so as to be able to determine whether to continue receiving from the persistent connection server in time. Message.
  • the long connection server side On the long connection server side, set a predetermined duration, and then time the interval at which the long connection server receives the network connectivity detection message. When the time interval exceeds the predetermined duration, the long connection server disconnects from the second client. Long connection.
  • the long connection server stores an online device list, which records identification information of each client that maintains a long connection with the long connection server. If the long connection between the client and the persistent connection server is disconnected, the identification information corresponding to the disconnected client is deleted in the online device list of the persistent connection server.
  • the online device list stored in the long connection server can be updated in real time, so that the long connection server can update the information of the client that establishes the long connection with the network, so as to avoid the disconnection of the online device list data.
  • the client sends data, which causes malicious consequences such as packet loss, and improves the security of data transmission.
  • the long connection server When the long connection server receives the data of the first client, the long connection server determines the corresponding second client according to the identifier information carried in the data of the first client, and determines the second client according to the information recorded in the online device list. The state of the long connection between. If the status of the long connection is a connection, the long connection server sends the data of the first client to the second client. If the status of the long connection is disconnected, the data of the first client is stored in the persistent connection server, and then, after the state of the long connection is restored, the data of the first client stored in the persistent connection server is sent to Second client.
  • the first client and/or the second client may be disposed in any terminal, which is not limited by the embodiment of the present invention.
  • client data transmission between the mobile terminal and the terminal can be implemented in addition to the client data transmission between different terminals. Therefore, in the embodiment of the present invention, the first client and/or the second client may be disposed in the terminal, for example, a desktop computer, a notebook computer, or the like, and may also be disposed on the mobile terminal, for example, a mobile phone, a music player, or a tablet computer. Wait.
  • the first client and/or the second client are disposed on the mobile terminal, so as to more clearly and concisely describe the data transmission of the client between different terminals.
  • the first client and/or the second client may be a browser client and a security guard. Any client of the same type, such as a client client, a reader client, and a media player client, may also be a client of a different type but performing the same function, which is not limited by the embodiment of the present invention.
  • the first and second are used to distinguish different clients. The attributes, order, and functions of the client are not limited.
  • the first and second transpositions can be used to refer to different clients. That is, in the embodiment of the present invention, the first client may send the data of the first client to the second client, or the second client may send the data of the second client to the first client to implement the client. The mutual transmission of information.
  • the first client and/or the second client are browser clients.
  • the user usually performs a personalized operation such as collecting a web address and setting a common web page on the browser client.
  • a personalized operation such as collecting a web address and setting a common web page on the browser client.
  • the user is The personalized operation set on the former client can be automatically synchronized into the newly enabled client without the user repeating the operation, so the browser client can be more clearly shown as the preferred embodiment of the present invention. Process and beneficial effects.
  • the first client and the second client perform data transmission through a wired network and/or a wireless network, where the wired network includes a data line, and the wireless network includes Bluetooth, wifi, a local area network, and the like.
  • an embodiment of the present invention provides an apparatus for implementing the foregoing data transmission method.
  • FIG. 27 is a block diagram showing the structure of a data transmission device according to an embodiment of the present invention.
  • the data transmission device 2700 of the embodiment of the present invention includes at least an information acquirer 2710, a second connection establisher 2720, a third data transmitter 2730, a third data receiver 2740, and a monitor 2750.
  • the data transmission device 2700 is simply referred to as the client 2700.
  • the second connection establisher 2720 establishes a long connection with the corresponding long connection server, and then the third data receiver 2740 receives other clients sent by other clients via the long connection server corresponding to the client 2700.
  • the third data transmitter 2730 in the client 2700 sends the data in the client 2700 to other clients.
  • the first client can send data to the second client, and the first client can perform data transmission to the second client, which solves the problem that the client cannot transfer data according to the prior art.
  • the problem is further solved. Because data transmission cannot be performed between different clients, the new client must be re-introduced when it is enabled, resulting in waste of resources and inefficiency.
  • the information acquirer 2710 in the client 2700 acquires the address information of the corresponding long connection server according to the identity information of the client.
  • the address requesting module 2711 in the information acquirer 2710 transmits an address request message carrying the identification information of the client 2700 to the long connection distribution server.
  • the long connection allocation server determines the long connection server corresponding to the client 2700 according to the identification information of the client 2700 carried in the request message, and then returns a response message to the information acquirer 2710.
  • the response message carries address information of at least one long connection server.
  • the address receiving module 2712 in the information acquirer 2710 then receives the address message returned by the long connection distribution server.
  • the second connection establisher 2720 After receiving the address message corresponding to the persistent connection server, the second connection establisher 2720 establishes a long connection with the corresponding persistent connection server according to the returned address message of the persistent connection server.
  • the second connection establisher 2720 selects one of the at least two pieces of address information, and then determines the corresponding long connection server according to the selected address information. And establish a long connection with the determined long connection server.
  • the second connection establisher 2720 reselects an address information in the remaining address information to establish a long connection with the long connection server determined by the reselected address information.
  • the second connection establisher 2720 repeatedly performs the selection operation of the address information, and repeatedly performs the operation of establishing the long connection with the long connection server corresponding to the reselected address information until the long connection is successfully established with the persistent connection server.
  • the information acquirer 2710 is triggered.
  • the information acquirer 2710 re-requests the address information of the long connection server to the long connection allocation server.
  • the second connection establisher 2720 re-establishes a long connection with the corresponding persistent connection server according to the address information of the long connection server that is returned again until the long connection establishment is successful.
  • the long connection server stores an online device list, which records identification information of each client that maintains a long connection with the long connection server. If the long connection between the client and the persistent connection server is disconnected, the identification information corresponding to the disconnected client is deleted in the online device list of the persistent connection server.
  • the online device list stored in the long connection server can be updated in real time, so that the long connection server can update the information of the client that establishes the long connection with the network, so as to avoid the disconnection of the online device list data.
  • the client sends data, which causes malicious consequences such as packet loss, and improves the security of data transmission.
  • the client 2700 After the client 2700 successfully establishes a long connection with the corresponding long connection server, the client 2700 sends a network connectivity detection message to the persistent connection server every preset time.
  • the network connectivity detection message is a Ping message.
  • the ping message is a widely used message for detecting network connectivity, and the ping message can perform network connectivity detection quickly and efficiently. Therefore, in the embodiment of the present invention, the ping message is preferably used as a detection message sent when detecting network connectivity.
  • the monitor 2750 in the client 2700 monitors the network connectivity detection message continuously sent by the second connection establisher 2720. If the second connection establisher 2720 detects that the network connectivity detection message expires or the transmission fails, the monitor 2750 triggers.
  • the second connection establisher 2720 is triggered by the monitor 2750 to disconnect the long connection between the client 2700 and the current persistent connection server. After the long connection between the client 2700 and the persistent connection server is disconnected, the address of the persistent connection server is reselected, the corresponding long connection server is determined, and a long connection is established with the determined long connection server.
  • the third data transmitter 2730 in the client 2700 sends the data in the client 2700 and its identification information to the persistent connection server, and the long connection server is in accordance with the state of the long connection between the long connection server and other clients. Determine whether to send data from this client 2700 to other clients.
  • the client 2700 and/or other clients may be set in any terminal.
  • the embodiments of the present invention are not limited thereto.
  • client data transmission between the mobile terminal and the terminal can be implemented in addition to the client data transmission between different terminals. Therefore, in the embodiment of the present invention, the client 2700 and/or other clients may be disposed in the terminal, for example, a desktop computer, a notebook computer, or the like, and may also be disposed on the mobile terminal, for example, a mobile phone, a music player, a tablet computer, or the like. .
  • the client 2700 and/or other clients are disposed on the mobile terminal, so as to more clearly and concisely describe the data transmission of the client between different terminals.
  • the client 2700 and/or other clients may be any client of the same type, such as a browser client, a security guard client, a reader client, a media player client, or the like.
  • the client of the different types but performing the same function is not limited by the embodiment of the present invention.
  • the present and other here are only used to distinguish different clients, and there is no limit to the attributes, order, and functions of the client itself. This and other transpositions can also refer to different clients. That is, in the embodiment of the present invention, the client 2700 may send the data of the client 2700 to other clients, or the other client may send data of other clients to the client 2700 to implement information between the clients. Transfer to each other.
  • the client 2700 and/or other clients are browser clients.
  • the user usually performs a personalized operation such as collecting a web address and setting a common web page on the browser client.
  • a personalized operation such as collecting a web address and setting a common web page on the browser client.
  • the user is The personalized operation set on the former client can be automatically synchronized into the newly enabled client without the user repeating the operation, so the browser client can be more clearly shown as the preferred embodiment of the present invention. Process and beneficial effects.
  • the client 2700 and other clients perform data transmission through a wired network and/or a wireless network, wherein the wired network includes a data line, and the wireless network includes Bluetooth, wifi, a local area network, and the like.
  • the embodiment of the present invention provides a wireless data transmission system.
  • FIG. 28 is a block diagram showing the structure of a data transmission system according to an embodiment of the present invention.
  • the data transmission system in the embodiment of the present invention includes a first client 2810, a second client 2820, a long connection distribution server 2830, and a persistent connection server 2840.
  • the first client 2810 and the second client 2820 refer to the client shown in FIG. 27, in order to distinguish the first client and the second client in the process, so that the two are not confused, respectively It is labeled as a first client 2810 and a second client 2820.
  • the first client 2810 sends data to the second client 2820 via the persistent connection server 2840. After the second client 2820 establishes a long connection with the persistent connection server 2840, the data transmitted by the first client 2810 is received from the persistent connection server 2840.
  • the information acquirer 2710 in the second client 2820 acquires the address information of the corresponding persistent connection server 2840 according to its own identification information.
  • the address requesting module 2711 in the information acquirer 2710 transmits an address request message carrying the identification information of the second client 2820 to the long connection allocating server 2830.
  • Long connection distribution service After receiving the address request message, the server 2830 determines the long connection server 2840 corresponding to the second client 2820 according to the identification information carried in the request message, and then returns a response message to the information acquirer 2710.
  • the response message carries address information of at least one long connection server 2840.
  • the address receiving module 2712 in the information acquirer 2710 then receives the address message returned by the persistent connection assignment server 2830.
  • the second connection establisher 2720 After receiving the address message corresponding to the persistent connection server 2840, the second connection establisher 2720 establishes a long connection with the corresponding persistent connection server 2840 according to the returned address message of the persistent connection server 2840.
  • the second connection establisher 2720 selects one of the at least two pieces of address information, and then determines the corresponding long connection server according to the selected address information. 2840, and establishes a long connection with the determined long connection server 2840.
  • the second connection establisher 2720 reselects an address information in the remaining address information to establish a long connection with the long connection server determined by the reselected address information.
  • the second connection establisher 2720 repeatedly performs the selection operation of the address information, and repeatedly performs the operation of establishing the long connection by the persistent connection server 2840 corresponding to the reselected address information until the long connection is successfully established with the persistent connection server 2840.
  • the information acquirer 2710 is triggered.
  • the information acquirer 2710 re-requests the address information of the long connection server 2840 to the long connection distribution server 2830.
  • the second connection establisher 2720 then re-establishes a long connection with the corresponding persistent connection server 2840 based on the address information of the long connection server 2840 returned again until the long connection is established successfully.
  • the long connection server 2840 stores an online device list that records identification information of each client that maintains a long connection with the persistent connection server 2840. If the long connection between the client and the persistent connection server 2840 is disconnected, the identification information corresponding to the disconnected client is deleted in the online device list of the persistent connection server 2840.
  • the real-time update of the online device list in the persistent connection server 2840 ensures that the persistent connection server 2840 can update the information of the client with which the long connection is established in time, and improve the data transmission speed.
  • the second client 2820 After the second client 2820 successfully establishes a long connection with the corresponding persistent connection server 2840, it sends a network connectivity detection message to the persistent connection server every predetermined time period.
  • the monitor 2750 in the second client 2820 monitors the network connectivity detection message continuously sent by the second connection establisher 2720. If the second client 2820 detects that the network connectivity detection message has expired or the transmission fails, the monitor 2750 triggers.
  • the second connection establisher 2720 via the trigger of the monitor 2750, disconnects the long connection between the second client 2820 and the current persistent connection server 2840.
  • the address of the persistent connection server 2840 is then reselected, the corresponding persistent connection server 2840 is determined, and a long connection is established with the determined persistent connection server 2840.
  • the persistent connection server 2840 When the persistent connection server 2840 receives the data transmitted by the first client 2810, the persistent connection server 2840 searches for the status of the long connection with the corresponding second client 2820 based on the stored list of online devices. If the state of the long connection is a connection, the persistent connection server 2840 transmits the data of the first client 2810 to the third data receiver 2740 of the second client 2820. If the state of the long connection is disconnected, the data of the first client 2810 is stored in the persistent connection server 2840, and then the first client stored in the persistent connection server 2840 is restored after the state of the long connection is restored. The data of 2810 is sent to the second client 2820. In addition, through A similar mechanism may be used to send the data in the second client 2820 to the first client 2810. The specific process is not described here.
  • the first client can send data to the second client, and the first client can perform data transmission to the second client, which solves the problem that the client cannot transfer data according to the prior art.
  • the problem is further solved. Because data transmission cannot be performed between different clients, the new client must be re-introduced when it is enabled, resulting in waste of resources and inefficiency.
  • the first client 2810 and/or the second client 2820 may be disposed in any terminal, which is not limited by the embodiment of the present invention.
  • client data transmission between the mobile terminal and the terminal can be implemented in addition to the client data transmission between different terminals. Therefore, in the embodiment of the present invention, the first client 2810 and/or the second client 2820 may be disposed in a terminal, such as a desktop computer, a notebook computer, or the like, and may also be disposed on a mobile terminal, such as a mobile phone, a music player, or the like. Tablets, etc.
  • the first client 2810 and/or the second client 2820 are disposed on the mobile terminal, so as to more clearly and concisely describe the data transmission of the client between different terminals.
  • the first client 2810 and/or the second client 2820 may be any client of the same type, such as a browser client, a security guard client, a reader client, and a media player client.
  • the embodiments of the present invention are not limited to the clients that perform the same functions.
  • the first and second are used to distinguish different clients.
  • the attributes, order, and functions of the client are not limited.
  • the first and second transpositions can be used to refer to different clients. That is, in the embodiment of the present invention, the first client 2810 may send the data of the first client 2810 to the second client 2820, or the second client 2820 may send the second client by using the third data transmitter 2730.
  • the data of 2820 is sent to the first client 2810 to realize mutual transmission of information between the clients.
  • the first client 2810 and/or the second client 2820 are browser clients.
  • the user usually performs a personalized operation such as collecting a web address and setting a common web page on the browser client.
  • a new client needs to be newly enabled on the other device.
  • the user is The personalized operation set on the former client can be automatically synchronized into the newly enabled client without the user repeating the operation, so the browser client can be more clearly shown as the preferred embodiment of the present invention. Process and beneficial effects.
  • the first client 2810 and the second client 2820 perform data transmission through a wired network and/or a wireless network, where the wired network includes a data line, and the wireless network includes Bluetooth, wifi, a local area network, and the like.
  • FIG. 29 is a flowchart of a data transmission method for supporting any one of the data transmission methods and the data transmission device provided in Embodiment 5, and the data transmission method and the data transmission device are more clearly explained in accordance with a preferred embodiment of the present invention.
  • the PC is selected as the first terminal
  • the mobile phone is the second terminal
  • the client is the browser client
  • the first client is set in the first terminal
  • the second client is set in the second terminal. terminal.
  • the first client settings On the PC called the PC browser
  • the second client is set on the mobile phone and is called the mobile browser.
  • the mobile phone browser confirms the corresponding long connection server through the long connection distribution server according to its own identification information.
  • the mobile phone browser first sends an address request message carrying its own identification information to the long connection distribution server.
  • the long connection distribution server After receiving the address request message, the long connection distribution server performs step 2 in FIG. 29, and confirms the long connection server corresponding to the mobile phone browser according to the identification information of the mobile phone browser in the address request message. Then returning to the mobile browser response message, the response message carries the address information of at least one long connection server.
  • the mobile phone browser selects one of the at least two pieces of address information, performs step 3, determines a corresponding long connection server according to the selected address information, and sends a request to establish a long connection. Request message to the long connection server. If the long connection fails to be established, the mobile browser reselects an address information in the remaining address information carried in the response message, and establishes a long connection with the long connection server corresponding to the address information. If the mobile phone browser still cannot establish a long connection successfully with the address information of the long connection server carried according to the response message, the mobile phone browser repeatedly performs an operation arbitrarily selected in the remaining address information carried in the response message, and repeatedly executes and selects the selected address information. The corresponding long connection server establishes a long connection operation until the mobile browser successfully establishes a long connection with the corresponding long connection server.
  • the mobile browser resends the address request message to the long connection distribution server, and then according to The address information returned by the long connection distribution server again sends a long connection establishment request to the long connection server.
  • step 4 is executed, and the long connection between the mobile device browser and the mobile phone browser is identified in the local online device list according to the identification information of the mobile phone browser carried in the request message. The status is connected.
  • step 5 is triggered, and the mobile browser sends a network connectivity detection message to the persistent connection server.
  • the mobile phone browser continuously sends a network connection detection message to the long connection server, and if the mobile phone browser detects that the network connection detection message times out or fails to send, disconnects the long connection between the mobile phone browser and the corresponding long connection server. .
  • the mobile browser reselects the address information of the long connection server, and establishes a long connection with the corresponding long connection server according to the reselected address information of the long connection server.
  • a predetermined duration is set, and then the time interval for the long connection server to receive the network connectivity detection message is counted.
  • the long connection server disconnects with the mobile browser. A long connection between the two, and the status of the long connection between the online device list and the mobile browser is marked as disconnected.
  • step 6 in Fig. 29 is performed.
  • the long connection server determines the corresponding mobile phone browser according to the identification information carried in the data of the PC browser, and determines the state of the long connection with the mobile phone browser according to the information recorded in the online device list, and secondly, the long connection server Whether to transmit data in the PC browser to the mobile browser is determined according to the state of the long connection described above. Specifically, if the state of the long connection between the long connection server and the mobile browser is a connection, the PC browser is sent.
  • Data to the mobile phone browser if the state of the long connection is disconnected, the data of the PC browser is stored in the long connection server, and the PC browser is restored when the state of the long connection between the long connection server and the mobile browser is restored.
  • the data is sent to the mobile browser.
  • FIG. 30 is a flowchart of a data transmission method according to another preferred embodiment of the present invention, which is used to support any of the above data transmission methods and data transmission devices, and to explain the above data transmission method and data transmission device more clearly, such as
  • the PC is selected as the first terminal
  • the mobile phone is the second terminal
  • the client is the browser client.
  • the first client is set on the PC, which is called a PC browser
  • the second client is set on the mobile phone, which is called a mobile browser.
  • the PC browser confirms the corresponding long connection server through the long connection distribution server according to its own identification information.
  • the PC browser first sends an address request message carrying its own identification information to the long connection distribution server.
  • the long connection distribution server After receiving the address request message, the long connection distribution server performs step 2 in FIG. 30, and confirms the long connection server corresponding to the PC browser according to the identification information of the PC browser in the address request message. Then returning to the PC browser response message, the response message carries the address information of at least one long connection server.
  • the PC browser selects one of the at least two pieces of address information, performs step 3, determines a corresponding long connection server according to the selected address information, and sends a request to establish a long connection. Request message to the long connection server. If the long connection fails to be established, the PC browser reselects an address information in the remaining address information carried in the response message, and establishes a long connection with the long connection server corresponding to the address information. If the PC browser still cannot successfully establish a long connection with the address information of the long connection server carried according to the response message, the PC browser repeatedly performs an operation arbitrarily selected in the remaining address information carried in the response message, and repeatedly executes and selects the selected address information. The corresponding long connection server establishes a long connection operation until the PC browser successfully establishes a long connection with the corresponding long connection server.
  • the PC browser resends the address request message to the long connection distribution server, and then according to The address information returned by the long connection distribution server again sends a long connection establishment request to the long connection server.
  • step 4 is executed, and the long connection between the PC browser and the PC browser is identified in the local online device list according to the identification information of the PC browser carried in the request message. The status is connected.
  • step 5 in FIG. 30 is triggered, and the PC browser sends a network connectivity detection message to the persistent connection server.
  • the PC browser continuously monitors the network connection detection message to the long connection server, and if the PC browser sends a network connectivity detection message timeout or fails to send, disconnects the long connection between the PC browser and the corresponding long connection server. .
  • the PC browser reselects the address information of the long connection server, and establishes a long connection with the corresponding long connection server according to the reselected address information of the long connection server.
  • the long connection server on the side of the long connection server, set a predetermined duration, and then receive the network for the long connection server.
  • the time interval of the connection detection message is counted.
  • the long connection server disconnects the long connection with the PC browser, and connects the online device list with the PC browser. The status is identified as broken.
  • step 6 in FIG. 5 is performed.
  • the long connection server determines the corresponding PC browser according to the identification information carried in the data of the mobile phone browser, and determines the state of the long connection with the PC browser according to the information recorded in the online device list, and secondly, the long connection server Whether to transmit data in the mobile browser to the PC browser is determined according to the state of the long connection described above. Specifically, if the state of the long connection between the long connection server and the PC browser is a connection, the data of the mobile browser is sent to the PC browser, and if the state of the long connection is disconnected, the mobile phone is stored in the long connection server. The data of the browser is sent to the PC browser when the state of the long connection between the long connection server and the PC browser is restored.
  • the embodiment of the present invention can achieve the following beneficial effects:
  • the first client can send data to the second client, and the first client can perform data transmission to the second client, which solves the problem that the client cannot transfer data according to the prior art.
  • the problem is further solved. Because data transmission cannot be performed between different clients, the new client must be re-introduced when it is enabled, resulting in waste of resources and inefficiency.
  • modules in the devices of the embodiments can be adaptively changed and placed in one or more devices different from the embodiment.
  • the modules or units or components of the embodiments may be combined into one module or unit or component, and further they may be divided into a plurality of sub-modules or sub-units or sub-components.
  • any combination of the features disclosed in the specification, including the accompanying claims, the abstract and the drawings, and any methods so disclosed, or All processes or units of the device are combined.
  • Each feature disclosed in this specification (including the accompanying claims, the abstract and the drawings) may be replaced by alternative features that provide the same, equivalent or similar purpose.
  • the various component embodiments of the present invention may be implemented in hardware, or in a software module running on one or more processors, or in a combination thereof.
  • a microprocessor or digital signal processor may be used in practice to implement some or all of the functionality of some or all of the components or devices or systems in accordance with embodiments of the present invention.
  • the invention can also be implemented as a device or device program (e.g., a computer program and a computer program product) for performing some or all of the methods described herein.
  • a program implementing the invention may be stored on a computer readable medium or may be in the form of one or more signals. Such signals may be downloaded from an Internet website, provided on a carrier signal, or provided in any other form.
  • Figure 31 illustrates a computing device in which the data transfer method in accordance with the present invention can be implemented.
  • the computing device conventionally includes a processor 3110 and a computer program product or computer readable medium in the form of a memory 3120.
  • the memory 3120 may be an electronic memory such as a flash memory, an EEPROM (Electrically Erasable Programmable Read Only Memory), an EPROM, a hard disk, or a ROM.
  • Memory 3120 has a storage space 3130 for program code 3131 for performing any of the method steps described above.
  • storage space 3130 for program code may include various program code 3131 for implementing various steps in the above methods, respectively.
  • the program code can be read from or written to one or more computer program products.
  • Such computer program products include program code carriers such as hard disks, compact disks (CDs), memory cards or floppy disks.
  • Such a computer program product is typically a portable or fixed storage unit as described with reference to FIG.
  • the storage unit may have a storage segment, a storage space, and the like that are similarly arranged to the storage 3120 in the computing device of FIG.
  • the program code can be compressed, for example, in an appropriate form.
  • the storage unit comprises computer readable code 3131', ie code that can be read by a processor, such as, for example, 3110, which when executed by a computing device causes the computing device to perform each of the methods described above step.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Environmental & Geological Engineering (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

本发明公开了一种数据传输的方法、设备及系统。其中的一种数据传输方法包括:确定第一终端与第二终端间建立连接;获取设置于第一终端的第一客户端的标识信息;将标识信息传输至设置于第二终端的第二客户端。采用本发明能够解决因不同客户端间无法进行数据传输,新客户端启用时必须重新引入用户需求,从而导致资源浪费以及效率低下的问题。

Description

数据传输方法、设备及系统 技术领域
本发明涉及互联网应用领域,特别是涉及一种数据传输方法、设备及系统
背景技术
随着移动终端网民的爆炸式增长,移动互联网应用的日新月异,无论是企业,还是普通的网民都对于移动终端与其他终端上同一客户端之间信息的共享的要求都变得越来越高。就现有技术而言,移动终端的客户端和其他终端上的同一客户端之间无法做到信息同步。
具体来说,很多用户都有过这样的体验,在不同终端上使用同一浏览器时,针对浏览器中收藏夹内的信息或者是经常浏览的网页信息,需要重复执行在一个浏览器上以及执行过的操作才能将一些惯用的执行操作数据保存到另一终端的浏览器中。
这种不同终端的同一客户端之间无法做到信息同步共享的问题使得用户在移动终端和其他终端上使用同一客户端时不得不进行重复操作来保证信息的同步共享,不仅操作步骤非常繁琐,而且效率低下。
发明内容
鉴于上述问题,提出了本发明以便提供一种克服上述问题或者至少部分地解决或者减缓上述问题的数据传输方法、设备及系统。
根据本发明的一个方面,提供了一种数据传输方法,包括:
确定第一终端与第二终端间建立连接;
获取设置于所述第一终端的第一客户端的标识信息;
将所述标识信息传输至设置于所述第二终端的第二客户端。
本发明还提供了另一种数据方法,包括:
在第一终端与第二终端连接之后,接收设置于所述第一终端的第一客户端发送的所述第一客户端的标识信息;
位于所述第二终端的所述第二客户端利用所述标识信息,查找对应的长连接服务器的地址信息;
根据获取的地址信息在所述第二客户端与所述长连接服务器间建立长连接,以便所述第二客户端从所述长连接服务器处接收数据。
本发明还提供了一种第一客户端,设置于第一终端,包括:
第一确定模块,配置为确定所述第一终端与第二终端相连接;
第一获取模块,配置为获取本客户端的标识信息;
数据传输模块,配置为将所述标识信息传输至所述第二终端。
本发明还提供了一种第二客户端,设置于第二终端,包括:
第二确定模块,配置为确定所述第二终端与第一终端相连接;
第二接收模块,配置为接收设置于所述第一终端的第一客户端发送的所述第一客户端的标识信息;
第二获取模块,配置为获取所述标识信息,根据所述标识信息查找对应的长连接服务器的地址信息;
连接建立模块,配置为根据获取的地址信息在本客户端与所述长连接服务器间建立长连接,以便本客户端从所述长连接服务器处接收数据。
本发明还提供了一种数据传输系统,包括上述任一项所述的第一客户端和上述任一项所述的第二客户端,所述第一客户端设置于第一终端,所述第二客户端设置于第二终端,所述第一终端与所述第二终端相连接,还包括所述第一终端对应的第一服务器、长连接分配服务器以及长连接服务器,其中,
所述第一客户端,配置为将自身的标识信息传输至所述第二客户端;以及,将所述第一客户端中的数据经所述第一服务器传输至所述长连接服务器;
所述第一服务器,配置为接收所述第一客户端发送的数据,将其转发至所述长连接服务器;
所述第二客户端,配置为接收所述第一客户端发送的标识信息,经所述长连接分配服务器查找对应的长连接服务器的地址信息;与所述长连接服务器间建立长连接;以及,经所述长连接服务器接收所述第一客户端传输的数据;
所述长连接分配服务器,配置为根据所述第一客户端的标识信息分配长连接服务器;接收各客户端发送的携带有所述第一客户端的标识信息的地址请求消息,将对应长连接服务器的地址反馈至请求方;
长连接服务器,配置为与所述第二客户端建立长连接;以及,接收所述第一服务器转发的来自所述第一客户端的数据,并将该数据转发至所述第二客户端。
根据本发明的另一个方面,提供了一种数据传输方法,应用于第一客户端向第二客户端发送数据,包括:
利用网络在所述第二客户端与长连接服务器间建立长连接;
接收所述长连接服务器转发的、来自所述第一客户端的数据,其中,所述第一客户端将所述数据发送至第一服务器,由所述第一服务器转发至所述长连接服务器。
本发明还提供了一种第二客户端,包括:
第一连接建立器,配置为利用网络与长连接服务器间建立长连接;
第一数据接收器,配置为接收所述长连接服务器转发的、来自第一客户端的数据,其中,所述第一客户端将所述数据发送至第一服务器,由所述第一服务器转发至所述长连接服务器。
本发明还提供了一种第一客户端,包括:
第一数据获取器,配置为获取本客户端的数据;
第一数据发送器,配置为将所述数据发送至第一服务器,由所述第一服务器将所述数据经长连接服务器转发至第二客户端。
本发明还提供了一种数据传输系统,包括上述的第一客户端,上述的第二客户端,还包括第一服务器及长连接服务器:
所述第一客户端,配置为发送所述第一客户端的数据至所述第一服务器;
所述第一服务器,配置为将所述第一客户端数据转至所述长连接服务器;
所述长连接服务器,配置为接收来自所述第一服务器的数据,并转发至第二客户端;
所述第二客户端,配置为接收所述长连接服务器转发的数据。
根据本发明的又一个方面,提供了一种数据传输方法,包括:
在第一终端和移动终端之间建立连接,其中,第一客户端设置在所述第一终端中,第二客户端设置在所述移动终端中;
获取所述第一客户端的第一数据,并将所述第一数据发送至所述第二客户端中;和/或
获取所述第二客户端的第二数据,并将所述第二数据发送至所述第一客户端。
本发明还提供了一种第一客户端,设置于第一终端,所述第一终端与移动终端建立连接,包括:
第三获取模块,配置为获取本地运行的第一客户端的第一数据;
第一发送模块,配置为发送所述第一数据至运行在设置于所述移动终端的第二客户端中。
本发明还提供了一种第二客户端,设置于移动终端,所述移动终端与第一终端建立连接,包括:
第四获取模块,配置为获取本客户端的第二数据;
第二发送模块,配置为发送所述第二数据至运行在所述第一终端的第一客户端中。
本发明还提供了一种网络系统,包括设置于第一终端的第一客户端,设置于移动终端的第二客户端,所述第一终端与所述移动终端间建立连接:
所述第一客户端,配置将第一数据发送至所述第二客户端中;
所述第二客户端,配置为将第二数据发送至所述第一客户端中。
根据本发明的再一个方面,提供了一种数据传输方法,应用于第一客户端与第二客户端间能够进行数据传输的情况,包括:
将所述第一客户端中的数据及其标识信息传输至第一服务器,由所述第一服务 器转发至根据所述第一客户端的标识信息确定的长连接服务器;
根据所述第二客户端与所述长连接服务器的长连接状态,确定是否将所述第一客户端的数据转发至所述第二客户端。
本发明还提供了一种客户端,应用于本客户端与其他客户端间能够进行数据传输的情况,包括:
第二数据获取器,配置为获取本客户端的数据及其标识信息;
数据传输器,配置为传输所述数据获取器获取的本客户端中的数据及其标识信息至第一服务器,由所述第一服务器转发至根据本客户端的标识信息确定的长连接服务器,并根据其他客户端与所述长连接服务器的长连接状态,确定是否将本客户端中的数据转发至所述其他客户端。
本发明还提供了一种数据传输系统,应用于第一客户端与第二客户端间能够进行数据传输的情况,包括第一客户端,第二客户端,根据所述第一客户端的标识信息确定的长连接服务器以及第一服务器,其中,
所述第一客户端,配置为传输所述第一客户端中的数据及其标识信息至第一服务器;
所述第一服务器,配置为接收所述第一客户端发送的数据及其标识信息,并转发至所述长连接服务器;
所述长连接服务器,配置为与所述第二客户端建立长连接;以及,接收所述第一服务器转发的所述第一客户端中的数据及其标识信息,根据所述第二客户端与所述长连接服务器的长连接状态,确定是否将所述第一客户端的数据转发至所述第二客户端;
所述第二客户端,配置为接收经所述长连接服务器发送的数据。
根据本发明的又一个方面,还提供了一种数据传输方法,应用于第一客户端与第二客户端间进行数据传输的情况,包括:
发送所述第一客户端中的数据至长连接服务器;
根据所述长连接服务器与所述第二客户端之间长连接的状态,确定是否将所述第一客户端的数据发送至所述第二客户端。
本发明还提供了一种客户端,应用于本客户端与其他客户端间进行数据传输的情况,包括:
第三数据发送器,配置为将本客户端中的数据及其标识信息发送至与所述其他客户端对应的长连接服务器,其中,根据所述长连接服务器与所述其他客户端之间的长连接状态确定是否将所述数据发送至所述其他客户端;
第二连接建立器,配置为在本客户端和与本客户端对应的长连接服务器之间建立长连接;
第三数据接收器,配置为接收所述其他客户端经所述与本客户端对应的长连接 服务器发送的所述其他客户端中的数据。
本发明还提供了一种无线数据传输系统,包括上述的第一客户端和第二客户端,其中,所述第一客户端与所述第二客户端间进行数据传输,还包括长连接服务器以及长连接分配服务器,其中,
所述第一客户端,配置为经所述长连接服务器发送所述第一客户端中的数据;
所述长连接分配服务器,配置为根据不同客户端发送的地址请求消息,为各客户端分配长连接服务器,并将分配的地址信息分别相应发送至各客户端;
所述长连接服务器,配置为接收所述第一客户端传输的所述第一客户端的数据;以及根据所述第二客户端与所述长连接服务器间的长连接状态,确定是否将所述第一客户端中的数据转发至所述第二客户端;
所述第二客户端,配置为接收所述长连接服务器转发的所述第一客户端中的数据。
根据本发明的又一个方面,提供了一种计算机程序,其包括计算机可读代码,当所述计算机可读代码在计算设备上运行时,导致所述计算设备执行根据1-7中的任一个所述的数据传输方法,和/或,权利要求8-17中的任一个所述的数据传输方法,和/或,权利要求21-32中的任一个所述的数据传输方法,和/或,权利要求36-55中的任一个所述的数据传输方法,和/或,权利要求59-71中的任一个所述的数据传输方法,和/或,权利要求74-85中的任一个所述的数据传输方法。
根据本发明的再一个方面,提供了一种计算机可读介质,其中存储了如权利要求88所述的计算机程序。
本发明的有益效果为:
本发明实施例中,第一客户端的任意数据均可以被发送至第二客户端,保证了用户在第一客户端中所进行的各种操作均可以被同步更新到第二客户端中,避免用户在新客户端执行重复操作,获取重复信息,进一步避免数据冗余以及资源的浪费。
上述说明仅是本发明技术方案的概述,为了能够更清楚了解本发明的技术手段,而可依照说明书的内容予以实施,并且为了让本发明的上述和其它目的、特征和优点能够更明显易懂,以下特举本发明的具体实施方式。
附图说明
通过阅读下文优选实施方式的详细描述,各种其他的优点和益处对于本领域普通技术人员将变得清楚明了。附图仅用于示出优选实施方式的目的,而并不认为是对本发明的限制。而且在整个附图中,用相同的参考符号表示相同的部件。在附图中:
图1示出了根据本发明一个实施例的第一种数据传输方法的处理流程图;
图2示出了根据本发明一个优选实施例的发送数据流程图;
图3示出了根据本发明一个实施例的第二种数据传输方法处理流程图;
图4示出了根据本发明一个优选实施例的数据传输方法流程图;
图5示出了根据本发明一个实施例的一种客户端的结构示意图;
图6示出了根据本发明一个实施例的另一种客户端的结构示意图;
图7示出了根据本发明一个实施例的数据传输系统的结构示意图;
图8示出了根据本发明一个实施例的又一种数据传输方法的处理流程图;
图9示出了根据本发明一个优选实施例的数据传输方法流程图;
图10示出了根据本发明一个实施例的又一种客户端的结构示意图;
图11示出了根据本发明一个实施例的又一种客户端的结构示意图;
图12示出了根据本发明一个实施例的又一种数据传输系统的结构示意图;
图13示出了根据本发明一个实施例的又一种数据传输方法的处理流程图;
图14示出了根据本发明一个实施例的第一客户端一侧的数据传输方法的处理流程图;
图15示出了根据本发明一个优选实施例的另一种发送数据流程图;
图16示出了根据本发明一个实施例的第二客户端一侧的数据传输方法处理流程图;
图17示出了根据本发明一个优选实施例的另一种数据传输方法流程图;
图18示出了根据本发明一个实施例的又一种客户端的结构示意图;
图19示出了根据本发明一个实施例的又一种客户端的结构示意图;
图20示出了根据本发明一个实施例的又一种数据传输系统的结构示意图;
图21示出了根据本发明一个实施例的又一种数据传输方法的处理流程图;
图22示出了根据本发明一个实施例的又一种客户端的结构示意图;
图23示出了根据本发明一个优选实施例的又一种数据传输方法流程图;
图24示出了根据本发明另一个优选实施例的又一种数据传输方法流程图;
图25示出了根据本发明一个实施例的又一种数据传输系统的结构示意图;
图26示出了根据本发明一个实施例的又一种数据传输方法的处理流程图;
图27示出了根据本发明一个实施例的数据传输设备的结构示意图;
图28示出了根据本发明一个实施例的又一种数据传输系统的结构示意图;
图29示出了根据本发明一个优选实施例的又一种数据传输方法流程图;
图30示出了根据本发明另一个优选实施例的数据传输方法流程图;
图31示意性地示出了用于执行根据本发明的数据传输方法的计算设备的框图;以及
图32示意性地示出了用于保持或者携带实现根据本发明的数据传输方法的程序代码的存储单元。
具体实施方式
下面结合附图和具体的实施方式对本发明作进一步的描述。
相关技术中提及,用户启用一个新的客户端,需要重新将用户需求输入到新的客户端中,造成新客户端的动作以及数据冗余,浪费大量的资源,且使得实现用户需求的时延变长,效率较低。
为解决上述技术问题,本发明实施例提供了多种数据传输方法,现利用实施例对不同的数据传输方法进行详细描述。
实施例一
本实施例提供了一种数据传输的方法。图1示出了根据本发明一个实施例的第一种数据传输方法的处理流程图。如图1所示,该流程起始于步骤S102,确定第一终端与第二终端间建立连接。第一终端可以通过多种方式与第二终端建立连接,例如有线方式、无线方式,其中,有线方式可以通过数据线进行连接,无线方式可以通过无线网络(例如蓝牙、wifi、局域网等)进行连接。优选的,本发明实施例中,第一终端与第二终端通过通用串行总线(Universal Serial Bus,以下简称USB)数据线直接建立连接,使用USB数据线建立连接的方式操作简单易行,USB数据线目前被广泛采用且可识别性高,能够快速高效地进行数据(例如标识信息)的传输。
在步骤S102执行结束后,进一步触发步骤S104,获取设置于第一终端的第一客户端的标识信息。在标识信息获取结束后,触发步骤S106,将步骤S104获取的第一客户端的标识信息沿步骤S102已建立的连接传输至设置于第二终端的第二客户端。
依据本发明实施例,能够将第一客户端的标识信息发送至第二客户端,实现了第一客户端向第二客户端进行数据传输,解决了现有技术提到的客户端间无法进行数据传输的问题,进一步解决因不同客户端间无法进行数据传输,新客户端启用时必须重新引入用户需求,从而导致资源浪费以及效率低下的问题。
由图1所示流程可知,本发明实施例中,第一客户端与第二客户端间能够传输标识信息,即,第一客户端与第二客户端间已建立能够进行数据传输的通道。因此,在步骤S106提及的标识信息传输至第二客户端之后,还可以将第一客户端中的数据传输至第二客户端。第一客户端中的数据传输至第二客户端可以经过服务器等路由转发。现对其传输过程进行具体说明。
首先,获取第一客户端中的数据。其次,将获取的数据传输至第一服务器,此处的第一服务器为第一终端所对应的服务器。例如,若第一终端为个人计算机(Personal Computer,以下简称PC),则第一服务器为PC服务器。第一服务器接收到来自第一客户端的数据后,将其传输到与第二客户端间具有长连接的长连接服务器,再由长连接服务器将第一客户端的数据传输到第二客户端。
图2示出了根据本发明一个优选实施例的发送数据流程图。参见图2,首先执行步骤S201,即当第一客户端与第二客户端间已建立能够进行数据传输的通道之后, 第一客户端将自身的标识信息以及数据发送至对应的第一服务器。
参见图2中的步骤S202,第一服务器接收到第一客户端的数据之后,首先对第一客户端的数据进行合法性验证。优选的,本发明实施例中,第一服务器对上述数据中第一客户端的标识信息进行验证,确定第一客户端的标识信息是否为合法信息,例如验证该标识信息是否已在客户端中心注册,或者是该标识信息是否是服务器内部生成的标识符。若该标识信息经验证是合法信息,则第一服务器将该标识信息传输至长连接服务器,若该标识信息不是合法信息,则第一服务器拒绝将该标识信息发送至长连接服务器。
同样,第一服务器还可以对数据中除标识信息外的其他数据进行合法性验证,例如,验证第一客户端的网页数据等,是否为非恶意数据。本发明实施例中,恶意数据指对用户终端内的数据进行窃取、毁坏等非法行为的病毒、木马等等。若第一服务器验证第一客户端的数据是上述恶意数据,则第一服务器拒绝将该恶意数据传输至长连接服务器。若经第一服务器的验证,第一客户端的数据是非恶意数据,则第一服务器将该数据传输至长连接服务器。优选的,本发明实施例中,第一客户端的数据经合法性验证之后,第一服务器还可以对第一客户端的数据进行加密处理,更加有效地提高数据传输的安全性。通过第一服务器对第一客户端的数据进行安全性验证及处理,能够更加有效地保证传输数据的安全性,防止在数据传输的过程中,一些恶意网址等附加到传输的数据中,对用户的终端或者客户端造成损害。
第一服务器对第一客户端的数据进行合法性验证之后,将经过合法性验证的数据发送至对应的长连接服务器。第一服务器与长连接服务器可以通过多种协议进行通信,例如,传输控制协议、用户数据报协议等。优选的,本发明实施例中,第一服务器与长连接服务器通过超文本传输协议(Hypertext transfer protocol,以下简称HTTP)请求通信。HTTP支持多种服务器模式、简单快速,因此通过HTTP请求通信能够提高数据传输效率。
由图2可知,当执行完第一服务器将第一客户端的数据发送至对应的长连接服务器这一步骤(即图2中的步骤S202)之后,执行步骤S203,长连接服务器将第一客户端的数据发送至第二客户端。第二客户端接收到第一客户端的数据之后,触发步骤S204。在步骤S204中,第二客户端根据接收的第一客户端的数据进行相应处理。
由上述可知,将数据由第一客户端传输至第二客户端,需要经过对应的长连接服务器。该长连接服务器的地址信息需要第一客户端根据第一客户端的标识信息进行获取。现介绍第一客户端获取对应的长连接服务器的地址信息的方式。首先,第一客户端将携带有自身标识信息的地址请求消息发送至长连接分配服务器。长连接分配服务器收到地址请求消息之后,对其携带的标识信息进行验证,然后根据此标识信息向第一客户端返回响应消息。其中,长连接分配服务器返回的响应消息中携带有与第一客户端对应的长连接服务器的地址信息。
本发明实施例中,第一客户端通过长连接分配服务器查找对应的长连接服务器 地址信息。长连接分配服务器根据不同终端上客户端的标识信息将不同的长连接服务器地址返回给各客户端,保证不同客户端之间信息的同步更加快速及时。另外,第一客户端与第二客户端通过同一标识信息查找对应的长连接服务器,保证指定用户客户端的数据被发送到同一用户的其他终端的客户端上,避免用户客户端的数据发送混淆。第一客户端获取到对应长连接服务器的地址信息之后,根据此地址信息与长连接服务器建立长连接并将用户在第一客户端中的数据通过此长连接服务器发送至第二客户端。
本发明实施例中,标识信息是客户端的身份认证信息,可以是由用户设置的身份认证信息,还可以是服务器为客户端设置的身份认证信息,本发明实施例并不对此加以限定。优选的,本发明实施例中,标识信息可以是第一客户端的用户登录的账户信息,该账户信息是用户在客户端中心申请注册的账户,账户信息的申请简单易行,并且每个账户信息可以在多个客户端进行登录。
另外,本发明实施例中的标识信息也可以是服务器生成的一个能作为唯一标识的字符串,例如影子账户。影子账户可以是服务器根据时间、机器标识等信息生成的唯一标识,影子账户也可以是服务器随机生成的一个账户,服务器在生成这个账户之后,检查生成的这个影子账户是否已经存在,如果存在,则服务器重新生成一个影子账户,直到这个账户之前并不存在。影子账户具有不可重复性以及唯一性,每个影子账户仅能够标识一个客户端。
在本发明实施例中,第一客户端和/或第二客户端可以为浏览器客户端、安全卫士客户端、阅读器客户端、媒体播放器客户端等任意相同类型的客户端,还可以为不同类型但执行相同功能的客户端,本发明实施例并不对此加以限定。此处的第一、第二仅用于区分不同的客户端,对于客户端本身属性、顺序以及功能并不造成限定,将第一、第二换位指代不同的客户端也可。
优选的,本发明实施例中,第一客户端和/或第二客户端为浏览器客户端。用户通常在浏览器客户端执行收藏网址、设置常用网页等个性化操作,当用户从一个终端转向另一个终端时,需要在另一个终端新启用新的客户端,根据本发明实施例,用户在曾经的客户端上设置的个性化操作可以被自动同步到新启用的客户端内,无需用户重复操作。
同理,本发明实施例中,第一客户端的数据可以为用户在第一客户端内执行任何操作的数据,也可以是第一客户端更新的其他数据,存储在第一客户端的数据等等,本发明实施例并不对此做任何限定。优选的,本发明实施例中,该数据可以包括第一客户端的收藏夹中收藏的各网址、第一客户端当前打开的网址、第一客户端的常用网址以及任意第一客户端根据用户指令调用的用户数据等。第一客户端的任意数据均可以被发送至第二客户端,保证了用户在第一客户端中所进行的各种操作均可以被同步更新到第二客户端中,避免用户在新客户端执行重复操作,获取重复信息,进一步避免数据冗余以及资源的浪费。
本发明实施例中,除在前文提到的不同终端间的客户端数据传输,还能够实现移动终端和终端间的客户端数据传输。因此,本发明实施例中,第一终端与第二终端可以是台式电脑、笔记本电脑等终端,还可以是手机、音乐播放器、平板电脑等移动终端。优选的,本发明实施例中,第二终端为移动终端,以便更加清楚简洁地阐述终端与移动终端间的客户端的数据传输。
图3示出了根据本发明一个实施例的第二种数据传输方法处理流程图,该数据传输方法侧重于数据接收端。参见图3,首先,执行步骤S302,即在第一终端与第二终端建立连接之后,设置于第二终端的第二客户端接收第一客户端发送的标识信息。第二客户端接收到标识信息之后,执行步骤S304。第二客户端利用第一客户端发送的标识信息查找对应的长连接服务器的地址信息。查找到相应的长连接服务器地址之后,执行步骤S306,根据获取到的长连接服务器的地址信息,在第二客户端与对应的长连接服务器间建立长连接,以便第二客户端从对应的长连接服务器处接收数据。
依据本发明实施例,第二客户端利用标识信息,能够与对应的长连接服务器建立长连接,使得用户在第一客户端中的数据及时传输给第二客户端,方便第二客户端进行信息更新。本发明实施例解决了第一客户端与第二客户端之间的信息共享问题,使用户能够及时对两个客户端之间的信息进行同步,从而避免用户在新客户端执行重复操作,获取重复信息,进一步避免数据冗余以及资源的浪费。
具体地,在执行完步骤S302,第二终端接收到第一客户端发送的标识信息之后,第二终端查询是否存在第二客户端。若存在第二客户端,执行步骤S304,第二客户端根据第一客户端的标识信息查找长连接服务器的地址。若不存在上述第二客户端,则需要首先获取第二客户端的安装包,并在第二终端中对第二客户端进行下载及安装。安装完成之后,执行步骤S304,由第二客户端根据第一客户端的标识信息进行长连接服务器地址的查找。
现介绍第二客户端进行长连接服务器地址的查找的具体方式。第二客户端向长连接分配服务器发送携带有标识信息的地址请求消息,长连接分配服务器接收到该地址请求消息之后,根据该地址请求消息所携带的标识信息,确定对应的长连接服务器,并返回给第二客户端携带有对应的长连接服务器的地址信息的响应消息。
第二客户端接收到长连接分配服务器发送的对应长连接服务器的地址信息之后执行步骤S306,与上述地址信息对应的长连接服务器建立长连接,以便从长连接服务器处接收数据。
当第二客户端与对应的长连接服务器成功建立长连接之后,长连接服务器中存储有在线设备列表,该列表记录与该长连接服务器保持长连接的各个客户端的标识信息。若某一个客户端与该长连接服务器之间的长连接断开,则在长连接服务器的在线设备列表中删除已断开的客户端对应的标识信息。长连接服务器中的在线设备列表的实时更新保证长连接服务器能够及时更新与其建立长连接的客户端的信息, 避免因在线设备列表数据更新不及时导致向已断开的客户端发送数据,导致数据包丢失等恶性后果,提高数据传输的安全性。
当长连接服务器接收到经第一服务器发送的第一客户端的数据时,长连接服务器根据第一客户端的数据中携带的标识信息查找到第二客户端,并根据在线设备列表中记录的信息确定与第二客户端之间的长连接状态。若此长连接的状态为连接,长连接服务器将第一客户端的数据发送至第二客户端。若此长连接的状态为断开,则在该长连接服务器中存储第一客户端的数据,然后,待该长连接服务器与第二客户端之间的长连接的状态由断开转为连接时,再将长连接服务器中存储的第一客户端的数据发送至第二客户端。
第二客户端接收到长连接服务器发送的数据之后,根据数据做相应处理以保证第一客户端与第二客户端之间实现信息共享,并能够在第二客户端上继续执行之前在第一客户端未执行结束的操作,例如继续进行网页内容阅读。
本发明实施例中,标识信息是客户端的身份认证信息,可以是由用户设置的身份认证信息,还可以是服务器为客户端设置的身份认证信息,本发明实施例并不对此加以限定。优选的,本发明实施例中,标识信息可以是第一客户端的用户登录的账户信息,该账户信息是用户在客户端中心申请注册的账户,账户信息的申请简单易行,并且每个账户信息可以在多个客户端进行登录。另外,本发明实施例中的标识信息也可以是服务器生成的一个能作为唯一标识的字符串,例如影子账户。影子账户可以是服务器根据时间、机器标识等信息生成的唯一标识,影子账户也可以是服务器随机生成的一个账户,服务器在生成这个账户之后,检查生成的这个影子账户是否已经存在,如果存在,则服务器重新生成一个影子账户,直到这个账户之前并不存在。影子账户具有不可重复性以及唯一性,每个影子账户仅能够标识一个客户端。
在本发明实施例中,第一客户端和/或第二客户端可以为浏览器客户端、安全卫士客户端、阅读器客户端、媒体播放器客户端等任意相同类型的客户端,还可以为不同类型但执行相同功能的客户端,本发明实施例并不对此加以限定。此处的第一、第二仅用于区分不同的客户端,对于客户端本身属性、顺序以及功能并不造成限定,将第一、第二换位指代不同的客户端也可。
优选的,本发明实施例中,第一客户端和/或第二客户端为浏览器客户端。用户通常在浏览器客户端执行收藏网址、设置常用网页等个性化操作,当用户从一个终端转向另一个终端时,需要在另一个终端新启用新的客户端,根据本发明实施例,用户在曾经的客户端上设置的个性化操作可以被自动同步到新启用的客户端内,无需用户重复操作。
同理,本发明实施例中,第一客户端的数据可以为用户在第一客户端内执行任何操作的数据,也可以是第一客户端更新的其他数据,存储在第一客户端的数据,等等,本发明实施例并不对此做任何限定。优选的,本发明实施例中,该数据可以 包括第一客户端的收藏夹中收藏的各网址、第一客户端当前打开的网址、第一客户端的常用网址以及任意第一客户端根据用户指令调用的用户数据等。另外,本发明实施例中,第二客户端根据接收到的第一客户端的数据所进行的处理可以为根据第一客户端的数据对第二客户端自身进行相应处理,也可以为对接收的第一客户端的数据进行处理。优选的,本发明实施例中,第二客户端根据第一客户端的数据进行的处理包括,第二客户端更新收藏夹,第二客户端更新常用网址以及第二客户端打开网址对应的网页等等。
本发明实施例中,第一客户端的任意数据均可以被发送至第二客户端,保证了用户在第一客户端中所进行的各种操作均可以被同步更新到第二客户端中,避免用户在新客户端执行重复操作,获取重复信息,进一步避免数据冗余以及资源的浪费。
本发明实施例中,除在前提到的不同终端间的客户端数据传输,还能够实现移动终端和终端间的客户端数据传输。因此,本发明实施例中,第一终端与第二终端可以是台式电脑、笔记本电脑等终端,还可以是手机、音乐播放器、平板电脑等移动终端。优选的,本发明实施例中,第二终端为移动终端,以便更加清楚简洁地阐述终端与移动终端间的客户端的数据传输。
实施例1.1
图4示出了本发明一个优选实施例的数据传输方法流程图,用于支持上述任意一个数据传输方法,将上述数据传输方法阐述得更清楚明白。如图4所示,本例中选择PC作为第一终端,手机为第二终端,客户端为浏览器客户端。为方便辨识第一客户端与第二客户端,在本例中,第一客户端被称为PC浏览器,第二客户端被称为手机浏览器。
参见图4,首先执行步骤S401,在PC和手机之间使用USB数据线建立连接。PC浏览器接收到手机连接到PC的通知后,执行步骤S402,将自身的标识信息发送至手机。PC浏览器收到上述通知之后,执行步骤S403,查询是否已有账户信息在该客户端登录,并根据查询结果将PC浏览器的数据发送至PC服务器。具体地,若已有账户信息在该客户端登录,则PC浏览器将该账户信息以及PC浏览器的数据发送至PC服务器。若无账户信息在该客户端登录,则PC浏览器生成一个唯一标识,作为该PC浏览器的标识信息,并将此标识信息以及PC浏览器的数据发送至PC服务器。
在本优选实施例中,步骤S403中提及的PC浏览器发送数据至PC服务器这一步骤能够在数据传输的整个过程中执行,以保证PC浏览器能够及时将自身数据以及实时更新的数据发送至PC服务器。即,PC浏览器可以在PC与手机建立连接之后将PC浏览器的数据发送至PC服务器,也可以在PC未与手机建立连接时发送数据。同理,PC浏览器可以在将自身的标识信息发送至手机之前,将数据发送至PC服务器,也可以在PC浏览器将自身的标识信息发送至手机之后,再将数据发送至PC服务器。
PC服务器接收到PC浏览器的数据之后,执行步骤S404,对PC浏览器发送的数据进行合法性验证,并将通过合法性验证的数据发送经加密处理后,发送至长连接 服务器。其中,合法性验证可以是验证PC浏览器发送的标识信息是否合法,也可以是验证PC浏览器发送的数据是否为非恶意数据。若PC浏览器的数据无法通过PC服务器的合法性验证,则PC服务器并不对该数据进行发送处理。
另外,手机通过步骤S402接收到PC浏览器发送的标识信息之后,执行步骤S405,查询自身是否安装有相应的手机浏览器。若手机中没有安装相应的手机浏览器,则首先在手机中对手机浏览器进行下载及安装,安装完成后,手机将PC浏览器的标识信息发送至手机浏览器。若手机中已存在相应的手机浏览器,则直接将PC浏览器的标识信息发送至手机浏览器。
手机浏览器收到PC浏览器的标识信息之后,执行步骤S406,将携带有上述标识信息的长连接服务器的地址请求信息发送至长连接分配服务器。长连接分配服务器接收到手机浏览器的地址请求消息之后,触发步骤S407,发送携带有长连接服务器的地址信息的响应消息至手机浏览器。手机浏览器接收到携带有长连接服务器的地址信息的响应消息,执行步骤S408,根据长连接服务器的地址信息,与对应的长连接服务器建立长连接,以便从长连接服务器处接收PC浏览器的数据。
长连接服务器中存储有在线设备列表,该列表的实时更新保证长连接服务器能够及时更新与其建立长连接的浏览器的信息,避免因在线设备列表数据更新不及时导致向已断开的浏览器发送数据,导致数据包丢失等恶性后果,提高数据传输的安全性。
当长连接服务器接收到经PC服务器发送的PC浏览器的数据之后,参见图4中步骤S409,长连接服务器根据与手机浏览器之间长连接的状态判断是否发送PC浏览器的数据至手机浏览器。具体地,长连接服务器根据上述在线设备列表查询与对应的手机浏览器之间长连接的状态,若该长连接的状态为保持,则发送PC浏览器的数据至手机浏览器。若该长连接的状态为断开,则存储PC浏览器的数据,待长连接服务器与对应的手机浏览器之间的长连接状态恢复时,再将PC浏览器的数据发送至手机浏览器。
参见图4,手机浏览器接收到长连接服务器发送的数据之后,触发步骤S410。在步骤S410中,手机浏览器根据接收到的PC浏览器的数据做相应处理以保证第一客户端与第二客户端之间实现信息共享,并能够在第二客户端上继续执行之前在第一客户端未执行结束的操作,例如继续进行网页内容阅读。
基于上文各优选实施例提供的数据传输的方法,基于同一发明构思,本发明实施例提供了一种用于数据传输的客户端,用于实现上述数据传输的方法。
图5示出了根据本发明一个实施例的一种客户端的结构示意图。为将本发明实施例阐述得更加清楚简洁,以下将用于数据传输的客户端简称为第一客户端,设置于第一终端。参见图5,本发明实施例的第一客户端500至少包括:第一确定模块510、第一获取模块520以及数据传输模块530。
现介绍本发明实施例的数据传输设备中第一客户端500的各器件或组成的功能 以及各部分间的连接关系。第一客户端500中,第一确定模块510确定第一终端与第二终端建立连接,与其耦合的第一获取模块520能够获取自身的标识信息,然后,与第一获取模块520耦合的数据传输模块530将标识信息传输至第二终端。
依据本发明实施例,能够将第一客户端500的标识信息发送至第二客户端,实现了第一客户端500向第二客户端进行数据传输,解决了现有技术提到的客户端间无法进行数据传输的问题,进一步解决因不同客户端间无法进行数据传输,新客户端启用时必须重新引入用户需求,从而导致资源浪费以及效率低下的问题。
具体地,本发明实施例中,第一客户端500与第二客户端间能够传输标识信息,即,第一客户端500与第二客户端间已建立能够进行数据传输的通道。因此,在标识信息传输至第二客户端之后,第一获取模块520还可以获取到第一客户端500中的数据,然后由数据传输模块530将第一客户端500中的数据传输至第二客户端。第一客户端500中的数据传输至第二客户端可以经过服务器等路由转发。
当第一获取模块520获取到第一客户端500中的数据之后,数据传输模块530将获取到的数据传输至第一服务器,此处的第一服务器为第一终端500所对应的服务器。例如,若第一终端为PC,则第一服务器为PC服务器。第一服务器接收到来自第一客户端500的数据之后,将其传输到与第二客户端间具有长连接的长连接服务器,再由长连接服务器将第一客户端500的数据传输至第二客户端。
由上述可知,将数据由第一客户端500传输至第二客户端,需要经过对应的长连接服务器。该长连接服务器的地址信息需要第一客户端500中的第一获取模块520根据第一客户端500的标识信息进行获取。现介绍第一获取模块520获取对应的长连接服务器的地址信息的方式。首先,第一获取模块520将携带有第一客户端500的标识信息的地址请求消息发送至长连接分配服务器。长连接分配服务器收到地址请求消息之后,对其携带的标识信息进行验证,然后根据此标识信息向第一获取模块520返回响应消息。其中,长连接分配服务器返回的响应消息中携带有与第一客户端500对应的长连接服务器的地址信息。
本发明实施例中,第一客户端500通过长连接分配服务器查找对应的长连接服务器的地址信息。长连接分配服务器根据不同终端上客户端的标识信息将不同的长连接服务器地址返回给各客户端,保证不同客户的之间信息的同步更加快速及时。另外,第一客户端500与第二客户端通过同一标识信息查找对应的长连接服务器,保证指定用户客户端的数据被发送到同一用户的其他终端的客户端上,避免用户客户端的数据发送混淆。第一客户端500中的第一获取模块520获取到对应长连接服务器的地址信息之后,连接建立模块530根据此地址信息与长连接服务器建立长连接并将用户在第一客户端500中的数据通过此长连接服务器发送至第二客户端。
本发明实施例中,标识信息是客户端的身份认证信息,可以是由用户设置的身份认证信息,还可以是服务器为客户端设置的身份认证信息,本发明实施例并不对此加以限定。优选的,本发明实施例中,标识信息可以是第一客户端500的用户登 录的账户信息,该账户信息是用户在客户端中心申请注册的账户,账户信息的申请简单易行,并且每个账户信息可以在多个客户端进行登录。
另外,本发明实施例中的标识信息也可以是服务器生成的一个能作为唯一标识的字符串,例如影子账户。影子账户可以是服务器根据时间、机器标识等信息生成的唯一标识,影子账户也可以是服务器随机生成的一个账户,服务器在生成这个账户之后,检查生成的这个影子账户是否已经存在,如果存在,则服务器重新生成一个影子账户,直到这个账户之前并不存在。影子账户具有不可重复性以及唯一性,每个影子账户仅能够标识一个客户端。
在本发明实施例中,第一客户端500和/或第二客户端可以为浏览器客户端、安全卫士客户端、阅读器客户端、媒体播放器客户端等任意相同类型的客户端,还可以为不同类型但执行相同功能的客户端,本发明实施例并不对此加以限定。此处的第一、第二仅用于区分不同的客户端,对于客户端本身属性、顺序以及功能并不造成限定,将第一、第二换位指代不同的客户端也可。
优选的,本发明实施例中,第一客户端500和/或第二客户端为浏览器客户端。用户通常在浏览器客户端执行收藏网址、设置常用网页等个性化操作,当用户从一个终端转向另一个终端时,需要在另一个终端新启用新的客户端,根据本发明实施例,用户在曾经的客户端上设置的个性化操作可以被自动同步到新启用的客户端内,无需用户重复操作。
同理,本发明实施例中,第一客户端500的数据可以为用户在第一客户端500内执行任何操作的数据,也可以是第一客户端500更新的其他数据,存储在第一客户端500的数据,等等,本发明实施例并不对此做任何限定。优选的,本发明实施例中,该数据可以包括第一客户端500的收藏夹中收藏的各网址、第一客户端500当前打开的网址、第一客户端500的常用网址以及任意第一客户端500根据用户指令调用的用户数据等。第一客户端500的任意数据均可以被发送至第二客户端,保证了用户在第一客户端500中所进行的各种操作均可以被同步更新到第二客户端中,避免用户在新客户端执行重复操作,获取重复信息,进一步避免数据冗余以及资源浪费。
本发明实施例中,除在前提到的不同终端间的客户端数据传输,还能够实现移动终端和终端间的客户端数据传输。因此,本发明实施例中,第一终端与第二终端可以是台式电脑、笔记本电脑等终端,还可以是手机、音乐播放器、平板电脑等移动终端。优选的,本发明实施例中,第二终端为移动终端,以便更加清楚简洁地阐述终端与移动终端间的客户端的数据传输。
图6示出了根据本发明一个实施例的另一种客户端的结构示意图。为将本发明实施例阐述得更加清楚简洁,以下将另一种用于数据传输的客户端简称为第二客户端,设置于第二终端。参见图6,第二客户端600至少包括:第二确定模块610、第二接收模块620、第二获取模块630、连接建立模块640以及数据处理模块650。
现介绍第二客户端600中的各器件或组成的功能以及各部分间的连接关系。第二客户端600中的第二确定模块610确定第一终端与第二终端600建立连接完成之后,第二接收模块620接收第一客户端发送的标识信息。第二接收模块620接收到第一客户端的标识信息之后,直接触发第二获取模块630。
第二获取模块630根据第一客户端的标识信息查找对应的长连接服务器的地址信息。查找到对应的长连接服务器的地址信息之后,第二获取模块630触发连接建立模块640。连接建立模块640根据获取到的长连接服务器的地址信息,在第二客户端600与对应的长连接服务器间建立长连接,以便第二客户端600从对应的长连接服务器处接收数据。
依据本发明实施例,第二客户端600利用标识信息,能够与对应的长连接服务器建立长连接,以便从长连接服务器处接收数据,解决了第一客户端与第二客户端600之间的信息共享问题,进一步解决了在新客户端执行用户需求的操作重复以及获取信息的重复,从而避免不同客户端操作的耗时以及数据的冗余,节省用户时间,提升用户体验。
具体的,当第二接收模块620接收到第一客户端的标识信息之后,第二获取模块630发送携带有标识信息的地址请求消息至长连接分配服务器。长连接分配服务器接收到该地址请求消息,根据其所携带的标识信息,返回给第二获取模块630响应消息。该响应消息中携带有与第二客户端600相对应的长连接服务器的地址信息。第二获取模块630接收到携带有对应的长连接服务器的地址信息的响应消息之后,触发连接建立模块640。连接建立模块640根据长连接分配服务器返回的地址信息,在第二客户端600与上述地址信息对应的长连接服务器之间建立长连接,以便从长连接服务器处接收数据。
当长连接服务器接收到经第一服务器发送的第一客户端的数据时,长连接服务器根据第一客户端的数据中携带的标识信息查找到第二客户端600,并查询与第二客户端600之间长连接的状态。若此长连接的状态为连接,长连接服务器将第一客户端的数据发送至第二客户端600。若此长连接的状态为断开,则在该长连接服务器中存储第一客户端的数据,然后,待该长连接服务器与第二客户端600之间的长连接的状态恢复时,再将长连接服务器中存储的第一客户端的数据发送至第二客户端600。
第二客户端600中的第二接收模块620接收经长连接服务器发送的第一客户端的数据,然后触发数据处理器650。由数据处理器650根据第一客户端的数据做相应处理以保证第一客户端与第二客户端600之间实现信息共享,并能够在第二客户端上继续执行之前在第一客户端未执行结束的操作,例如继续进行网页内容阅读。
本发明实施例中,标识信息是客户端的身份认证信息,可以是由用户设置的身份认证信息,还可以是服务器为客户端设置的身份认证信息,本发明实施例并不对此加以限定。优选的,本发明实施例中,标识信息可以是第一客户端的用户登录的 账户信息,该账户信息是用户在客户端中心申请注册的账户,账户信息的申请简单易行,并且每个账户信息可以在多个客户端进行登录。
另外,本发明实施例中的标识信息也可以是服务器生成的一个能作为唯一标识的字符串,例如影子账户。影子账户可以是服务器根据时间、机器标识等信息生成的唯一标识,影子账户也可以是服务器随机生成的一个账户,服务器在生成这个账户之后,检查生成的这个影子账户是否已经存在,如果存在,则服务器重新生成一个影子账户,直到这个账户之前并不存在。影子账户具有不可重复性以及唯一性,每个影子账户仅能够标识一个客户端。
在本发明实施例中,第一客户端和/或第二客户端600可以为浏览器客户端、安全卫士客户端、阅读器客户端、媒体播放器客户端等任意相同类型的客户端,还可以为不同类型但执行相同功能的客户端,本发明实施例并不对此加以限定。此处的第一、第二仅用于区分不同的客户端,对于客户端本身属性、顺序以及功能并不造成限定,将第一、第二换位指代不同的客户端也可。
优选的,本发明实施例中,第一客户端和/或第二客户端600为浏览器客户端。用户通常在浏览器客户端执行收藏网址、设置常用网页等个性化操作,当用户从一个终端转向另一个终端时,需要在另一个终端新启用新的客户端,根据本发明实施例,用户在曾经的客户端上设置的个性化操作可以被自动同步到新启用的客户端内,无需用户重复操作。
同理,本发明实施例中,第二客户端600接收的数据可以为用户在第一客户端内执行任何操作的数据,也可以是第一客户端更新的其他数据,存储在第一客户端的数据,等等,本发明实施例并不对此做任何限定。优选的,本发明实施例中,该数据可以包括第一客户端的收藏夹中收藏的各网址、第一客户端当前打开的网址、第一客户端的常用网址以及任意第一客户端根据用户指令调用的用户数据等。
另外,本发明实施例中,第二客户端600根据接收到的第一客户端的数据所进行的处理可以为根据第一客户端的数据对第二客户端600自身进行相应处理,也可以为对接收的第一客户端的数据进行处理。优选的,本发明实施例中,第二客户端600根据第一客户端的数据进行的处理包括,第二客户端600更新收藏夹,第二客户端600更新常用网址以及第二客户端600打开网址对应的网页等等。
本发明实施例中,第一客户端的任意数据均可以被发送至第二客户端600,保证了用户在第一客户端中所进行的各种操作均可以被同步更新到第二客户端600中,避免用户在新客户端执行重复操作,获取重复信息,进一步避免数据冗余以及资源的浪费。
本发明实施例中,除在前提到的不同终端间的客户端数据传输,还能够实现移动终端和终端间的客户端数据传输。因此,本发明实施例中,第一终端与第二终端可以是台式电脑、笔记本电脑等终端,还可以是手机、音乐播放器、平板电脑等移动终端。优选的,本发明实施例中,第二终端为移动终端,以便更加清楚简洁地阐 述终端与移动终端间的客户端的数据传输。
图7示出了根据本发明一个实施例的数据传输系统的结构示意图。如图7所示,本发明实施例中的数据传输系统700包括设置于第一终端的第一客户端710、设置于第二终端的第二客户端720、长连接分配服务器730、长连接服务器740以及与第一客户端710对应的第一服务器750。
现介绍本发明实施例的数据传输系统700中的各器件或组成的功能以及各部分间的连接关系。第一客户端710中,第一确定模块711确定第一终端已与第二终端建立连接,然后与第一确定模块711相耦合的第一获取模块712获取自身的标识信息,并由与第一获取模块712相耦合的数据传输模块713将此标识信息传输至第二终端。
具体地,第一获取模块712发送携带有标识信息的地址请求消息至长连接分配服务器730,长连接分配服务器730接收到地址请求信息后,验证地址请求信息所携带标识信息,然后返回携带有长连接服务器740的地址信息的响应消息至第一获取模块712。另外,第一获取模块712能够获取第一客户端710中的数据。与第一获取模块712相耦合的数据传输模块713将第一获取模块712获取到的数据经第一服务器750传输至对应的长连接服务器740。长连接服务器740与第二客户端720之间具有长连接,进而第一客户端710中的数据由长连接服务器740发送至与其建立长连接的第二客户端720。
数据传输系统700中,直接由第二获取模块723根据第二接收模块720接收到的第一客户端710的标识信息向长连接分配服务器730发送带有上述标识信息的地址请求消息。长连接分配服务器730接收到地址请求消息之后返回带有地址信息的响应消息。第二获取模块723接收携带有上述地址信息的响应消息。进一步,第二客户端720中的连接建立模块724根据所获取的长连接服务器的地址信息与长连接服务器建立连接。
连接建立成功之后,数据可以在第一客户端710与第二客户端720之间传输。此时,第一客户端710可以将第一客户端710的数据经第一服务器750传输至长连接服务器740。长连接服务器740再将第一客户端的数据传输给第二客户端720。第二客户端720的数据处理模块725对上述数据进行处理。
依据本发明实施例,能够将第一客户端的标识信息发送至第二客户端,实现了第一客户端向第二客户端进行数据传输,解决了现有技术提到的客户端间无法进行数据传输的问题,进一步解决因不同客户端间无法进行数据传输,新客户端启用时必须重新引入用户需求,从而导致资源浪费以及效率低下的问题。
另外,依据本发明实施例,第二客户端利用标识信息,能够与对应的长连接服务器建立长连接,以便从长连接服务器处接收数据,解决了第一客户端与第二客户端之间的信息共享问题,进一步解决了在新客户端执行用户需求的操作重复以及获取信息的重复,从而避免不同客户端操作的耗时以及数据的冗余,节省用户时间, 提升用户体验。
本发明实施例中,标识信息是客户端的身份认证信息,可以是由用户设置的身份认证信息,还可以是服务器为客户端设置的身份认证信息,本发明实施例并不对此加以限定。优选的,本发明实施例中,标识信息可以是第一客户端的用户登录的账户信息,该账户信息是用户在客户端中心申请注册的账户,账户信息的申请简单易行,并且每个账户信息可以在多个客户端进行登录。
另外,本发明实施例中的标识信息也可以是服务器生成的一个能作为唯一标识的字符串,例如影子账户。影子账户可以是服务器根据时间、机器标识等信息生成的唯一标识,影子账户也可以是服务器随机生成的一个账户,服务器在生成这个账户之后,检查生成的这个影子账户是否已经存在,如果存在,则服务器重新生成一个影子账户,直到这个账户之前并不存在。影子账户具有不可重复性以及唯一性,每个影子账户仅能够标识一个客户端。
在本发明实施例中,第一客户端和/或第二客户端可以为浏览器客户端、安全卫士客户端、阅读器客户端、媒体播放器客户端等任意相同类型的客户端,还可以为不同类型但执行相同功能的客户端,本发明实施例并不对此加以限定。此处的第一、第二仅用于区分不同的客户端,对于客户端本身属性、顺序以及功能并不造成限定,将第一、第二换位指代不同的客户端也可。
优选的,本发明实施例中,第一客户端和/或第二客户端为浏览器客户端。用户通常在浏览器客户端执行收藏网址、设置常用网页等个性化操作,当用户从一个终端转向另一个终端时,需要在另一个终端新启用新的客户端,根据本发明实施例,用户在曾经的客户端上设置的个性化操作可以被自动同步到新启用的客户端内,无需用户重复操作。
同理,本发明实施例中,第一客户端的数据可以为用户在第一客户端内执行任何操作的数据,也可以是第一客户端更新的其他数据,存储在第一客户端的数据,等等,本发明实施例并不对此做任何限定。优选的,本发明实施例中,该数据可以包括第一客户端的收藏夹中收藏的各网址、第一客户端当前打开的网址、第一客户端的常用网址以及任意第一客户端根据用户指令调用的用户数据等。
另外,本发明实施例中,第二客户端根据接收到的第一客户端的数据所进行的处理可以为根据第一客户端的数据对第二客户端自身进行相应处理,也可以为对接收的第一客户端的数据进行处理。优选的,本发明实施例中,第二客户端根据第一客户端的数据进行的处理包括,第二客户端更新收藏夹,第二客户端更新常用网址以及第二客户端打开网址对应的网页等等。
本发明实施例中,第一客户端的任意数据均可以被发送至第二客户端,保证了用户在第一客户端中所进行的各种操作均可以被同步更新到第二客户端中,避免用户在新客户端执行重复操作,获取重复信息,进一步避免数据冗余以及资源的浪费。
本发明实施例中,除在前提到的不同终端间的客户端数据传输,还能够实现移 动终端和终端间的客户端数据传输。因此,本发明实施例中,第一终端与第二终端可以是台式电脑、笔记本电脑等终端,还可以是手机、音乐播放器、平板电脑等移动终端。优选的,本发明实施例中,第二终端为移动终端,以便更加清楚简洁地阐述终端与移动终端间的客户端的数据传输。
根据上述任意一个优选实施例或多个优选实施例的组合,本发明实施例能够达到如下有益效果:
依据本发明实施例,能够将第一客户端的标识信息发送至第二客户端,实现了第一客户端向第二客户端进行数据传输,解决了现有技术提到的客户端间无法进行数据传输的问题,进一步解决因不同客户端间无法进行数据传输,新客户端启用时必须重新引入用户需求,从而导致资源浪费以及效率低下的问题。
另外,依据本发明实施例,第二客户端利用标识信息,能够与对应的长连接服务器建立长连接,以便从长连接服务器处接收数据,解决了第一客户端与第二客户端之间的信息共享问题,进一步解决了在新客户端执行用户需求的操作重复以及获取信息的重复,从而避免不同客户端操作的耗时以及数据的冗余,节省用户时间,提升用户体验。
本发明实施例中,第二客户端通过长连接服务器接收第一客户端的数据,其中,第二客户端首先向长连接分配服务器请求对应的长连接服务器地址信息。长连接分配服务器根据不同客户端的标识信息将不同的长连接服务器地址返回给各客户端,保证不同终端的同一客户端之间信息的同步更加快速及时。另外,本发明实施例中,长连接服务器中存储的在线设备列表能够实时更新,保证长连接服务器能够及时更新与其建立长连接的客户端的信息,避免因在线设备列表数据更新不及时导致向已断开的客户端发送数据,导致数据包丢失等恶性后果,提高数据传输的安全性。
实施例二
为解决上述技术问题,本发明实施例提供了又一种数据传输的方法,该方法中不同终端间通过无线方式进行连接(例如网络)。图8示出了根据本发明一个实施例的又一种数据传输方法的处理流程图。如图8所示,该流程起始于步骤S802,利用网络在第二客户端与长连接服务器间建立长连接。第二客户端与长连接服务器间的长连接建立成功之后,执行步骤S804,接收长连接服务器转发的、来自第一客户端的数据。
依据本发明实施例,能够将第一客户端的数据发送至第二客户端,解决了现有技术提到的客户端间无法进行数据传输的问题,进一步解决因不同客户端间无法进行数据传输,新客户端启用时必须重新引入用户需求,在新客户端执行用户需求的操作重复以及获取信息的重复,从而导致资源浪费以及效率低下的问题,避免不同客户端操作的耗时以及数据的冗余,节省用户时间,提升用户体验。
具体地,第一客户端向第二客户端发送数据,需要经过服务器等路由转发。参见图8中的步骤S804,第一客户端将数据发送至第一服务器,由第一服务器将第一 客户端的数据转发至长连接服务器。第一服务器接收到第一客户端发送的数据之后,首先对第一客户端的数据进行合法性验证。优选的,本发明实施例中,第一服务器对上述数据中第一客户端的标识信息进行验证,确定第一客户端的标识信息是否为合法信息,例如验证该标识信息是否已在客户端中心注册,或者是该标识信息是否是服务器内部生成的标识符。若该标识信息经验证是合法信息,则第一服务器将该标识信息传输至长连接服务器,若该标识信息不是合法信息,则第一服务器拒绝将该标识信息发送至长连接服务器。
同样,第一服务器还可以对数据中除标识信息外的其他数据进行合法性验证,例如,验证第一客户端的网页数据等是否为非恶意数据。本发明实施例中,恶意数据指对用户终端内的数据进行窃取、毁坏等非法行为的病毒、木马等等。若第一服务器验证第一客户端的数据是上述恶意数据,则第一服务器可以拒绝将该恶意数据传输至长连接服务器,还可以在传输至长连接服务器时,提示长连接服务器上述数据可能包含恶意数据,进而在长连接服务器将数据传输至第二客户端时提示用户,第二客户端接收的数据可能包含恶意数据。第二客户端根据用户指示选择是否接收可能包含恶意数据的数据。另外,若经第一服务器的验证,第一客户端的数据是非恶意数据,则第一服务器将该数据传输至长连接服务器。
优选的,本发明实施例中,第一客户端的数据经合法性验证之后,第一服务器还可以对第一客户端的数据进行加密处理,更加有效地提高数据传输的安全性。通过第一服务器对第一客户端的数据进行安全性验证及处理,能够更加有效地保证传输数据的安全性,防止在数据传输的过程中,一些恶意网址等附加到传输的数据中,对用户的终端或者客户端造成损害。
第一服务器对第一客户端的数据进行合法性验证之后,将经过合法性验证的数据发送至对应的长连接服务器。第一服务器与长连接服务器可以通过多种协议进行通信,例如,传输控制协议、用户数据报协议等。优选的,本发明实施例中,第一服务器与长连接服务器通过HTTP请求通信。HTTP支持多种服务器模式、简单快速,因此通过HTTP请求通知能够提高数据传输效率。
长连接服务器接收到经第一服务器转发的第一客户端的数据之后,将数据转发至第二客户端。第二客户端从长连接服务器处接收第一客户端的数据之前,首先查找长连接服务器的地址信息,并根据地址信息与对应的长连接服务器建立长连接。
现介绍第二客户端查找长连接服务器的地址信息的具体方式。第二客户端向长连接分配服务器发送携带有第一客户端标识信息的地址请求消息,长连接分配服务器接收到该地址请求消息之后,根据其所携带的标识信息,确定对应的长连接服务器,并返回给第二客户端携带有对应的长连接服务器的地址信息的响应消息。
第二客户端根据查找到的长连接服务器的地址信息执行步骤S802,利用网络与长连接服务器建立长连接。值得说明地是,若长连接分配服务器返回的响应消息中携带至少两个地址信息,第二客户端可以根据预设策略选择其中一个地址信息作为 即将连接的长连接服务器的地址信息,并与对应的长连接服务器建立长连接。具体选择哪一个地址信息根据实际情况而定。此处的预设策略仅仅是一种地址信息的选择方法、步骤或策略,例如可以是随机选择策略,也可以是顺序选择策略。还可以根据与第二客户端相关的信息确定预定策略,对地址信息进行选择,例如,根据与第二客户端间的连接方式对地址信息进行选择,或者,根据与第二客户端间的数据传输带宽的大小对地址信息进行选择,等等。
本发明实施例中,上述网络包括有线网络和无线网络,优选的,本发明实施例中,无线网络包括Wifi、2G\3G\4G中的任意之一或多个的组合。上述无线网络均为目前被广泛采用的无线网络,能够快速高效地进行数据(例如标识信息或者网页地址)的传输。
当第二客户端与对应的长连接服务器成功建立长连接之后,长连接服务器中存储有在线设备列表,该列表记录与该长连接服务器保持长连接的各个客户端的标识信息。若某一个客户端与该长连接服务器之间的长连接断开,则在长连接服务器的在线设备列表中删除已断开的客户端对应的标识信息。长连接服务器中的在线设备列表的实时更新保证长连接服务器能够及时更新与其建立长连接的客户端的信息,避免因在线设备列表数据更新不及时导致向已断开的客户端发送数据,导致数据包丢失等恶性后果,提高数据传输的安全性。
当长连接服务器接收到经第一服务器发送的第一客户端的数据时,长连接服务器根据第一客户端的数据中携带的标识信息查找到第二客户端,并根据在线设备列表中记录的信息确定与第二客户端之间的长连接状态。若此长连接的状态为连接,长连接服务器将第一客户端的数据发送至第二客户端。若此长连接的状态为断开,则在该长连接服务器中存储第一客户端的数据,然后,待该长连接服务器与第二客户端之间的长连接的状态由断开转为连接时,再将长连接服务器中存储的第一客户端的数据发送至第二客户端。长连接服务器对于不能及时传输至第二客户端的数据进行存储,同样能够避免数据包丢失的恶性后果,保证第一客户端的数据均被发送至第二客户端。
第二客户端接收到长连接服务器发送的数据之后,根据数据做相应处理。通过第二客户端对接收到的第一客户端的数据进行相应处理,保证第一客户端与第二客户端之间实现信息共享,并能够在第二客户端上继续执行之前在第一客户端未执行结束的操作,例如继续进行网页内容阅读。
本发明实施例中,标识信息是客户端的身份认证信息,可以是由用户设置的身份认证信息,还可以是服务器为客户端设置的身份认证信息,本发明实施例并不对此加以限定。优选的,本发明实施例中,标识信息可以是第一客户端的用户登录的账户信息,该账户信息是用户在客户端中心申请注册的账户,账户信息的申请简单易行,并且每个账户信息可以在多个客户端进行登录。另外,本发明实施例中的标识信息也可以是服务器生成的一个能作为唯一标识的字符串,例如影子账户。影子 账户可以是服务器根据时间、机器标识等信息生成的唯一标识,也可以是服务器随机生成的一个账户,服务器在生成这个账户之后,检查生成的这个影子账户是否已经存在,如果存在,则服务器重新生成一个影子账户,直到这个账户之前并不存在。影子账户具有不可重复性以及唯一性,每个影子账户仅能够标识一个客户端。
在本发明实施例中,第一客户端和/或第二客户端可以为浏览器客户端、安全卫士客户端、阅读器客户端、媒体播放器客户端等任意相同类型的客户端,还可以为不同类型但执行相同功能的客户端,本发明实施例并不对此加以限定。此处的第一、第二仅用于区分不同的客户端,对于客户端本身属性、顺序以及功能并不造成限定,将第一、第二换位指代不同的客户端也可。
优选的,本发明实施例中,第一客户端和/或第二客户端为浏览器客户端。用户通常在浏览器客户端执行收藏网址、设置常用网页等个性化操作,当用户从一个终端转向另一个终端时,需要在另一个终端新启用新的客户端,根据本发明实施例,用户在曾经的客户端上设置的个性化操作可以被自动同步到新启用的客户端内,无需用户重复操作。
本发明实施例中,第一客户端的任意数据均可以被发送至第二客户端,保证了用户在第一客户端中所进行的各种操作均可以被同步更新到第二客户端中,避免用户在新客户端执行重复操作,获取重复信息,进一步避免数据冗余以及资源的浪费。
本发明实施例中,若将第一客户端设置于第一终端,第二客户端设置于第二终端,可以实现不同终端间的客户端数据传输,还可以实现移动终端和终端间的客户端数据传输。因此,本发明实施例中,第一终端与第二终端可以是台式电脑、笔记本电脑等终端,还可以是手机、音乐播放器、平板电脑等移动终端。优选的,本发明实施例中,将第二客户端设置于移动终端,以便更加清楚简洁地阐述终端与移动终端间的客户端的数据传输。
实施例2.1
图9示出了根据本发明一个优选实施例的数据传输方法流程图,用于支持实施例二所提供的数据传输方法,将上述数据传输方法阐述得更清楚明白。如图9所示,本例中选择PC作为终端,手机为移动终端,客户端为浏览器客户端。为方便辨识第一客户端与第二客户端,在本例中,第一客户端被称为PC浏览器,第二客户端被称为手机浏览器,标识信息被称为唯一ID。
图9中,PC浏览器与手机浏览器间已建立能够进行数据传输的通路,并且分别保存有唯一ID。参见图9,手机浏览器第一次连接网络时,向长连接分配服务器请求长连接服务器的地址,手机浏览器在长连接分配服务器返回的地址信息中任选一个地址信息,并如图9中步骤2所示,利用网络自动与对应的长连接服务器建立长连接。手机浏览器在与长连接服务器建立长连接时,发送唯一ID至长连接服务器。长连接服务器中的在线设备列表将上述唯一ID对应的手机浏览器用户标识为在线。
参见图9中的步骤3,PC浏览器发送唯一ID以及自身数据(例如网页地址)至 PC服务器。PC服务器接收到PC浏览器的数据之后,首先对PC浏览器的数据进行验证,包括验证唯一ID合法,即,验证上述唯一ID为已在系统中注册过的ID,以及,验证其他PC浏览器的数据为非恶意数据。例如,通过将网址发送到网盾服务器验证上述网址为非恶意网址。对PC浏览器的数据进行验证之后,PC服务器将经过合法性验证的数据通过HTTP通信方式转发至长连接服务器。长连接服务器接收到PC服务器的数据之后,执行图9中的步骤7,根据长连接服务器存储的在线设备列表,查找对应的手机浏览器是否在线,若在线,长连接服务器通过与手机浏览器之间的长连接发送PC浏览器的数据,若不在线,则长连接服务器存储PC服务器的数据,待与手机浏览器之间的长连接恢复之后,再发送数据至手机浏览器。
手机浏览器接收到长连接服务器发送的数据之后,根据数据做相应处理以保证第一客户端与第二客户端之间实现信息共享,并能够在第二客户端上继续执行之前在第一客户端未执行结束的操作,例如继续进行网页内容阅读。
基于上文各优选实施例提供的数据传输的方法,基于同一发明构思,本发明实施例提供了又一种用于数据传输的客户端,用于实现实施例二所提供的数据传输的方法。
图10示出了根据本发明一个实施例的一种客户端的结构示意图。为将本发明实施例阐述得更加清楚简洁,以下将用于数据传输的客户端简称为第一客户端。参见图10,本发明实施例的第一客户端1000至少包括:第一数据获取器1010以及第一数据发送器1020。
现介绍本发明实施例的数据传输设备中第一客户端1000的各器件或组成的功能以及各部分间的连接关系。第一客户端1000中,第一数据获取器1010能够获取自身的标识信息,然后,与第一数据获取器1010耦合的第一数据发送器1020将标识信息传输至第二终端。
依据本发明实施例,能够将第一客户端1000的数据发送至第二客户端,解决了现有技术提到的客户端间无法进行数据传输的问题,进一步解决因不同客户端间无法进行数据传输,新客户端启用时必须重新引入用户需求,在新客户端执行用户需求的操作重复以及获取信息的重复,从而导致资源浪费以及效率低下的问题,避免不同客户端操作的耗时以及数据的冗余,节省用户时间,提升用户体验。
具体地,本发明实施例中,第一客户端1000与第二客户端间能够传输标识信息,即,第一客户端1000与第二客户端间已建立能够进行数据传输的通道,例如通过数据线连接。因此,在标识信息传输至第二客户端之后,第一数据获取器1010还可以获取到第一客户端1000中的数据,然后由第一数据发送器1020将第一客户端1000中的数据传输至第二客户端。与标识信息的直接传输不同,第一客户端1000中的数据传输至第二客户端可以经过服务器等路由转发。
当第一数据获取器1010获取到第一客户端1000中的数据之后,第一数据发送器1020将获取到的数据传输至第一服务器,此处的第一服务器为第一终端1000所 对应的服务器。例如,若第一终端为PC,则第一服务器为PC服务器。第一服务器接收到来自第一客户端1000的数据之后,将其传输到与第二客户端间具有长连接的长连接服务器,再由长连接服务器将第一客户端1000的数据传输至第二客户端。
由上述可知,将数据由第一客户端1000传输至第二客户端,需要经过对应的长连接服务器。该长连接服务器的地址信息需要第一客户端1000中的第一数据获取器1010根据第一客户端1000的标识信息进行获取。现介绍第一数据获取器1010获取对应的长连接服务器的地址信息的方式。首先,第一数据获取器1010将携带有第一客户端1000的标识信息的地址请求消息发送至长连接分配服务器。长连接分配服务器收到地址请求消息之后,对其携带的标识信息进行验证,然后根据此标识信息向第一数据获取器1010返回响应消息。其中,长连接分配服务器返回的响应消息中携带有与第一客户端1000对应的长连接服务器的地址信息。
本发明实施例中,第一客户端1000通过长连接分配服务器查找对应的长连接服务器的地址信息。长连接分配服务器根据不同终端上客户端的标识信息将不同的长连接服务器地址返回给各客户端,保证不同客户端的之间信息的同步更加快速及时。另外,第一客户端1000与第二客户端通过同一标识信息查找对应的长连接服务器,保证指定用户客户端的数据被发送到同一用户的其他终端的客户端上,避免用户客户端的数据发送混淆。第一客户端1000中的第一数据获取器1010获取到对应长连接服务器的地址信息之后,连接建立模块10100根据此地址信息与长连接服务器建立长连接并将用户在第一客户端1000中的数据通过此长连接服务器发送至第二客户端。
本发明实施例中,标识信息是客户端的身份认证信息,可以是由用户设置的身份认证信息,还可以是服务器为客户端设置的身份认证信息,本发明实施例并不对此加以限定。优选的,本发明实施例中,标识信息可以是第一客户端1000的用户登录的账户信息,该账户信息是用户在客户端中心申请注册的账户,账户信息的申请简单易行,并且每个账户信息可以在多个客户端进行登录。
另外,本发明实施例中的标识信息也可以是服务器生成的一个能作为唯一标识的字符串,例如影子账户。影子账户可以是服务器根据时间、机器标识等信息生成的唯一标识,也可以是服务器随机生成的一个账户,服务器在生成这个账户之后,检查生成的这个影子账户是否已经存在,如果存在,则服务器重新生成一个影子账户,直到这个账户之前并不存在。影子账户具有不可重复性以及唯一性,每个影子账户仅能够标识一个客户端。
在本发明实施例中,第一客户端1000和/或第二客户端可以为浏览器客户端、安全卫士客户端、阅读器客户端、媒体播放器客户端等任意相同类型的客户端,还可以为不同类型但执行相同功能的客户端,本发明实施例并不对此加以限定。此处的第一、第二仅用于区分不同的客户端,对于客户端本身属性、顺序以及功能并不造成限定,将第一、第二换位指代不同的客户端也可。
优选的,本发明实施例中,第一客户端1000和/或第二客户端为浏览器客户端。用户通常在浏览器客户端执行收藏网址、设置常用网页等个性化操作,当用户从一个终端转向另一个终端时,需要在另一个终端新启用新的客户端,根据本发明实施例,用户在曾经的客户端上设置的个性化操作可以被自动同步到新启用的客户端内,无需用户重复操作。
同理,本发明实施例中,第一客户端1000的数据可以为用户在第一客户端1000内执行任何操作的数据,也可以是第一客户1000端更新的其他数据,存储在第一客户端1000的数据,等等,本发明实施例并不对此做任何限定。优选的,本发明实施例中,该数据可以包括第一客户端1000的收藏夹中收藏的各网址、第一客户端1000当前打开的网址、第一客户端1000的常用网址以及任意第一客户端1000根据用户指令调用的用户数据等。第一客户端1000的任意数据均可以被发送至第二客户端,保证了用户在第一客户端1000中所进行的各种操作均可以被同步更新到第二客户端中,避免用户在新客户端执行重复操作,获取重复信息,进一步避免数据冗余以及资源浪费。
本发明实施例中,若将第一客户端设置于第一终端,第二客户端设置于第二终端,可以实现不同终端间的客户端数据传输,还可以实现移动终端和终端间的客户端数据传输。因此,本发明实施例中,第一终端与第二终端可以是台式电脑、笔记本电脑等终端,还可以是手机、音乐播放器、平板电脑等移动终端。优选的,本发明实施例中,将第二客户端设置于移动终端,以便更加清楚简洁地阐述终端与移动终端间的客户端的数据传输。
图11示出了根据本发明一个实施例的另一种客户端的结构示意图。为将本发明实施例阐述得更加清楚简洁,以下将另一种用于数据传输的客户端简称为第二客户端。参见图11,第二客户端1100至少包括:第一连接建立器1110以及第一数据接收器1120。
现介绍第二客户端1100中的各器件或组成的功能以及各部分间的连接关系。第二客户端1100中的第一连接建立器1110利用网络与长连接服务器建立长连接。当第二客户端1100与长连接服务器之间的长连接建立成功,第二客户端1100中的第一数据接收器1120接收长连接服务器转发的第一客户端的数据。
依据本发明实施例,能够将第一客户端的数据发送至第二客户端1100,解决了现有技术提到的客户端间无法进行数据传输的问题,进一步解决因不同客户端间无法进行数据传输,新客户端启用时必须重新引入用户需求,在新客户端执行用户需求的操作重复以及获取信息的重复,从而导致资源浪费以及效率低下的问题,避免不同客户端操作的耗时以及数据的冗余,节省用户时间,提升用户体验。
具体地,第一连接建立器1110向长连接分配服务器发送携带有第一客户端标识信息的地址请求消息,长连接分配服务器接收到该地址请求消息之后,根据其所携带的标识信息,确定对应的长连接服务器,并返回给第一连接建立器1110携带有对 应的长连接服务器的地址信息的响应消息。
第一连接建立器1110接收长连接分配服务器返回的响应消息,并根据该响应消息中携带的长连接服务器的地址信息与对应的长连接服务器建立长连接。特别地,若长连接分配服务器返回的响应消息中携带至少两个地址信息,第一连接建立器1110根据预设策略选择其中一个地址信息作为即将连接的长连接服务器的地址信息,并与对应的长连接服务器建立长连接。
第一连接建立器1110根据长连接服务器的地址信息,利用网络与长连接服务器成功建立长连接。本发明实施例中,上述网络包括有线网络和无线网络,优选的,本发明实施例中,无线网络包括Wifi、2G\3G\11G中的任意之一或多个的组合。上述无线网络均为目前被广泛采用的无线网络,能够快速高效地进行数据(例如标识信息或者网页地址)的传输。
长连接服务器中存储有在线设备列表,该列表记录与该长连接服务器保持长连接的各个客户端的标识信息。若某一个客户端与该长连接服务器之间的长连接断开,则在长连接服务器的在线设备列表中删除已断开的客户端对应的标识信息。第二客户端1100的第一连接建立器1110与长连接服务器成功建立长连接之后,在线设备列表中将第二客户端1100标识为在线。长连接服务器中的在线设备列表的实时更新保证长连接服务器能够及时更新与其建立长连接的客户端的信息,避免因在线设备列表数据更新不及时导致向已断开的客户端发送数据,导致数据包丢失等恶性后果,提高数据传输的安全性。
当长连接服务器接收到经第一服务器发送的第一客户端的数据时,长连接服务器根据第一客户端的数据中携带的标识信息查找到第二客户端1100,并根据在线设备列表中记录的信息确定与第二客户端1100之间的长连接状态。若此长连接的状态为连接,长连接服务器将第一客户端的数据发送至第二客户端1100。若此长连接的状态为断开,则在该长连接服务器中存储第一客户端的数据,然后,待该长连接服务器与第二客户端1100之间的长连接的状态由断开转为连接时,再将长连接服务器中存储的第一客户端的数据发送至第二客户端1100。
第二客户端1100中的第一数据接收器1120根据第二客户端1100与长连接服务器之间长连接的状态确定是否接收第一客户端的数据。具体方式为,若第二客户端1100与长连接服务器之间长连接的状态为断开,则第一数据接收器1120停止接收数据,待第二客户端1100与长连接服务器之间长连接的状态恢复,第一数据接收器1120继续从长连接服务器处接收第一客户端的数据,若第二客户端1100与长连接服务器之间长连接的状态为连接,则第一数据接收器1120从长连接服务器处接收第一客户端的数据。
在第一客户端的数据向第二客户端的传送过程中,首先利用第一服务器对第一客户端的数据进行合法性验证。优选的,本发明实施例中,第一服务器对上述数据中第一客户端的标识信息进行验证,确定第一客户端的标识信息是否为合法信息, 例如验证该标识信息是否已在客户端中心注册,或者是该标识信息是否是服务器内部生成的标识符。若该标识信息经验证是合法信息,则第一服务器将该标识信息传输至长连接服务器,若该标识信息不是合法信息,则第一服务器拒绝将该标识信息发送至长连接服务器。
同样,第一服务器还可以对数据中除标识信息外的其他数据进行合法性验证,例如,验证第一客户端的网页数据等,是否为非恶意数据。本发明实施例中,恶意数据指对用户终端内的数据进行窃取、毁坏等非法行为的病毒、木马等等。若第一服务器验证第一客户端的数据是上述恶意数据,则第一服务器拒绝将该恶意数据传输至长连接服务器,若经第一服务器的验证,第一客户端的数据是非恶意数据,则第一服务器将该数据传输至长连接服务器。
长连接服务器接收到通过合法性验证的第一客户端的数据之后,由第二客户端1100中的第一数据接收器1120对第一客户端的数据进行接收。
本发明实施例中,标识信息是客户端的身份认证信息,可以是由用户设置的身份认证信息,还可以是服务器为客户端设置的身份认证信息,本发明实施例并不对此加以限定。优选的,本发明实施例中,标识信息可以是第一客户端的用户登录的账户信息,该账户信息是用户在客户端中心申请注册的账户,账户信息的申请简单易行,并且每个账户信息可以在多个客户端进行登录。
另外,本发明实施例中的标识信息也可以是服务器生成的一个能作为唯一标识的字符串,例如影子账户。影子账户可以是服务器根据时间、机器标识等信息生成的唯一标识,也可以是服务器随机生成的一个账户,服务器在生成这个账户之后,检查生成的这个影子账户是否已经存在,如果存在,则服务器重新生成一个影子账户,直到这个账户之前并不存在。影子账户具有不可重复性以及唯一性,每个影子账户仅能够标识一个客户端。
在本发明实施例中,第一客户端和/或第二客户端1100可以为浏览器客户端、安全卫士客户端、阅读器客户端、媒体播放器客户端等任意相同类型的客户端,还可以为不同类型但执行相同功能的客户端,本发明实施例并不对此加以限定。此处的第一、第二仅用于区分不同的客户端,对于客户端本身属性、顺序以及功能并不造成限定,将第一、第二换位指代不同的客户端也可。
优选的,本发明实施例中,第一客户端和/或第二客户端1100为浏览器客户端。用户通常在浏览器客户端执行收藏网址、设置常用网页等个性化操作,当用户从一个终端转向另一个终端时,需要在另一个终端新启用新的客户端,根据本发明实施例,用户在曾经的客户端上设置的个性化操作可以被自动同步到新启用的客户端内,无需用户重复操作。
同理,本发明实施例中,第二客户端1100接收的数据可以为用户在第一客户端内执行任何操作的数据,也可以是第一客户端更新的其他数据,存储在第一客户端的数据,等等,本发明实施例并不对此做任何限定。优选的,本发明实施例中,该 数据可以包括第一客户端的收藏夹中收藏的各网址、第一客户端当前打开的网址、第一客户端的常用网址以及任意第一客户端根据用户指令调用的用户数据等。
另外,本发明实施例中,第二客户端1100根据接收到的第一客户端的数据所进行的处理可以为根据第一客户端的数据对第二客户端1100自身进行相应处理,也可以为对接收的第一客户端的数据进行处理。优选的,本发明实施例中,第二客户端1100根据第一客户端的数据进行的处理包括,第二客户端1100更新收藏夹,第二客户端1100更新常用网址以及第二客户端1100打开网址对应的网页等等。
本发明实施例中,第一客户端的任意数据均可以被发送至第二客户端1100,保证了用户在第一客户端中所进行的各种操作均可以被同步更新到第二客户端1100中,避免用户在新客户端执行重复操作,获取重复信息,进一步避免数据冗余以及资源的浪费。
本发明实施例中,若将第一客户端设置于第一终端,第二客户端设置于第二终端,可以实现不同终端间的客户端数据传输,还可以实现移动终端和终端间的客户端数据传输。因此,本发明实施例中,第一终端与第二终端可以是台式电脑、笔记本电脑等终端,还可以是手机、音乐播放器、平板电脑等移动终端。优选的,本发明实施例中,将第二客户端设置于移动终端,以便更加清楚简洁地阐述终端与移动终端间的客户端的数据传输。
图12示出了根据本发明一个实施例的数据传输系统的结构示意图。如图12所示,本发明实施例中的数据传输系统1200包括第一客户端1210、第一服务器1220、长连接服务器1230、长连接分配服务器1240以及第二客户端1250。
现介绍本发明实施例的数据传输系统1200中的各器件或组成的功能以及各部分间的连接关系。第一客户端1210中的第一数据获取器1211获取到自身的数据,并触发第一数据发送器1212。
第一数据发送器1212将第一客户端1210中的数据发送至第一服务器1220。第一服务器1220接收到第一客户端1210中的数据之后,首先对第一客户端1210中的数据进行合法性验证。优选的,本发明实施例中,第一服务器1220对上述数据中第一客户端1210的标识信息进行验证,确定第一客户端1210的标识信息是否为合法信息,例如验证该标识信息是否已在客户端中心注册,或者是该标识信息是否是服务器内部生成的标识符。若该标识信息经验证是合法信息,则第一服务器1220将该标识信息传输至长连接服务器1230,若该标识信息不是合法信息,则第一服务器1220拒绝将该标识信息发送至长连接服务器1230。
同样,第一服务器1220还可以对数据中除标识信息外的其他数据进行合法性验证,例如,验证第一客户端1210的网页数据等,是否为非恶意数据。本发明实施例中,恶意数据指对用户终端内的数据进行窃取、毁坏等非法行为的病毒、木马等等。若第一服务器1220验证第一客户端1210的数据是上述恶意数据,则第一服务器1220拒绝将该恶意数据传输至长连接服务器1230,若经第一服务器1220的验证,第一客 户端1210的数据是非恶意数据,则第一服务器1220将该数据传输至长连接服务器1230。
当长连接服务器1230接收到经第一服务器1220发送的第一客户端1210的数据时,长连接服务器1230根据第一客户端1210的数据中携带的标识信息查找到第二客户端1250,并根据在线设备列表中记录的信息确定与第二客户端1250之间的长连接状态。若此长连接的状态为连接,长连接服务器1230将第一客户端1210的数据发送至第二客户端1250。若此长连接的状态为断开,则在该长连接服务器1230中存储第一客户端1210的数据,然后,待该长连接服务器1230与第二客户端1250之间的长连接的状态由断开转为连接时,再将长连接服务器530中存储的第一客户端1210的数据发送至第二客户端1250。
第二客户端1250在通过长连接服务器1230接收第一客户端1210的数据之前,首先通过长连接分配服务器1240查找对应长连接服务器1230的地址信息。具体方式为,第一连接建立器1251向长连接分配服务器1240发送携带有第一客户端1210标识信息的地址请求消息,长连接分配服务器接收到该地址请求消息之后,根据其所携带的标识信息,确定对应的长连接服务器1230,并返回给第一连接建立器1251携带有对应的长连接服务器1230的地址信息的响应消息。
第一连接建立器1251接收长连接分配服务器1240返回的响应消息,并根据该响应消息中携带的长连接服务器的地址信息与对应的长连接服务器1230建立长连接。特别地,若长连接分配服务器1240返回的响应消息中携带至少两个地址信息,第一连接建立器1251根据预设策略选择其中一个地址信息作为即将连接的长连接服务器1230的地址信息,并与对应的长连接服务器1230建立长连接。
第一连接建立器1251根据长连接服务器1230的地址信息,利用网络与长连接服务器1230成功建立长连接。本发明实施例中,上述网络包括有线网络和无线网络,优选的,本发明实施例中,无线网络包括Wifi、2G\3G\4G中的任意之一或多个的组合。上述无线网络均为目前被广泛采用的无线网络,能够快速高效地进行数据(例如标识信息或者网页地址)的传输。
第二客户端1250与长连接服务器1230成功建立长连接之后,第二客户端1250中的第一数据接收器1252根据第二客户端1250与长连接服务器1230之间长连接的状态确定是否接收第一客户端1210的数据。具体方式为,若第二客户端1250与长连接服务器1230之间长连接的状态为断开,则第一数据接收器1252停止接收数据,待第二客户端1250与长连接服务器之间长连接的状态恢复,第一数据接收器1252继续从长连接服务器1230处接收第一客户端1210的数据,若第二客户端1250与长连接服务器1230之间长连接的状态为连接,则第二客户端1250中的第一数据接收器1252从长连接服务器1230处接收数据。
本发明实施例中,标识信息是客户端的身份认证信息,可以是由用户设置的身份认证信息,还可以是服务器为客户端设置的身份认证信息,本发明实施例并不对 此加以限定。优选的,本发明实施例中,标识信息可以是第一客户端的用户登录的账户信息,该账户信息是用户在客户端中心申请注册的账户,账户信息的申请简单易行,并且每个账户信息可以在多个客户端进行登录。
另外,本发明实施例中的标识信息也可以是服务器生成的一个能作为唯一标识的字符串,例如影子账户。影子账户可以是服务器根据时间、机器标识等信息生成的唯一标识,也可以是服务器随机生成的一个账户,服务器在生成这个账户之后,检查生成的这个影子账户是否已经存在,如果存在,则服务器重新生成一个影子账户,直到这个账户之前并不存在。影子账户具有不可重复性以及唯一性,每个影子账户仅能够标识一个客户端。
在本发明实施例中,第一客户端和/或第二客户端可以为浏览器客户端、安全卫士客户端、阅读器客户端、媒体播放器客户端等任意相同类型的客户端,还可以为不同类型但执行相同功能的客户端,本发明实施例并不对此加以限定。此处的第一、第二仅用于区分不同的客户端,对于客户端本身属性、顺序以及功能并不造成限定,将第一、第二换位指代不同的客户端也可。
优选的,本发明实施例中,第一客户端和/或第二客户端为浏览器客户端。用户通常在浏览器客户端执行收藏网址、设置常用网页等个性化操作,当用户从一个终端转向另一个终端时,需要在另一个终端新启用新的客户端,根据本发明实施例,用户在曾经的客户端上设置的个性化操作可以被自动同步到新启用的客户端内,无需用户重复操作。
同理,本发明实施例中,第一客户端的数据可以为用户在第一客户端内执行任何操作的数据,也可以是第一客户端更新的其他数据,存储在第一客户端的数据,等等,本发明实施例并不对此做任何限定。优选的,本发明实施例中,该数据可以包括第一客户端的收藏夹中收藏的各网址、第一客户端当前打开的网址、第一客户端的常用网址以及任意第一客户端根据用户指令调用的用户数据等。
另外,本发明实施例中,第二客户端根据接收到的第一客户端的数据所进行的处理可以为根据第一客户端的数据对第二客户端自身进行相应处理,也可以为对接收的第一客户端的数据进行处理。优选的,本发明实施例中,第二客户端根据第一客户端的数据进行的处理包括,第二客户端更新收藏夹,第二客户端更新常用网址以及第二客户端打开网址对应的网页等等。
本发明实施例中,第一客户端的任意数据均可以被发送至第二客户端,保证了用户在第一客户端中所进行的各种操作均可以被同步更新到第二客户端中,避免用户在新客户端执行重复操作,获取重复信息,进一步避免数据冗余以及资源的浪费。
本发明实施例中,若将第一客户端设置于第一终端,第二客户端设置于第二终端,可以实现不同终端间的客户端数据传输,还可以实现移动终端和终端间的客户端数据传输。因此,本发明实施例中,第一终端与第二终端可以是台式电脑、笔记本电脑等终端,还可以是手机、音乐播放器、平板电脑等移动终端。优选的,本发 明实施例中,将第二客户端设置于移动终端,以便更加清楚简洁地阐述终端与移动终端间的客户端的数据传输。
根据上述任意一个优选实施例或多个优选实施例的组合,本发明实施例能够达到如下有益效果:
依据本发明实施例,能够将第一客户端的数据发送至第二客户端,解决了现有技术提到的客户端间无法进行数据传输的问题,进一步解决因不同客户端间无法进行数据传输,新客户端启用时必须重新引入用户需求,在新客户端执行用户需求的操作重复以及获取信息的重复,从而导致资源浪费以及效率低下的问题,避免不同客户端操作的耗时以及数据的冗余,节省用户时间,提升用户体验。
本发明实施例中,第二客户端通过长连接服务器接收第一客户端的数据,其中,第二客户端首先向长连接分配服务器请求对应的长连接服务器地址信息。长连接分配服务器根据不同客户端的标识信息将不同的长连接服务器地址返回给各客户端,保证不同终端的同一客户端之间信息的同步更加快速及时。另外,本发明实施例中,长连接服务器中存储的在线设备列表能够实时更新,保证长连接服务器能够及时更新与其建立长连接的客户端的信息,避免因在线设备列表数据更新不及时导致向已断开的客户端发送数据,导致数据包丢失等恶性后果,提高数据传输的安全性。
实施例三
为解决相关技术中的技术问题,本发明实施例提供了又一种数据传输的方法,提供了数据双向传输的技术方案。图13示出了根据本发明一个实施例的数据传输方法的处理流程图。如图13所示,在本发明实施例中,第一客户端设置在第一终端中,第二客户端设置在移动终端中。参见图13中的步骤S1302,首先在第一终端和移动终端之间建立连接。当第一终端与移动终端之间连接建立完成,执行步骤S1304,获取第一客户端的第一数据,并将第一数据发送至第二客户端中,和/或执行步骤S1306,获取第二客户端的第二数据,并将第二数据发送至第一客户端。
依据本发明实施例,第一终端和移动终端建立连接之后,分别设置在两个终端的第一客户端与第二客户端之间能够进行数据的双向传输,解决了现有技术提到的客户端间无法进行数据传输的问题,进一步解决因不同客户端间无法进行数据传输,新客户端启用时必须重新引入用户需求,从而导致资源浪费以及效率低下的问题。
由图13可知,本发明实施例提供的数据传输方法为双向数据传输方法,即,本发明实施例提供的数据传输方法可以是第一客户端将第一数据传输至第二客户端,也可以是第二客户端将第二数据传输至第一客户端,其中,两种方向的数据传输过程相似。为将本发明实施例阐述得更加清楚简洁,现以第一客户端发送数据至第二客户端为例进行介绍。
图14示出了根据本发明一个实施例的第一客户端一侧的数据传输方法的处理流程图。如图14所示,该流程起始于步骤S1402,确定第一终端与移动终端间建立连接。第一终端可以通过多种方式与移动终端建立连接,例如有线方式、无线方式, 其中,有线方式可以通过数据线进行连接,无线方式可以通过无线网络(例如蓝牙、wifi、局域网等)进行连接。
在步骤S1402执行结束后,第一终端与移动终端间建立连接。进一步触发步骤S1404,获取设置于第一终端的第一客户端的第一数据,并将第一数据发送至第二客户端中。
依据本发明实施例,第一终端和移动终端建立连接之后,分别设置在两个终端的第一客户端与第二客户端之间能够进行数据的双向传输,解决了现有技术提到的客户端间无法进行数据传输的问题,进一步解决因不同客户端间无法进行数据传输,新客户端启用时必须重新引入用户需求,从而导致资源浪费以及效率低下的问题。
由图14所示流程可知,本发明实施例中,第一客户端与第二客户端间能够传输数据。具体地,第一客户端中的数据传输至第二客户端需要经过服务器等路由转发。现对其传输过程进行具体说明。
首先,获取第一客户端中的第一数据。其次,将获取的第一数据利用第一消息作为载体传输至第一服务器。此处的第一消息中携带有第一数据以及第一客户端的标识信息。另外,此处的第一服务器为第一终端所对应的服务器。例如,若第一终端为PC,则第一服务器为PC服务器。第一服务器接收到第一客户端发送的第一消息之后,将其传输到与第二客户端间具有长连接的长连接服务器,再由长连接服务器将第一消息传输到第二客户端。
图15示出了根据本发明一个优选实施例的发送数据流程图。首先确定第一终端与移动终端之间建立连接。当移动终端连接到第一终端时,可以直接在移动终端与第一终端间建立连接,也可以根据第一终端是否已与其他移动终端建立连接以及用户的选择来确定是否与移动终端建立连接。
优选的,本发明实施例中,首先判断第一终端是否与其他移动终端建立了连接。若否,则确定第一终端与移动终端之间建立连接。若是,则根据用户的选择来确定与第一终端建立连接的移动终端。通过判断第一终端是否与其他移动终端建立连接以及用户的选择,确定是否与移动终端建立连接,能够保证用户根据自身的需要,将指定移动终端的客户端的数据发送至第一终端,避免用户客户端的数据发送混淆。
确定第一终端与移动终端之间建立连接之后,参见图15,首先执行步骤S1501,第一客户端将携带有第一数据以及第一客户端自身标识信息的第一消息发送至第一服务器。
第一服务器接收到第一消息之后,参见图15中的步骤S1502,首先对第一消息进行合法性验证,并将通过合法性验证的第一消息转发。优选的,本发明实施例中,第一服务器对第一消息中第一客户端的标识信息进行验证,确定第一客户端的标识信息是否为合法信息,例如验证该标识信息是否已在客户端中心注册,或者是该标识信息是否是服务器内部生成的标识符。若该标识信息经验证是合法信息,则第一服务器将该标识信息传输至长连接服务器,若该标识信息不是合法信息,则第一服 务器拒绝将该标识信息发送至长连接服务器。
同样,第一服务器还可以对第一消息中除标识信息外的其他数据进行合法性验证,例如,验证第一客户端的网页数据等,是否为非恶意数据。本发明实施例中,恶意数据指对用户终端内的数据进行窃取、毁坏等非法行为的病毒、木马等等。若第一服务器验证第一客户端的数据是上述恶意数据,则第一服务器拒绝将该恶意数据传输至长连接服务器,若经第一服务器的验证,第一客户端的数据是非恶意数据,则第一服务器将该数据传输至长连接服务器。优选的,本发明实施例中,第一客户端传输的第一消息经合法性验证之后,第一服务器还可以对第一消息进行加密处理,更加有效地提高数据传输的安全性。通过第一服务器对第一消息进行安全性验证及处理,能够更加有效地保证传输数据的安全性,防止在数据传输的过程中,一些恶意网址等附加到传输的数据中,对用户的终端或者客户端造成损害。
第一服务器对第一消息进行合法性验证之后,将经过合法性验证的第一消息发送至对应的长连接服务器。第一服务器与长连接服务器可以通过多种协议进行通信,例如,传输控制协议、用户数据报协议等。优选的,本发明实施例中,第一服务器与长连接服务器通过HTTP请求通信。HTTP支持多种服务器模式、简单快速,因此通过HTTP请求通知能够提高数据传输效率。
由图15可知,当执行完第一服务器将第一消息发送至对应的长连接服务器这一步骤(即图15中的步骤S1502)之后,执行步骤S1503。在步骤S1503中,长连接服务器将第一消息发送至第二客户端。步骤S1504,第二客户端根据接收的第一消息进行相应处理以保证第一客户端与第二客户端之间实现信息共享,并能够在第二客户端上继续执行之前的第一客户端为执行结束的操作,例如继续进行网页内容阅读。
由上述可知,将第一消息由第一客户端传输至第二客户端,需要经过对应的长连接服务器。该长连接服务器的地址信息需要第一客户端根据第一客户端的标识信息进行获取。现介绍第一客户端获取对应的长连接服务器的地址信息的方式。首先,第一客户端将携带有自身标识信息的地址请求消息发送至长连接分配服务器。长连接分配服务器收到地址请求消息之后,对其携带的标识信息进行验证,然后根据此标识信息向第一客户端返回响应消息。其中,长连接分配服务器返回的响应消息中携带有与第一客户端对应的长连接服务器的地址信息。
本发明实施例中,第二客户端通过长连接分配服务器查找对应的长连接服务器地址信息。长连接分配服务器根据不同终端上客户端的标识信息将不同的长连接服务器地址返回给各客户端,保证不同客户端之间信息的同步更加快速及时。
图16示出了根据本发明一个实施例的第二客户端一侧的数据传输方法处理流程图。参见图16,首先,执行步骤S1602,即在第一终端与移动终端之间建立连接。确定第一终端与移动终端之间建立连接之后,第二客户端接收第一客户端的第一数据。
依据本发明实施例,第二客户端能够及时获取第一客户端中的第一数据,方便 第二客户端进行信息更新。本发明实施例解决了第一客户端与第二客户端之间的信息共享问题,使用户能够及时对两个客户端之间的信息进行同步,从而避免用户在新客户端执行重复操作,获取重复信息,进一步避免数据冗余以及资源的浪费。
具体地,在执行完第一终端与移动终端建立连接(即图16中的步骤S1602)之后,移动终端查询是否存在第二客户端。若存在第二客户端,直接触发步骤S1604,第二客户端接收第一客户端的第一数据。若不存在上述第二客户端,则需要首先获取第二客户端的安装包,并在第二终端中对第二客户端进行下载及安装。安装完成之后,执行步骤S1604,第二客户端接收第一客户端的第一数据。
第二客户端接收第一客户端的第一数据的过程中,第一数据需要经过服务器等路由转发,另外,第一数据利用第一消息作为载体进行传输,其中,第一消息中携带有第一数据以及第一客户端的标识信息。现对其传输过程进行具体说明。
第二客户端首先查找与其对应的长连接服务器的地址信息。现介绍第二客户端进行长连接服务器地址的查找的具体方式。第二客户端向长连接分配服务器发送携带有标识信息的地址请求消息,长连接分配服务器接收到该地址请求消息之后,根据其所携带的标识信息,确定对应的长连接服务器,并返回给第二客户端携带有对应的长连接服务器的地址信息的响应消息。
第二客户端接收到长连接分配服务器发送的对应长连接服务器的地址信息之后,与上述地址信息对应的长连接服务器建立长连接,以便从长连接服务器处接收第一数据。
当第二客户端与对应的长连接服务器成功建立长连接之后,长连接服务器中存储有在线设备列表,该列表记录与该长连接服务器保持长连接的各个客户端的标识信息。若某一个客户端与该长连接服务器之间的长连接断开,则在长连接服务器的在线设备列表中删除已断开的客户端对应的标识信息。长连接服务器中的在线设备列表的实时更新保证长连接服务器能够及时更新与其建立长连接的客户端的信息,避免因在线设备列表数据更新不及时导致向已断开的客户端发送数据,导致数据包丢失等恶性后果,提高数据传输的安全性。
当长连接服务器接收到经第一服务器发送的第一数据时,长连接服务器根据第一数据中携带的标识信息查找到第二客户端,并根据在线设备列表中记录的信息确定与第二客户端之间的长连接状态。若此长连接的状态为连接,长连接服务器将第一数据发送至第二客户端。若此长连接的状态为断开,则在该长连接服务器中存储第一数据,然后,待该长连接服务器与第二客户端之间的长连接的状态由断开转为连接时,再将长连接服务器中存储的第一数据发送至第二客户端。
第二客户端接收到长连接服务器发送的第一数据之后,根据第一数据做相应处理以保证第一客户端与第二客户端之间实现信息共享,并能够在第二客户端上继续执行之前在第一客户端未执行结束的操作,例如继续进行网页内容阅读。
本发明实施例中,标识信息是客户端的身份认证信息,可以是由用户设置的身 份认证信息,还可以是服务器为客户端设置的身份认证信息,本发明实施例并不对此加以限定。优选的,本发明实施例中,标识信息可以是第一客户端的用户登录的账户信息,该账户信息是用户在客户端中心申请注册的账户,账户信息的申请简单易行,并且每个账户信息可以在多个客户端进行登录。另外,本发明实施例中的标识信息也可以是服务器生成的一个能作为唯一标识的字符串,例如影子账户。影子账户可以是服务器根据时间、机器标识等信息生成的唯一标识,影子账户也可以是服务器随机生成的一个账户,服务器在生成这个账户之后,检查生成的这个影子账户是否已经存在,如果存在,则服务器重新生成一个影子账户,直到这个账户之前并不存在。影子账户具有不可重复性以及唯一性,每个影子账户仅能够标识一个客户端。
在本发明实施例中,第一客户端和/或第二客户端可以为浏览器客户端、安全卫士客户端、阅读器客户端、媒体播放器客户端等任意相同类型的客户端,还可以为不同类型但执行相同功能的客户端,本发明实施例并不对此加以限定。此处的第一、第二仅用于区分不同的客户端,对于客户端本身属性、顺序以及功能并不造成限定,将第一、第二换位指代不同的客户端也可。
优选的,本发明实施例中,第一客户端和/或第二客户端为浏览器客户端。用户通常在浏览器客户端执行收藏网址、设置常用网页等个性化操作,当用户从一个终端转向另一个终端时,需要在另一个终端新启用新的客户端,根据本发明实施例,用户在曾经的客户端上设置的个性化操作可以被自动同步到新启用的客户端内,无需用户重复操作。
同理,本发明实施例中,第一数据可以为用户在第一客户端内执行任何操作的数据,也可以是第一客户端更新的其他数据,存储在第一客户端的数据,等等,本发明实施例并不对此做任何限定。优选的,本发明实施例中,该数据可以包括第一客户端的收藏夹中收藏的各网址、第一客户端当前打开的网址、第一客户端的常用网址以及任意第一客户端根据用户指令调用的用户数据等。另外,本发明实施例中,第二客户端根据接收到的第一数据所进行的处理可以为根据第一数据对第二客户端自身进行相应处理,也可以为对接收的第一数据进行处理。优选的,本发明实施例中,第二客户端根据第一数据进行的处理包括,第二客户端更新收藏夹,第二客户端更新常用网址以及第二客户端打开网址对应的网页等等。
本发明实施例中,第一客户端的任意数据均可以被发送至第二客户端,保证了用户在第一客户端中所进行的各种操作均可以被同步更新到第二客户端中,避免用户在新客户端执行重复操作,获取重复信息,进一步避免数据冗余以及资源的浪费。
实施例3.1
图17示出了根据本发明一个优选实施例的数据传输方法流程图,用于支持上述任意一个数据传输方法,将上述数据传输方法阐述得更清楚明白。如图17所示,本例中选择PC作为终端,手机为移动终端,客户端为浏览器客户端。为方便辨识第一 客户端与第二客户端,在本例中,第一客户端被称为PC浏览器,第二客户端被称为手机浏览器。
参见图17,首先执行步骤S1701,在PC和手机之间使用USB数据线建立连接。PC浏览器接收到手机连接到PC的通知后,执行步骤S1702,将自身的标识信息发送至手机。PC浏览器收到上述通知之后,执行步骤S1703,查询是否已有账户信息在该客户端登录,并根据查询结果将PC浏览器的数据发送至PC服务器。具体地,若已有账户信息在该客户端登录,则PC浏览器将该账户信息中的有效数据发送至PC服务器。若无账户信息在该客户端登录,则PC浏览器生成一个唯一标识,为PC浏览器的标识信息,并将此标识信息以及PC浏览器自身的数据发送至PC服务器。
在本优选实施例中,步骤S1703中提及的PC浏览器发送自身数据至PC服务器这一步骤能够在数据传输的整个过程中执行,以保证PC浏览器能够及时将自身数据以及实时更新的数据发送至PC服务器。即,PC浏览器可以在PC与手机建立连接之后将自身的数据发送至PC服务器,也可以在PC未与手机建立连接时,发送数据。同理,PC浏览器可以在将自身的标识信息发送至手机之前,将数据发送至PC服务器,也可以在PC浏览器将自身的标识信息发送至手机之后,再将数据发送至PC服务器。
PC服务器接收到PC浏览器的数据之后,执行步骤S1704,对PC浏览器发送的数据进行合法性验证,并将通过合法性验证的数据发送经加密处理后,发送至长连接服务器。其中,合法性验证可以是验证PC浏览器发送的标识信息是否合法,也可以是验证PC浏览器发送的数据是否为非恶意数据。若PC浏览器的数据无法通过PC服务器的合法性验证,则PC服务器并不对该数据进行发送处理。
另外,手机通过步骤S1702接收到PC浏览器发送的标识信息之后,执行步骤S1705,查询自身是否安装有手机浏览器。若手机中没有安装手机浏览器,则首先在手机中对手机浏览器进行下载及安装,安装完成后,手机将PC浏览器的标识信息发送至手机浏览器。若手机中已存在手机浏览器,则直接将PC浏览器的标识信息发送至手机浏览器。
手机浏览器收到PC浏览器的标识信息之后,执行步骤S1706,将携带有上述标识信息的长连接服务器的地址请求信息发送至长连接分配服务器。长连接分配服务器接收到手机浏览器的地址请求消息之后,执行步骤S1707,发送携带有长连接服务器的地址信息的响应消息至手机浏览器。手机浏览器接收到携带有长连接服务器的地址信息的响应消息,执行步骤S1708,根据长连接服务器的地址信息,与对应的长连接服务器建立长连接。
长连接服务器接收到PC浏览器的数据之后,执行步骤S1709,根据手机浏览器与长连接服务器之间长连接的状态判断是否发送PC浏览器的数据至手机浏览器。具体地,长连接服务器中存储有在线设备列表,该列表的实时更新保证长连接服务器能够及时更新与其建立长连接的浏览器的信息,避免因在线设备列表数据更新不及时导致向已断开的浏览器发送数据,导致数据包丢失等恶性后果,提高数据传输的 安全性。
当长连接服务器收到经PC服务器发送的PC浏览器的数据之后,根据上述在线设备列表查询与对应的手机浏览器之间长连接的状态,若该长连接的状态为连接,则发送PC浏览器的数据至手机浏览器。若该长连接的状态为断开,则存储PC浏览器的数据,待长连接服务器与对应的手机浏览器之间的长连接状态恢复时,再将PC浏览器的数据发送至手机浏览器。
手机浏览器接收到长连接服务器发送的数据之后,执行步骤S1710,根据接收到的数据做相应处理以保证第一客户端与第二客户端之间实现信息共享,并能够在第二客户端上继续执行之前在第一客户端未执行结束的操作,例如继续进行网页内容阅读。
基于上文各优选实施例提供的数据传输的方法,基于同一发明构思,本发明实施例提供了一种用于数据传输的客户端,用于实现实施例三所提供的数据传输的方法。
图18示出了根据本发明一个实施例的一种客户端的结构示意图。为将本发明实施例阐述得更加清楚简洁,以下将用于数据传输的一种客户端简称为第一客户端。参见图18,本发明实施例的第一客户端1800至少包括:第三获取模块1810、第一发送模块1820、第三接收模块1830以及第一处理模块1840。
现介绍本发明实施例的数据传输设备中第一客户端1800的各器件或组成的功能以及各部分间的连接关系。第一客户端1800中,第三获取模块1810获取本地运行的第一客户端1800的第一数据。第三获取模块1810获取到第一数据之后,由第一发送模块1820发送第一数据至设置于移动终端的第二客户端。
依据本发明实施例,第一终端和移动终端建立连接之后,分别设置在两个终端的第一客户端1800与第二客户端之间能够进行数据的双向传输,解决了现有技术提到的客户端间无法进行数据传输的问题,进一步解决因不同客户端间无法进行数据传输,新客户端启用时必须重新引入用户需求,从而导致资源浪费以及效率低下的问题。
第一客户端1800中的第三获取模块1810以及第一发送模块1820能够完成第一客户端1800的数据发送功能,而第三接收模块1830接收第二客户端的第二数据,并触发第一处理模块1840,由第一处理模块1840根据第二客户端的第二数据进行相应处理,以保证第一客户端1800与第二客户端之间实现信息共享,并能够在第二客户端上继续执行之前在第一客户端1800未执行结束的操作,例如继续进行网页内容阅读。
本发明实施例中,第一客户端1800根据接收到的第二客户端的第二数据所进行的处理可以为根据第二数据对第一客户端1800自身进行相应处理,也可以为对接收的第二数据进行处理。优选的,本发明实施例中,第一客户端1800根据第二数据进行的处理包括,第一客户端1800更新收藏夹,第一客户端1800更新常用网址以及 第第一客户端1800打开网址对应的网页等等。
在本发明实施例中,第一客户端1800和/或第二客户端可以为任意相同类型的客户端,还可以为不同类型但执行相同功能的客户端,本发明实施例并不对此加以限定。此处的第一、第二仅用于区分不同的客户端,对于客户端本身属性、顺序以及功能并不造成限定,将第一、第二换位指代不同的客户端也可。
优选的,本发明实施例中,第一客户端1800和/或第二客户端为浏览器客户端。用户通常在浏览器客户端执行收藏网址、设置常用网页等个性化操作,当用户从一个终端转向另一个终端时,需要在另一个终端新启用新的客户端,根据本发明实施例,用户在曾经的客户端上设置的个性化操作可以被自动同步到新启用的客户端内,无需用户重复操作。
图19示出了根据本发明一个实施例的另一种客户端的结构示意图。为将本发明实施例阐述得更加清楚简洁,以下将另一种用于数据传输的客户端简称为第二客户端。参见图19,本发明实施例的第二客户端1900至少包括:第四获取模块1910、第二发送模块1919、第四接收模块1930以及第二处理模块1940。
现介绍本发明实施例的数据传输设备中第二客户端1900的各器件或组成的功能以及各部分间的连接关系。第二客户端1900中,第四获取模块1910获取本地运行的第二客户端1900的第二数据。第四获取模块1910获取到第二数据之后,由第二发送模块1919发送第二数据至第一客户端。
依据本发明实施例,能够将第二客户端1900的第二数据发送至第一客户端,实现了第一客户端与第二客户端1900之间进行数据传输,解决了现有技术提到的客户端间无法进行数据传输的问题,进一步解决因不同客户端间无法进行数据传输,新客户端启用时必须重新引入用户需求,从而导致资源浪费以及效率低下的问题。
第二客户端1900中的第四获取模块1910以及第二发送模块1919能够完成第二客户端1900的数据发送功能,而第四接收模块1930接收第一客户端的第一数据,并触发第二处理模块1940,由第二处理模块1940根据第一客户端的第一数据进行相应处理,以保证第一客户端与第二客户端1900之间实现信息共享,并能够在第二客户端1900上继续执行之前在第一客户端未执行结束的操作,例如继续进行网页内容阅读。
在本发明实施例中,第一客户端和/或第二客户端1900可以为任意相同类型的客户端,还可以为不同类型但执行相同功能的客户端,本发明实施例并不对此加以限定。此处的第一、第二仅用于区分不同的客户端,对于客户端本身属性、顺序以及功能并不造成限定,将第一、第二换位指代不同的客户端也可。
优选的,本发明实施例中,第一客户端和/或第二客户端1900为浏览器客户端。用户通常在浏览器客户端执行收藏网址、设置常用网页等个性化操作,当用户从一个终端转向另一个终端时,需要在另一个终端新启用新的客户端,根据本发明实施例,用户在曾经的客户端上设置的个性化操作可以被自动同步到新启用的客户端内, 无需用户重复操作。
同理,本发明实施例中,第二客户端1900接收的第一数据可以为用户在第一客户端内执行任何操作的数据,也可以是第一客户端更新的其他数据,存储在第一客户端的数据,等等,本发明实施例并不对此做任何限定。优选的,本发明实施例中,该数据可以包括第一客户端的收藏夹中收藏的各网址、第一客户端当前打开的网址、第一客户端的常用网址以及任意第一客户端根据用户指令调用的用户数据等。
另外,本发明实施例中,第二客户端1900根据接收到的第一数据所进行的处理可以为根据第一数据对第二客户端1900自身进行相应处理,也可以为对接收的第一数据进行处理。优选的,本发明实施例中,第二客户端1900根据第一数据进行的处理包括,第二客户端1900更新收藏夹,第二客户端1900更新常用网址以及第二客户端1900打开网址对应的网页等等。
图20示出了根据本发明一个实施例的数据传输系统的结构示意图。如图20所示,本发明实施例中的数据传输系统2000包括设置于第一终端的第一客户端2010、设置于移动终端的第二客户端2020、长连接分配服务器2030、长连接服务器2040以及与第一客户端对应的第一服务器2050。
现介绍本发明实施例的数据传输系统2000中的各器件或组成的功能以及各部分间的连接关系。第一客户端2010作为数据发送端时,获取自身的第一数据,并将第一数据以及自身的标识信息利用第一消息作为载体发送至第一服务器2050。第一服务器2050接收到第一消息之后,对第一消息进行合法性验证。优选的,本发明实施例中,第一服务器2050对第一消息中第一客户端2010的标识信息进行验证,确定第一客户端2010的标识信息是否为合法信息,例如验证该标识信息是否已在客户端中心注册,或者是该标识信息是否是服务器内部生成的标识符。若该标识信息经验证是合法信息,则第一服务器2050将该标识信息传输至长连接服务器2040,若该标识信息不是合法信息,则第一服务器2050拒绝将该标识信息发送至长连接服务器2040。
同样,第一服务器2050还可以对第一消息中除标识信息外的其他数据进行合法性验证,例如,验证第一客户端2010的网页数据等,是否为非恶意数据。本发明实施例中,恶意数据指对用户终端内的数据进行窃取、毁坏等非法行为的病毒、木马等等。若第一服务器2050验证第一客户端2010的数据是上述恶意数据,则第一服务器2050拒绝将该恶意数据传输至长连接服务器2040,若经第一服务器2050的验证,第一客户端2010的数据是非恶意数据,则第一服务器2050将该数据传输至长连接服务器2040。优选的,本发明实施例中,第一客户端2010传输的第一消息经合法性验证之后,第一服务器2050还可以对第一消息进行加密处理,更加有效地提高数据传输的安全性。通过第一服务器2050对第一消息进行安全性验证及处理,能够更加有效地保证传输数据的安全性,防止在数据传输的过程中,一些恶意网址等附加到传输的数据中,对用户的终端或者客户端造成损害。
第一服务器2050对第一消息进行合法性验证之后,将通过合法性验证的第一消息经过加密处理发送至长连接服务器2040。长连接服务器2040接收到第一消息,根据其中携带的标识信息在本地在线设备列表中查询与对应的第二客户端2020之间长连接的状态。若上述长连接的状态为连接,则长连接服务器2040发送第一数据至第二客户端2020。若上述长连接状态为断开,则在长连接服务器2040中存储第一数据,待与第二客户端2020之间长连接的状态恢复,再行发送。
第二客户端2020作为数据接收端,首先向长连接分配服务器2030请求对应长连接服务器2040的地址信息。第二客户端2020请求长连接服务器2040的地址信息的具体方式为,第二客户端2020发送携带有第一客户端2010标识信息的地址请求消息至长连接分配服务器2030。长连接分配服务器2030根据收到的地址请求消息中第一客户端2010的标识信息确定对应的长连接服务器2040,并返回给第二客户端2020响应消息。该响应消息中携带有长连接服务器2040的地址信息。第二客户端2020接收到上述响应消息之后,根据响应消息中携带的长连接服务器2040的地址信息,与对应的长连接服务器2040建立长连接,以便从长连接服务器2040处接收第一客户端2010的第一数据。
第二客户端2020接收到第一数据之后,根据第一数据做相应处理以保证第一客户端2010与第二客户端2020之间实现信息共享,并能够在第二客户端2020上继续执行之前在第一客户端2010未执行结束的操作,例如继续进行网页内容阅读。
依据本发明实施例,第一终端和移动终端建立连接之后,分别设置在两个终端的第一客户端2010与第二客户端2020之间能够进行数据的双向传输,解决了现有技术提到的客户端间无法进行数据传输的问题,进一步解决因不同客户端间无法进行数据传输,新客户端启用时必须重新引入用户需求,从而导致资源浪费以及效率低下的问题。
本发明实施例中,标识信息是客户端的身份认证信息,可以是由用户设置的身份认证信息,还可以是服务器为客户端设置的身份认证信息,本发明实施例并不对此加以限定。优选的,本发明实施例中,标识信息可以是第一客户端2010的用户登录的账户信息,该账户信息是用户在客户端中心申请注册的账户,账户信息的申请简单易行,并且每个账户信息可以在多个客户端进行登录。另外,本发明实施例中的标识信息也可以是服务器生成的一个能作为唯一标识的字符串,例如影子账户。影子账户可以是服务器根据时间、机器标识等信息生成的唯一标识,影子账户也可以是服务器随机生成的一个账户,服务器在生成这个账户之后,检查生成的这个影子账户是否已经存在,如果存在,则服务器重新生成一个影子账户,直到这个账户之前并不存在。影子账户具有不可重复性以及唯一性,每个影子账户仅能够标识一个客户端。
在本发明实施例中,第一客户端2010和/或第二客户端2020可以为浏览器客户端、安全卫士客户端、阅读器客户端、媒体播放器客户端等任意相同类型的客户端, 还可以为不同类型但执行相同功能的客户端,本发明实施例并不对此加以限定。此处的第一、第二仅用于区分不同的客户端,对于客户端本身属性、顺序以及功能并不造成限定,将第一、第二换位指代不同的客户端也可。
优选的,本发明实施例中,第一客户端2010和/或第二客户端2020为浏览器客户端。用户通常在浏览器客户端执行收藏网址、设置常用网页等个性化操作,当用户从一个终端转向另一个终端时,需要在另一个终端新启用新的客户端,根据本发明实施例,用户在曾经的客户端上设置的个性化操作可以被自动同步到新启用的客户端内,无需用户重复操作。
同理,本发明实施例中,第一数据可以为用户在第一客户端2010内执行任何操作的数据,也可以是第一客户端2010更新的其他数据,存储在第一客户端2010的数据,等等,本发明实施例并不对此做任何限定。优选的,本发明实施例中,该数据可以包括第一客户端2010的收藏夹中收藏的各网址、第一客户端2010当前打开的网址、第一客户端2010的常用网址以及任意第一客户端2010根据用户指令调用的用户数据等。另外,本发明实施例中,第二客户端2020根据接收到的第一数据所进行的处理可以为根据第一数据对第二客户端2020自身进行相应处理,也可以为对接收的第一数据进行处理。优选的,本发明实施例中,第二客户端2020根据第一数据进行的处理包括,第二客户端2020更新收藏夹,第二客户端2020更新常用网址以及第二客户端2020打开网址对应的网页等等。
本发明实施例中,第一客户端2010的任意数据均可以被发送至第二客户端2020,保证了用户在第一客户端2010中所进行的各种操作均可以被同步更新到第二客户端2020中,避免用户在新客户端执行重复操作,获取重复信息,进一步避免数据冗余以及资源的浪费。值得注意的是,与第一客户端对应的长连接服务器和与第二客户端对应的长连接服务器可以是相同的也可以是不同的服务器。
本发明实施例中,第一客户端2010与第二客户端2020之间可以进行双向数据传输,即,可以是第一客户端2010发送第一客户端2010的第一数据至第二客户端,也可以是第二客户端2020发送第二客户端2020的第二数据至第一客户端。上文介绍了数据传输系统2000中,第一客户端2010向第二客户端2020传输第一数据的具体过程,第二客户端2020向第一客户端2010传输第二数据的过程与其相似,再次不作赘述。
实施例四
为解决上述技术问题,本发明实施例还提供了又一种数据传输方法,应用于第一客户端与第二客户端之间已建立数据传输的通道的情况,即,第一客户端与第二客户端之间能够进行数据传输,本发明实施例旨在说明第一客户端与第二客户端之间进行数据传输的具体过程。
图21示出了根据本发明一个实施例的数据传输方法的处理流程图。如图21所示,该数据传输方法的处理流程起始于步骤S2102,将第一客户端中的数据及其标识 信息传输至第一服务器。第一服务器接收到第一客户端的数据及其标识信息之后,触发步骤S2104。
在步骤S2104中,第一服务器根据第一客户端的标识信息确定对应的长连接服务器,并将第一客户端中的数据及其标识信息转发至对应的长连接服务器。当长连接服务器接收到第一服务器发送的第一客户端的数据及其标识信息之后,执行步骤S2106,根据第二客户端与长连接服务器的长连接状态,确定是否将第一客户端的数据转发至第二客户端。
依据本发明实施例,第一客户端能够发送数据至第二客户端,实现了第一客户端向第二客户端进行数据传输,解决了现有技术提到的客户端间无法进行数据传输的问题,进一步解决因不同客户端间无法进行数据传输,新客户端启用时必须重新引入用户需求,从而导致资源浪费以及效率低下的问题。
为将本发明实施例阐述得更加清楚简洁,本发明实施例中,将第一客户端设置于第一终端,将第二客户端设置于第二终端。由图21所示的流程可知,在数据传输过程中,第一客户端中的数据传输至第二客户端需要经过服务器等路由转发。现对其第一客户端将第一客户端中的数据传输至第二客户端的传输过程进行具体说明。
首先,执行如图21所示的步骤S2102,第一客户端将第一客户端中的数据及其标识信息发送至第一服务器,此处的第一服务器为第一终端所对应的服务器。例如,若第一终端为PC,则第一服务器为PC服务器。其次,执行步骤S2104,第一服务器接收到第一客户端的数据之后,对第一客户端的数据进行合法性验证。优选的,本发明实施例中,第一服务器对上述数据中第一客户端的标识信息进行验证,确定第一客户端的标识信息是否为合法信息,例如验证该标识信息是否已在客户端中心注册,或者是该标识信息是否是服务器内部生成的标识符。若该标识信息经验证是合法信息,则第一服务器将该标识信息传输至长连接服务器,若该标识信息不是合法信息,则第一服务器拒绝将该标识信息发送至长连接服务器。
同样,第一服务器还可以对数据中除标识信息外的其他数据进行合法性验证,例如,验证第一客户端的网页数据等,是否为非恶意数据。本发明实施例中,恶意数据指对用户终端内的数据进行窃取、毁坏等非法行为的病毒、木马等等。若第一服务器验证第一客户端的数据是上述恶意数据,则第一服务器拒绝将该恶意数据传输至长连接服务器,若经第一服务器的验证,第一客户端的数据是非恶意数据,则第一服务器将该数据传输至长连接服务器。优选的,本发明实施例中,第一客户端的数据经合法性验证之后,第一服务器还可以对第一客户端的数据进行加密处理,更加有效地提高数据传输的安全性。通过第一服务器对第一客户端的数据进行安全性验证及处理,能够更加有效地保证传输数据的安全性,防止在数据传输的过程中,一些恶意网址等附加到传输的数据中,对用户的终端或者客户端造成损害。
第一服务器对第一客户端的数据进行合法性验证之后,将经过合法性验证的数据发送至对应的长连接服务器。第一服务器与长连接服务器可以通过多种协议进行 通信,例如,传输控制协议、用户数据报协议等。优选的,本发明实施例中,第一服务器与长连接服务器通过HTTP请求通信。HTTP支持多种服务器模式、简单快速,因此通过HTTP请求通知能够提高数据传输效率。
当长连接服务器接收到经第一服务器发送的第一客户端中的数据及其标识信息时,长连接服务器根据第一客户端的标识信息确定对应的第二客户端,并根据长连接服务器存储的在线设备列表中记录的信息确定与第二客户端之间长连接的状态。
长连接服务器中存储的在线设备列表记录与该长连接服务器保持长连接的各个客户端的标识信息。若某一个客户端与该长连接服务器之间的长连接断开,则在长连接服务器的在线设备列表中删除已断开的客户端对应的标识信息。本发明实施例中,长连接服务器中存储的在线设备列表能够实时更新,保证长连接服务器能够及时更新与其建立长连接的客户端的信息,避免因在线设备列表数据更新不及时导致向已断开的客户端发送数据,导致数据包丢失等恶性后果,提高数据传输的安全性。
长连接服务器确定是否发送第一客户端中的数据至第二客户端的具体方式为,若根据长连接服务器的在线设备列表,长连接服务器与第二客户端之间长连接的状态为连接,长连接服务器将第一客户端的数据发送至第二客户端。若根据长连接服务器的在线设备列表,长连接服务器与第二客户端之间此长连接的状态为断开,则在该长连接服务器中存储第一客户端的数据,然后,待该长连接的状态恢复之后,再将长连接服务器中存储的第一客户端的数据发送至第二客户端。
本发明实施例中,第一客户端与第二客户端之间已建立数据传输通道,能够进行数据传输,优选的,第一客户端向第二客户端发送数据时可以首先发送第一客户端的标识信息,以便数据发送过程中经过的服务器(如第一服务器、长连接服务器)等能够根据标识信息确认对应的数据接收端,其次第一客户端向第二客户端发送第一客户端中除标识信息外的其他数据,实现第一客户端向第二客户端传输数据的过程。
由上述可知,在数据传输过程中,第二客户端与长连接服务器建立长连接,以便从长连接服务器处接收第一客户端中的数据。现具体介绍第二客户端与长连接服务器建立长连接的过程。
第二客户端根据第二客户端的标识信息确定对应的长连接服务器,并向该长连接服务器发送连接建立请求,该连接建立请求中携带有第二客户端的标识信息。长连接服务器接收到第二客户端发送的连接建立请求之后,长连接服务器根据连接建立请求中携带的第二客户端的标识信息对第二客户端进行身份验证。优选的,本发明实施例中,长连接服务器还可以根据第二客户端的其他设备信息对第二客户端进行身份验证,以保证该第二客户端为接收第一客户端中的数据的接收端。第二客户端的其他设备信息可以是第二客户端的设备信息,还可以是第二终端的设备信息,优选的,本发明实施例中,其他设备信息包括第二终端的国际移动设备身份码(International Mobile Equipment Identity,以下简称IMEI号码)、第二终端的 设备名称以及第二终端的系统版本号。
在数据传输过程中,长连接服务器根据第二客户端的标识信息及其设备信息对第二客户端进行身份验证之后,若第二客户端未能通过身份验证,长连接服务器拒绝与其建立长连接,若第二客户端通过身份验证,则长连接服务器与第二客户端建立长连接。
第二客户端与长连接服务器成功建立长连接之后,第二客户端从长连接服务器处接收第一客户端中的数据,并根据第一客户端中的数据进行相应处理以保证第一客户端与第二客户端之间在已建立数据传输通道的情况下实现信息共享,并能够在第二客户端上继续执行之前在第一客户端未执行结束的操作,例如继续进行网页内容阅读。
本发明实施例中,标识信息是客户端的身份认证信息,可以是由用户设置的身份认证信息,还可以是服务器为客户端设置的身份认证信息,本发明实施例并不对此加以限定。优选的,本发明实施例中,标识信息可以是第一客户端的用户登录的账户信息,该账户信息是用户在客户端中心申请注册的账户,账户信息的申请简单易行,并且每个账户信息可以在多个客户端进行登录。
另外,本发明实施例中的标识信息也可以是服务器生成的一个能作为唯一标识的字符串,例如影子账户。影子账户可以是服务器根据时间、机器标识等信息生成的唯一标识,影子账户也可以是服务器随机生成的一个账户,服务器在生成这个账户之后,检查生成的这个影子账户是否已经存在,如果存在,则服务器重新生成一个影子账户,直到这个账户之前并不存在。影子账户具有不可重复性以及唯一性,每个影子账户仅能够标识一个客户端。
本发明实施例中,第一客户端的数据可以为用户在第一客户端内执行任何操作的数据,也可以是第一客户端更新的其他数据,存储在第一客户端的数据,等等,本发明实施例并不对此做任何限定。优选的,本发明实施例中,该数据可以包括第一客户端的收藏夹中收藏的各网址、第一客户端当前打开的网址、第一客户端的常用网址以及任意第一客户端根据用户指令调用的用户数据等。
第一客户端的任意数据均可以被发送至第二客户端,保证了用户在第一客户端中所进行的各种操作均可以被同步更新到第二客户端中,避免用户在新客户端执行重复操作,获取重复信息,进一步避免数据冗余以及资源的浪费。用户通常在浏览器客户端执行收藏网址、设置常用网页等个性化操作,当用户从一个终端转向另一个终端时,需要在另一个终端启用新的客户端,根据本发明实施例,用户在曾经的客户端上设置的个性化操作可以被自动同步到新启用的客户端内,无需用户重复操作。
在本发明实施例中,第一客户端和/或第二客户端可以为浏览器客户端、安全卫士客户端、阅读器客户端、媒体播放器客户端等任意相同类型的客户端,还可以为不同类型但执行相同功能的客户端,本发明实施例并不对此加以限定。此处的第一、 第二仅用于区分不同的客户端,对于客户端本身属性、顺序以及功能并不造成限定,将第一、第二换位指代不同的客户端也可。即,本发明实施例中,可以是设置于第一终端的第一客户端发送第一客户端的数据至设置于第二终端的第二客户端,还可以是设置于第二终端的第二客户端发送第二客户端的数据至设置于第一终端的第一客户端,实现客户端之间信息的相互传输。
本发明实施例中,除在前提到的不同终端间的客户端数据传输,还能够实现同一终端上不同客户端间的数据传输以及移动终端和终端间的客户端数据传输。因此,本发明实施例中,第一终端与第二终端可以是台式电脑、笔记本电脑等终端,还可以是手机、音乐播放器、平板电脑等移动终端。优选的,本发明实施例中,第一客户端和/或第二客户端设置于移动客户端,以便更加清楚简洁地阐述终端与移动终端间的客户端的数据传输。
基于上文各优选实施例提供的数据传输的方法,基于同一发明构思,本发明实施例提供了一种用于数据传输的客户端,用于实现上述数据传输的方法。
图22示出了根据本发明一个实施例的客户端的结构示意图。图22中示出了第一客户端2210与第二客户端2220之间的数据传输流程。其中,第一客户端与第二客户端的架构或组成或结构是相似的。为将本发明实施例阐述得更加清楚简洁,本发明实施例仅详细介绍第一客户端2210的结构,对于第二客户端2220的结构,本发明实施例不再赘述。另外,图22中的两个客户端仅用于示意不同的客户端间能够进行数据传输,对于两个客户端间的传输过程、传输路径以及传输的数据等参数并不造成限定。
参加图22,第一客户端2210中至少包括:第二数据获取器2211、数据传输器2212以及第二数据接收器2213。现介绍第一客户端2210的各器件或组成的功能以及各部分间的连接关系。第一客户端2210中的第二数据获取器2211获取第一客户端2210中的数据及其标识信息。第二数据获取器2211获取到第一客户端2210中的数据及其标识信息之后,触发数据传输器2212。数据传输器2212将第一客户端2210中的数据及其标识信息传输至第一服务器,由第一服务器经长连接服务器传输至对应的第二客户端2220。
依据本发明实施例,第一客户端2210能够发送数据至第二客户端2220,实现了第一客户端2210向第二客户端2220进行数据传输,解决了现有技术提到的客户端间无法进行数据传输的问题,进一步解决因不同客户端间无法进行数据传输,新客户端启用时必须重新引入用户需求,从而导致资源浪费以及效率低下的问题。
具体地,第一客户端2210中的第二数据获取器2211获取第一客户端2210中的数据及其标识信息。第二数据获取器2211获取到第一客户端2210中的数据及其标识信息之后,触发数据传输器2212。数据传输器2212经触发,将第一客户端2210中的数据及其标识信息发送至第一服务器,此处的第一服务器为第一终端所对应的服务器。例如,若第一终端为PC,则第一服务器为PC服务器。
第一服务器接收到第一客户端2210的数据之后,对第一客户端2210的数据进行合法性验证。优选的,本发明实施例中,第一服务器对第一客户端2210的标识信息进行验证,确定第一客户端2210的标识信息是否为合法信息,例如验证该标识信息是否已在客户端中心注册,或者是该标识信息是否是服务器内部生成的标识符。若该标识信息经验证是合法信息,则第一服务器将该标识信息传输至长连接服务器,若该标识信息不是合法信息,则第一服务器拒绝将该标识信息发送至长连接服务器。
同样,第一服务器还可以对除标识信息外的其他数据进行合法性验证,例如,验证第一客户端2210的网页数据等,是否为非恶意数据。本发明实施例中,恶意数据指对用户终端内的数据进行窃取、毁坏等非法行为的病毒、木马等等。若第一服务器验证第一客户端2210的数据是上述恶意数据,则第一服务器拒绝将该恶意数据传输至长连接服务器,若经第一服务器的验证,第一客户端2210的数据是非恶意数据,则第一服务器将该数据传输至长连接服务器。优选的,本发明实施例中,第一客户端2210的数据经合法性验证之后,第一服务器还可以对第一客户端2210的数据进行加密处理,更加有效地提高数据传输的安全性。通过第一服务器对第一客户端2210的数据进行安全性验证及处理,能够更加有效地保证传输数据的安全性,防止在数据传输的过程中,一些恶意网址等附加到传输的数据中,对用户的终端或者客户端造成损害。
第一服务器对第一客户端2210的数据进行合法性验证之后,将经过合法性验证的数据发送至对应的长连接服务器。第一服务器与长连接服务器可以通过多种协议进行通信,例如,传输控制协议、用户数据报协议等。优选的,本发明实施例中,第一服务器与长连接服务器通过HTTP请求通信。HTTP支持多种服务器模式、简单快速,因此通过HTTP请求通知能够提高数据传输效率。
当长连接服务器接收到经第一服务器发送的第一客户端2210中的数据及其标识信息时,长连接服务器根据第一客户端2210的标识信息确定对应的第二客户端2220,并根据长连接服务器存储的在线设备列表中记录的信息确定与第二客户端2220之间长连接的状态。
长连接服务器中存储的在线设备列表记录与该长连接服务器保持长连接的各个客户端的标识信息。若某一个客户端与该长连接服务器之间的长连接断开,则在长连接服务器的在线设备列表中删除已断开的客户端对应的标识信息。本发明实施例中,长连接服务器中存储的在线设备列表能够实时更新,保证长连接服务器能够及时更新与其建立长连接的客户端的信息,避免因在线设备列表数据更新不及时导致向已断开的客户端发送数据,导致数据包丢失等恶性后果,提高数据传输的安全性。
长连接服务器确定是否发送第一客户端2210中的数据至第二客户端2220的具体方式为,若根据长连接服务器的在线设备列表,长连接服务器与第二客户端2220之间长连接的状态为连接,长连接服务器将第一客户端2210的数据发送至第二客户端2220。若根据长连接服务器的在线设备列表,长连接服务器与第二客户端2220之 间此长连接的状态为断开,则在该长连接服务器中存储第一客户端2210的数据,然后,待该长连接的状态恢复之后,再将长连接服务器中存储的第一客户端2210的数据发送至第二客户端2220。
另外,第一客户端2210中第二数据接收器2213能够接收经长连接服务器转发的、来自第二客户端2220中的数据。当与第一客户端2210对应的长连接服务器接收到第二客户端2220中的数据之后,根据在线设备列表查询与第一客户端2210之间长连接的状态。当该长连接服务器与第一客户端2210之间长连接的状态为连接时,长连接服务器发送第二客户端2220中的数据至第一客户端2210。第一客户端2210中的第二数据接收器2213接收长连接服务器发送的第二客户端2220中的数据。当该长连接服务器与第一客户端2210之间长连接的状态为断开时,长连接服务器存储第二客户端2220中的数据,待与第一客户端2210之间长连接的状态恢复之后,发送第二客户端2220中的数据至第一客户端2210。
本发明实施例中,标识信息是客户端的身份认证信息,可以是由用户设置的身份认证信息,还可以是服务器为客户端设置的身份认证信息,本发明实施例并不对此加以限定。优选的,本发明实施例中,标识信息可以是第一客户端2210的用户登录的账户信息,该账户信息是用户在客户端中心申请注册的账户,账户信息的申请简单易行,并且每个账户信息可以在多个客户端进行登录。
另外,本发明实施例中的标识信息也可以是服务器生成的一个能作为唯一标识的字符串,例如影子账户。影子账户可以是服务器根据时间、机器标识等信息生成的唯一标识,影子账户也可以是服务器随机生成的一个账户,服务器在生成这个账户之后,检查生成的这个影子账户是否已经存在,如果存在,则服务器重新生成一个影子账户,直到这个账户之前并不存在。影子账户具有不可重复性以及唯一性,每个影子账户仅能够标识一个客户端。
优选的,本发明实施例中,第一客户端2210的数据可以为用户在第一客户端2210内执行任何操作的数据,也可以是第一客户端2210更新的其他数据,存储在第一客户端2210的数据,等等,本发明实施例并不对此做任何限定。优选的,本发明实施例中,该数据可以包括第一客户端2210的收藏夹中收藏的各网址、第一客户端2210当前打开的网址、第一客户端2210的常用网址以及任意第一客户端2210根据用户指令调用的用户数据等。
第一客户端2210的任意数据均可以被发送至第二客户端2220,保证了用户在第一客户端2210中所进行的各种操作均可以被同步更新到第二客户端2220中,避免用户在新客户端执行重复操作,获取重复信息,进一步避免数据冗余以及资源的浪费。用户通常在浏览器客户端执行收藏网址、设置常用网页等个性化操作,当用户从一个终端转向另一个终端时,需要在另一个终端启用新的客户端,根据本发明实施例,用户在曾经的客户端上设置的个性化操作可以被自动同步到新启用的客户端内,无需用户重复操作。
本发明实施例中,除在前提到的不同终端间的客户端数据传输,还能够实现同一终端上不同客户端间的数据传输以及移动终端和终端间的客户端数据传输。因此,本发明实施例中,第一终端与第二终端可以是台式电脑、笔记本电脑等终端,还可以是手机、音乐播放器、平板电脑等移动终端。优选的,本发明实施例中,第一客户端2210和/或第二客户端2220设置于移动终端,以便更加清楚简洁地阐述终端与移动终端间的客户端的数据传输。
实施例4.1
图23示出了根据本发明一个优选实施例的数据传输方法流程图,用于支持上述实施例四所提供的数据传输方法及数据传输设备,将上述数据传输方法及数据传输设备阐述得更清楚简洁。如图23所示,本例中选择PC作为第一终端,手机为第二终端,客户端为浏览器客户端。为方便辨识第一客户端与第二客户端,在本例中,第一客户端被称为PC浏览器,第二客户端被称为手机浏览器,标识信息为唯一ID。另外,本优选实施例重点描述PC浏览器如何向手机浏览器发送数据的过程。
如图23所示,本优选实施例的步骤起始于步骤1,手机浏览器与长连接服务器建立长连接。具体方式为,手机浏览器根据自身的标识信息确定对应的长连接服务器,并向该长连接服务器发送连接建立请求,该连接建立请求中携带有手机浏览器的标识信息。长连接服务器接收到手机浏览器发送的连接建立请求之后,长连接服务器根据连接建立请求中携带的手机浏览器的标识信息对手机浏览器进行身份验证。优选的,本发明实施例中,长连接服务器还可以根据手机浏览器的其他设备信息对手机浏览器进行身份验证,以保证该手机浏览器为接收PC浏览器中的数据的接收端。手机浏览器的其他设备信息可以是手机浏览器的信息,还可以是第二终端的信息,优选的,本发明实施例中,其他设备信息包括第二终端的IMEI号码、第二终端的设备名称以及第二终端的系统版本号。
长连接服务器根据手机浏览器的标识信息及其设备信息对手机浏览器进行身份验证之后,若手机浏览器未能通过身份验证,长连接服务器拒绝与其建立长连接,若手机浏览器通过身份验证,则长连接服务器与手机浏览器建立长连接。
手机浏览器与长连接服务器成功建立长连接之后,手机浏览器从长连接服务器处接收PC浏览器中的数据,并根据PC浏览器中的数据进行相应处理以保证PC浏览器与手机浏览器之间实现信息共享,并能够在手机浏览器上继续执行之前在PC浏览器未执行结束的操作,例如继续进行网页内容阅读。
PC浏览器中的数据由PC浏览器经PC服务器以及长连接服务器发送至手机浏览器,现介绍PC浏览器经PC服务器发送PC浏览器中的数据至长连接服务器的过程。
如图23中的步骤2所述,PC浏览器发送PC浏览器中的数据及唯一ID至PC服务器。PC服务器接收到PC浏览器的数据之后,对PC浏览器的数据进行合法性验证。优选的,本发明实施例中,PC服务器对上述数据中PC浏览器的唯一ID进行验证,确定PC浏览器的唯一ID是否为合法信息,例如验证唯一ID是否已在客户端中心注 册,或者是唯一ID是否是服务器内部生成的标识符。若唯一ID经验证是合法信息,则PC服务器将唯一ID传输至长连接服务器,若唯一ID不是合法信息,则PC服务器拒绝将唯一ID发送至长连接服务器。
同样,PC服务器还可以对PC浏览器中的数据进行合法性验证,例如,验证PC浏览器的网页数据等,是否为非恶意数据。本发明实施例中,恶意数据指对用户终端内的数据进行窃取、毁坏等非法行为的病毒、木马等等。若PC服务器验证PC浏览器的数据是上述恶意数据,则PC服务器拒绝将该恶意数据传输至长连接服务器,若经PC服务器的验证,PC浏览器的数据是非恶意数据,则PC服务器将该数据传输至长连接服务器。优选的,本发明实施例中,PC浏览器的数据经合法性验证之后,PC服务器还可以对PC浏览器的数据进行加密处理,更加有效地提高数据传输的安全性。通过PC服务器对PC浏览器的数据进行安全性验证及处理,能够更加有效地保证传输数据的安全性,防止在数据传输的过程中,一些恶意网址等附加到传输的数据中,对用户的终端或者客户端造成损害。
PC服务器对PC浏览器的数据进行合法性验证之后,执行如图23中的步骤3,将经过合法性验证的唯一ID及PC浏览器中的数据转发至对应的长连接服务器。
长连接服务器接收到经PC服务器发送的PC浏览器中的数据及唯一ID时,长连接服务器根据PC浏览器的唯一ID确定对应的手机浏览器,并根据长连接服务器存储的在线设备列表中记录的信息确定与手机浏览器之间长连接的状态。
长连接服务器中存储的在线设备列表记录与该长连接服务器保持长连接的各个浏览器的唯一ID。若某一个浏览器与该长连接服务器之间的长连接断开,则在长连接服务器的在线设备列表中删除已断开的浏览器对应的唯一ID。本发明实施例中,长连接服务器中存储的在线设备列表能够实时更新,保证长连接服务器能够及时更新与其建立长连接的浏览器的信息,避免因在线设备列表数据更新不及时导致向已断开的浏览器发送数据,导致数据包丢失等恶性后果,提高数据传输的安全性。
如图23中步骤4所示,长连接服务器根据与手机浏览器之间长连接的状态确定是否发送PC浏览器中的数据至手机浏览器。长连接服务器确定是否发送PC浏览器中的数据至手机浏览器的具体方式为,若根据长连接服务器的在线设备列表,长连接服务器与手机浏览器之间长连接的状态为连接,长连接服务器将PC浏览器中的数据发送至手机浏览器。若根据长连接服务器的在线设备列表,长连接服务器与手机浏览器之间此长连接的状态为断开,则在该长连接服务器中存储PC浏览器中的数据,然后,待该长连接的状态恢复之后,再将长连接服务器中存储的PC浏览器中的数据发送至手机浏览器。
实施例4.2
图24示出了根据本发明另一个优选实施例的数据传输方法流程图,用于支持上述任意一个数据传输方法及数据传输设备,将上述数据传输方法及数据传输设备阐述得更清楚简洁。如图24所示,本例中选择PC作为第一终端,手机为第二终端, 客户端为浏览器客户端。为方便辨识第一客户端与第二客户端,在本例中,第一客户端被称为PC浏览器,第二客户端被称为手机浏览器,标识信息为唯一ID。另外,本优选实施例重点描述手机浏览器如何向PC浏览器发送数据的过程。
如图24所示,本优选实施例的步骤起始于步骤1,PC浏览器与长连接服务器建立长连接。具体方式为,PC浏览器根据唯一ID确定对应的长连接服务器,并向该长连接服务器发送连接建立请求,该连接建立请求中携带有PC浏览器的唯一ID。长连接服务器接收到PC浏览器发送的连接建立请求之后,长连接服务器根据连接建立请求中携带的PC浏览器的唯一ID对PC浏览器进行身份验证。优选的,本发明实施例中,长连接服务器还可以根据PC浏览器的其他设备信息对PC浏览器进行身份验证,以保证该PC浏览器为接收手机浏览器中的数据的接收端。PC浏览器的其他设备信息可以是PC浏览器的设备信息,还可以是第一终端的设备信息,优选的,本发明实施例中,其他设备信息包括第一终端的设备名称以及第一终端的系统版本号等。
长连接服务器根据PC浏览器的唯一ID及其设备信息对PC浏览器进行身份验证之后,若PC浏览器未能通过身份验证,长连接服务器拒绝与其建立长连接,若PC浏览器通过身份验证,则长连接服务器与PC浏览器建立长连接。
PC浏览器与长连接服务器成功建立长连接之后,PC浏览器从长连接服务器处接收手机浏览器中的数据,并根据手机浏览器中的数据进行相应处理以保证手机浏览器与PC浏览器之间实现信息共享,并能够在PC浏览器上继续执行之前在手机浏览器未执行结束的操作,例如继续进行网页内容阅读。
手机浏览器中的数据由手机浏览器经PC服务器以及长连接服务器发送至PC浏览器,现介绍手机浏览器经PC服务器发送手机浏览器中的数据至长连接服务器的过程。
如图24中的步骤2所示,手机浏览器发送手机浏览器中的数据及唯一ID至PC服务器。PC服务器接收到手机浏览器的数据及唯一ID之后,对手机浏览器的数据及唯一ID进行合法性验证。优选的,本发明实施例中,PC服务器对上述数据中手机浏览器的唯一ID进行验证,确定手机浏览器的唯一ID是否为合法信息,例如验证唯一ID是否已在客户端中心注册,或者是唯一ID是否是服务器内部生成的标识符。若唯一ID经验证是合法信息,则PC服务器将唯一ID传输至长连接服务器,若唯一ID不是合法信息,则PC服务器拒绝将唯一ID发送至长连接服务器。
同样,PC服务器还可以对手机浏览器中的数据进行合法性验证,例如,验证手机浏览器的网页数据等,是否为非恶意数据。本发明实施例中,恶意数据指对用户终端内的数据进行窃取、毁坏等非法行为的病毒、木马等等。若PC服务器验证手机浏览器的数据是上述恶意数据,则PC服务器拒绝将该恶意数据传输至长连接服务器,若经PC服务器的验证,手机浏览器的数据是非恶意数据,则PC服务器将该数据传输至长连接服务器。优选的,本发明实施例中,手机浏览器的数据经合法性验证之后,PC服务器还可以对手机浏览器的数据进行加密处理,更加有效地提高数据传输 的安全性。通过PC服务器对手机浏览器的数据进行安全性验证及处理,能够更加有效地保证传输数据的安全性,防止在数据传输的过程中,一些恶意网址等附加到传输的数据中,对用户的终端或者客户端造成损害。
PC服务器对手机浏览器的数据进行合法性验证之后,执行如图24中的步骤3,将经过合法性验证的唯一ID及手机浏览器中的数据转发至对应的长连接服务器。
长连接服务器接收到经PC服务器发送的手机浏览器中的数据及唯一ID时,长连接服务器根据手机浏览器的唯一ID确定对应的PC浏览器,并根据长连接服务器存储的在线设备列表中记录的信息确定与PC浏览器之间长连接的状态。
长连接服务器中存储的在线设备列表记录与该长连接服务器保持长连接的各个浏览器的唯一ID。若某一个浏览器与该长连接服务器之间的长连接断开,则在长连接服务器的在线设备列表中删除已断开的浏览器对应的唯一ID。本发明实施例中,长连接服务器中存储的在线设备列表能够实时更新,保证长连接服务器能够及时更新与其建立长连接的浏览器的信息,避免因在线设备列表数据更新不及时导致向已断开的浏览器发送数据,导致数据包丢失等恶性后果,提高数据传输的安全性。
如图24中步骤4所示,长连接服务器根据与PC浏览器之间长连接的状态确定是否发送手机浏览器中的数据至PC浏览器。长连接服务器确定是否发送手机浏览器中的数据至PC浏览器的具体方式为,若根据长连接服务器的在线设备列表,长连接服务器与PC浏览器之间长连接的状态为连接,长连接服务器将手机浏览器中的数据发送至PC浏览器。若根据长连接服务器的在线设备列表,长连接服务器与PC浏览器之间此长连接的状态为断开,则在该长连接服务器中存储手机浏览器中的数据,然后,待该长连接的状态恢复之后,再将长连接服务器中存储的手机浏览器中的数据发送至PC浏览器。
基于实施例四提供的数据传输的方法及设备,基于同一发明构思,本发明实施例提供了一种数据传输系统。图25示出了根据本发明一个实施例的数据传输系统的结构示意图。参见图25,本发明实施例中的数据传输系统2500至少包括第一服务器2510、第一客户端2520、第二客户端2530以及长连接服务器2540。
为将本发明实施例阐述得更加清楚简洁,本发明实施例中,将第一客户端2520设置于第一终端,将第二客户端2530设置于第二终端。现介绍本发明实施例的数据传输系统中各器件或组成的功能以及各部分间的连接关系。数据传输系统2500中,第一客户端2520中的第二数据获取器2521获取第一客户端2520中的数据及其标识信息,并触发数据传输器2522。数据传输器2522经触发将第一客户端2520中的数据及其标识信息传输至第一服务器2510。
第一服务器2510接收到第一客户端2520的数据及其标识信息之后,对第一客户端2520的数据及其标识信息进行合法性验证。优选的,本发明实施例中,第一服务器2510对第一客户端2520的标识信息进行验证,确定第一客户端2520的标识信息是否为合法信息,例如验证该标识信息是否已在客户端中心注册,或者是该标识 信息是否是服务器内部生成的标识符。若该标识信息经验证是合法信息,则第一服务器2510将该标识信息传输至长连接服务器2540,若该标识信息不是合法信息,则第一服务器2510拒绝将该标识信息发送至长连接服务器2540。
同样,第一服务器2510还可以对除标识信息外的其他数据进行合法性验证,例如,验证第一客户端2520的网页数据等,是否为非恶意数据。本发明实施例中,恶意数据指对用户终端内的数据进行窃取、毁坏等非法行为的病毒、木马等等。若第一服务器2510验证第一客户端2520的数据是上述恶意数据,则第一服务器2510拒绝将该恶意数据传输至长连接服务器2540,若经第一服务器2510的验证,第一客户端2520的数据是非恶意数据,则第一服务器2510将该数据传输至长连接服务器2540。
优选的,本发明实施例中,第一客户端2520的数据经合法性验证之后,第一服务器2510还可以对第一客户端2520的数据进行加密处理,更加有效地提高数据传输的安全性。通过第一服务器2510对第一客户端2520的数据进行安全性验证及处理,能够更加有效地保证传输数据的安全性,防止在数据传输的过程中,一些恶意网址等附加到传输的数据中,对用户的终端或者客户端造成损害。
第一服务器2510对第一客户端2520的数据及其标识信息进行合法性验证之后,将经过合法性验证的数据及第一客户端2520的标识信息发送至对应的长连接服务器2540。第一服务器2510与长连接服务器2540可以通过多种协议进行通信,例如,传输控制协议、用户数据报协议等。优选的,本发明实施例中,第一服务器2510与长连接服务器2540通过HTTP请求通信。HTTP支持多种服务器模式、简单快速,因此通过HTTP请求通知能够提高数据传输效率。
当长连接服务器2540接收到经第一服务器2510发送的第一客户端2520中的数据及其标识信息时,长连接服务器2540根据第一客户端2520的标识信息确定对应的第二客户端2530,并根据长连接服务器2540存储的在线设备列表中记录的信息确定与第二客户端2530之间长连接的状态。
长连接服务器2540中存储的在线设备列表记录与该长连接服务器2540保持长连接的各个客户端的标识信息。若某一个客户端与该长连接服务器2540之间的长连接断开,则在长连接服务器2540的在线设备列表中删除已断开的客户端对应的标识信息。本发明实施例中,长连接服务器2540中存储的在线设备列表能够实时更新,保证长连接服务器2540能够及时更新与其建立长连接的客户端的信息,避免因在线设备列表数据更新不及时导致向已断开的客户端发送数据,导致数据包丢失等恶性后果,提高数据传输的安全性。
长连接服务器2540确定是否发送第一客户端2520中的数据至第二客户端2530的具体方式为,若根据长连接服务器2540的在线设备列表,长连接服务器2540与第二客户端2530之间长连接的状态为连接,长连接服务器2540将第一客户端2520的数据发送至第二客户端2530。若根据长连接服务器2540的在线设备列表,长连接 服务器2540与第二客户端2530之间此长连接的状态为断开,则在该长连接服务器2540中存储第一客户端2520的数据,然后,待该长连接的状态恢复之后,再将长连接服务器2540中存储的第一客户端2520的数据发送至第二客户端2530。
由上述可知,第二客户端2530从长连接服务器2540处接收第一客户端2520中的数据之前,需要与长连接服务器2540建立长连接。同理,第一客户端2520从长连接服务器2540处接收第二客户端2530中的数据之前,同样需要与长连接服务器2540建立长连接。这里需要注意,与第一客户端对应的长连接服务器和与第二客户端对应的长连接服务器可以是相同的也可以是不同的服务器,在图25中都用2540来表示。
本发明实施例上述部分以第一客户端为数据发送端的角度出发进行描述。考虑到本发明实施例的数据传输过程中是一个双向传输的过程,第一客户端在作为数据发送端的同时,也可以作为数据接收端存在。下文以第一客户端作为数据接收端的角度出发,进行详细阐述。
现具体介绍第一客户端2520与长连接服务器2540建立长连接的过程。
第一客户端2520根据第一客户端2520的标识信息确定对应的长连接服务器2540,并向该长连接服务器2540发送连接建立请求,该连接建立请求中携带有第一客户端2520的标识信息。长连接服务器2540接收到第一客户端2520发送的连接建立请求之后,长连接服务器2540根据连接建立请求中携带的第一客户端2520的标识信息对第一客户端2520进行身份验证。优选的,本发明实施例中,长连接服务器2540还可以根据第一客户端2520的其他设备信息对第一客户端2520进行身份验证,以保证该第一客户端2520为接收第二客户端2530中的数据接收端。第一客户端2520的其他设备信息可以是第一客户端2520的设备信息,还可以是第一终端的设备信息,优选的,本发明实施例中,其他设备信息包括第一终端的IMEI号码、第一终端的设备名称以及第一终端的系统版本号。
长连接服务器2540根据第一客户端2520的标识信息及其设备信息对第一客户端2520进行身份验证之后,若第一客户端2520未能通过身份验证,长连接服务器2540拒绝与其建立长连接,若第一客户端2520通过身份验证,则长连接服务器2540与第一客户端2520建立长连接。
第一客户端2520与长连接服务器2540成功建立长连接之后,第一客户端2520利用第二数据接收器2523从长连接服务器2540处接收第二客户端2530中的数据,并根据第二客户端2530中的数据进行相应处理以保证第一客户端2520与第二客户端2530之间实现信息共享,并能够在第一客户端2520上继续执行之前在第二客户端2530未执行结束的操作,例如继续进行网页内容阅读。
依据本发明实施例,第一客户端2520能够发送数据至第二客户端2530,实现了第一客户端2520向第二客户端2530进行数据传输,解决了现有技术提到的客户端间无法进行数据传输的问题,进一步解决因不同客户端间无法进行数据传输,新 客户端启用时必须重新引入用户需求,从而导致资源浪费以及效率低下的问题。
根据上述任意一个优选实施例或多个优选实施例的组合,本发明实施例能够达到如下有益效果:
依据本发明实施例,第一客户端能够发送数据至第二客户端,实现了第一客户端向第二客户端进行数据传输,解决了现有技术提到的客户端间无法进行数据传输的问题,进一步解决因不同客户端间无法进行数据传输,新客户端启用时必须重新引入用户需求,从而导致资源浪费以及效率低下的问题。
实施例五
为解决上述技术问题,本发明实施例提供了又一种数据传输的方法,应用于第一客户端与第二客户端在无线下进行数据传输的情况。图26示出了根据本发明一个实施例的数据传输方法的处理流程图。参见图26,首先执行S2602,发送第一客户端中的数据至长连接服务器。长连接服务器接收到第一客户端中的数据之后,执行步骤S2604,根据该长连接服务器与第二客户端之间长连接的状态,确定是否将第一客户端的数据发送至第二客户端。
依据本发明实施例,第一客户端能够发送数据至第二客户端,实现了第一客户端向第二客户端进行数据传输,解决了现有技术提到的客户端间无法进行数据传输的问题,进一步解决因不同客户端间无法进行数据传输,新客户端启用时必须重新引入用户需求,从而导致资源浪费以及效率低下的问题。
具体的,第二客户端根据自身的标识信息通过长连接分配服务器确认对应的长连接服务器。第二客户端首先向长连接分配服务器发送携带有自身标识信息的地址请求消息。长连接分配服务器收到上述地址请求消息之后,根据该地址请求消息中第二客户端的标识信息确认第二客户端对应的长连接服务器。然后返回给第二客户端一个响应消息,该响应消息中携带有至少一条长连接服务器的地址信息。
当响应消息中携带的地址信息为至少两条时,第二客户端在至少两条地址信息中任选一条,并根据选择的地址信息确定对应的长连接服务器,然后与该长连接服务器建立长连接。若此长连接建立失败,第二客户端在响应消息携带的剩余地址信息中重新选择一条地址信息,并与该地址信息对应的长连接服务器建立长连接。
若第二客户端与根据响应消息携带的长连接服务器的地址信息仍然无法成功建立长连接,第二客户端重复执行在响应消息携带的剩余地址信息中任意选择的操作,并且重复执行与选择的地址信息对应的长连接服务器建立长连接的操作,直至第二客户端与对应的长连接服务器成功建立长连接。
若第二客户端与此次长连接分配服务器返回的响应消息中携带的任意一条地址信息对应的长连接服务器均无法成功建立长连接,第二客户端重新发送地址请求消息至长连接分配服务器,然后根据长连接分配服务器再次返回的长连接服务器的地址信息与对应的长连接服务器建立长连接。
当第二客户端与对应的长连接服务器成功建立长连接之后,第二客户端每隔设 定的时间向上述长连接服务器发送网络连通检测消息。优选的,本发明实施例中,上述网络连通消息为分组因特网探索器(Packet Internet Groper,以下简称Ping)消息。Ping消息是目前被广泛使用的、用于检测网络连通的消息,该Ping消息能够快速高效地进行网络连通检测,因此,本发明实施例中优选Ping消息作为检测网络连通时发送的检测消息。
另外,对第二客户端向长连接服务器持续发送网络连通检测消息进行监测,若监测到第二客户端发送网络连通检测消息超时或者发送失败,则断开第二客户端与对应的长连接服务器之间的长连接。断开此长连接之后,第二客户端重新选择长连接服务器的地址信息,并根据重新选择的长连接服务器的地址信息与对应的长连接服务器建立长连接。通过向长连接服务器每隔预设时间发送网络连通检测消息,第二客户端能够及时监控第二客户端与长连接服务器之间长连接的状态,以便能够及时确定是否继续从长连接服务器处接收消息。
在长连接服务器一侧,设置一个预定时长,然后对长连接服务器接收网络连通检测消息的时间间隔进行计时,当计时的时间间隔超过预定时长,则长连接服务器断开与第二客户端之间的长连接。
长连接服务器中存储有在线设备列表,该列表记录与该长连接服务器保持长连接的各个客户端的标识信息。若某一个客户端与该长连接服务器之间的长连接断开,则在长连接服务器的在线设备列表中删除已断开的客户端对应的标识信息。本发明实施例中,长连接服务器中存储的在线设备列表能够实时更新,保证长连接服务器能够及时更新与其建立长连接的客户端的信息,避免因在线设备列表数据更新不及时导致向已断开的客户端发送数据,导致数据包丢失等恶性后果,提高数据传输的安全性。
当长连接服务器接收到第一客户端的数据时,长连接服务器根据第一客户端的数据中携带的标识信息确定对应的第二客户端,并根据在线设备列表中记录的信息确定与第二客户端之间长连接的状态。若此长连接的状态为连接,长连接服务器将第一客户端的数据发送至第二客户端。若此长连接的状态为断开,则在该长连接服务器中存储第一客户端的数据,然后,待该长连接的状态恢复之后,再将长连接服务器中存储的第一客户端的数据发送至第二客户端。
本发明实施例中,第一客户端和/或第二客户端可以设置于任何终端,本发明实施例并不对此加以限定。另外,本发明实施例中,除在前提到的不同终端间的客户端数据传输,还能够实现移动终端和终端间的客户端数据传输。因此,本发明实施例中,第一客户端和/或第二客户端可以设置于终端,例如,台式电脑、笔记本电脑等,还可以设置于移动终端,例如,手机、音乐播放器、平板电脑等。优选的,本发明实施例中,第一客户端和/或第二客户端设置于移动终端,以便更加清楚简洁地阐述不同终端间的客户端的数据传输。
在本发明实施例中,第一客户端和/或第二客户端可以为浏览器客户端、安全卫 士客户端、阅读器客户端、媒体播放器客户端等任意相同类型的客户端,还可以为不同类型但执行相同功能的客户端,本发明实施例并不对此加以限定。此处的第一、第二仅用于区分不同的客户端,对于客户端本身属性、顺序以及功能并不造成限定,将第一、第二换位指代不同的客户端也可。即,本发明实施例中,可以是第一客户端发送第一客户端的数据至第二客户端,还可以是第二客户端发送第二客户端的数据至第一客户端,实现客户端之间信息的相互传输。
优选的,本发明实施例中,第一客户端和/或第二客户端为浏览器客户端。用户通常在浏览器客户端执行收藏网址、设置常用网页等个性化操作,当用户从一个设备转向另一个设备时,需要在另一个设备新启用新的客户端,根据本发明实施例,用户在曾经的客户端上设置的个性化操作可以被自动同步到新启用的客户端内,无需用户重复操作,所以,采用浏览器客户端为本发明的优选实施例可以更加清楚地展示出本发明的过程以及有益效果。
另外,本发明实施例中,第一客户端与第二客户端通过有线网络和/或无线网络进行数据传输,其中,有线网络包括数据线,无线网络包括蓝牙、wifi、局域网等。
基于实施例五提供的数据传输的方法,基于同一发明构思,本发明实施例提供了一种装置,用于实现上述数据传输的方法。
图27示出了根据本发明一个实施例的数据传输设备的结构示意图。参见图27,本发明实施例的数据传输设备2700至少包括:信息获取器2710、第二连接建立器2720、第三数据发送器2730、第三数据接收器2740以及监测器2750。为将本发明实施例阐述得更加清楚简洁,以下将数据传输设备2700简称为本客户端2700。
现介绍本发明实施例的本客户端2700的各器件或组成的功能以及各部分间的连接关系。本客户端2700中,第二连接建立器2720与对应的长连接服务器建立长连接,然后由第三数据接收器2740接收其他客户端经与本客户端2700相对应的长连接服务器发送的其他客户端中的数据。另外,本客户端2700中的第三数据发送器2730发送本客户端2700中的数据至其他客户端。
依据本发明实施例,第一客户端能够发送数据至第二客户端,实现了第一客户端向第二客户端进行数据传输,解决了现有技术提到的客户端间无法进行数据传输的问题,进一步解决因不同客户端间无法进行数据传输,新客户端启用时必须重新引入用户需求,从而导致资源浪费以及效率低下的问题。
具体的,本客户端2700中的信息获取器2710根据自身的标识信息获取对应的长连接服务器的地址信息。信息获取器2710中的地址请求模块2711向长连接分配服务器发送携带有本客户端2700标识信息的地址请求消息。长连接分配服务器接收到该地址请求消息之后,根据该请求消息中携带的本客户端2700的标识信息确定与本客户端2700对应的长连接服务器,然后返回给信息获取器2710响应消息。该响应消息中携带有至少一条长连接服务器的地址信息。然后信息获取器2710中的地址接收模块2712接收长连接分配服务器返回的地址消息。
接收到对应长连接服务器的地址消息之后,第二连接建立器2720根据返回的长连接服务器的地址消息与对应的长连接服务器建立长连接。当长连接分配服务器返回的响应消息中携带的地址信息为至少两条时,第二连接建立器2720在至少两条地址信息中任选一条,然后根据选择的地址信息确定对应的长连接服务器,并且与确定的长连接服务器建立长连接。
若长连接建立失败,则第二连接建立器2720在剩余的地址信息中重新选择一条地址信息,与重新选择的地址信息确定的长连接服务器建立长连接。第二连接建立器2720重复执行地址信息的选择操作,并且重复执行与重新选择的地址信息对应的长连接服务器建立长连接的操作,直至与长连接服务器成功建立长连接。
若第二连接建立器2720与此次长连接分配服务器返回的响应消息中携带的任一条地址信息对应的长连接服务器均无法成功建立长连接,则触发信息获取器2710。信息获取器2710重新向长连接分配服务器请求长连接服务器的地址信息。第二连接建立器2720根据再次返回的长连接服务器的地址信息重新与对应的长连接服务器建立长连接,直至长连接建立成功。
长连接服务器中存储有在线设备列表,该列表记录与该长连接服务器保持长连接的各个客户端的标识信息。若某一个客户端与该长连接服务器之间的长连接断开,则在长连接服务器的在线设备列表中删除已断开的客户端对应的标识信息。本发明实施例中,长连接服务器中存储的在线设备列表能够实时更新,保证长连接服务器能够及时更新与其建立长连接的客户端的信息,避免因在线设备列表数据更新不及时导致向已断开的客户端发送数据,导致数据包丢失等恶性后果,提高数据传输的安全性。
本客户端2700与对应的长连接服务器成功建立长连接之后,每隔预设时长向上述长连接服务器发送一个网络连通检测消息。优选的,本发明实施例中,该网络连通检测消息为Ping消息。Ping消息是目前被广泛使用的、用于检测网络连通的消息,该Ping消息能够快速高效地进行网络连通检测,因此,本发明实施例中优选Ping消息作为检测网络连通时发送的检测消息。本客户端2700中的监测器2750对第二连接建立器2720持续发送的网络连通检测消息进行监测,若监测到第二连接建立器2720发送网络连通检测消息超时或者发送失败,则监测器2750触发第二连接建立器2720。第二连接建立器2720经监测器2750触发,断开本客户端2700与当前长连接服务器之间的长连接。本客户端2700与长连接服务器之间的长连接断开之后,重新选择长连接服务器的地址,确定对应的长连接服务器,并且与确定的长连接服务器建立长连接。
另外,本客户端2700中的第三数据发送器2730将本客户端2700中的数据及其标识信息发送至长连接服务器,由长连接服务器根据长连接服务器与其他客户端之间长连接的状态确定是否将本客户端2700中的数据发送至其他客户端。
在本发明实施例发明中,本客户端2700和/或其他客户端可以设置于任何终端, 本发明实施例并不对此加以限定。另外,本发明实施例中,除在前提到的不同终端间的客户端数据传输,还能够实现移动终端和终端间的客户端数据传输。因此,本发明实施例中,本客户端2700和/或其他客户端可以设置于终端,例如,台式电脑、笔记本电脑等,还可以设置于移动终端,例如,手机、音乐播放器、平板电脑等。优选的,本发明实施例中,本客户端2700和/或其他客户端设置于移动终端,以便更加清楚简洁地阐述不同终端间的客户端的数据传输。
在本发明实施例中,本客户端2700和/或其他客户端可以为浏览器客户端、安全卫士客户端、阅读器客户端、媒体播放器客户端等任意相同类型的客户端,还可以为不同类型但执行相同功能的客户端,本发明实施例并不对此加以限定。此处的本、其他仅用于区分不同的客户端,对于客户端本身属性、顺序以及功能并不造成限定,将本、其他换位指代不同的客户端也可。即,本发明实施例中,可以是本客户端2700发送本客户端2700的数据至其他客户端,还可以是其他客户端发送其他客户端的数据至本客户端2700,实现客户端之间信息的相互传输。
优选的,本发明实施例中,本客户端2700和/或其他客户端为浏览器客户端。用户通常在浏览器客户端执行收藏网址、设置常用网页等个性化操作,当用户从一个设备转向另一个设备时,需要在另一个设备新启用新的客户端,根据本发明实施例,用户在曾经的客户端上设置的个性化操作可以被自动同步到新启用的客户端内,无需用户重复操作,所以,采用浏览器客户端为本发明的优选实施例可以更加清楚地展示出本发明的过程以及有益效果。
另外,本发明实施例中,本客户端2700和其他客户端通过有线网络和/或无线网络进行数据传输,其中,有线网络包括数据线,无线网络包括蓝牙、wifi、局域网等。
基于实施例五提供的数据传输的方法及设备,基于同一发明构思,本发明实施例提供了一种无线数据传输系统。
图28示出了根据本发明一个实施例的数据传输系统的结构示意图。如图28所示,本发明实施例中的数据传输系统包括第一客户端2810、第二客户端2820、长连接分配服务器2830以及长连接服务器2840。其中,第一客户端2810与第二客户端2820的内部结构参见图27所示的客户端,为了在本流程中区分第一客户端和第二客户端,使其两者不至于混淆,分别将其标为第一客户端2810与第二客户端2820。
现介绍本发明实施例的数据传输系统中各器件或组成的功能以及各部分间的连接关系。第一客户端2810通过长连接服务器2840发送数据至第二客户端2820。第二客户端2820与长连接服务器2840建立长连接之后,从长连接服务器2840处接收第一客户端2810发送的数据。
第二客户端2820中的信息获取器2710根据自身的标识信息获取对应的长连接服务器2840的地址信息。信息获取器2710中的地址请求模块2711向长连接分配服务器2830发送携带有第二客户端2820的标识信息的地址请求消息。长连接分配服 务器2830接收到该地址请求消息之后,根据该请求消息中携带的标识信息确定与第二客户端2820对应的长连接服务器2840,然后返回给信息获取器2710响应消息。该响应消息中携带至少一条长连接服务器2840的地址信息。然后信息获取器2710中的地址接收模块2712接收长连接分配服务器2830返回的地址消息。
接收到对应长连接服务器2840的地址消息之后,第二连接建立器2720根据返回的长连接服务器2840的地址消息与对应的长连接服务器2840建立长连接。当长连接分配服务器2830返回的响应消息中携带的地址信息为至少两条时,第二连接建立器2720在至少两条地址信息中任选一条,然后根据选择的地址信息确定对应的长连接服务器2840,并且与确定的长连接服务器2840建立长连接。
若长连接建立失败,则第二连接建立器2720在剩余的地址信息中重新选择一条地址信息,与重新选择的地址信息确定的长连接服务器建立长连接。第二连接建立器2720重复执行地址信息的选择操作,并且重复执行与重新选择的地址信息对应的长连接服务器2840建立长连接的操作,直至与长连接服务器2840成功建立长连接。
若第二连接建立器2720与此次长连接分配服务器返回的响应消息中携带的任一条地址信息对应的长连接服务器2840均无法成功建立长连接,则触发信息获取器2710。信息获取器2710重新向长连接分配服务器2830请求长连接服务器2840的地址信息。然后第二连接建立器2720根据再次返回的长连接服务器2840的地址信息重新与对应的长连接服务器2840建立长连接,直至长连接建立成功。
长连接服务器2840中存储有在线设备列表,该列表记录与该长连接服务器2840保持长连接的各个客户端的标识信息。若某一个客户端与该长连接服务器2840之间的长连接断开,则在长连接服务器2840的在线设备列表中删除已断开的客户端对应的标识信息。长连接服务器2840中的在线设备列表的实时更新保证长连接服务器2840能够及时更新与其建立长连接的客户端的信息,提高数据传输速度。
第二客户端2820与对应的长连接服务器2840成功建立长连接之后,每隔预定时长向上述长连接服务器发送一个网络连通检测消息。第二客户端2820中的监测器2750对第二连接建立器2720持续发送的网络连通检测消息进行监测,若监测到第二客户端2820发送网络连通检测消息超时或者发送失败,则监测器2750触发第二连接建立器2720。第二连接建立器2720经监测器2750的触发,断开第二客户端2820与当前长连接服务器2840之间的长连接。然后重新选择长连接服务器2840的地址,确定对应的长连接服务器2840,并且与确定的长连接服务器2840建立长连接。
当长连接服务器2840接收到第一客户端2810发送的数据,长连接服务器2840根据存储的在线设备列表查找与对应的第二客户端2820之间的长连接的状态。若此长连接的状态为连接,长连接服务器2840将第一客户端2810的数据发送至第二客户端2820的第三数据接收器2740。若此长连接的状态为断开,则在该长连接服务器2840中存储第一客户端2810的数据,然后,待长连接的状态恢复之后,再将长连接服务器2840中存储的第一客户端2810的数据发送至第二客户端2820。另外,通过 类似的机制,可以将第二客户端2820中的数据发送至第一客户端2810,具体过程在此不再赘述。
依据本发明实施例,第一客户端能够发送数据至第二客户端,实现了第一客户端向第二客户端进行数据传输,解决了现有技术提到的客户端间无法进行数据传输的问题,进一步解决因不同客户端间无法进行数据传输,新客户端启用时必须重新引入用户需求,从而导致资源浪费以及效率低下的问题。
本发明实施例中,第一客户端2810和/或第二客户端2820可以设置于任何终端,本发明实施例并不对此加以限定。另外,本发明实施例中,除在前提到的不同终端间的客户端数据传输,还能够实现移动终端和终端间的客户端数据传输。因此,本发明实施例中,第一客户端2810和/或第二客户端2820可以设置于终端,例如,台式电脑、笔记本电脑等,还可以设置于移动终端,例如,手机、音乐播放器、平板电脑等。优选的,本发明实施例中,第一客户端2810和/或第二客户端2820设置于移动终端,以便更加清楚简洁地阐述不同终端间的客户端的数据传输。
在本发明实施例中,第一客户端2810和/或第二客户端2820可以为浏览器客户端、安全卫士客户端、阅读器客户端、媒体播放器客户端等任意相同类型的客户端,还可以为不同类型但执行相同功能的客户端,本发明实施例并不对此加以限定。此处的第一、第二仅用于区分不同的客户端,对于客户端本身属性、顺序以及功能并不造成限定,将第一、第二换位指代不同的客户端也可。即,本发明实施例中,可以是第一客户端2810发送第一客户端2810的数据至第二客户端2820,还可以是第二客户端2820利用第三数据发送器2730发送第二客户端2820的数据至第一客户端2810,实现客户端之间信息的相互传输。
优选的,本发明实施例中,第一客户端2810和/或第二客户端2820为浏览器客户端。用户通常在浏览器客户端执行收藏网址、设置常用网页等个性化操作,当用户从一个设备转向另一个设备时,需要在另一个设备新启用新的客户端,根据本发明实施例,用户在曾经的客户端上设置的个性化操作可以被自动同步到新启用的客户端内,无需用户重复操作,所以,采用浏览器客户端为本发明的优选实施例可以更加清楚地展示出本发明的过程以及有益效果。
另外,本发明实施例中,第一客户端2810与第二客户端2820通过有线网络和/或无线网络进行数据传输,其中,有线网络包括数据线,无线网络包括蓝牙、wifi、局域网等。
实施例5.1
图29示出了根据本发明一个优选实施例的数据传输方法流程图,用于支持实施例五所提供的任意一个数据传输方法及数据传输设备,将上述数据传输方法以及数据传输设备阐述得更清楚明白,如图29所示,本例中选择PC作为第一终端,手机为第二终端,客户端为浏览器客户端,第一客户端设置于第一终端,第二客户端设置于第二终端。为方便辨识第一客户端与第二客户端,在本例中,第一客户端设置 于PC,被称为PC浏览器,第二客户端设置于手机,被称为手机浏览器。
参见图29,手机浏览器根据自身的标识信息通过长连接分配服务器确认对应的长连接服务器。如图29中步骤1所示,手机浏览器首先向长连接分配服务器发送携带有自身标识信息的地址请求消息。长连接分配服务器收到上述地址请求消息之后,执行如图29中的步骤2,根据该地址请求消息中手机浏览器的标识信息确认手机浏览器对应的长连接服务器。然后返回给手机浏览器响应消息,该响应消息中携带有至少一条长连接服务器的地址信息。
当响应消息中携带的地址信息为至少两条时,手机浏览器在至少两条地址信息中任选一条,执行步骤3,根据选择的地址信息确定对应的长连接服务器,并发送请求建立长连接的请求消息至长连接服务器。若此长连接建立失败,手机浏览器在响应消息携带的剩余地址信息中重新选择一条地址信息,并与该地址信息对应的长连接服务器建立长连接。若手机浏览器与根据响应消息携带的长连接服务器的地址信息仍然无法成功建立长连接,手机浏览器重复执行在响应消息携带的剩余地址信息中任意选择的操作,并且重复执行与选择的地址信息对应的长连接服务器建立长连接的操作,直至手机浏览器与对应的长连接服务器成功建立长连接。
若手机浏览器与此次长连接分配服务器返回的响应消息中携带的任意一条地址信息对应的长连接服务器均无法成功建立长连接,手机浏览器重新发送地址请求消息至长连接分配服务器,然后根据长连接分配服务器再次返回的地址信息发送长连接建立请求至长连接服务器。
长连接服务器接收到手机浏览器发送的建立长连接的请求之后,执行步骤4,根据请求消息中携带的手机浏览器的标识信息在本地在线设备列表中标识与该手机浏览器之间长连接的状态为连接。手机浏览器与长连接服务器之间的长连接成功建立之后,触发步骤5,手机浏览器向长连接服务器发送网络连通检测消息。对手机浏览器向长连接服务器持续发送网络连通检测消息进行监测,若监测到手机浏览器发送网络连通检测消息超时或者发送失败,则断开手机浏览器与对应的长连接服务器之间的长连接。断开此长连接之后,手机浏览器重新选择长连接服务器的地址信息,并根据重新选择的长连接服务器的地址信息与对应的长连接服务器建立长连接。
另外,在长连接服务器一侧,设置一个预定时长,然后对长连接服务器接收网络连通检测消息的时间间隔进行计时,当计时的时间间隔超过预定时长,则长连接服务器断开与手机浏览器之间的长连接,并将在线设备列表中与该手机浏览器之间长连接的状态标识为断开。
当长连接服务器接收到PC浏览器的数据时,执行图29中的步骤6。首先,长连接服务器根据PC浏览器的数据中携带的标识信息确定对应的手机浏览器,并根据在线设备列表中记录的信息确定与该手机浏览器之间长连接的状态,其次,长连接服务器根据上述长连接的状态确定是否将PC浏览器中的数据发送至手机浏览器。具体地,若长连接服务器与手机浏览器之间长连接的状态为连接,则发送PC浏览器的 数据至手机浏览器,若上述长连接的状态为断开,则在长连接服务器中存储PC浏览器的数据,待长连接服务器与手机浏览器之间长连接的状态恢复时,将PC浏览器的数据发送至手机浏览器。
实施例5.2
图30示出了根据本发明另一个优选实施例的数据传输方法流程图,用于支持上述任意一个数据传输方法及数据传输设备,将上述数据传输方法以及数据传输设备阐述得更清楚明白,如图30所示,本例中选择PC作为第一终端,手机为第二终端,客户端为浏览器客户端。为方便辨识第一客户端与第二客户端,在本例中,第一客户端设置于PC,被称为PC浏览器,第二客户端设置于手机,被称为手机浏览器。
参见图30,PC浏览器根据自身的标识信息通过长连接分配服务器确认对应的长连接服务器。如图30中步骤1所示,PC浏览器首先向长连接分配服务器发送携带有自身标识信息的地址请求消息。长连接分配服务器收到上述地址请求消息之后,执行如图30中的步骤2,根据该地址请求消息中PC浏览器的标识信息确认PC浏览器对应的长连接服务器。然后返回给PC浏览器响应消息,该响应消息中携带有至少一条长连接服务器的地址信息。
当响应消息中携带的地址信息为至少两条时,PC浏览器在至少两条地址信息中任选一条,执行步骤3,根据选择的地址信息确定对应的长连接服务器,并发送请求建立长连接的请求消息至长连接服务器。若此长连接建立失败,PC浏览器在响应消息携带的剩余地址信息中重新选择一条地址信息,并与该地址信息对应的长连接服务器建立长连接。若PC浏览器与根据响应消息携带的长连接服务器的地址信息仍然无法成功建立长连接,PC浏览器重复执行在响应消息携带的剩余地址信息中任意选择的操作,并且重复执行与选择的地址信息对应的长连接服务器建立长连接的操作,直至PC浏览器与对应的长连接服务器成功建立长连接。
若PC浏览器与此次长连接分配服务器返回的响应消息中携带的任意一条地址信息对应的长连接服务器均无法成功建立长连接,PC浏览器重新发送地址请求消息至长连接分配服务器,然后根据长连接分配服务器再次返回的地址信息发送长连接建立请求至长连接服务器。
长连接服务器接收到PC浏览器发送的建立长连接的请求之后,执行步骤4,根据请求消息中携带的PC浏览器的标识信息在本地在线设备列表中标识与该PC浏览器之间长连接的状态为连接。当PC浏览器与长连接服务器之间的长连接成功建立之后,触发图30中的步骤5,PC浏览器向长连接服务器发送网络连通检测消息。对PC浏览器向长连接服务器持续发送网络连通检测消息进行监测,若监测到PC浏览器发送网络连通检测消息超时或者发送失败,则断开PC浏览器与对应的长连接服务器之间的长连接。断开此长连接之后,PC浏览器重新选择长连接服务器的地址信息,并根据重新选择的长连接服务器的地址信息与对应的长连接服务器建立长连接。
另外,在长连接服务器一侧,设置一个预定时长,然后对长连接服务器接收网 络连通检测消息的时间间隔进行计时,当计时的时间间隔超过预定时长,则长连接服务器断开与PC浏览器之间的长连接,并将在线设备列表中与该PC浏览器之间长连接的状态标识为断开。
当长连接服务器接收到手机浏览器的数据时,执行图5中的步骤6。首先,长连接服务器根据手机浏览器的数据中携带的标识信息确定对应的PC浏览器,并根据在线设备列表中记录的信息确定与该PC浏览器之间长连接的状态,其次,长连接服务器根据上述长连接的状态确定是否将手机浏览器中的数据发送至PC浏览器。具体地,若长连接服务器与PC浏览器之间长连接的状态为连接,则发送手机浏览器的数据至PC浏览器,若上述长连接的状态为断开,则在长连接服务器中存储手机浏览器的数据,待长连接服务器与PC浏览器之间长连接的状态恢复时,将手机浏览器的数据发送至PC浏览器。
根据上述任意一个优选实施例或多个优选实施例的组合,本发明实施例能够达到如下有益效果:
依据本发明实施例,第一客户端能够发送数据至第二客户端,实现了第一客户端向第二客户端进行数据传输,解决了现有技术提到的客户端间无法进行数据传输的问题,进一步解决因不同客户端间无法进行数据传输,新客户端启用时必须重新引入用户需求,从而导致资源浪费以及效率低下的问题。
在此处所提供的说明书中,说明了大量具体细节。然而,能够理解,本发明的实施例可以在没有这些具体细节的情况下实践。在一些实例中,并未详细示出公知的方法、结构和技术,以便不模糊对本说明书的理解。
类似地,应当理解,为了精简本公开并帮助理解各个发明方面中的一个或多个,在上面对本发明的示例性实施例的描述中,本发明的各个特征有时被一起分组到单个实施例、图、或者对其的描述中。然而,并不应将该公开的方法解释成反映如下意图:即所要求保护的本发明要求比在每个权利要求中所明确记载的特征更多的特征。更确切地说,如下面的权利要求书所反映的那样,发明方面在于少于前面公开的单个实施例的所有特征。因此,遵循具体实施方式的权利要求书由此明确地并入该具体实施方式,其中每个权利要求本身都作为本发明的单独实施例。
本领域那些技术人员可以理解,可以对实施例中的设备中的模块进行自适应性地改变并且把它们设置在与该实施例不同的一个或多个设备中。可以把实施例中的模块或单元或组件组合成一个模块或单元或组件,以及此外可以把它们分成多个子模块或子单元或子组件。除了这样的特征和/或过程或者单元中的至少一些是相互排斥之外,可以采用任何组合对本说明书(包括伴随的权利要求、摘要和附图)中公开的所有特征以及如此公开的任何方法或者设备的所有过程或单元进行组合。除非另外明确陈述,本说明书(包括伴随的权利要求、摘要和附图)中公开的每个特征可以由提供相同、等同或相似目的的替代特征来代替。
此外,本领域的技术人员能够理解,尽管在此所述的一些实施例包括其它实施 例中所包括的某些特征而不是其它特征,但是不同实施例的特征的组合意味着处于本发明的范围之内并且形成不同的实施例。例如,在下面的权利要求书中,所要求保护的实施例的任意之一都可以以任意的组合方式来使用。
本发明的各个部件实施例可以以硬件实现,或者以在一个或者多个处理器上运行的软件模块实现,或者以它们的组合实现。本领域的技术人员应当理解,可以在实践中使用微处理器或者数字信号处理器(DSP)来实现根据本发明实施例的设备或装置或系统中的一些或者全部部件的一些或者全部功能。本发明还可以实现为用于执行这里所描述的方法的一部分或者全部的设备或者装置程序(例如,计算机程序和计算机程序产品)。这样的实现本发明的程序可以存储在计算机可读介质上,或者可以具有一个或者多个信号的形式。这样的信号可以从因特网网站上下载得到,或者在载体信号上提供,或者以任何其他形式提供。
例如,图31示出了可以实现根据本发明的数据传输方法的计算设备。该计算设备传统上包括处理器3110和以存储器3120形式的计算机程序产品或者计算机可读介质。存储器3120可以是诸如闪存、EEPROM(电可擦除可编程只读存储器)、EPROM、硬盘或者ROM之类的电子存储器。存储器3120具有用于执行上述方法中的任何方法步骤的程序代码3131的存储空间3130。例如,用于程序代码的存储空间3130可以包括分别用于实现上面的方法中的各种步骤的各个程序代码3131。这些程序代码可以从一个或者多个计算机程序产品中读出或者写入到这一个或者多个计算机程序产品中。这些计算机程序产品包括诸如硬盘,紧致盘(CD)、存储卡或者软盘之类的程序代码载体。这样的计算机程序产品通常为如参考图32所述的便携式或者固定存储单元。该存储单元可以具有与图31的计算设备中的存储器3120类似布置的存储段、存储空间等。程序代码可以例如以适当形式进行压缩。通常,存储单元包括计算机可读代码3131’,即可以由例如诸如3110之类的处理器读取的代码,这些代码当由计算设备运行时,导致该计算设备执行上面所描述的方法中的各个步骤。
本文中所称的“一个实施例”、“实施例”或者“一个或者多个实施例”意味着,结合实施例描述的特定特征、结构或者特性包括在本发明的至少一个实施例中。此外,请注意,这里“在一个实施例中”的词语例子不一定全指同一个实施例。
应该注意的是上述实施例对本发明进行说明而不是对本发明进行限制,并且本领域技术人员在不脱离所附权利要求的范围的情况下可设计出替换实施例。在权利要求中,不应将位于括号之间的任何参考符号构造成对权利要求的限制。单词“包含”不排除存在未列在权利要求中的元件或步骤。位于元件之前的单词“一”或“一个”不排除存在多个这样的元件。本发明可以借助于包括有若干不同元件的硬件以及借助于适当编程的计算机来实现。在列举了若干装置的单元权利要求中,这些装置中的若干个可以是通过同一个硬件项来具体体现。单词第一、第二、以及第三等的使用不表示任何顺序。可将这些单词解释为名称。
此外,还应当注意,本说明书中使用的语言主要是为了可读性和教导的目的而 选择的,而不是为了解释或者限定本发明的主题而选择的。因此,在不偏离所附权利要求书的范围和精神的情况下,对于本技术领域的普通技术人员来说许多修改和变更都是显而易见的。对于本发明的范围,对本发明所做的公开是说明性的,而非限制性的,本发明的范围由所附权利要求书限定。

Claims (89)

  1. 一种数据传输方法,包括:
    确定第一终端与第二终端间建立连接;
    获取设置于所述第一终端的第一客户端的标识信息;
    将所述标识信息传输至设置于所述第二终端的第二客户端。
  2. 根据权利要求1所述的方法,其中,将所述标识信息传输至所述第二客户端之后,包括:
    获取所述第一客户端中的数据;
    将所述数据经所述第一终端的第一服务器传输至对应的长连接服务器,由所述长连接服务器将所述数据传输至所述第二客户端,其中,所述长连接服务器与所述第二客户端之间具有长连接。
  3. 根据权利要求2所述的方法,其中,所述对应的长连接服务器的地址信息的获取方式如下:
    发送地址请求消息至长连接分配服务器,其中,所述地址请求消息中携带有所述标识信息;
    接收所述长连接分配服务器返回的响应消息,其中,所述响应消息中携带有所述长连接服务器的地址信息。
  4. 根据权利要求2或3所述的方法,其中,所述数据包括下列至少之一:
    所述第一客户端的收藏夹中收藏的各网址;
    所述第一客户端的常用网址;
    所述第一客户端当前打开的网址;
    所述第一客户端根据用户指令调用的用户数据。
  5. 根据权利要求1至4任一项所述的方法,其中,所述标识信息包括下列任意之一:
    所述第一客户端的使用者登录的账户信息;
    为所述第一客户端生成的唯一标识。
  6. 根据权利要求1至5任一项所述的方法,其中,所述第一终端与所述第二终端通过USB数据线连接。
  7. 根据权利要求1至6任一项所述的方法,其中,所述第一客户端和/或所述第二客户端为浏览器客户端。
  8. 一种数据传输方法,包括:
    在第一终端与第二终端连接之后,接收设置于所述第一终端的第一客户端发送的所述第一客户端的标识信息;
    位于所述第二终端的所述第二客户端利用所述标识信息,查找对应的长连接服 务器的地址信息;
    根据获取的地址信息在所述第二客户端与所述长连接服务器间建立长连接,以便所述第二客户端从所述长连接服务器处接收数据。
  9. 根据权利要求8所述的方法,其中,利用所述标识信息,查找对应的长连接服务器的地址信息,包括:
    发送地址请求消息至长连接分配服务器,其中,所述地址请求消息中携带有所述标识信息;
    接收所述长连接分配服务器返回的响应消息,其中,所述响应消息中携带有所述长连接服务器的地址信息。
  10. 根据权利要求8或9所述的方法,其中,根据获取的地址信息在所述第二客户端与所述长连接服务器间建立长连接之后,包括:
    接收来自所述长连接服务器的数据,其中,所述数据为所述第一客户端上传至所述长连接服务器的数据;
    所述第二客户端根据所述数据进行处理。
  11. 根据权利要求10所述的方法,其中,所述数据包括下列至少之一:
    所述第一客户端的收藏夹中收藏的各网址;
    所述第一客户端的常用网址;
    所述第一客户端当前打开的网址;
    所述第一客户端根据用户指令调用的用户数据。
  12. 根据权利要求11所述的方法,其中,所述第二客户端根据所述数据进行处理,包括以下至少一个:
    所述第二客户端更新收藏夹;
    所述第二客户端更新常用网址;
    所述第二客户端打开网址对应的网页。
  13. 根据权利要求8至12任一项所述的方法,其中,接收所述第一客户端的标识信息之后,若查询所述第二终端中不存在所述第二客户端,获取所述第二客户端的安装包并在所述第二终端中进行安装。
  14. 根据权利要求8至13任一项所述的方法,其中,所述标识信息包括下列任意之一:
    所述第一客户端的使用者登录的账户信息;
    为所述第一客户端生成的唯一标识。
  15. 根据权利要求8至14任一项所述的方法,其中,所述第二终端是移动终端。
  16. 根据权利要求8至15任一项所述的方法,其中,所述第一终端与所述第二终端通过USB数据线连接。
  17. 根据权利要求8至16任一项所述的方法,其中,所述第一客户端和/或所述第二客户端为浏览器客户端。
  18. 一种第一客户端,设置于第一终端,包括:
    第一确定模块,配置为确定所述第一终端与第二终端相连接;
    第一获取模块,配置为获取本客户端的标识信息;
    数据传输模块,配置为将所述标识信息传输至所述第二终端。
  19. 一种第二客户端,设置于第二终端,包括:
    第二确定模块,配置为确定所述第二终端与第一终端相连接;
    第二接收模块,配置为接收设置于所述第一终端的第一客户端发送的所述第一客户端的标识信息;
    第二获取模块,配置为获取所述标识信息,根据所述标识信息查找对应的长连接服务器的地址信息;
    连接建立模块,配置为根据获取的地址信息在本客户端与所述长连接服务器间建立长连接,以便本客户端从所述长连接服务器处接收数据。
  20. 一种数据传输系统,包括权利要求18所述的第一客户端和权利要求19所述的第二客户端,所述第一客户端设置于第一终端,所述第二客户端设置于第二终端,所述第一终端与所述第二终端相连接,还包括所述第一终端对应的第一服务器、长连接分配服务器以及长连接服务器,其中,
    所述第一客户端,配置为将自身的标识信息传输至所述第二客户端;以及,将所述第一客户端中的数据经所述第一服务器传输至所述长连接服务器;
    所述第一服务器,配置为接收所述第一客户端发送的数据,将其转发至所述长连接服务器;
    所述第二客户端,配置为接收所述第一客户端发送的标识信息,经所述长连接分配服务器查找对应的长连接服务器的地址信息;与所述长连接服务器间建立长连接;以及,经所述长连接服务器接收所述第一客户端传输的数据;
    所述长连接分配服务器,配置为根据所述第一客户端的标识信息分配长连接服务器;接收各客户端发送的携带有所述第一客户端的标识信息的地址请求消息,将对应长连接服务器的地址反馈至请求方;
    长连接服务器,配置为与所述第二客户端建立长连接;以及,接收所述第一服务器转发的来自所述第一客户端的数据,并将该数据转发至所述第二客户端。
  21. 一种数据传输方法,应用于第一客户端向第二客户端发送数据,包括:
    利用网络在所述第二客户端与长连接服务器间建立长连接;
    接收所述长连接服务器转发的、来自所述第一客户端的数据,其中,所述第一客户端将所述数据发送至第一服务器,由所述第一服务器转发至所述长连接服务器。
  22. 根据权利要求21所述的方法,其中,根据所述第一客户端的标识信息确定所述长连接服务器。
  23. 根据权利要求22所述的方法,其中,根据所述第一客户端的标识信息确定所述长连接服务器,包括:
    利用所述第二客户端向长连接分配服务器发送地址请求消息,请求获取所述长连接服务器的地址信息,其中,所述地址请求消息中携带有所述第一客户端的标识信息;
    接收所述长连接分配服务器返回的响应消息,其中,所述响应消息中携带有所述长连接服务器的地址信息。
  24. 根据权利要求23所述的方法,其中,所述响应消息中携带至少两个地址信息时,根据预设策略选择其中一个地址信息作为即将连接的长连接服务器的地址信息。
  25. 根据权利要求21至25任一项所述的方法,其中,接收所述长连接服务器转发的、来自所述第一客户端的数据,包括:
    若所述第二客户端当前与所述长连接服务器断开长连接,则在所述长连接服务器中存储所述数据;
    检测到两者间再次建立长连接,接收所述长连接服务器转发的数据。
  26. 根据权利要求25所述的方法,其中,在所述长连接服务器中存储有在线设备列表,其中记录有与所述长连接服务器保持长连接的各客户端的标识信息;
    若某一客户端与所述长连接服务器断开长连接,在所述在线设备列表中删除已断开的客户端所对应的标识信息。
  27. 根据权利要求21至26任一项所述的方法,接收所述长连接服务器转发的、来自所述第一客户端的数据,包括:
    利用所述第一服务器接收来自所述第一客户端的数据,其中,所述数据包括网页数据以及所述第一客户端的标识信息;
    利用所述第一服务器对来自所述第一客户端的数据进行合法性验证,并根据所述标识信息确定长连接服务器;
    将通过验证的数据传输至确定的长连接服务器,由所述长连接服务器将数据转发至所述第二客户端。
  28. 根据权利要求27所述的方法,其中,对来自所述第一客户端的数据进行合法性验证,包括下列至少之一:
    验证来自所述第一客户端的标识信息合法;
    验证所述网页数据中的网址为非恶意网址。
  29. 根据权利要求27或28所述的方法,其中,所述第一服务器与所述长连接服务器通过HTTP请求通信。
  30. 根据权利要求21至29任一项所述的方法,其中,所述网络包括有线网络和无线网络,其中,所述无线网络包括Wifi、2G\3G\4G中的任意之一或多个的组合。
  31. 根据权利要求21至30任一项所述的方法,其中,所述第一客户端和/或所述第二客户端为浏览器客户端。
  32. 根据权利要求21至31任一项所述的方法,其中,所述第一客户端设置于 终端,所述第二客户端设置于移动终端。
  33. 一种第二客户端,包括:
    第一连接建立器,配置为利用网络与长连接服务器间建立长连接;
    第一数据接收器,配置为接收所述长连接服务器转发的、来自第一客户端的数据,其中,所述第一客户端将所述数据发送至第一服务器,由所述第一服务器转发至所述长连接服务器。
  34. 一种第一客户端,包括:
    第一数据获取器,配置为获取本客户端的数据;
    第一数据发送器,配置为将所述数据发送至第一服务器,由所述第一服务器将所述数据经长连接服务器转发至第二客户端。
  35. 一种数据传输系统,包括权利要求34所述的第一客户端,权利要求33所述的第二客户端,还包括第一服务器及长连接服务器:
    所述第一客户端,配置为发送所述第一客户端的数据至所述第一服务器;
    所述第一服务器,配置为将所述第一客户端数据转至所述长连接服务器;
    所述长连接服务器,配置为接收来自所述第一服务器的数据,并转发至第二客户端;
    所述第二客户端,配置为接收所述长连接服务器转发的数据。
  36. 一种数据传输方法,包括:
    在第一终端和移动终端之间建立连接,其中,第一客户端设置在所述第一终端中,第二客户端设置在所述移动终端中;
    获取所述第一客户端的第一数据,并将所述第一数据发送至所述第二客户端中;和/或
    获取所述第二客户端的第二数据,并将所述第二数据发送至所述第一客户端。
  37. 根据权利要求36所述的方法,其中,将所述第一数据发送至所述第二客户端,包括:
    将所述第一数据经所述第一终端的第一服务器传输至对应的长连接服务器,由所述长连接服务器将所述第一数据发送至所述第二客户端,其中,所述长连接服务器与所述第二客户端之间具有长连接。
  38. 根据权利要求37所述的方法,其中,所述第一数据利用第一消息作为载体进行传输,其中,所述第一消息中携带有所述第一数据、所述第一客户端的标识信息。
  39. 根据权利要求38所述的方法,其中,所述第一服务器对所述第一消息进行验证。
  40. 根据权利要求37至39任一项所述的方法,其中,根据所述第一客户端的标识信息确定所述对应的长连接服务器。
  41. 根据权利要求40所述的方法,其中,根据所述第一客户端的标识信息确定 所述对应的长连接服务器,包括:
    发送地址请求消息至长连接分配服务器,其中,所述地址请求消息中携带有所述第一客户端的标识信息;
    接收所述长连接分配服务器返回的响应消息,其中,所述响应消息中携带有所述长连接服务器的地址信息。
  42. 根据权利要求36至41任一项所述的方法,其中,所述第一数据包括下列至少之一:
    所述第一客户端的收藏夹中收藏的网址;
    所述第一客户端的常用网址;
    所述第一客户端当前打开的网址;
    所述第一客户端根据用户指令调用的用户数据。
  43. 根据权利要求36至42任一项所述的方法,其中,将所述第一数据发送至所述第二客户端中之后,还包括:
    所述第二客户端接收所述第一数据;
    所述第二客户端根据所述第一数据进行处理。
  44. 根据权利要求43所述的方法,其中,所述第二客户端根据所述第一数据进行处理,包括以下至少一个:
    所述第二客户端更新收藏夹;
    所述第二客户端更新常用网址;
    所述第二客户端打开网址对应的网页。
  45. 根据权利要求36至44任一项所述的方法,其中,在所述第一终端和所述移动终端之间建立连接之后,若查询所述移动终端中不存在所述第二客户端,获取所述第二客户端的安装包并在所述移动终端中进行安装。
  46. 根据权利要求36至45任一项所述的方法,其中,将所述第二数据发送至所述第一客户端,包括:
    将所述第二数据经所述第一终端的第一服务器传输发至对应的长连接服务器,由所述长连接服务器将所述数据发送至所述第一客户端。
  47. 根据权利要求46所述的方法,其中,所述第二数据利用第二消息作为载体进行传输,其中,所述第二消息中携带有所述第二数据、所述第二客户端的标识信息。
  48. 根据权利要求47所述的方法,其中,所述第一服务器对所述第二消息进行验证。
  49. 根据权利要求46至48任一项所述的方法,其中,所述第二数据包括下列至少之一:
    所述第二客户端的收藏夹中收藏的网址;
    所述第二客户端的常用网址;
    所述第二客户端当前打开的网址;
    所述第二客户端根据用户指令调用的用户数据。
  50. 根据权利要求46至49任一项所述的方法,其中,将所述第二数据发送至运行在所述客户端的第一客户端中之后,还包括:
    所述第一客户端接收所述第二数据;
    所述第一客户端根据所述第二数据进行处理。
  51. 根据权利要求50所述的方法,其中,所述第一客户端根据所述第二数据进行处理,包括以下至少一个:
    所述第一客户端更新收藏夹;
    所述第一客户端更新常用网址;
    所述第一客户端打开网址对应的网页。
  52. 根据权利要求46至51任一项所述的方法,其中,在所述第一终端和所述移动终端之间建立连接,包括:
    判断所述第一终端是否与其他移动终端建立了连接;
    若是,则根据用户的选择来确定与所述第一终端连接的移动终端。
  53. 根据权利要求36至52任一项所述的方法,其中,在所述第一终端和所述移动终端之间建立连接,包括:
    在所述第一终端和所述移动终端之间建立有线连接;或者
    在所述第一终端和所述移动终端之间建立无线连接。
  54. 根据权利要求37至53任一项所述的方法,其中,所述第一客户端的标识信息包括下列至少之一:
    所述第一客户端的使用者登录的账户信息;
    为所述第一客户端生成的唯一标识。
  55. 根据权利要求36至54任一项所述的方法,其中,所述第一客户端和/或所述第二客户端为浏览器客户端。
  56. 一种第一客户端,设置于第一终端,所述第一终端与移动终端建立连接,包括:
    第三获取模块,配置为获取本地运行的第一客户端的第一数据;
    第一发送模块,配置为发送所述第一数据至运行在设置于所述移动终端的第二客户端中。
  57. 一种第二客户端,设置于移动终端,所述移动终端与第一终端建立连接,包括:
    第四获取模块,配置为获取本客户端的第二数据;
    第二发送模块,配置为发送所述第二数据至运行在所述第一终端的第一客户端中。
  58. 一种网络系统,包括设置于第一终端的第一客户端,设置于移动终端的第 二客户端,所述第一终端与所述移动终端间建立连接:
    所述第一客户端,配置将第一数据发送至所述第二客户端中;
    所述第二客户端,配置为将第二数据发送至所述第一客户端中。
  59. 一种数据传输方法,应用于第一客户端与第二客户端间能够进行数据传输的情况,包括:
    将所述第一客户端中的数据及其标识信息传输至第一服务器,由所述第一服务器转发至根据所述第一客户端的标识信息确定的长连接服务器;
    根据所述第二客户端与所述长连接服务器的长连接状态,确定是否将所述第一客户端的数据转发至所述第二客户端。
  60. 根据权利要求59所述的方法,其中,由所述第一服务器转发所述第一客户端中的数据及其标识信息至根据所述第一客户端的标识信息确定的长连接服务器,包括:
    由所述第一服务器对所述第一客户端中的数据及其标识信息进行安全性验证;
    将通过安全性验证的所述第一客户端中的数据及其标识信息转发至所述长连接服务器。
  61. 根据权利要求60所述的方法,其中,通过安全性验证的所述第一客户端的数据为非恶意数据,通过安全性验证的所述第一客户端的标识信息为在所述第一服务器中已注册的所述第一客户端的标识信息。
  62. 根据权利要求59至61任一项所述的方法,其中,根据所述第二客户端与所述长连接服务器的长连接状态,确定是否将所述第一客户端的数据转发至所述第二客户端,包括:
    所述第二客户端与所述长连接服务器的长连接状态为连接状态时,将所述第一客户端的数据转发至所述第二客户端;
    所述第二客户端与所述长连接服务器的长连接状态为非连接状态时,在所述长连接服务器中存储所述第一客户端中的数据;以及,当所述第二客户端与所述长连接服务器之间的长连接状态从非连接状态转为连接状态时,由所述长连接服务器将已存储的所述第一客户端中的数据发送至所述第二客户端。
  63. 根据权利要求59至62任一项所述的方法,其中,按照如下步骤在所述第二客户端与所述长连接服务器间建立长连接,包括:
    所述第二客户端根据所述第二客户端的标识信息请求与所述长连接服务器建立长连接;
    所述长连接服务器根据所述第二客户端的标识信息对所述第二客户端进行身份验证;
    所述长连接服务器与通过所述身份验证的所述第二客户端建立长连接。
  64. 根据权利要求63所述方法,其中,所述长连接服务器还根据所述第二客户端所位于的终端的设备信息进行身份验证。
  65. 根据权利要求64所述的方法,其中,所述设备信息包括下列至少之一:
    所述终端的国际移动设备身份码IMEI号码;
    所述终端的设备名称;
    所述终端的系统版本号。
  66. 根据权利要求59至65任一项所述的方法,其中,所述第二客户端与所述长连接服务器的长连接状态的确定方式包括:
    在所述长连接服务器存储的在线设备列表中查询所述第二客户端与所述长连接服务器间的长连接状态,其中,所述在线设备列表中存储有与所述长连接服务器已建立长连接的各客户端的标识信息;
    若查询到所述第二客户端的标识信息,则确定所述第二客户端与所述长连接服务器的长连接状态为连接状态;
    若未查询到所述第二客户端的标识信息,则确定所述第二客户端与所述长连接服务器的长连接状态为非连接状态。
  67. 根据权利要求59至66任一项所述的方法,其中,所述第一客户端中的数据包括下列至少之一:
    所述第一客户端的收藏夹中收藏的各网址;
    所述第一客户端的常用网址;
    所述第一客户端当前打开的网页;
    所述第一客户端根据用户指令调用的用户数据。
  68. 根据权利要求59至67任一项所述的方法,其中,所述第一客户端与所述第二客户端具备相同的标识信息。
  69. 根据权利要求68所述的方法,其中,所述标识信息包括:
    所述第一客户端的用户登陆的账户信息;
    为所述第一客户端生成的唯一标识。
  70. 根据权利要求59至69任一项所述的方法,其中,所述第一服务器通过超文本传输协议HTTP请求与所述长连接服务器通信。
  71. 根据权利要求59至70任一项所述的方法,其中,
    所述第一客户端和/或第二客户端设置于移动终端中。
  72. 一种客户端,应用于本客户端与其他客户端间能够进行数据传输的情况,包括:
    第二数据获取器,配置为获取本客户端的数据及其标识信息;
    数据传输器,配置为传输所述数据获取器获取的本客户端中的数据及其标识信息至第一服务器,由所述第一服务器转发至根据本客户端的标识信息确定的长连接服务器,并根据其他客户端与所述长连接服务器的长连接状态,确定是否将本客户端中的数据转发至所述其他客户端。
  73. 一种数据传输系统,应用于第一客户端与第二客户端间能够进行数据传输 的情况,包括权利要求72所述的第一客户端,权利要求72所述的第二客户端,根据所述第一客户端的标识信息确定的长连接服务器以及第一服务器,其中,
    所述第一客户端,配置为传输所述第一客户端中的数据及其标识信息至第一服务器;
    所述第一服务器,配置为接收所述第一客户端发送的数据及其标识信息,并转发至所述长连接服务器;
    所述长连接服务器,配置为与所述第二客户端建立长连接;以及,接收所述第一服务器转发的所述第一客户端中的数据及其标识信息,根据所述第二客户端与所述长连接服务器的长连接状态,确定是否将所述第一客户端的数据转发至所述第二客户端;
    所述第二客户端,配置为接收经所述长连接服务器发送的数据。
  74. 一种数据传输方法,应用于第一客户端与第二客户端间进行数据传输的情况,包括:
    发送所述第一客户端中的数据至长连接服务器;
    根据所述长连接服务器与所述第二客户端之间长连接的状态,确定是否将所述第一客户端的数据发送至所述第二客户端。
  75. 根据权利要求74所述的方法,其中,所述长连接服务器根据所述二客户端的标识信息确定。
  76. 根据权利要求75所述的方法,其中,所述长连接服务器的地址信息获取方式包括:
    发送地址请求消息至长连接分配服务器,其中,所述地址请求消息中携带有所述标识信息;
    接收所述长连接分配服务器返回的响应消息,其中,所述响应消息中携带有至少一条长连接服务器的地址信息。
  77. 根据权利要求76所述的方法,其中,当所述响应消息中携带的地址信息为至少两条时,所述第二客户端与所述长连接服务器建立长连接的步骤包括:
    在至少两条所述地址信息中任选一条,根据选择的地址信息确定对应的长连接服务器,在所述第二客户端与确定的长连接服务器间建立长连接;
    若长连接建立失败,在剩余地址信息中重新选择一条地址信息,在所述第二客户端与重新选择的地址信息确定的长连接服务器间建立长连接;
    重复执行地址信息的选择以及长连接建立操作,直至所述第二客户端与根据选择的地址信息确定的长连接服务器间的长连接建立成功。
  78. 根据权利要求77所述的方法,其中,若所述第二客户端与任意一条地址信息对应的长连接服务器均无法建立长连接,
    重新发送所述地址请求消息至所述长连接分配服务器;
    根据所述长连接分配服务器再次分配的长连接服务器的地址信息,在所述第二 客户端与再次分配的地址信息对应的长连接服务器间建立长连接。
  79. 根据权利要求74至78任一项所述的方法,其中,所述长连接建立成功之后,还包括:
    对所述第二客户端持续发送的网络连通检测消息进行监测,若监测到所述第二客户端发送所述网络连通检测消息超时或者发送失败,则断开所述第二客户端与所述长连接服务器间的长连接;以及
    重新选择长连接服务器的地址信息,确定对应的长连接服务器,在所述第二客户端与重新选择的长连接服务器间建立长连接。
  80. 根据权利要求79所述的方法,其中,所述网络连通检测消息为Ping消息。
  81. 根据权利要求79或80所述的方法,其中,还包括:
    对所述长连接服务器接收所述网络连通检测消息的时间间隔进行计时,当计时的时间间隔超过预定时长时,则断开所述长连接服务器与所述第二客户端间的长连接。
  82. 根据权利要求74至81任一项所述的方法,其中,根据所述长连接服务器与所述第二客户端之间长连接的状态,确定是否将数据发送至所述第二客户端,包括:
    当所述长连接的状态为连接时,将所述第一客户端的数据发送至所述第二客户端;
    当所述长连接的状态为断开时,在所述长连接服务器中存储所述第一客户端的数据;以及,待所述长连接的状态由断开转为连接时,将所述长连接服务器中存储的所述第一客户端的数据发送至所述第二客户端。
  83. 根据权利要求74至82任一项所述的方法,其中,
    所述第一客户端和/或所述第二客户端设置于移动终端。
  84. 根据权利要求74至83任一项所述的方法,其中,所述第一客户端与所述第二客户端通过有线网络和/或无线网络进行数据传输。
  85. 根据权利要求74至84任一项所述的方法,其中,所述第一客户端和/或所述第二客户端为浏览器客户端。
  86. 一种客户端,应用于本客户端与其他客户端间进行数据传输的情况,包括:
    第三数据发送器,配置为将本客户端中的数据及其标识信息发送至与所述其他客户端对应的长连接服务器,其中,根据所述长连接服务器与所述其他客户端之间的长连接状态确定是否将所述数据发送至所述其他客户端;
    第二连接建立器,配置为在本客户端和与本客户端对应的长连接服务器之间建立长连接;
    第三数据接收器,配置为接收所述其他客户端经所述与本客户端对应的长连接服务器发送的所述其他客户端中的数据。
  87. 一种无线数据传输系统,包括权利要求86所述的第一客户端和第二客户端, 其中,所述第一客户端与所述第二客户端间进行数据传输,还包括长连接服务器以及长连接分配服务器,其中,
    所述第一客户端,配置为经所述长连接服务器发送所述第一客户端中的数据;
    所述长连接分配服务器,配置为根据不同客户端发送的地址请求消息,为各客户端分配长连接服务器,并将分配的地址信息分别相应发送至各客户端;
    所述长连接服务器,配置为接收所述第一客户端传输的所述第一客户端的数据;以及根据所述第二客户端与所述长连接服务器间的长连接状态,确定是否将所述第一客户端中的数据转发至所述第二客户端;
    所述第二客户端,配置为接收所述长连接服务器转发的所述第一客户端中的数据。
  88. 一种计算机程序,包括计算机可读代码,当所述计算机可读代码在计算设备上运行时,导致所述计算设备执行根据权利要求1-7中的任一个所述的数据传输方法,和/或,权利要求8-17中的任一个所述的数据传输方法,和/或,权利要求21-32中的任一个所述的数据传输方法,和/或,权利要求36-55中的任一个所述的数据传输方法,和/或,权利要求59-71中的任一个所述的数据传输方法,和/或,权利要求74-85中的任一个所述的数据传输方法。
  89. 一种计算机可读介质,其中存储了如权利要求88所述的计算机程序。
PCT/CN2014/087203 2013-09-29 2014-09-23 数据传输方法、设备及系统 WO2015043455A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US15/025,401 US20160234307A1 (en) 2013-09-29 2014-09-23 Data transmission method, device, and system

Applications Claiming Priority (10)

Application Number Priority Date Filing Date Title
CN201310456279.XA CN103491184A (zh) 2013-09-29 2013-09-29 数据传输方法、设备及系统
CN201310456279.X 2013-09-29
CN201310456454.5A CN103501335A (zh) 2013-09-29 2013-09-29 数据传输方法、设备及系统
CN201310456173.XA CN103501331B (zh) 2013-09-29 2013-09-29 数据传输方法、设备及系统
CN201310456173.X 2013-09-29
CN201310456451.1A CN103501334B (zh) 2013-09-29 2013-09-29 数据传输方法、设备及网络系统
CN201310456451.1 2013-09-29
CN201310456199.4 2013-09-29
CN201310456454.5 2013-09-29
CN2013104561994A CN103475753A (zh) 2013-09-29 2013-09-29 数据传输方法、设备及系统

Publications (1)

Publication Number Publication Date
WO2015043455A1 true WO2015043455A1 (zh) 2015-04-02

Family

ID=52742057

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2014/087203 WO2015043455A1 (zh) 2013-09-29 2014-09-23 数据传输方法、设备及系统

Country Status (2)

Country Link
US (1) US20160234307A1 (zh)
WO (1) WO2015043455A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105120472A (zh) * 2015-09-16 2015-12-02 上海斐讯数据通信技术有限公司 一种接入点、接入点管理方法及系统

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR102018815B1 (ko) * 2014-10-24 2019-11-04 삼성전자주식회사 주변 기기를 활용하여 원격 태스크를 수행하는 방법 및 디바이스
US10467409B2 (en) * 2014-12-23 2019-11-05 Mcafee, Llc Identification of malicious execution of a process
CN106487864B (zh) * 2015-09-02 2019-09-27 华为终端有限公司 数据连接的建立方法、服务端及移动终端
WO2017210208A1 (en) 2016-05-31 2017-12-07 Brocade Communications Systems, Inc. Keepalive technique in a network device
US9935984B1 (en) 2017-07-31 2018-04-03 Malwarebytes Inc. Scalable cloud-based endpoint security system
US11659218B2 (en) * 2018-01-22 2023-05-23 Comcast Cable Communications, Llc Methods and systems for managing content restrictions
CN109560975B (zh) * 2019-01-31 2022-02-25 新华三技术有限公司 设备更新方法及装置
US11182472B2 (en) * 2019-09-30 2021-11-23 Vmware, Inc. Security in a computing environment by monitoring expected operation of processes within the computing environment
CN113395392B (zh) * 2021-06-11 2022-08-05 哈尔滨海能达科技有限公司 一种呼叫接入控制的方法、系统、同播系统及终端

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101080056A (zh) * 2006-12-21 2007-11-28 腾讯科技(深圳)有限公司 一种移动终端的网络浏览器收藏夹的管理方法及系统
CN102724184A (zh) * 2012-06-01 2012-10-10 北京奇乐客科技有限公司 一种网页收藏分享方法及服务器
CN103049492A (zh) * 2012-12-07 2013-04-17 康佳集团股份有限公司 一种智能电视与pc机同步收藏夹的方法及系统
CN103179164A (zh) * 2011-12-23 2013-06-26 宇龙计算机通信科技(深圳)有限公司 存储页面信息的方法及其通信终端
CN103475753A (zh) * 2013-09-29 2013-12-25 北京奇虎科技有限公司 数据传输方法、设备及系统
CN103491184A (zh) * 2013-09-29 2014-01-01 北京奇虎科技有限公司 数据传输方法、设备及系统
CN103501335A (zh) * 2013-09-29 2014-01-08 北京奇虎科技有限公司 数据传输方法、设备及系统
CN103501331A (zh) * 2013-09-29 2014-01-08 北京奇虎科技有限公司 数据传输方法、设备及系统
CN103501334A (zh) * 2013-09-29 2014-01-08 北京奇虎科技有限公司 数据传输方法、设备及网络系统

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101080056A (zh) * 2006-12-21 2007-11-28 腾讯科技(深圳)有限公司 一种移动终端的网络浏览器收藏夹的管理方法及系统
CN103179164A (zh) * 2011-12-23 2013-06-26 宇龙计算机通信科技(深圳)有限公司 存储页面信息的方法及其通信终端
CN102724184A (zh) * 2012-06-01 2012-10-10 北京奇乐客科技有限公司 一种网页收藏分享方法及服务器
CN103049492A (zh) * 2012-12-07 2013-04-17 康佳集团股份有限公司 一种智能电视与pc机同步收藏夹的方法及系统
CN103475753A (zh) * 2013-09-29 2013-12-25 北京奇虎科技有限公司 数据传输方法、设备及系统
CN103491184A (zh) * 2013-09-29 2014-01-01 北京奇虎科技有限公司 数据传输方法、设备及系统
CN103501335A (zh) * 2013-09-29 2014-01-08 北京奇虎科技有限公司 数据传输方法、设备及系统
CN103501331A (zh) * 2013-09-29 2014-01-08 北京奇虎科技有限公司 数据传输方法、设备及系统
CN103501334A (zh) * 2013-09-29 2014-01-08 北京奇虎科技有限公司 数据传输方法、设备及网络系统

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105120472A (zh) * 2015-09-16 2015-12-02 上海斐讯数据通信技术有限公司 一种接入点、接入点管理方法及系统
CN105120472B (zh) * 2015-09-16 2018-10-12 上海斐讯数据通信技术有限公司 一种接入点、接入点管理方法及系统

Also Published As

Publication number Publication date
US20160234307A1 (en) 2016-08-11

Similar Documents

Publication Publication Date Title
WO2015043455A1 (zh) 数据传输方法、设备及系统
US9454540B2 (en) Systems and methods for sharing files among multiple terminals
KR101548574B1 (ko) 통신 네트워크들에 대한 네트워크 접속된 미디어 게이트웨이
CN103746812B (zh) 一种接入认证方法及系统
EP3276917B1 (en) Terminal remote assistance method, device and system
WO2017024842A1 (zh) 一种上网认证方法及客户端、计算机存储介质
JP6280641B2 (ja) アカウントログイン方法、デバイス及びシステム
CN106656911B (zh) 一种Portal认证方法、接入设备和管理服务器
CN105873055B (zh) 一种无线网络接入认证方法及装置
JP6549320B2 (ja) 通信装置接続方法、端末装置、及びサーバシステム
CN103369531B (zh) 一种基于终端信息进行权限控制的方法及装置
CN103501331B (zh) 数据传输方法、设备及系统
WO2018107593A1 (zh) 一种在不同终端间共享文件的方法及设备
WO2014161266A1 (zh) 应用软件的传输方法、终端及系统
JP2017513151A (ja) プライベートクラウド接続装置クラスタアーキテクチャ
CN105162802B (zh) Portal认证方法及认证服务器
CN109302437B (zh) 一种重定向网站的方法和装置
US20160226849A1 (en) Portal authentication method, broadband network gateway, portal server and system
CN105871853A (zh) 一种入口认证方法和系统
CN110830516B (zh) 一种网络访问方法、装置、网络控制设备及存储介质
JP7135206B2 (ja) アクセス認証
CN105592180B (zh) 一种Portal认证的方法和装置
CN107508822A (zh) 访问控制方法及装置
WO2014179950A1 (zh) 一种文件上传方法、客户端和服务端
CN103200159A (zh) 一种网络访问方法和设备

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 14849990

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 15025401

Country of ref document: US

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 14849990

Country of ref document: EP

Kind code of ref document: A1