Detailed Description
Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While certain embodiments of the present disclosure are shown in the drawings, it is to be understood that the present disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein, but rather are provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the disclosure are for illustration purposes only and are not intended to limit the scope of the disclosure.
It should be understood that the various steps recited in the method embodiments of the present disclosure may be performed in a different order, and/or performed in parallel. Moreover, method embodiments may include additional steps and/or omit performing the illustrated steps. The scope of the present disclosure is not limited in this respect.
The term "include" and variations thereof as used herein are open-ended, i.e., "including but not limited to". The term "based on" is "based, at least in part, on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Relevant definitions for other terms will be given in the following description.
It should be noted that the terms "first", "second", and the like in the present disclosure are only used for distinguishing different devices, modules or units, and are not used for limiting the order or interdependence relationship of the functions performed by the devices, modules or units.
It is noted that references to "a", "an", and "the" modifications in this disclosure are intended to be illustrative rather than limiting, and that those skilled in the art will recognize that "one or more" may be used unless the context clearly dictates otherwise.
The names of messages or information exchanged between devices in the embodiments of the present disclosure are for illustrative purposes only, and are not intended to limit the scope of the messages or information.
Example one
Fig. 1 is a flowchart illustrating a multi-terminal data synchronization method applied to a server according to an embodiment of the present disclosure, where the embodiment of the present disclosure is applicable to a case where a client account implements real-time synchronous update of multiple terminal client data when multiple terminals log in, and the method may be implemented by a multi-terminal data synchronization apparatus configured in the server, and may be implemented by software and/or hardware in a server device.
As shown in fig. 1, the multi-terminal data synchronization method applied to a server provided in the embodiment of the present disclosure includes the following steps:
s110, when detecting that the data updating occurs in the client of the current terminal, determining whether the account of the client is logged in at least one other terminal.
Specifically, after any client of one terminal logs in through a registered account, the server acquires the device identifier, such as a device serial number, of the terminal logging in the account.
The current terminal is the terminal with the data update of the client, other terminals are the terminals with the same account and the other terminals do not have the data update. Illustratively, there is a user who logs in a shopping application simultaneously on a mobile phone, a tablet computer and a desktop computer (or different mobile phone terminals and other terminals with different device identifiers) by using the same account. When a user adds a shopping cart to a commodity or collects a commodity in the shopping application through the mobile phone, the shopping application on the mobile phone generates data updating, and then the mobile phone is the current terminal. When detecting that the data of the current terminal is updated, the server determines whether the account of the shopping application is logged in other terminals, wherein the tablet computer and the desktop computer belong to other terminals.
S120, responding to a determination result that at least one other terminal logs in the account of the client, and sending a data updating instruction to all terminals logging in the account so as to enable the client of the at least one other terminal to synchronously complete data updating, wherein the data updating instruction comprises data to be updated and an updating sequence value, and the updating sequence value is used for representing the number of times of client data updating operation recorded by the server.
The update sequence value is used for representing the number of times of the client data update operation, and is all data update operations of the client account on different terminals recorded by the server, for example, when a client account has data update operations in a mobile phone, a tablet computer and a desktop computer, the server can sequentially record and accumulate the number of times of the client data update operations according to the sequence of the update operations. In each terminal, there is also a corresponding update order value, which records the number of update operations that the client has completed on the terminal where the client is located. For example, assuming that initial values of update sequence values recorded on a server and terminals logging in the same account are all 0, when a data update operation is applied to shopping at a mobile phone terminal, the update sequence value of the mobile phone terminal becomes 1, after detecting that a client of a current terminal has data update and before sending a data update instruction to all terminals logging in the account, the server obtains the update sequence value set for the client, and increments the update sequence value by one, that is, the update sequence value of the server is updated from 0 to 1. When the shopping application of the tablet computer is subjected to data updating operation once, the updating sequence value of the terminal of the tablet computer is changed into 1, correspondingly, when the server detects the data updating operation of the tablet computer, the updating sequence value of the server is updated from 1 to 2, and when other terminals logging in the same account are subjected to data updating operation, the updating sequence value of the server is updated in the same mode.
It should be noted here that the server sends a data update instruction to all terminals registered with the account, that is, the current terminal that has performed data update also receives the data update instruction. In this way, the server side is considered to have a large data volume to be processed, and when the same client side of a plurality of terminals logs in the same account and the plurality of terminals simultaneously perform different data updating operations, one terminal is easily missed to synchronize one data updating operation. And sending a data updating instruction to all terminals logged in with the account by the server, so that all the terminals logged in with the account can synchronize all the data updating steps.
Further, in order to avoid that the current terminal repeatedly executes the data updating operation after receiving the data updating instruction, the data to be updated includes the identifier of the current terminal, that is, the identifier of the terminal where the client implementing the data updating operation is located, such as the identifier of the mobile phone terminal in the above example, so that the terminal receiving the data updating instruction determines whether to execute the current data updating operation. For example, the server sends the data updating instruction to the mobile phone, the tablet computer and the desktop computer terminal at the same time, and the mobile phone terminal recognizes that the current terminal identifier in the data to be updated is the terminal identifier of the mobile phone terminal, which indicates that the data to be updated is updated at the mobile phone terminal, and does not need to execute the data updating instruction again.
Preferably, the data update instruction further includes a data update type identifier, so that after the client obtains the data update instruction of the data update operation for multiple times, if multiple data update type identifiers of the same type exist, the data update is completed according to the latest data to be updated in the data to be updated corresponding to the multiple data update type identifiers of the same type, and thus the data update efficiency of the client can be improved. For example, when a user adds a commodity into a shopping cart and then deletes the commodity in the shopping cart through a mobile phone terminal in a shopping application, and repeats the process for multiple times, and finally adds the commodity into the shopping cart, the tablet personal computer terminal may acquire multiple data update instructions, and then may determine whether the data update operation in the latest data update instruction is to add the commodity into the shopping cart or delete the commodity from the shopping cart according to the data update type identifier in the tree update instruction, and perform an update operation once without repeatedly performing an intermediate process of deleting the commodity in the shopping cart after adding the commodity into the shopping cart.
The embodiment of the disclosure provides a multi-terminal data synchronization method applied to a server, which determines whether a client account logs in other terminals or not when the server detects that a client of a current terminal has data update, and sends a data update instruction to other terminals logging in the client account, wherein the data update instruction comprises data to be updated and an update sequence value, so that a plurality of terminals logging in one client account at the same time realize synchronous data update, the problem that the data update synchronization is actively performed at different terminals, and the plurality of terminals logging in one client account at the same time cannot synchronously update in real time is solved, when any one of the plurality of terminals logging in one client account at the same time has data update, the same applications of other terminals can automatically complete data synchronization in real time and only synchronize data with change, all data do not need to be traversed, the synchronization efficiency is improved, a user does not need to actively pull updated data, and the user experience is improved.
Example two
Fig. 2 is a flowchart illustrating a multi-terminal data synchronization method applied to a client according to a second embodiment of the present disclosure, where the second embodiment of the present disclosure is applicable to a case where a client account implements real-time synchronous update of multiple terminal client data when multiple terminals log in, and the method may be implemented by a multi-terminal data synchronization apparatus configured in a terminal device, and may be implemented by software and/or hardware in the terminal device.
Fig. 2 shows a flowchart of a multi-terminal data synchronization method applied to a client according to a second embodiment of the present disclosure, where the multi-terminal data synchronization method provided in the embodiment of the present disclosure includes the following steps:
s210, receiving a data updating instruction sent by a server, wherein the data updating instruction comprises data to be updated and an updating sequence value, and the updating sequence value is used for representing the number of times of client data updating operation recorded by the server.
Specifically, when the server detects that a client with a terminal has data update and determines that an account of the client is already logged in at least one other terminal, the server sends a data update instruction to all terminals logged in with the account. Then, the terminal that receives the data update instruction issued by the server is the terminal that logs in the same account at the same time. The terminals include a terminal where a data update operation occurs and a terminal to be updated synchronously.
Preferably, the data to be updated includes an identifier of a terminal where the client that implements the data update is located. For example, a user logs in a shopping application simultaneously with the same account on a mobile phone, a tablet computer and a desktop computer (or different mobile phone terminals and other terminals with different device identifiers). When a user adds a shopping cart to a commodity or collects a commodity in the shopping application through a mobile phone, the shopping application on the mobile phone generates data updating, and then the identifier of the mobile phone terminal is the identifier of the terminal where the client side for realizing the data updating is located, so that the terminal receiving the data updating instruction judges whether to execute the current data updating operation. For example, the server sends the data updating instruction to the mobile phone, the tablet computer and the desktop computer terminal at the same time, and the mobile phone terminal recognizes that the identifier of the terminal where the client implementing the data updating is located is the terminal identifier of the mobile phone terminal, which indicates that the data to be updated is updated at the mobile phone terminal, and does not need to execute the data updating instruction again.
Further, the update sequence value is used to indicate the number of times of the data update operation of the client, and is all data update operations of the client account recorded by the server on different terminals, for example, when a data update operation of a client account exists in a mobile phone, a tablet computer, and a desktop computer, the server may sequentially record and accumulate the number of times of the data update operation of the client according to the sequence of the update operations.
S220, judging whether the update sequence value is smaller than or equal to a numerical value obtained by adding one to the current update sequence value of the client at the current terminal where the client is located.
And the current updating sequence value is the number of times of updating operation finished by the client on the current terminal recorded by each terminal. For example, assuming that initial values of update sequence values recorded on the server and each terminal logged in the same account are all 0, when a shopping application at the mobile phone end has a data update operation, the update sequence value of the mobile phone terminal becomes 1, and the current update sequence value of the mobile phone terminal is 1.
Assuming that the current update sequence value of the current terminal is 1, and the update sequence value in the data update instruction received by the current terminal is 2, if 1 plus 1 is exactly equal to 2, it indicates that the data update instruction received by the current terminal is exactly the further data update operation that the current terminal needs to execute, so as to implement synchronous update of the client data in the current terminal.
In an embodiment, assuming that two terminals a and B logged in the same account perform data updating operations at the same time, and the current updating sequence values of the two terminals are both 1, when the server detects the data updating operations of the two terminals at the same time, it is not certain which terminal corresponds to the updating sequence value of the data updating operation as 1, and which terminal corresponds to the data updating operation as 2. Then, the data update instruction with the update order of 1 received by the terminal a may correspond to the data update operation already completed by the terminal a itself, or may correspond to the data update operation completed in the terminal B, and at this time, the current update order value of the terminal a plus 1 is greater than the update order value in the received data update instruction. Therefore, the terminal a needs to further determine whether to perform the data updating operation according to the information such as the data to be updated in the data updating command.
And S230, responding to a judgment result that the update sequence value is less than or equal to a numerical value obtained by adding one to the current update sequence value of the client at the current terminal where the client is located, and finishing data update according to the data update instruction.
Specifically, the current terminal judges whether the identifier belongs to the identifier of the current terminal; if yes, ignoring the received data updating instruction and not executing the data updating. Otherwise, finishing data updating according to the data updating instruction, and adding one to the current updating sequence value.
In an embodiment, if one of the terminals logged in the same account is disconnected from the server due to a network problem, etc., then when the terminal is reconnected to the server and receives a data update command issued by the server, the update sequence value in the data update command may not be equal to the value of the current update sequence value of the terminal plus 1, and the difference between the update sequence value in the data update command and the value of the current update sequence value of the terminal plus 1 is greater than 1. For example, if the current update order of the current terminal is 1 and the update order of the received data update instruction is 7, it indicates that the terminal has 6 times of data update operations that are not synchronized, it needs to request the server for the data update instruction corresponding to the data update operation with the unexecuted update order of 2-6, and then complete the corresponding data update according to all the unexecuted data update instructions. And then, updating the current updating sequence value of the current terminal to the updating sequence value, namely updating 1 to 7.
Preferably, the data update instruction further includes a data update type identifier, and correspondingly, when a plurality of data update type identifiers of the same type exist in the data update instruction corresponding to the plurality of unexecuted update order values, the method further includes: determining the latest data to be updated in the data to be updated corresponding to the data updating type identification of each same type; and finishing the data updating operation corresponding to the plurality of data updating type identifications of the same type according to the latest data to be updated. For example, assuming that the data update operation is an increase of the praise of a certain picture, if the data update type identifier in the data update instruction corresponding to the plurality of unexecuted update sequence values all increases the praise by one, the latest praise may be determined according to the latest data update operation instruction without increasing the praise to the latest value one by one.
The second embodiment of the disclosure provides a multi-terminal data synchronization method applied to a client, which implements data update synchronized with other terminals logging in the same client account by receiving a data update instruction sent by a server, and according to data to be updated and an update sequence value in the data update instruction, solves the problem that a user needs to actively update and synchronize data at different terminals, and a plurality of terminals logging in one client account at the same time cannot synchronously update in real time, and implements that when a client in any one of the plurality of terminals logging in one client account at the same time has data update, the same applications of other terminals can automatically complete data synchronization in real time, and only data with change is synchronized, without traversing all data, improving synchronization efficiency, and without the user actively pulling updated data, the user experience is improved.
EXAMPLE III
Fig. 3 is a schematic structural diagram illustrating a multi-terminal data synchronization apparatus configured in a server according to a third embodiment of the present disclosure, where the third embodiment of the present disclosure is applicable to a case where a client account implements real-time synchronous update of multiple terminal client data when multiple terminals log in, and the multi-terminal data synchronization apparatus provided in the third embodiment of the present disclosure can implement the multi-terminal data synchronization method applied to the server according to the third embodiment of the present disclosure.
As shown in fig. 3, the multi-terminal data synchronization apparatus in the embodiment of the present disclosure includes: a multi-terminallogin judging module 310 and an updateinstruction sending module 320.
The multi-terminallogin judging module 310 is configured to determine whether an account of a client logs in at least one other terminal when detecting that a data update occurs to the client of a current terminal; an updateinstruction sending module 320, configured to send a data update instruction to all terminals that log in the account in response to a determination result that at least one other terminal logs in the account of the client, so that the client of the at least one other terminal completes data update synchronously, where the data update instruction includes data to be updated and an update order value, and the update order value is used to indicate the number of times of data update operations of the client recorded by the server.
The technical scheme of the embodiment of the disclosure determines whether a client account logs in other terminals or not when a server detects that a client of a current terminal has data update, and sends a data update instruction to other terminals logging in the client account, wherein the data update instruction comprises data to be updated and an update sequence value, so that a plurality of terminals logging in one client account at the same time realize synchronous data update, the problems that a user needs to actively update and synchronize data at different terminals and a plurality of terminals logging in one client account at the same time cannot synchronously update in real time are solved, when a client of any one of the terminals logging in one client account at the same time has data update, the same applications of other terminals can automatically complete data synchronization in real time and only synchronize data with change, all data do not need to be traversed, the synchronization efficiency is improved, a user does not need to actively pull updated data, and the user experience is improved.
Further, the multi-terminal data synchronization apparatus configured in the server further includes: and the sequence value updating module is used for acquiring an updating sequence value set aiming at the client and adding one to the updating sequence value after detecting that the data updating of the client of the current terminal occurs and before sending a data updating instruction to all terminals logged with the account.
Optionally, the data to be updated includes an identifier of the current terminal.
Optionally, the data update instruction further includes a data update type identifier, so that after the data update instruction of the data update operation is obtained for multiple times, if multiple data update type identifiers of the same type exist, the data update is completed according to the latest data to be updated in the data to be updated corresponding to the multiple data update type identifiers of the same type.
The data synchronization device configured on multiple terminals of the server provided by the embodiment of the present disclosure is the same as the data synchronization method applied to multiple terminals of the server provided by the embodiment of the present disclosure, and the technical details that are not described in detail in the embodiment of the present disclosure may be referred to the embodiment of the present disclosure, and the embodiment of the present disclosure has the same beneficial effects as the embodiment of the present disclosure.
Example four
Fig. 4 is a schematic structural diagram illustrating a multi-terminal data synchronization apparatus configured at a client according to a fourth embodiment of the present disclosure, where the fourth embodiment of the present disclosure is applicable to a case where a client account implements real-time synchronous update of data of multiple terminal clients when multiple terminals log in, and the multi-terminal data synchronization apparatus provided by the fourth embodiment of the present disclosure can implement the multi-terminal data synchronization method applied to the client according to the foregoing embodiment.
As shown in fig. 4, the multi-terminal data synchronization apparatus configured at the client in the embodiment of the present disclosure includes: an updateinstruction receiving module 410, anupdate judging module 420 and anupdate module 430.
The updateinstruction receiving module 410 is configured to receive a data update instruction issued by a server, where the data update instruction includes data to be updated and an update sequence value, and the update sequence value is used to indicate the number of times of the client data update operation recorded by the server; anupdate determining module 420, configured to determine whether the update sequence value is less than or equal to a value obtained by adding one to the current update sequence value of the current terminal where the client is located; and theupdating module 430 is configured to respond to a determination result that the update sequence value is less than or equal to a value obtained by adding one to the current update sequence value of the client at the current terminal where the client is located, and complete data updating according to the data updating instruction.
According to the technical scheme of the embodiment of the disclosure, the data updating instruction is sent by the receiving server, and according to the data to be updated and the updating sequence value in the data updating instruction, the data updating synchronous with other terminals logging in the same client account is realized, the problems that a user needs to actively perform data updating synchronization on different terminals and a plurality of terminals logging in one client account at the same time cannot synchronously update in real time are solved, when the client in any one of the terminals logging in one client account at the same time has data updating, the data synchronization can be automatically completed in real time by the application with the same other terminals, only the changed data is synchronized, all data does not need to be traversed, the synchronization efficiency is improved, the user does not need to actively pull the updated data, and the user experience is improved.
Optionally, the updatingmodule 430 is specifically configured to: judging whether the identifier belongs to the identifier of the current terminal; if yes, ignoring the data updating instruction, and not executing the data updating; otherwise, finishing data updating according to the data updating instruction, and adding one to the current updating sequence value.
Optionally, the multi-terminal data device configured at the client further includes: and the data request module is used for requesting a server for a data updating instruction corresponding to the updating sequence value which is not executed by the client at the current terminal of the client when the updating sequence value is larger than a numerical value obtained by adding one to the current updating sequence value of the client at the current terminal of the client.
Correspondingly, the updatingmodule 430 is further configured to update the data according to the data updating instruction corresponding to the update sequence value that is not executed by the client at the current terminal where the client is located and requested from the server, and complete data updating; updating the current update order value to the update order value; wherein the unexecuted update order value is an update order value between the current update order value and the update order value.
Preferably, the data update instruction further includes a data update type identifier, and correspondingly, theupdate module 430 is further configured to determine, when multiple data update type identifiers of the same type exist in the data update instruction corresponding to multiple unexecuted update sequence values, the latest data to be updated in the data to be updated corresponding to each data update type identifier of the same type; and finishing the data updating operation corresponding to the plurality of data updating type identifications of the same type according to the latest data to be updated.
The multi-terminal data synchronization device configured on the client according to the embodiment of the present disclosure is the same as the multi-terminal data synchronization method applied to the client according to the embodiment of the present disclosure, and the technical details that are not described in detail in the embodiment of the present disclosure may be referred to in the embodiment of the present disclosure, and the embodiment of the present disclosure has the same beneficial effects as the embodiment of the present disclosure.
EXAMPLE five
Referring now to fig. 5, a block diagram of aterminal device 500 suitable for use in implementing embodiments of the present disclosure is shown. The terminal device in the embodiments of the present disclosure may include, but is not limited to, a mobile terminal such as a mobile phone, a notebook computer, a digital broadcast receiver, a PDA (personal digital assistant), a PAD (tablet computer), a PMP (portable multimedia player), a vehicle terminal (e.g., a car navigation terminal), etc., and a fixed terminal such as a digital TV, a desktop computer, etc., and may further include a server or a server cluster, etc. The terminal device shown in fig. 5 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
As shown in fig. 5, theterminal device 500 may include a processing means (e.g., a central processing unit, a graphic processor, etc.) 501 that may perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM)502 or a program loaded from a storage means 506 into a Random Access Memory (RAM) 503. In theRAM 503, various programs and data necessary for the operation of theterminal apparatus 500 are also stored. Theprocessing device 501, theROM 502, and theRAM 503 are connected to each other through abus 504. An input/output (I/O)interface 505 is also connected tobus 504.
Generally, the following devices may be connected to the I/O interface 505:input devices 506 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.;output devices 507 including, for example, a Liquid Crystal Display (LCD), speakers, vibrators, and the like;storage devices 506 including, for example, magnetic tape, hard disk, etc.; and acommunication device 509. The communication means 509 may allow theterminal device 500 to perform wireless or wired communication with other devices to exchange data. While fig. 5 illustrates aterminal apparatus 500 having various means, it is to be understood that not all illustrated means are required to be implemented or provided. More or fewer devices may alternatively be implemented or provided.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program carried on a non-transitory computer readable medium, the computer program containing program code for performing the method illustrated by the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network via the communication means 509, or installed from the storage means 506, or installed from theROM 502. The computer program performs the above-described functions defined in the methods of the embodiments of the present disclosure when executed by theprocessing device 501.
The functions implemented by the terminal provided by the embodiment of the present disclosure and the multi-terminal data synchronization method applied to the server or the client provided by the embodiment of the present disclosure belong to the same inventive concept, and technical details that are not described in detail in the embodiment of the present disclosure may be referred to in the embodiment of the present disclosure, and the embodiment of the present disclosure have the same beneficial effects.
EXAMPLE six
The embodiment of the present disclosure provides a computer storage medium, on which a computer program is stored, which when executed by a processor implements the multi-terminal data synchronization method applied to a server or a client provided by the above-mentioned embodiment.
It should be noted that the computer readable medium in the present disclosure can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In contrast, in the present disclosure, a computer readable signal medium may comprise a propagated data signal with computer readable program code embodied therein, either in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, RF (radio frequency), etc., or any suitable combination of the foregoing.
In some embodiments, the clients, servers may communicate using any currently known or future developed network Protocol, such as HTTP (HyperText Transfer Protocol), and may interconnect with any form or medium of digital data communication (e.g., a communications network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), the Internet (e.g., the Internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed network.
The computer readable medium may be included in the terminal device; or may exist separately without being assembled into the terminal device.
The computer readable medium carries one or more programs which, when executed by the terminal device, cause the terminal device to: acquiring at least two internet protocol addresses; sending a node evaluation request comprising the at least two internet protocol addresses to node evaluation equipment, wherein the node evaluation equipment selects the internet protocol addresses from the at least two internet protocol addresses and returns the internet protocol addresses; receiving an internet protocol address returned by the node evaluation equipment; wherein the obtained internet protocol address indicates an edge node in the content distribution network.
Alternatively, the computer readable medium carries one or more programs which, when executed by the terminal device, cause the terminal device to: receiving a node evaluation request comprising at least two internet protocol addresses; selecting an internet protocol address from the at least two internet protocol addresses; returning the selected internet protocol address; wherein the received internet protocol address indicates an edge node in the content distribution network.
Computer program code for carrying out operations for the present disclosure may be written in any combination of one or more programming languages, including but not limited to an object oriented programming language such as Java, Smalltalk, C + +, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present disclosure may be implemented by software or hardware. Where the name of a unit does not in some cases constitute a limitation of the unit itself, for example, the first retrieving unit may also be described as a "unit for retrieving at least two internet protocol addresses".
The functions described herein above may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), systems on a chip (SOCs), Complex Programmable Logic Devices (CPLDs), and the like.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
According to one or more embodiments of the present disclosure, [ example one ] there is provided a multi-terminal data synchronization method applied to a server, including:
when detecting that a client of a current terminal has data updating, determining whether an account of the client is logged in at least one other terminal;
and in response to a determination result that at least one other terminal logs in the account of the client, sending a data updating instruction to all terminals logging in the account so as to enable the client of the at least one other terminal to synchronously complete data updating, wherein the data updating instruction comprises data to be updated and an updating sequence value, and the updating sequence value is used for representing the number of times of data updating operation of the client recorded by the server.
In accordance with one or more embodiments of the present disclosure, [ example two ] there is provided the method of example one, further comprising:
after detecting that a client of a current terminal has data updating and before sending data updating instructions to all terminals logged in with the account, acquiring an updating sequence value set for the client, and adding one to the updating sequence value.
In accordance with one or more embodiments of the present disclosure, [ example three ] there is provided the method of example one, further comprising:
the data to be updated comprises the identification of the current terminal.
According to one or more embodiments of the present disclosure, [ example four ] there is provided the method of example one, further comprising:
the data updating instruction further comprises a data updating type identifier, so that after the data updating instruction of multiple data updating operations is obtained by the client, if multiple data updating type identifiers of the same type exist, data updating is completed according to the latest data to be updated in the data to be updated corresponding to the multiple data updating type identifiers of the same type.
According to one or more embodiments of the present disclosure, [ example five ] there is provided a multi-terminal data synchronization method applied to a client, including:
receiving a data updating instruction issued by a server, wherein the data updating instruction comprises data to be updated and an updating sequence value, and the updating sequence value is used for representing the times of the client data updating operation recorded by the server;
judging whether the update sequence value is less than or equal to a numerical value obtained by adding one to the current update sequence value of the client at the current terminal where the client is located;
and responding to a judgment result that the update sequence value is smaller than or equal to a numerical value obtained by adding one to the current update sequence value of the client at the current terminal where the client is positioned, and finishing data update according to the data update instruction.
In accordance with one or more embodiments of the present disclosure, [ example six ] there is provided the method of example five, further comprising:
the data to be updated comprises the identification of the terminal where the client terminal for realizing the data updating is positioned, correspondingly,
completing data updating according to the data updating instruction, comprising:
judging whether the identifier belongs to the identifier of the current terminal;
if yes, ignoring the data updating instruction, and not executing the data updating;
otherwise, finishing data updating according to the data updating instruction, and adding one to the current updating sequence value.
In accordance with one or more embodiments of the present disclosure, [ example seven ] there is provided the method of example five, further comprising:
when the update sequence value is larger than the value obtained by adding one to the current update sequence value of the client at the current terminal, requesting a server for a data update instruction corresponding to the update sequence value which is not executed by the client at the current terminal, and completing data update;
updating the current update order value to the update order value;
wherein the unexecuted update order value is an update order value between the current update order value and the update order value.
In accordance with one or more embodiments of the present disclosure, [ example eight ] there is provided the method of example five, further comprising:
the data update instruction further includes a data update type identifier, and correspondingly, when a plurality of data update type identifiers of the same type exist in the data update instruction corresponding to the plurality of unexecuted update order values, the method further includes:
determining the latest data to be updated in the data to be updated corresponding to the data updating type identification of each same type;
and finishing the data updating operation corresponding to the plurality of data updating type identifications of the same type according to the latest data to be updated.
According to one or more embodiments of the present disclosure, [ example nine ] there is provided a multi-terminal data synchronization apparatus configured at a server, including:
the multi-terminal login judging module is used for determining whether the account of the client logs in at least one other terminal when detecting that the data update occurs to the client of the current terminal;
the update instruction sending module is configured to send a data update instruction to all terminals that log in the account in response to a determination result that at least one other terminal logs in the account of the client, so that the client of the at least one other terminal completes data update synchronously, where the data update instruction includes data to be updated and an update sequence value, and the update sequence value is used to indicate the number of times of data update operations of the client recorded by the server.
In accordance with one or more embodiments of the present disclosure, [ example ten ] there is provided the apparatus of example nine, further comprising:
and the sequence value updating module is used for acquiring an updating sequence value set aiming at the client and adding one to the updating sequence value after detecting that the data updating of the client of the current terminal occurs and before sending a data updating instruction to all terminals logged with the account.
In accordance with one or more embodiments of the present disclosure, [ example eleven ] there is provided the apparatus of example nine, further comprising:
the data to be updated comprises the identification of the current terminal.
In accordance with one or more embodiments of the present disclosure, [ example twelve ] there is provided the apparatus of example nine, further comprising:
the data updating instruction further comprises a data updating type identifier, so that after the data updating instruction of multiple data updating operations is obtained by the client, if multiple data updating type identifiers of the same type exist, data updating is completed according to the latest data to be updated in the data to be updated corresponding to the multiple data updating type identifiers of the same type.
According to one or more embodiments of the present disclosure, [ example thirteen ] there is provided a multi-terminal data synchronization apparatus configured at a client, including:
the update instruction receiving module is used for receiving a data update instruction sent by a server, wherein the data update instruction comprises data to be updated and an update sequence value, and the update sequence value is used for representing the number of times of client data update operation recorded by the server;
the update judging module is used for judging whether the update sequence value is less than or equal to a numerical value obtained by adding one to the current update sequence value of the client at the current terminal of the client;
and the updating module is used for responding to a judgment result that the updating sequence value is smaller than or equal to a numerical value obtained by adding one to the current updating sequence value of the client at the current terminal of the client, and finishing data updating according to the data updating instruction.
In accordance with one or more embodiments of the present disclosure, [ example fourteen ] there is provided the apparatus of example thirteen, further comprising:
the data to be updated comprises the identification of the terminal where the client terminal for realizing the data updating is positioned, correspondingly,
the update module is specifically configured to: judging whether the identifier belongs to the identifier of the current terminal;
if yes, ignoring the data updating instruction, and not executing the data updating;
otherwise, finishing data updating according to the data updating instruction, and adding one to the current updating sequence value.
According to one or more embodiments of the present disclosure, [ example fifteen ] there is provided the apparatus of example thirteen, further comprising:
the multi-terminal data device configured at the client further comprises: a data request module, configured to request, from the server, a data update instruction corresponding to an update order value that is not executed by the client at the current terminal where the client is located when the update order value is greater than a value obtained by adding one to the current update order value of the client at the current terminal where the client is located,
the updating module is also used for updating data according to a data updating instruction corresponding to the updating sequence value which is not executed by the client at the current terminal where the client is located and requested by the server; updating the current update order value to the update order value;
wherein the unexecuted update order value is an update order value between the current update order value and the update order value.
In accordance with one or more embodiments of the present disclosure, [ example sixteen ] there is provided the apparatus of example thirteen, further comprising:
the data updating instruction further comprises a data updating type identifier, and correspondingly, the updating module is further configured to determine the latest data to be updated in the data to be updated corresponding to each data updating type identifier of the same type when a plurality of data updating type identifiers of the same type exist in the data updating instruction corresponding to the plurality of unexecuted updating sequence values; and finishing the data updating operation corresponding to the plurality of data updating type identifications of the same type according to the latest data to be updated.
The foregoing description is only exemplary of the preferred embodiments of the disclosure and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the disclosure herein is not limited to the particular combination of features described above, but also encompasses other embodiments in which any combination of the features described above or their equivalents does not depart from the spirit of the disclosure. For example, the above features and (but not limited to) the features disclosed in this disclosure having similar functions are replaced with each other to form the technical solution.
Further, while operations are depicted in a particular order, this should not be understood as requiring that such operations be performed in the particular order shown or in sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Likewise, while several specific implementation details are included in the above discussion, these should not be construed as limitations on the scope of the disclosure. Certain features that are described in the context of separate embodiments can also be implemented in combination in a single embodiment. Conversely, various features that are described in the context of a single embodiment can also be implemented in multiple embodiments separately or in any suitable subcombination.
Although the subject matter has been described in language specific to structural features and/or methodological acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are disclosed as example forms of implementing the claims.