WO2018166373A1 - 数据同步系统、方法、服务器、客户端及电子设备 - Google Patents
数据同步系统、方法、服务器、客户端及电子设备 Download PDFInfo
- Publication number
- WO2018166373A1 WO2018166373A1 PCT/CN2018/078094 CN2018078094W WO2018166373A1 WO 2018166373 A1 WO2018166373 A1 WO 2018166373A1 CN 2018078094 W CN2018078094 W CN 2018078094W WO 2018166373 A1 WO2018166373 A1 WO 2018166373A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- data
- client
- service
- server
- calculation
- Prior art date
- Legal status (The legal status 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 status listed.)
- Ceased
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
- H04L67/1095—Replication or mirroring of data, e.g. scheduling or transport for data synchronisation between network nodes
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/445—Program loading or initiating
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/54—Interprogram communication
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/14—Session management
- H04L67/141—Setup of application sessions
Definitions
- the present application relates to the field of communications technologies, and in particular, to a data synchronization system, method, server, client, and electronic device.
- the server needs to notify the client of the data in real time, and different types of users use different data.
- the server first informs the client that there is a change through the long connection, and then the client calls the specified interface to obtain the required data from the server according to the needs of processing the data.
- the so-called long connection means that multiple data packets can be continuously transmitted on one connection. During the connection hold period, if there is no data packet transmission, both parties need to send a link detection packet.
- the server needs to organize the downlink service data for different clients locally through logical calculation according to the data content requested by different clients. Since the client immediately requests data from the server after receiving the notification of the data change, this method will suddenly cause a huge momentary pressure on the server, which in turn affects other server processing. It may even cause the server to avalanche.
- the invention provides a data synchronization system, a method, a server, a client and an electronic device, so as to alleviate the pressure of the server during the process of downlink data from the server to the client.
- a data synchronization system based on a C/S architecture including: a server and a client;
- the client uses the calculation logic to perform logical calculation on the attribute data of the user currently logged in to the client, extracts a data part applicable to the client from the service data according to the calculation result, and performs local service data synchronization.
- a data synchronization method based on a C/S architecture including:
- the calculation logic is configured to perform logic calculation on the attribute data of the user currently logged in to the client, so that the client extracts the data part applicable to the client from the service data according to the calculation result, and performs localization.
- Business data synchronization is configured to perform logic calculation on the attribute data of the user currently logged in to the client, so that the client extracts the data part applicable to the client from the service data according to the calculation result, and performs localization.
- Another data synchronization method based on a C/S architecture including:
- Service change data delivered by the server, where the service change data includes service data and calculation logic of at least one service
- the calculation logic is used to logically calculate the attribute data of the user currently logged in to the client, and extract the data part applicable to the client from the service data according to the calculation result, and perform local service data synchronization.
- a server including:
- a data sending module configured to send service change data to the client, where the service change data includes service data and calculation logic of at least one service;
- the calculation logic is configured to perform logic calculation on the attribute data of the user currently logged in to the client, so that the client extracts the data part applicable to the client from the service data according to the calculation result, and performs localization.
- Business data synchronization is configured to perform logic calculation on the attribute data of the user currently logged in to the client, so that the client extracts the data part applicable to the client from the service data according to the calculation result, and performs localization.
- a client including:
- a data receiving module configured to receive service change data delivered by the server, where the service change data includes service data and calculation logic of at least one service;
- the data synchronization module is configured to perform logic calculation on the attribute data of the user currently logged in to the client by using the calculation logic, extract a data part applicable to the client from the service data according to the calculation result, and perform local service data synchronization. .
- an electronic device including:
- a processor coupled to the memory for executing the program for:
- the calculation logic is configured to perform logic calculation on the attribute data of the user currently logged in to the client, so that the client extracts the data part applicable to the client from the service data according to the calculation result, and performs localization.
- Business data synchronization is configured to perform logic calculation on the attribute data of the user currently logged in to the client, so that the client extracts the data part applicable to the client from the service data according to the calculation result, and performs localization.
- another electronic device including:
- a processor coupled to the memory for executing the program for:
- Service change data delivered by the server, where the service change data includes service data and calculation logic of at least one service
- the calculation logic is used to logically calculate the attribute data of the user currently logged in to the client, and extract the data part applicable to the client from the service data according to the calculation result, and perform local service data synchronization.
- the data synchronization system, the method, the server, the client, and the electronic device provided by the present invention when the server synchronizes the service data with the client, the server only needs to send the service change data to the client, and the service change data includes at least one service.
- Figure 1 is a schematic diagram of a conventional C/S architecture
- FIG. 2 is a flowchart of processing downlink data synchronization of a server based on a traditional C/S architecture
- FIG. 3 is a schematic diagram of a C/S architecture according to an embodiment of the present invention.
- FIG. 4 is a flowchart of data synchronization processing based on a C/S architecture according to an embodiment of the present invention
- FIG. 5 is a structural diagram of a data synchronization system based on a C/S architecture according to an embodiment of the present invention
- FIG. 6 is a flowchart 1 of a data synchronization method based on a C/S architecture according to an embodiment of the present invention
- FIG. 7 is a second flowchart of a data synchronization method based on a C/S architecture according to an embodiment of the present invention.
- FIG. 8 is a schematic structural diagram of a server according to an embodiment of the present invention.
- FIG. 9 is a schematic structural diagram of a client according to an embodiment of the present invention.
- FIG. 10 is a schematic structural diagram 1 of an electronic device according to an embodiment of the present invention.
- FIG. 11 is a schematic structural diagram 2 of an electronic device according to an embodiment of the present invention.
- the invention changes the prior art, in the process of server downlink data synchronization under the C/S architecture, the server needs to send a data change notification to the client first, and then according to different data requests of each client, the targeted organization
- the core idea of the service data is that the server sends the entire service data and the calculation logic of the current change to all the clients at one time, so that the client calculates the attribute data of the currently logged-in user through the above calculation logic.
- the business data suitable for the client is extracted from the delivered business data, and then the business data is synchronized, thereby reducing the service burden caused by the server for organizing and delivering business data for different clients.
- a data transmission path is formed between the access layer of the server and the network layer of the client, so that data interaction can be performed between the client and the server, and the server also performs service data synchronization with the client.
- the server In the existing C/S architecture, a data transmission path is formed between the access layer of the server and the network layer of the client, so that data interaction can be performed between the client and the server, and the server also performs service data synchronization with the client.
- the client will choose to establish a long connection with the server.
- the client When the client needs data, it will initiate a data request to pull the required business data from the server.
- This request is typically an http request.
- the client pulls the business data After the client pulls the business data, the underlying link corresponding to the http request will be disconnected.
- Some clients establish a long connection between the client and the server in order to avoid frequent consumption of the underlying link in order to avoid frequent data requests. Initiate an http request on top of a long connection. After the client obtains the business data, it performs business processing locally. Of course, the client can also store the obtained business data for later use.
- FIG. 2 it is a data synchronization processing flow of server downlink data based on a traditional C/S architecture.
- the process of real-time downlink service data from the server to the client includes the following steps:
- the server sends a notification of a service data change through a long connection
- the client After receiving the notification of the business change, the client processes the content of the notification, and parses out the service that the client needs to process;
- the client initiates an interface call corresponding to the service to request corresponding service data from the server.
- the server organizes and generates corresponding business data according to different client data requests
- the server delivers the generated business data to the client, so that the client uses the number of services.
- the server will reduce the frequency when the notification of the downlink service change is made.
- the setting of this frequency will be calculated according to the pressure that the current server can bear. For example: notify all online users within 30 minutes, at this time the server pressure is 7 million / 30 * 60 seconds ⁇ 3.9 thousand / sec.
- the server sends a downlink service change notification to all online clients in a short period of time, but the client randomly requests the server within 30 minutes, and the pressure is the same as the a) scheme.
- the server sends a downlink service change notification to all online clients in a short period of time.
- the client requests the server, but the server performs flow control and can only serve some clients at the same time.
- the problem to be solved by the present invention is how to synchronize data to the client in a low-cost, high-efficiency manner for the application of the C/S architecture, and to enable different types of users to use different data.
- the solution provides an improved C/S architecture.
- the C/S architecture adds data calculation to each client based on the traditional C/S architecture. Floor.
- the server does not send a notification of the service change to the client, and then sends the service data and the calculation logic, and the client will present
- the attribute data of the logged-in user is logically calculated locally by the above calculation logic, so that the business data part required by the user is extracted from the business data according to the calculation result, and the specific service data is not required to be requested from the server.
- FIG. 4 it is a data synchronization processing flow of server downlink data based on the C/S architecture shown in FIG. 3.
- the process of the server real-time downlink service data to the client includes the following steps:
- the server directly downlinks all the changed business data and calculation logic through the long connection established between the server and the client;
- the client After receiving the service data and the calculation logic, the client calculates the attribute data of the currently logged-in user through the calculation logic, and extracts the service data part applicable to the client from the service data according to the calculation result, and performs service processing;
- the client After the client processes the service data successfully, it returns a successful message to the server.
- the server After receiving the message that the receipt processing is successful, the server marks the corresponding user's business data processing successfully for recording.
- a data change can be synchronized to all online clients in a long connection heartbeat cycle (a heartbeat cycle is typically around 90 seconds - 4 minutes), and the client itself handles essentially within a few tens of milliseconds.
- the embodiment of the present invention provides a data synchronization system based on the C/S architecture, which is used to reduce the pressure on the downlink service data of the server to the client. At the same time, improve the synchronization efficiency of downlink data.
- the system includes a server 510 and a client 520.
- the server 510 is configured to send service change data to the client, where the service change data includes service data and calculation logic of at least one service;
- the client 520 is configured to perform logic calculation on the attribute data of the user currently logged in to the client by using the calculation logic, extract the data part applicable to the client from the service data according to the calculation result, and perform local service data synchronization.
- the data transmission may be performed between the server 510 and the client 520 through a pre-established long connection.
- the server 510 includes:
- a data sending module configured to send service change data to the client 520, where the service change data includes service data and calculation logic of at least one service;
- the calculation logic is configured to perform logical calculation on the attribute data of the user currently logged in to the client, so that the client extracts the data part applicable to the client from the service data according to the calculation result, and performs local service data synchronization.
- the data delivery module delivers service change data to the client 520 through a long connection established between the client 520 and the server 510.
- the client 520 After receiving the service change data, the client 520 performs logic calculation on the attribute data of the user currently logged in to the client 520 by using the calculation logic, and extracts the data part applicable to the client 520 from the service data according to the calculation result, and performs localization.
- Business data synchronization After receiving the service change data, the client 520 performs logic calculation on the attribute data of the user currently logged in to the client 520 by using the calculation logic, and extracts the data part applicable to the client 520 from the service data according to the calculation result, and performs localization.
- server 510 may further include:
- the receiving processing module is configured to receive the service data synchronization success message sent by the client, and mark the current service data of the user who logs in to the client as a synchronization success state.
- the service data synchronization message sent to the server 510 is synchronized, and after receiving the message, the server 510 will log in locally.
- the current service data of the user of the client is marked as a synchronization success state to record the business data of the user.
- server 510 may further include:
- the status query module is configured to query, for the current service data to be delivered, whether the service data of the user logged in to the client is marked as a synchronization success status, and if not, the data delivery module is triggered to perform the service change data to the client. Operation.
- the server 510 If the server 510 has stored the record of the user service data of the current client, which is marked as the synchronization success status, the service change data is not sent to the client; otherwise, the trigger data is sent.
- the module performs an operation of delivering business change data to the client.
- Client 520 includes:
- a data receiving module configured to receive service change data delivered by the server 510, where the service change data includes service data and calculation logic of at least one service;
- the data receiving module receives the service change data sent by the client 520 through the long connection established between the client 520 and the server 510.
- the data synchronization module is configured to perform logic calculation on the attribute data of the user currently logged in to the client by using the calculation logic, extract the data part applicable to the client from the service data according to the calculation result, and perform local service data synchronization.
- client 520 further includes:
- the message sending module is configured to send a service data synchronization success message to the server 510 after the current service data is successfully synchronized, so that the server 510 marks the current service data of the user who logs in to the client as a synchronization success state.
- the data synchronization system based on the C/S architecture provided by the embodiment of the present invention does not need to separately send and send service data to each client, so there is no corresponding data.
- the increase of pressure improves the stability of the server, and uses the client to calculate the required business data locally, which effectively exerts the effectiveness of the client and improves the synchronization efficiency of the downlink data of the server.
- FIG. 6 is a flow chart of the data synchronization method based on the C/S architecture shown in the embodiment of the present invention.
- the main server is the C/S architecture.
- the data synchronization method based on the C/S architecture includes the following steps:
- the service change data is sent to the client, where the service change data includes the service data and the calculation logic of the at least one service, where the calculation logic is used to perform logic calculation on the attribute data of the user currently logged in to the client, so that The client extracts a data portion applicable to the client from the service data according to the calculation result, and performs local service data synchronization.
- the calculation logic for the client to select the required business data from all the business data that is sent by the client may be a script program written by Lua.
- Lua is a small scripting language with the following features: lightweight, scalable, efficient, and cross-platform. Lua can run on almost all systems, such as the current mainstream mobile IOS system, and Android also supports the Lua language.
- the function of the calculation logic is to match the service data sent by the server with different clients, so that the client can extract the business data part required by the client from all the service data that is delivered, and the matching basis. It is the attribute data of the user who logs in to the current client.
- the server no longer needs to organize and deliver business data according to the difference of data requested by each client, which reduces the working pressure of the server.
- the server further performs the following steps, that is, the receiving client sends the data.
- the business data is synchronized with the success message, and the current business data of the user who logs in to the client is marked as a synchronization success state for recording.
- the server sends the service data, it can know which clients have delivered the service data, which clients have not delivered the service data, and deliver the service data to the client that has not yet delivered the service data.
- the server sending the service change data to the client may include: the server sending the service change data to the client based on the long connection established with the client.
- the data synchronization method based on the C/S architecture provided in this embodiment uses the server as the execution entity to deliver all the service data and the calculation logic to the client at one time, and the attribute data of the login user is locally performed by the client.
- Computational logic performs calculations to extract the business data it needs from the business data, thereby reducing the server's business pressure.
- FIG. 7 it is a flow chart 2 of a C/S architecture-based data synchronization method according to an embodiment of the present invention.
- the execution of the method is mainly a client under the C/S architecture.
- the data synchronization method based on the C/S architecture includes the following steps:
- S710 Receive service change data delivered by a server, where the service change data includes service data and calculation logic of at least one service;
- the calculation logic may be a script program written in Lua.
- the function of the calculation logic is to match the service data sent by the server with different clients, so that the client can extract the part of the business data required by the client from all the service data that is delivered.
- S720 Perform calculation logic on the attribute data of the user currently logged in to the client by using the calculation logic, extract the data part applicable to the client from the service data according to the calculation result, and perform local service data synchronization.
- the attribute data of the user is obtained from the server after the current user logs in to the client, and the attribute data may include information such as a user name, a user ID, and a client version.
- the client uses the calculation logic to perform logical calculation on the attribute data of the user currently logged in to the client, and the result of the calculation is whether the current service data is applicable to the identifier or indication of the client.
- the client may also send a service data synchronization success message to the server, so that the server marks the current service data of the user who logs in to the client as a synchronization success state.
- the receiving, by the client, the service change data sent by the server may include: receiving, by the client, the service change data delivered by the server based on the long connection established with the server.
- the data synchronization method based on the C/S architecture provided in this embodiment takes the client as the execution subject, and after receiving the service data and the calculation logic sent by the server, the attribute data of the login user is calculated locally on the client side.
- the logic calculates and extracts the required business data from the business data, and uses the business data to perform business processing, thereby reducing the service pressure of the server and improving the data synchronization efficiency of the server downlink data to the client.
- FIG. 8 is a schematic structural diagram of a server according to an embodiment of the present invention.
- the server is configured to perform the method steps shown in FIG. 6, and the method includes:
- the data sending module 810 is configured to send service change data to the client, where the service change data includes service data and calculation logic of at least one service;
- the calculation logic is configured to perform logical calculation on the attribute data of the user currently logged in to the client, so that the client extracts the data part applicable to the client from the service data according to the calculation result, and performs local service data synchronization.
- the foregoing server may further include:
- the receiving processing module 820 is configured to receive a service data synchronization success message sent by the client, and mark the current service data of the user who logs in to the client as a synchronization success state.
- the foregoing server may further include:
- the status querying module 830 is configured to query, for the current service data to be delivered, whether the service data of the user logged in to the client is marked as a synchronization success status, and if not, the trigger data sending module 810 performs the service delivery to the client. The operation of changing data.
- the server provided in this embodiment sends all the service data and calculation logic to the client at one time, and the client calculates the attribute data of the login user locally through the calculation logic to extract the required data from the service data.
- Business data which reduces the pressure on the server business.
- FIG. 9 it is a schematic structural diagram of a client according to an embodiment of the present invention.
- the client may be used to perform the method steps shown in FIG. 7 , including:
- the data receiving module 910 is configured to receive service change data delivered by the server, where the service change data includes service data and calculation logic of at least one service;
- the data synchronization module 920 is configured to perform logic calculation on the attribute data of the user currently logged in to the client by using the calculation logic, extract the data part applicable to the client from the service data according to the calculation result, and perform local service data synchronization.
- the method further includes:
- the message sending module 930 is configured to send a service data synchronization success message to the server after the current service data is successfully synchronized, so that the server marks the current service data of the user who logs in to the client as a synchronization success state.
- the client After receiving the service data and calculation logic sent by the server, the client provided by the client calculates the attribute data of the login user locally through the calculation logic, and extracts the required data from the service data.
- Business data, and the business data is used for business processing, thereby reducing the pressure on the server and improving the data synchronization efficiency of the server downlink data to the client.
- FIG. 10 it is a schematic structural diagram of an electronic device according to an embodiment of the present invention, and specifically includes a memory 101 and a processor 102 .
- the memory 101 is configured to store a program.
- the memory 101 can also be configured to store various other data to support operations on the electronic device. Examples of such data include instructions for any application or method operating on an electronic device, contact data, phone book data, messages, pictures, videos, and the like.
- the memory 101 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read only memory (EEPROM), erasable Programmable Read Only Memory (EPROM), Programmable Read Only Memory (PROM), Read Only Memory (ROM), Magnetic Memory, Flash Memory, Disk or Optical Disk.
- SRAM static random access memory
- EEPROM electrically erasable programmable read only memory
- EPROM erasable Programmable Read Only Memory
- PROM Programmable Read Only Memory
- ROM Read Only Memory
- Magnetic Memory Flash Memory
- Disk Disk
- Optical Disk Optical Disk
- the processor 102 is coupled to the memory 101 for executing a program in the memory 101 for:
- the business change data including business data and calculation logic of at least one service
- the calculation logic is configured to perform logic calculation on the attribute data of the user currently logged in to the client, so that the client extracts the data part applicable to the client from the service data according to the calculation result, and performs local service data. Synchronize.
- the electronic device may further include: a communication component 103, a power component 104, an audio component 105, a display 106, and the like. Only some of the components are schematically illustrated in FIG. 10, and it is not meant that the electronic device includes only the components shown in FIG.
- the communication component 103 is configured to facilitate wired or wireless communication between the electronic device and other devices.
- the electronic device can access a wireless network based on a communication standard such as WiFi, 2G or 3G, or a combination thereof.
- the communication component 103 receives broadcast signals or broadcast associated information from an external broadcast management system via a broadcast channel.
- communication component 103 also includes a near field communication (NFC) module to facilitate short range communication.
- NFC near field communication
- the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
- RFID radio frequency identification
- IrDA infrared data association
- UWB ultra-wideband
- Bluetooth Bluetooth
- a power supply component 104 provides power to various components of the electronic device.
- Power component 104 can include a power management system, one or more power sources, and other components associated with generating, managing, and distributing power for the electronic device.
- the audio component 105 is configured to output and/or input an audio signal.
- the audio component 105 includes a microphone (MIC) that is configured to receive an external audio signal when the electronic device is in an operational mode, such as a call mode, a recording mode, and a voice recognition mode.
- the received audio signal may be further stored in the memory 101 or transmitted via the communication component 103.
- the audio component 105 also includes a speaker for outputting an audio signal.
- the display 106 includes a screen whose screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen can be implemented as a touch screen to receive input signals from the user.
- the touch panel includes one or more touch sensors to sense touches, slides, and gestures on the touch panel. The touch sensor can sense not only the boundaries of the touch or sliding action, but also the duration and pressure associated with the touch or slide operation.
- FIG. 11 it is a schematic structural diagram of the electronic device according to the embodiment of the present invention, and specifically includes: a memory 111 and a processor 112.
- the memory 111 is configured to store a program.
- the memory 111 can also be configured to store various other data to support operations on the electronic device. Examples of such data include instructions for any application or method operating on an electronic device, contact data, phone book data, messages, pictures, videos, and the like.
- the memory 111 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read only memory (EEPROM), erasable.
- SRAM static random access memory
- EEPROM electrically erasable programmable read only memory
- EPROM Programmable Read Only Memory
- PROM Programmable Read Only Memory
- ROM Read Only Memory
- Magnetic Memory Flash Memory
- Disk Disk or Optical Disk.
- the processor 112 is coupled to the memory 111 for executing a program in the memory 111 for:
- Service change data delivered by the server, where the service change data includes service data and calculation logic of at least one service
- the calculation logic is used to logically calculate the attribute data of the user currently logged in to the client, and the data part applicable to the client is extracted from the service data according to the calculation result, and the local service data is synchronized.
- the electronic device may further include: a communication component 113, a power component 114, an audio component 115, a display 116, and the like. Only some of the components are schematically illustrated in FIG. 11, and it is not meant that the electronic device includes only the components shown in FIG.
- Communication component 113 is configured to facilitate wired or wireless communication between the electronic device and other devices.
- the electronic device can access a wireless network based on a communication standard such as WiFi, 2G or 3G, or a combination thereof.
- the communication component 113 receives a broadcast signal or broadcast associated information from an external broadcast management system via a broadcast channel.
- communication component 113 also includes a near field communication (NFC) module to facilitate short range communication.
- NFC near field communication
- the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
- RFID radio frequency identification
- IrDA infrared data association
- UWB ultra-wideband
- Bluetooth Bluetooth
- a power component 114 provides power to various components of the electronic device.
- Power component 114 can include a power management system, one or more power sources, and other components associated with generating, managing, and distributing power for the electronic device.
- the audio component 115 is configured to output and/or input an audio signal.
- the audio component 115 includes a microphone (MIC) that is configured to receive an external audio signal when the electronic device is in an operational mode, such as a call mode, a recording mode, and a voice recognition mode.
- the received audio signal may be further stored in the memory 111 or transmitted via the communication component 113.
- the audio component 115 also includes a speaker for outputting an audio signal.
- the display 116 includes a screen whose screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen can be implemented as a touch screen to receive input signals from the user.
- the touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensor can sense not only the boundaries of the touch or sliding action, but also the duration and pressure associated with the touch or slide operation.
- the aforementioned program can be stored in a computer readable storage medium.
- the program when executed, performs the steps including the foregoing method embodiments; and the foregoing storage medium includes various media that can store program codes, such as a ROM, a RAM, a magnetic disk, or an optical disk.
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Information Transfer Between Computers (AREA)
- Computer And Data Communications (AREA)
Abstract
本发明实施例提供一种数据同步系统、方法、服务器、客户端及电子设备,其中,方法包括:客户端接收服务器下发的业务变更数据,所述业务变更数据包括至少一个业务的业务数据和计算逻辑;客户端采用计算逻辑对当前登录客户端的用户的属性数据进行逻辑计算,根据计算结果从业务数据中提取与该客户端相适用的数据部分,并进行本地业务数据同步。本发明实施例的方案可以减轻服务器下行数据至客户端的过程中,服务器的压力。
Description
本申请要求2017年03月15日递交的申请号为201710153849.6、发明名称为“数据同步系统、方法、服务器、客户端及电子设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
本申请涉及通信技术领域,尤其涉及一种数据同步系统、方法、服务器、客户端及电子设备。
传统的客户端(Client)和服务器(Server)架构(简称“C/S”架构)中,服务器需要把数据实时通知到客户端,并且不同类型的用户使用的数据不同。通常服务器先会通过长连接通知客户端数据有变更,然后客户端根据自身处理数据的需要,调用指定的接口从服务器获取所需的数据。所谓长连接,指在一个连接上可以连续发送多个数据包,在连接保持期间,如果没有数据包发送,需要双方发链路检测包。
现有技术的缺陷:
传统的C/S架构中,服务器需要根据不同客户端所请求的数据内容,在本地通过逻辑计算来组织形成针对不同客户端的下行业务数据。由于客户端在接到数据变更的通知后,会立即向服务器请求数据,此方式会突发性的给服务器造成巨大的瞬间压力,进而影响服务器其他的业务处理。甚至可能造成服务器雪崩。
发明内容
本发明提供了一种数据同步系统、方法、服务器、客户端及电子设备,以减轻服务器下行数据至客户端的过程中,服务器的压力。
为达到上述目的,本发明的实施例采用如下技术方案:
第一方面,提供了一种基于C/S架构的数据同步系统,包括:服务器和客户端;
所述服务器向所述客户端下发业务变更数据,所述业务变更数据包括至少一个业务的业务数据和计算逻辑;
所述客户端采用所述计算逻辑对当前登录客户端的用户的属性数据进行逻辑计算,根据计算结果从所述业务数据中提取与该客户端相适用的数据部分,并进行本地业务数 据同步。
第二方面,提供了一种基于C/S架构的数据同步方法,包括:
向客户端下发业务变更数据,所述业务变更数据包括至少一个业务的业务数据和计算逻辑;
其中,所述计算逻辑用于,对当前登录客户端的用户的属性数据进行逻辑计算,以使所述客户端根据计算结果从所述业务数据中提取与该客户端相适用的数据部分,进行本地业务数据同步。
第三方面,提供了另一种基于C/S架构的数据同步方法,包括:
接收服务器下发的业务变更数据,所述业务变更数据包括至少一个业务的业务数据和计算逻辑;
采用所述计算逻辑对当前登录客户端的用户的属性数据进行逻辑计算,根据计算结果从所述业务数据中提取与该客户端相适用的数据部分,并进行本地业务数据同步。
第四方面,提供了一种服务器,包括:
数据下发模块,用于向客户端下发业务变更数据,所述业务变更数据包括至少一个业务的业务数据和计算逻辑;
其中,所述计算逻辑用于,对当前登录客户端的用户的属性数据进行逻辑计算,以使所述客户端根据计算结果从所述业务数据中提取与该客户端相适用的数据部分,进行本地业务数据同步。
第五方面,提供了一种客户端,包括:
数据接收模块,用于接收服务器下发的业务变更数据,所述业务变更数据包括至少一个业务的业务数据和计算逻辑;
数据同步模块,用于采用所述计算逻辑对当前登录客户端的用户的属性数据进行逻辑计算,根据计算结果从所述业务数据中提取与该客户端相适用的数据部分,并进行本地业务数据同步。
第六方面,提供了一种电子设备,包括:
存储器,用于存储程序;
处理器,耦合至所述存储器,用于执行所述程序,以用于:
向客户端下发业务变更数据,所述业务变更数据包括至少一个业务的业务数据和计算逻辑;
其中,所述计算逻辑用于,对当前登录客户端的用户的属性数据进行逻辑计算,以 使所述客户端根据计算结果从所述业务数据中提取与该客户端相适用的数据部分,进行本地业务数据同步。
第七方面,提供了另一种电子设备,包括:
存储器,用于存储程序;
处理器,耦合至所述存储器,用于执行所述程序,以用于:
接收服务器下发的业务变更数据,所述业务变更数据包括至少一个业务的业务数据和计算逻辑;
采用所述计算逻辑对当前登录客户端的用户的属性数据进行逻辑计算,根据计算结果从所述业务数据中提取与该客户端相适用的数据部分,并进行本地业务数据同步。
本发明提供的数据同步系统、方法、服务器、客户端及电子设备,服务器在向客户端同步业务数据时,只需向客户端下发一次业务变更数据即可,该业务变更数据包括至少一个业务的业务数据和计算逻辑;客户端采用该计算逻辑对当前登录客户端的用户的属性数据进行逻辑计算,根据计算结果从业务数据中提取与该客户端相适用的数据部分,进行本地业务数据同步,从而降低服务器的业务处理压力。
上述说明仅是本申请技术方案的概述,为了能够更清楚了解本申请的技术手段,而可依照说明书的内容予以实施,并且为了让本申请的上述和其它目的、特征和优点能够更明显易懂,以下特举本申请的具体实施方式。
通过阅读下文优选实施方式的详细描述,各种其他的优点和益处对于本领域普通技术人员将变得清楚明了。附图仅用于示出优选实施方式的目的,而并不认为是对本申请的限制。而且在整个附图中,用相同的参考符号表示相同的部件。在附图中:
图1为传统C/S架构的示意图;
图2为基于传统C/S架构的服务器下行数据同步的处理流程图;
图3为本发明实施例的C/S架构示意图;
图4为本发明实施例的基于C/S架构的数据同步处理流程图;
图5为本发明实施例的基于C/S架构的数据同步系统结构图;
图6为本发明实施例的基于C/S架构的数据同步方法流程图一;
图7为本发明实施例的基于C/S架构的数据同步方法流程图二;
图8为本发明实施例的服务器的结构示意图;
图9为本发明实施例的客户端的结构示意图;
图10为本发明实施例的电子设备的结构示意图一;
图11为本发明实施例的电子设备的结构示意图二。
下面将参照附图更详细地描述本公开的示例性实施例。虽然附图中显示了本公开的示例性实施例,然而应当理解,可以以各种形式实现本公开而不应被这里阐述的实施例所限制。相反,提供这些实施例是为了能够更透彻地理解本公开,并且能够将本公开的范围完整的传达给本领域的技术人员。
本发明改变了现有技术中,在C/S架构下的服务器下行数据同步过程中,服务器需先向客户端下发数据变更通知,然后根据各客户端的不同的数据请求,有针对性的组织和下发业务数据,其核心思想在于,服务器通过将当次变更的全部业务数据以及计算逻辑一次性下发给所有客户端,使客户端通过将当前登录的用户的属性数据经上述计算逻辑计算,然后根据计算结果从下发的业务数据中提取出适用于本客户端的业务数据,然后进行业务数据同步,从而减轻了服务器因针对不同客户端进行组织和下发业务数据带来的业务负担,提高了下行业务数据同步的效率。
首先,结合图1所示,对传统的C/S架构进行简单说明。
现有的C/S架构中,服务器的接入层与客户端的网络层之间形成数据传输通路,使得客户端和服务器之间可进行数据交互,这其中也包括服务器向客户端进行业务数据同步。对于C/S架构的交互程序,为了降低客户端多次调用接口完成每次建立链接所消耗的时间,以及服务器能实时的下发数据到达客户端,客户端都会选择与服务器建立一个长连接。
客户端在需要数据的时候会发起一个数据请求从服务器拉取需要的业务数据。这种请求一般是http请求。客户端拉取到业务数据之后,这个http请求对应的底层链接就会断开。有些客户端为了避免频繁发起数据请求导致频繁建立底层链接带来的消耗,会在客户端和服务器之间建立一个长连接。在长连接之上发起http请求。客户端获取到业务数据之后,在本地进行业务处理。当然客户端也可先将获取到的业务数据进行数据存储以备后续使用。
如图2所示,为基于传统C/S架构的服务器下行数据的数据同步处理流程。在传统C/S架构下,服务器实时下行业务数据到客户端的过程包括如下步骤:
服务器通过长连接下行一个业务数据变更的通知;
客户端收到业务变更的通知后,对通知内容进行处理,从中解析出客户端需要处理的业务;
客户端发起获取此业务对应的接口调用,以向服务器请求相应的业务数据;
服务器根据不同客户端数据请求,组织和生成相应的业务数据;
服务器将生成的业务数据下发给客户端,以使客户端使用业务数。
以上的基于传统C/S架构下,服务器实时下行业务数据到客户端的过程存在如下技术缺陷:
成本高:当客户端同时向服务器发起数据请求时,会对服务器造成瞬间压力升高。据不完全统计:当同时在线用户达700万时,服务器下行数据一般在一个心跳周期90秒内完成,即90秒内会有700万的客户端同步发起数据请求,每秒的数据请求量会达到700万/90秒≈8万/秒。这个数据请求量是非常巨大的,假如每台处理机可以处理2000/秒的数据请求,也需要40台机器,而且处理机增多,会导致服务器的不稳定,影响其他的业务。
效率低:因为客户端请求数据会给服务器造成巨大的压力,所以一般在实际实施时会有一些权衡方案。一般的权衡方案如下:
a)服务器在下行业务变更的通知的时候会降低频率,这个频率的设置会考虑到当前服务器能承受的压力来计算。比如:30分钟内通知到全部在线用户,此时服务器的压力为700万/30*60秒≈3.9千/秒。
b)服务器在短时间内下行业务变更通知给全部在线客户端,但是客户端在30分钟内随机请求服务器,压力和a)方案一样。
c)服务器在短时间内下行业务变更通知给全部的在线客户端,客户端请求服务器,但是服务器进行流量控制,同一时间只能服务部分客户端。
以上这些权衡方案都在效率上面做了牺牲,对于某些对时间要求比较高的业务仍没办法满足要求。
本发明要解决的问题是:对于C/S架构的应用如何以低成本、高效率的方式同步数据到客户端,并且能做到不同类型的用户使用不同的数据。
为了解决上述问题,本方案提供了一种改进后的C/S架构,如图3所示,该C/S架构在传统的C/S架构的基础上,在各客户端中增加了数据计算层。与现有服务器下行业务数据至客户端不同的是,在改进后的C/S架构中,服务器不在下发业务变更的通知到 客户端,转而下发业务数据以及计算逻辑,客户端将当前登录的用户的属性数据在本地经上述计算逻辑进行逻辑计算,从而根据计算结果从业务数据中提取自身需要的业务数据部分,而不需要再向服务器请求具体的业务数据。
如图4所示,为基于图3所示的C/S架构的服务器下行数据的数据同步处理流程。在图3所示的C/S架构下,服务器实时下行业务数据到客户端的过程包括如下步骤:
服务器通过其与客户端之间建立的长连接直接下行已变更的所有业务数据和计算逻辑;
客户端收到业务数据和计算逻辑后,将当前登录的用户的属性数据经计算逻辑进行本地计算,并根据计算结果从业务数据中提取中适用于本客户端的业务数据部分,并进行业务处理;
客户端处理业务数据成功后,向服务器回执处理成功的消息;
服务器接收到回执处理成功的消息后,标记相应用户的业务数据处理成功,以进行记录。
改进后的服务器下行业务数据的数据同步流程较现有技术在以下几个方面有所提升:
成本:因为没有客户端向服务器额外发送获取业务数据的数据请求,服务器不必针对每个客户端组织和下发业务数据,所以没有相应压力的增长,提升了服务器的稳定性,不会对服务器的其他正常业务造成影响,不需要额外增加机器来支撑这些数据请求,降低了服务器的成本。
效率:基本上一个数据变更可以在一个长连接心跳周期(一个心跳周期一般在90秒-4分钟左右)可以同步到全部在线客户端,客户端本身处理基本上在几十ms之内。
基于改进后的C/S架构的服务器下行数据的数据同步处理流程,本发明实施例提供了一种基于C/S架构的数据同步系统,用以减轻服务器下行业务数据至客户端过程中的压力,同时提高下行数据的同步效率。如图5所示,该系统包括:服务器510和客户端520。其中,服务器510用于向客户端下发业务变更数据,该业务变更数据包括至少一个业务的业务数据和计算逻辑;
客户端520用于采用计算逻辑对当前登录客户端的用户的属性数据进行逻辑计算,根据计算结果从业务数据中提取与该客户端相适用的数据部分,并进行本地业务数据同步。
其中,服务器510和客户端520之间可通过预先建立的长连接,进行数据传输。
具体地,服务器510包括:
数据下发模块,用于向客户端520下发业务变更数据,该业务变更数据包括至少一个业务的业务数据和计算逻辑;
其中,所述计算逻辑用于,对当前登录客户端的用户的属性数据进行逻辑计算,以使客户端根据计算结果从业务数据中提取与该客户端相适用的数据部分,进行本地业务数据同步。
数据下发模块,通过客户端520与服务器510之间建立的长连接,向客户端520下发业务变更数据。客户端520接收到业务变更数据后,采用计算逻辑对当前登录客户端520的用户的属性数据进行逻辑计算,并根据计算结果从业务数据中提取与该客户端520相适用的数据部分,进行本地业务数据同步。
进一步地,服务器510还可包括:
接收处理模块,用于接收客户端发送的业务数据同步成功消息,并在服务器将登录该客户端的用户的本次业务数据标记为同步成功状态。
如果客户端520成功提取出业务数据中与其相适用的数据部分,并完成本地业务数据同步,会向服务器510发送的业务数据同步成功消息,服务器510收到这样的消息后,会在本地将登录该客户端的用户的本次业务数据标记为同步成功状态,以对该用户的业务数据进行记录。
进一步地,服务器510还可包括:
状态查询模块,用于针对本次待下发的业务数据,查询登录该客户端的用户的业务数据是否标记为同步成功状态,如果否,则触发数据下发模块执行向客户端下发业务变更数据的操作。
如果针对本次待下发的业务数据,服务器510本地已经存储了登录当前客户端的用户业务数据标记为同步成功状态的记录,则不再向该客户端发送业务变更数据;否则,触发数据下发模块执行向该客户端下发业务变更数据的操作。
客户端520包括:
数据接收模块,用于接收服务器510下发的业务变更数据,该业务变更数据包括至少一个业务的业务数据和计算逻辑;
数据接收模块,通过客户端520与服务器510之间建立的长连接,接收客户端520下发业务变更数据。
数据同步模块,用于采用计算逻辑对当前登录客户端的用户的属性数据进行逻辑计 算,根据计算结果从业务数据中提取与该客户端相适用的数据部分,并进行本地业务数据同步。
进一步地,客户端520还包括:
消息发送模块,用于在本次业务数据同步成功后,向服务器510发送业务数据同步成功消息,以使服务器510将登录该客户端的用户的本次业务数据标记为同步成功状态。
本发明实施例提供的基于C/S架构的数据同步系统,由于省去了客户端向服务器额外发送获取业务数据的数据请求,服务器不必针对每个客户端组织和下发业务数据,所以没有相应压力的增长,提升了服务器的稳定性,并且利用客户端在本地计算得到其所需要的业务数据,合理发挥了客户端的效力,提高了服务器下行数据的同步效率。
下面通过多个实施例来进一步说明本申请的技术方案。
实施例一
基于上述客户端在本地通过逻辑计算获取其所需的业务数据的方案思想,如图6所示,其为本发明实施例示出的基于C/S架构的数据同步方法流程图一,该方法的执行主为C/S架构下的服务器。如图6所示,该基于C/S架构的数据同步方法包括如下步骤:
S610,向客户端下发业务变更数据,该业务变更数据包括至少一个业务的业务数据和计算逻辑;其中,所述计算逻辑用于,对当前登录客户端的用户的属性数据进行逻辑计算,以使所述客户端根据计算结果从所述业务数据中提取与该客户端相适用的数据部分,进行本地业务数据同步。
其中,用于供客户端从下发的所有业务数据中选取其所需的业务数据的计算逻辑可以是采用Lua编写的脚本程序。Lua是一个小巧的脚本语言,它具有以下一些特性:轻量级、可扩展、高效率、跨平台。Lua几乎可以运行在所有系统上,例如目前主流的移动端IOS系统,以及Android也都很好的支持了Lua语言。计算逻辑的作用,就是将服务器下发的业务数据与不同的客户端的进行匹配,从而使客户端能够从下发的所有业务数据中提取出其自身所需的业务数据部分,而匹配的依据,就是登录当前客户端的用户的属性数据。
如此,服务器不必再根据各客户端请求数据的差异,有针对性的组织和下发业务数据,减轻了服务器的工作压力。
进一步地,如果客户端成功从下发的业务数据中提取出与该客户端相适用的数据部分,并完成了本地业务数据同步,则相应的,服务器还会执行如下步骤,即接收客户端 发送的业务数据同步成功消息,并在服务器将登录该客户端的用户的本次业务数据标记为同步成功状态,以进行记录。这样,服务器在下发业务数据时,就可以知道哪些客户端已经下发了业务数据,哪些客户端还没有下发业务数据,并向还没有下发本次业务数据的客户端下发业务数据。
在此基础上,在服务器下发业务变更数据至客户端时,可先执行如下步骤:
针对本次待下发的业务数据,查询登录该客户端的用户的业务数据是否标记为同步成功状态,如果否,则执行所述向客户端下发业务变更数据的操作,从而更加准确的下发业务数据。
进一步地,服务器向客户端下发业务变更数据可包括:服务器基于与客户端之间建立的长连接,向客户端下发业务变更数据。
本实施例提供的基于C/S架构的数据同步方法,以服务器为执行主体,通过一次性下发所有的业务数据和计算逻辑至客户端,由客户端在其本地对登录用户的属性数据经计算逻辑进行计算,以从业务数据中提取其所需的业务数据,从而减轻了服务器的业务压力。
实施例二
如图7所示,其为本发明实施例示出的基于C/S架构的数据同步方法流程图二,该方法的执行主为C/S架构下的客户端。如图7所示,该基于C/S架构的数据同步方法包括如下步骤:
S710,接收服务器下发的业务变更数据,该业务变更数据包括至少一个业务的业务数据和计算逻辑;
其中,所述的计算逻辑可以是采用Lua编写的脚本程序。计算逻辑的作用,是将服务器下发的业务数据与不同的客户端的进行匹配,从而使客户端能够从下发的所有业务数据中提取出其自身所需的业务数据部分。
S720,采用计算逻辑对当前登录客户端的用户的属性数据进行逻辑计算,根据计算结果从业务数据中提取与该客户端相适用的数据部分,并进行本地业务数据同步。
其中,所述的用户的属性数据为当前用户登录客户端之后,从服务器获取的,该属性数据可包括用户的:用户名、用户ID、客户端版本等信息。
具体地,客户端采用计算逻辑对当前登录客户端的用户的属性数据进行逻辑计算,计算的结果即为当前业务数据是否适用于客户端的标识或指示。
进一步地,客户端在本次业务数据同步成功后,还可向服务器发送业务数据同步成功消息,以使服务器将登录该客户端的用户的本次业务数据标记为同步成功状态。
进一步地,客户端接收服务器下发的业务变更数据可包括:客户端基于与服务器之间建立的长连接,接收服务器下发的业务变更数据。
本实施例提供的基于C/S架构的数据同步方法,以客户端为执行主体,在接收到服务器下发的业务数据和计算逻辑后,通过在客户端本地,对登录用户的属性数据经计算逻辑进行计算,并从业务数据中提取其所需的业务数据,并采用该业务数据进行业务处理,从而减轻了服务器的业务压力,提高了服务器下行数据至客户端的数据同步效率。
实施例三
如图8所示,为本发明实施例的服务器的结构示意图,该服务器可用于执行如图6所示的方法步骤,其包括:
数据下发模块810,用于向客户端下发业务变更数据,所述业务变更数据包括至少一个业务的业务数据和计算逻辑;
其中,所述计算逻辑用于,对当前登录客户端的用户的属性数据进行逻辑计算,以使客户端根据计算结果从业务数据中提取与该客户端相适用的数据部分,进行本地业务数据同步。
进一步地,如图8所示,上述服务器还可包括:
接收处理模块820,用于接收客户端发送的业务数据同步成功消息,并在服务器将登录该客户端的用户的本次业务数据标记为同步成功状态。
进一步地,如图8所示,上述服务器还可包括:
状态查询模块830,用于针对本次待下发的业务数据,查询登录该客户端的用户的业务数据是否标记为同步成功状态,如果否,则触发数据下发模块810执行向客户端下发业务变更数据的操作。
本实施例提供的服务器,通过一次性下发所有的业务数据和计算逻辑至客户端,由客户端在其本地对登录用户的属性数据经计算逻辑进行计算,以从业务数据中提取其所需的业务数据,从而减轻了服务器的业务压力。
实施例四
如图9所示,为本发明实施例的客户端的结构示意图,该客户端可用于执行如图7 所示的方法步骤,其包括:
数据接收模块910,用于接收服务器下发的业务变更数据,该业务变更数据包括至少一个业务的业务数据和计算逻辑;
数据同步模块920,用于采用计算逻辑对当前登录客户端的用户的属性数据进行逻辑计算,根据计算结果从业务数据中提取与该客户端相适用的数据部分,并进行本地业务数据同步。
进一步地,在图9所示的客户端中,还可包括:
消息发送模块930,用于在本次业务数据同步成功后,向服务器发送业务数据同步成功消息,以使服务器将登录该客户端的用户的本次业务数据标记为同步成功状态。
本实施例提供的客户端,在接收到服务器下发的业务数据和计算逻辑后,通过在客户端本地,对登录用户的属性数据经计算逻辑进行计算,并从业务数据中提取其所需的业务数据,并采用该业务数据进行业务处理,从而减轻了服务器的业务压力,提高了服务器下行数据至客户端的数据同步效率。
实施例五
前面描述了服务器的整体架构,该服务器的功能可借助一种电子设备实现完成,如图10所示,其为本发明实施例的电子设备的结构示意图,具体包括:存储器101和处理器102。
存储器101,用于存储程序。
除上述程序之外,存储器101还可被配置为存储其它各种数据以支持在电子设备上的操作。这些数据的示例包括用于在电子设备上操作的任何应用程序或方法的指令,联系人数据,电话簿数据,消息,图片,视频等。
存储器101可以由任何类型的易失性或非易失性存储设备或者它们的组合实现,如静态随机存取存储器(SRAM),电可擦除可编程只读存储器(EEPROM),可擦除可编程只读存储器(EPROM),可编程只读存储器(PROM),只读存储器(ROM),磁存储器,快闪存储器,磁盘或光盘。
处理器102,耦合至存储器101,用于执行存储器101中的程序,以用于:
向客户端下发业务变更数据,该业务变更数据包括至少一个业务的业务数据和计算逻辑;
其中,所述计算逻辑用于,对当前登录客户端的用户的属性数据进行逻辑计算,以 使客户端根据计算结果从所述业务数据中提取与该客户端相适用的数据部分,进行本地业务数据同步。
上述的具体处理操作已经在前面实施例中进行了详细说明,在此不再赘述。
进一步,如图10所示,电子设备还可以包括:通信组件103、电源组件104、音频组件105、显示器106等其它组件。图10中仅示意性给出部分组件,并不意味着电子设备只包括图10所示组件。
通信组件103被配置为便于电子设备和其他设备之间有线或无线方式的通信。电子设备可以接入基于通信标准的无线网络,如WiFi,2G或3G,或它们的组合。在一个示例性实施例中,通信组件103经由广播信道接收来自外部广播管理系统的广播信号或广播相关信息。在一个示例性实施例中,通信组件103还包括近场通信(NFC)模块,以促进短程通信。例如,在NFC模块可基于射频识别(RFID)技术,红外数据协会(IrDA)技术,超宽带(UWB)技术,蓝牙(BT)技术和其他技术来实现。
电源组件104,为电子设备的各种组件提供电力。电源组件104可以包括电源管理系统,一个或多个电源,及其他与为电子设备生成、管理和分配电力相关联的组件。
音频组件105被配置为输出和/或输入音频信号。例如,音频组件105包括一个麦克风(MIC),当电子设备处于操作模式,如呼叫模式、记录模式和语音识别模式时,麦克风被配置为接收外部音频信号。所接收的音频信号可以被进一步存储在存储器101或经由通信组件103发送。在一些实施例中,音频组件105还包括一个扬声器,用于输出音频信号。
显示器106包括屏幕,其屏幕可以包括液晶显示器(LCD)和触摸面板(TP)。如果屏幕包括触摸面板,屏幕可以被实现为触摸屏,以接收来自用户的输入信号。触摸面板包括一个或多个触摸传感器以感测触摸、滑动和触摸面板上的手势。触摸传感器可以不仅感测触摸或滑动动作的边界,而且还检测与触摸或滑动操作相关的持续时间和压力。
实施例六
前面描述了客户端的整体架构,该客户端的功能可借助一种电子设备实现完成,如图11所示,其为本发明实施例的电子设备的结构示意图,具体包括:存储器111和处理器112。
存储器111,用于存储程序。
除上述程序之外,存储器111还可被配置为存储其它各种数据以支持在电子设备上 的操作。这些数据的示例包括用于在电子设备上操作的任何应用程序或方法的指令,联系人数据,电话簿数据,消息,图片,视频等。
存储器111可以由任何类型的易失性或非易失性存储设备或者它们的组合实现,如静态随机存取存储器(SRAM),电可擦除可编程只读存储器(EEPROM),可擦除可编程只读存储器(EPROM),可编程只读存储器(PROM),只读存储器(ROM),磁存储器,快闪存储器,磁盘或光盘。
处理器112,耦合至存储器111,用于执行存储器111中的程序,以用于:
接收服务器下发的业务变更数据,该业务变更数据包括至少一个业务的业务数据和计算逻辑;
采用计算逻辑对当前登录客户端的用户的属性数据进行逻辑计算,根据计算结果从业务数据中提取与该客户端相适用的数据部分,并进行本地业务数据同步。
上述的具体处理操作已经在前面实施例中进行了详细说明,在此不再赘述。
进一步,如图11所示,电子设备还可以包括:通信组件113、电源组件114、音频组件115、显示器116等其它组件。图11中仅示意性给出部分组件,并不意味着电子设备只包括图11所示组件。
通信组件113被配置为便于电子设备和其他设备之间有线或无线方式的通信。电子设备可以接入基于通信标准的无线网络,如WiFi,2G或3G,或它们的组合。在一个示例性实施例中,通信组件113经由广播信道接收来自外部广播管理系统的广播信号或广播相关信息。在一个示例性实施例中,通信组件113还包括近场通信(NFC)模块,以促进短程通信。例如,在NFC模块可基于射频识别(RFID)技术,红外数据协会(IrDA)技术,超宽带(UWB)技术,蓝牙(BT)技术和其他技术来实现。
电源组件114,为电子设备的各种组件提供电力。电源组件114可以包括电源管理系统,一个或多个电源,及其他与为电子设备生成、管理和分配电力相关联的组件。
音频组件115被配置为输出和/或输入音频信号。例如,音频组件115包括一个麦克风(MIC),当电子设备处于操作模式,如呼叫模式、记录模式和语音识别模式时,麦克风被配置为接收外部音频信号。所接收的音频信号可以被进一步存储在存储器111或经由通信组件113发送。在一些实施例中,音频组件115还包括一个扬声器,用于输出音频信号。
显示器116包括屏幕,其屏幕可以包括液晶显示器(LCD)和触摸面板(TP)。如果屏幕包括触摸面板,屏幕可以被实现为触摸屏,以接收来自用户的输入信号。触摸面 板包括一个或多个触摸传感器以感测触摸、滑动和触摸面板上的手势。触摸传感器可以不仅感测触摸或滑动动作的边界,而且还检测与触摸或滑动操作相关的持续时间和压力。
本领域普通技术人员可以理解:实现上述各方法实施例的全部或部分步骤可以通过程序指令相关的硬件来完成。前述的程序可以存储于一计算机可读取存储介质中。该程序在执行时,执行包括上述各方法实施例的步骤;而前述的存储介质包括:ROM、RAM、磁碟或者光盘等各种可以存储程序代码的介质。
最后应说明的是:以上各实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述各实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分或者全部技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的范围。
Claims (15)
- 一种基于C/S架构的数据同步系统,其特征在于,包括:服务器和客户端;所述服务器,用于向所述客户端下发业务变更数据,所述业务变更数据包括至少一个业务的业务数据和计算逻辑;所述客户端,用于采用所述计算逻辑对当前登录客户端的用户的属性数据进行逻辑计算,根据计算结果从所述业务数据中提取与该客户端相适用的数据部分,并进行本地业务数据同步。
- 一种基于C/S架构的数据同步方法,其特征在于,包括:向客户端下发业务变更数据,所述业务变更数据包括至少一个业务的业务数据和计算逻辑;其中,所述计算逻辑用于,对当前登录客户端的用户的属性数据进行逻辑计算,以使所述客户端根据计算结果从所述业务数据中提取与该客户端相适用的数据部分,进行本地业务数据同步。
- 根据权利要求2所述的方法,其特征在于,所述方法还包括:接收客户端发送的业务数据同步成功消息,并将登录该客户端的用户的本次业务数据标记为同步成功状态。
- 根据权利要求3所述的方法,其特征在于,所述向客户端下发业务变更数据之前,还包括:针对本次待下发的业务数据,查询登录该客户端的用户的业务数据是否标记为同步成功状态,如果否,则执行所述向客户端下发业务变更数据的操作。
- 根据权利要求2所述的方法,其特征在于,所述向客户端下发业务变更数据包括:基于与所述客户端之间建立的长连接,向客户端下所述发业务变更数据。
- 一种基于C/S架构的数据同步方法,其特征在于,包括:接收服务器下发的业务变更数据,所述业务变更数据包括至少一个业务的业务数据和计算逻辑;采用所述计算逻辑对当前登录客户端的用户的属性数据进行逻辑计算,根据计算结果从所述业务数据中提取与该客户端相适用的数据部分,并进行本地业务数据同步。
- 根据权利要求6所述的方法,其特征在于,所述方法还包括:在本次业务数据同步成功后,向服务器发送业务数据同步成功消息,以使所述服务器将登录该客户端的用户的本次业务数据标记为同步成功状态。
- 根据权利要求6所述的方法,其特征在于,所述接收服务器下发的业务变更数据包括:基于与所述服务器之间建立的长连接,接收所述服务器下发的业务变更数据。
- 一种服务器,其特征在于,包括:数据下发模块,用于向客户端下发业务变更数据,所述业务变更数据包括至少一个业务的业务数据和计算逻辑;其中,所述计算逻辑用于,对当前登录客户端的用户的属性数据进行逻辑计算,以使所述客户端根据计算结果从所述业务数据中提取与该客户端相适用的数据部分,进行本地业务数据同步。
- 根据权利要求9所述的服务器,其特征在于,所述服务器还包括:接收处理模块,用于接收客户端发送的业务数据同步成功消息,并在所述服务器将登录该客户端的用户的本次业务数据标记为同步成功状态。
- 根据权利要求10所述的服务器,其特征在于,所述服务器还包括:状态查询模块,用于针对本次待下发的业务数据,查询登录该客户端的用户的业务数据是否标记为同步成功状态,如果否,则触发所述数据下发模块执行所述向客户端下发业务变更数据的操作。
- 一种客户端,其特征在于,包括:数据接收模块,用于接收服务器下发的业务变更数据,所述业务变更数据包括至少一个业务的业务数据和计算逻辑;数据同步模块,用于采用所述计算逻辑对当前登录客户端的用户的属性数据进行逻辑计算,根据计算结果从所述业务数据中提取与该客户端相适用的数据部分,并进行本地业务数据同步。
- 根据权利要求12所述的客户端,其特征在于,所述客户端还包括:消息发送模块,用于在本次业务数据同步成功后,向服务器发送业务数据同步成功消息,以使所述服务器将登录该客户端的用户的本次业务数据标记为同步成功状态。
- 一种电子设备,其特征在于,包括:存储器,用于存储程序;处理器,耦合至所述存储器,用于执行所述程序,以用于:向客户端下发业务变更数据,所述业务变更数据包括至少一个业务的业务数据和计算逻辑;其中,所述计算逻辑用于,对当前登录客户端的用户的属性数据进行逻辑计算,以使所述客户端根据计算结果从所述业务数据中提取与该客户端相适用的数据部分,进行本地业务数据同步。
- 一种电子设备,其特征在于,包括:存储器,用于存储程序;处理器,耦合至所述存储器,用于执行所述程序,以用于:接收服务器下发的业务变更数据,所述业务变更数据包括至少一个业务的业务数据和计算逻辑;采用所述计算逻辑对当前登录客户端的用户的属性数据进行逻辑计算,根据计算结果从所述业务数据中提取与该客户端相适用的数据部分,并进行本地业务数据同步。
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201710153849.6 | 2017-03-15 | ||
| CN201710153849.6A CN108632300B (zh) | 2017-03-15 | 2017-03-15 | 数据同步系统、方法、服务器、客户端及电子设备 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2018166373A1 true WO2018166373A1 (zh) | 2018-09-20 |
Family
ID=63522775
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2018/078094 Ceased WO2018166373A1 (zh) | 2017-03-15 | 2018-03-06 | 数据同步系统、方法、服务器、客户端及电子设备 |
Country Status (3)
| Country | Link |
|---|---|
| CN (1) | CN108632300B (zh) |
| TW (1) | TWI757363B (zh) |
| WO (1) | WO2018166373A1 (zh) |
Cited By (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN112732283A (zh) * | 2021-01-21 | 2021-04-30 | 深圳市位元领航科技有限公司 | 一种客户端-服务器模式的实现方法、客户端以及服务器 |
| CN113051276A (zh) * | 2021-04-21 | 2021-06-29 | 平安普惠企业管理有限公司 | 配置业务服务的方法、装置、计算机设备及存储介质 |
| CN114741444A (zh) * | 2021-01-07 | 2022-07-12 | 腾讯科技(深圳)有限公司 | 一种组织架构调整方法、装置、电子设备及存储介质 |
Families Citing this family (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN113765984B (zh) * | 2021-01-04 | 2025-05-23 | 北京沃东天骏信息技术有限公司 | 一种数据推送方法和装置 |
Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101155022A (zh) * | 2006-09-30 | 2008-04-02 | 华为技术有限公司 | 数据同步方法、系统和装置 |
| CN104539669A (zh) * | 2014-12-17 | 2015-04-22 | 中国电子科技集团公司第十五研究所 | 一种基于移动终端的数据同步方法 |
| CN106155818A (zh) * | 2016-06-17 | 2016-11-23 | 腾讯科技(深圳)有限公司 | 一种终端拉取信息的处理方法和终端以及服务器 |
| CN106209948A (zh) * | 2015-05-07 | 2016-12-07 | 阿里巴巴集团控股有限公司 | 一种数据推送方法及装置 |
Family Cites Families (22)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101009516B (zh) * | 2006-01-26 | 2011-05-04 | 华为技术有限公司 | 一种进行数据同步的方法、系统及装置 |
| CN101227379B (zh) * | 2008-01-25 | 2012-07-04 | 中兴通讯股份有限公司 | 一种实现数据同步的系统和方法 |
| KR101430517B1 (ko) * | 2008-01-31 | 2014-08-19 | 삼성전자주식회사 | 복수의 데이터 통신장치들 간의 데이터 동기 방법 |
| US8139580B2 (en) * | 2008-02-27 | 2012-03-20 | Industrial Technology Research Institute | System and method for providing multicast and broadcast services |
| CN101695032B (zh) * | 2009-11-02 | 2011-08-10 | 中国电信股份有限公司 | 统一客户端、统一客户端的业务配置方法及系统 |
| EP2740058A4 (en) * | 2011-08-03 | 2015-04-22 | Amazon Tech Inc | COLLECTING TRANSACTION DATA ASSOCIATED WITH LOCALLY RECORDED DATA FILES |
| US10360188B2 (en) * | 2012-07-27 | 2019-07-23 | International Business Machines Corporation | Dynamic property data integration framework |
| CN103731447B (zh) * | 2012-10-11 | 2019-03-26 | 腾讯科技(深圳)有限公司 | 一种数据查询方法及系统 |
| EP3670112B1 (en) * | 2013-02-15 | 2025-10-29 | Intuitive Surgical Operations, Inc. | Systems and methods for synchronizing nodes of a robotic system |
| CN104065613B (zh) * | 2013-03-18 | 2017-11-21 | 中国移动通信集团内蒙古有限公司 | 一种应用的离线操作数据的同步方法、系统及装置 |
| US10216814B2 (en) * | 2013-05-17 | 2019-02-26 | Oracle International Corporation | Supporting combination of flow based ETL and entity relationship based ETL |
| CN103338144B (zh) * | 2013-05-30 | 2016-06-22 | 华为软件技术有限公司 | 一种会话数据同步方法和装置 |
| CN104216902B (zh) * | 2013-05-31 | 2018-10-02 | 西门子公司 | 一种基于服务器分页的分页数据装载方法、装置和系统 |
| CN103744847A (zh) * | 2013-09-25 | 2014-04-23 | 宁波大学 | 一种适用于SQL Server数据库的数据下载方法 |
| CN104580085B (zh) * | 2013-10-17 | 2019-12-13 | 腾讯科技(深圳)有限公司 | 业务数据更新方法、系统、客户端及服务器 |
| CN104182234B (zh) * | 2014-08-25 | 2017-10-10 | 杭州华为数字技术有限公司 | 一种业务处理方法和业务系统 |
| CN104267939B (zh) * | 2014-09-17 | 2017-08-29 | 华为技术有限公司 | 一种业务处理的方法、装置及系统 |
| CN104580522A (zh) * | 2015-01-30 | 2015-04-29 | 宁波凯智信息科技有限公司 | 客户端与服务器端之间数据同步的方法及系统 |
| US9413824B1 (en) * | 2015-01-30 | 2016-08-09 | Dropbox, Inc. | Storage constrained synchronization of content items based on predicted user access to shared content items using retention scoring |
| CN104780211B (zh) * | 2015-04-13 | 2016-09-07 | 努比亚技术有限公司 | 数据同步方法和装置 |
| US9317575B1 (en) * | 2015-05-20 | 2016-04-19 | Atlassian Pty Ltd. | Systems and methods for synchronizing data |
| CN105760447A (zh) * | 2016-02-03 | 2016-07-13 | 网易(杭州)网络有限公司 | 思维导图的处理方法、服务器和客户端 |
-
2017
- 2017-03-15 CN CN201710153849.6A patent/CN108632300B/zh active Active
- 2017-11-07 TW TW106138407A patent/TWI757363B/zh not_active IP Right Cessation
-
2018
- 2018-03-06 WO PCT/CN2018/078094 patent/WO2018166373A1/zh not_active Ceased
Patent Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101155022A (zh) * | 2006-09-30 | 2008-04-02 | 华为技术有限公司 | 数据同步方法、系统和装置 |
| CN104539669A (zh) * | 2014-12-17 | 2015-04-22 | 中国电子科技集团公司第十五研究所 | 一种基于移动终端的数据同步方法 |
| CN106209948A (zh) * | 2015-05-07 | 2016-12-07 | 阿里巴巴集团控股有限公司 | 一种数据推送方法及装置 |
| CN106155818A (zh) * | 2016-06-17 | 2016-11-23 | 腾讯科技(深圳)有限公司 | 一种终端拉取信息的处理方法和终端以及服务器 |
Cited By (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN114741444A (zh) * | 2021-01-07 | 2022-07-12 | 腾讯科技(深圳)有限公司 | 一种组织架构调整方法、装置、电子设备及存储介质 |
| CN112732283A (zh) * | 2021-01-21 | 2021-04-30 | 深圳市位元领航科技有限公司 | 一种客户端-服务器模式的实现方法、客户端以及服务器 |
| CN112732283B (zh) * | 2021-01-21 | 2024-06-11 | 深圳市位元领航科技有限公司 | 一种客户端-服务器模式的实现方法、客户端以及服务器 |
| CN113051276A (zh) * | 2021-04-21 | 2021-06-29 | 平安普惠企业管理有限公司 | 配置业务服务的方法、装置、计算机设备及存储介质 |
| CN113051276B (zh) * | 2021-04-21 | 2022-08-19 | 平安普惠企业管理有限公司 | 配置业务服务的方法、装置、计算机设备及存储介质 |
Also Published As
| Publication number | Publication date |
|---|---|
| TW201835783A (zh) | 2018-10-01 |
| CN108632300B (zh) | 2021-12-10 |
| CN108632300A (zh) | 2018-10-09 |
| TWI757363B (zh) | 2022-03-11 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN106487742B (zh) | 用于验证源地址有效性的方法及装置 | |
| US9270815B2 (en) | Method and apparatus for data management of third party services | |
| US10841215B2 (en) | Apparatus and method for accessing a back-end service | |
| WO2018166373A1 (zh) | 数据同步系统、方法、服务器、客户端及电子设备 | |
| US10397647B2 (en) | System and method for delivering interactive trigger events | |
| US9686506B2 (en) | Method, apparatus, system, and storage medium for video call and video call control | |
| US9736518B2 (en) | Content streaming and broadcasting | |
| US20220353552A1 (en) | Methods and devices for pulling live stream | |
| US10721311B1 (en) | System and method for coupling two separate applications to an application session within a serverless infrastructure | |
| EP2748788A2 (en) | Method for transferring media playback from a different device | |
| US9756373B2 (en) | Content streaming and broadcasting | |
| US10778742B2 (en) | System and method for sharing multimedia content with synched playback controls | |
| CN107920018B (zh) | 一种实现延迟推送数据的方法、服务器及系统 | |
| US20140254788A1 (en) | Communication between a mobile device and a call center | |
| US9693112B2 (en) | Remote control system for a smart television | |
| CN105812878B (zh) | 视频点播vod的播放方法及装置 | |
| CN113806700A (zh) | 一种信息展示方法及装置 | |
| US10515473B2 (en) | Method and apparatus for generating actionable marked objects in images | |
| CN121116795A (zh) | 一种应用程序回溯方法、装置及电子设备 | |
| CN119728670A (zh) | 一种基于cdn和对象存储的文件分发方法及装置 | |
| US20170064377A1 (en) | Content streaming and broadcasting |
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: 18768689 Country of ref document: EP Kind code of ref document: A1 |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |
|
| 122 | Ep: pct application non-entry in european phase |
Ref document number: 18768689 Country of ref document: EP Kind code of ref document: A1 |