CN112769677A - Data synchronization method, data synchronization device, electronic equipment, storage medium and program product - Google Patents

Data synchronization method, data synchronization device, electronic equipment, storage medium and program product Download PDF

Info

Publication number
CN112769677A
CN112769677A CN202011643438.3A CN202011643438A CN112769677A CN 112769677 A CN112769677 A CN 112769677A CN 202011643438 A CN202011643438 A CN 202011643438A CN 112769677 A CN112769677 A CN 112769677A
Authority
CN
China
Prior art keywords
session
target
data
list
group
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.)
Granted
Application number
CN202011643438.3A
Other languages
Chinese (zh)
Other versions
CN112769677B (en
Inventor
刘硕
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Dajia Internet Information Technology Co Ltd
Original Assignee
Beijing Dajia Internet Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Dajia Internet Information Technology Co Ltd filed Critical Beijing Dajia Internet Information Technology Co Ltd
Priority to CN202011643438.3A priority Critical patent/CN112769677B/en
Publication of CN112769677A publication Critical patent/CN112769677A/en
Application granted granted Critical
Publication of CN112769677B publication Critical patent/CN112769677B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L51/00User-to-user messaging in packet-switching networks, transmitted according to store-and-forward or real-time protocols, e.g. e-mail
    • H04L51/21Monitoring or handling of messages
    • H04L51/216Handling conversation history, e.g. grouping of messages in sessions or threads
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1095Replication or mirroring of data, e.g. scheduling or transport for data synchronisation between network nodes

Abstract

The present disclosure relates to a data synchronization method, apparatus, electronic device, computer-readable storage medium and computer program product for instant messaging, wherein the method comprises: acquiring a session group corresponding to a target account, wherein the session group comprises a mapping list, the mapping list is used for pointing to a session list corresponding to the target account, and session data are stored in the session list; determining a target session group and a target mapping list in the session group; determining target session data in the session list according to the target mapping list; and transmitting the target session data to a terminal corresponding to the target account. The server determines the target session data to be synchronized in the session list according to the mapping list in the session group, and transmits the target session data to the terminal at one time, so that the session data to be synchronized are prevented from being determined and transmitted for multiple times, the occupation of system resources of the server is reduced, the processing pressure of the server is reduced, and the network resources between the terminal and the server are saved.

Description

Data synchronization method, data synchronization device, electronic equipment, storage medium and program product
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a method and an apparatus for data synchronization in instant messaging, an electronic device, a computer-readable storage medium, and a computer program product.
Background
Instant messaging applications are now being used more and more frequently, and accordingly a large amount of session data is also being generated.
In the related art, when a user logs in the same instant messaging account on different terminals, the later logged-in terminal requests the server for synchronous session data. If the session data to be synchronized on the server is more, the server needs to transmit the session data to be synchronized to the terminal for multiple times, the system resources of the server are occupied for multiple times, and the processing pressure of the server is higher. Moreover, the session data to be synchronized can be synchronized only through multiple interactions between the terminal and the server, so that network consumption between the terminal and the server is increased.
Disclosure of Invention
The present disclosure provides a data synchronization method, apparatus, electronic device, computer-readable storage medium, and computer program product for instant messaging, so as to at least solve the problems in the related art that a server repeatedly transmits session data to be synchronized to a terminal, which results in multiple times of occupation of system resources of the server, a large processing pressure of the server, and consumption of network resources between the terminal and the server. The technical scheme of the disclosure is as follows:
according to a first aspect of the embodiments of the present disclosure, there is provided a data synchronization method for instant messaging, applied to a server, the method including: acquiring a session group corresponding to a target account, wherein the session group comprises a mapping list, the mapping list is used for pointing to a session list corresponding to the target account, and session data are stored in the session list; in the session group, determining a target session group and a target mapping list in the target session group, wherein the target session group is the changed session group, or the target session group is all the session groups; determining target session data to be synchronized in the session list according to the target mapping list; and transmitting the target session data to a terminal corresponding to the target account.
Optionally, before the obtaining of the session group corresponding to the target account, the method further includes: and receiving a data request sent by the terminal, wherein the data request comprises the target account.
Optionally, the data request further includes a synchronization identifier, the session group further includes a setup time of the mapping list, and determining, in the session group, a target session group and a target mapping list in the target session group includes: when the synchronous identifier is a time identifier, determining a changed session group which is positioned after the time represented by the time identifier as a target session group; determining a mapping list changed after the time in the target session group as a target mapping list; and the time identification represents the time of the session data corresponding to the target account, which is received by the terminal from the server last time.
Optionally, the determining, in the session group, a target session group and a target mapping list in the target session group further includes: when the synchronous identification is the primary synchronous state identification, all the session groups corresponding to the target account are determined as target session groups; determining all mapping lists in the target session group as target mapping lists; the primary synchronization state identification represents session data which are received by the terminal from the server for the first time and correspond to the target account.
Optionally, the mapping list includes a storage address of session data in the session list, and determining target session data to be synchronized in the session list according to the target mapping list includes: and determining target session data to be synchronized in the session list according to the storage address of the session data in the target mapping list.
Optionally, before the obtaining of the session group corresponding to the target account, the method further includes: and reading the target account locally at the server according to a preset period.
According to a second aspect of the embodiments of the present disclosure, there is provided an instant messaging data synchronization apparatus, applied to a server, the apparatus including: the group acquisition unit is configured to execute acquisition of a session group corresponding to a target account, wherein the session group comprises a mapping list, the mapping list is used for pointing to a session list corresponding to the target account, and session data are stored in the session list; a target determining unit configured to determine, in the session groups, a target session group and a target mapping list in the target session group, where the target session group is the session group that changes or the target session group is all the session groups; the session determining unit is configured to determine target session data to be synchronized in the session list according to the target mapping list; and the session transmission unit is configured to transmit the target session data to a terminal corresponding to the target account.
Optionally, the apparatus further comprises: the request receiving unit is configured to receive a data request sent by the terminal before the group acquiring unit acquires the session group corresponding to the target account, wherein the data request includes the target account.
Optionally, the data request further includes a synchronization identifier, the session packet further includes a setup time of the mapping list, and the target determining unit includes: a target session group determination unit configured to perform, when the synchronization flag is a time flag, determining a session group that changes after a time indicated by the time flag as a target session group; a target mapping list determination unit configured to perform determination of a mapping list, which changes after the time, in the target session group, as a target mapping list; and the time identification represents the time of the session data corresponding to the target account, which is received by the terminal from the server last time.
Optionally, the target session group determining unit is further configured to determine all session groups corresponding to the target account as target session groups when the synchronization identifier is a primary synchronization status identifier; the target mapping list determining unit is further configured to perform determining all mapping lists in the target session group as a target mapping list; the primary synchronization state identification represents session data which are received by the terminal from the server for the first time and correspond to the target account.
Optionally, the mapping list includes a storage address of session data in the session list, and the session determining unit is configured to determine, according to the storage address of the session data in the target mapping list, target session data to be synchronized in the session list.
Optionally, the apparatus further comprises: the account reading unit is configured to perform reading of the target account according to a preset period locally at the server before the group acquiring unit acquires the session group corresponding to the target account.
According to a third aspect of the embodiments of the present disclosure, there is provided an electronic apparatus including: a processor; a memory for storing the processor-executable instructions; wherein the processor is configured to execute the instructions to implement the data synchronization method of instant messaging according to the first aspect.
According to a fourth aspect of embodiments of the present disclosure, there is provided a computer-readable storage medium, wherein instructions of the computer-readable storage medium, when executed by a processor of an electronic device, enable the electronic device to perform the data synchronization method of instant messaging according to the first aspect.
According to a fifth aspect of the embodiments of the present disclosure, there is provided a computer program product, including a computer program, which when executed by a processor, implements the data synchronization method of instant messaging according to the first aspect.
The technical scheme provided by the embodiment of the disclosure at least brings the following beneficial effects:
the data synchronization scheme of instant messaging provided by the embodiment of the disclosure is applied to a server. And acquiring a session group corresponding to the target account, wherein the session group comprises a mapping list, the mapping list is used for pointing to a session list corresponding to the target account, and session data are stored in the session list. In the session group, a target session group and a target mapping list in the target session group are determined, wherein the target session group is a changed session group, or the target session group is a whole session group. And then, determining target session data to be synchronized in the session list according to the target mapping list, and further transmitting the target session data to a terminal corresponding to the target account.
The server of the embodiment of the disclosure stores session data and session packets of instant messaging. The session packet contains a mapping list for determining session data, and the mapping list can point to a session list storing the session data. Therefore, the server may obtain the session group corresponding to the target account, and then determine which session groups include the mapping list required for this synchronization in the session group, that is, may determine the target session group from a plurality of session groups, and determine the target mapping list from a plurality of mapping lists in the target session group. After the target mapping list is determined, target session data to be synchronized can be determined according to the session list pointed by the target mapping list, and finally, the target session data are transmitted to the terminal, so that the session data of instant messaging are completed and synchronized to the terminal from the server. According to the embodiment of the disclosure, the server determines the target session data to be synchronized in the session list according to the mapping list in the session group, and transmits the target session data to the terminal at one time, so that the session data to be synchronized is prevented from being determined and transmitted by the server for multiple times, the occupation of system resources of the server is reduced, the processing pressure of the server is relieved, and network resources between the terminal and the server are saved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the disclosure and are not to be construed as limiting the disclosure.
Fig. 1 is a flowchart illustrating a data synchronization method for instant messaging according to an exemplary embodiment.
Fig. 2 is a diagram illustrating a plurality of session packets at a time, according to an example embodiment.
Fig. 3 is a diagram illustrating multiple conversation groups at another time, according to an example embodiment.
Fig. 4 is a block diagram illustrating an instant messaging data synchronization apparatus according to an exemplary embodiment.
Fig. 5 is a block diagram illustrating an instant messaging data synchronization electronic device in accordance with an exemplary embodiment.
Fig. 6 is a block diagram illustrating an electronic device for synchronizing data for instant messaging in accordance with an exemplary embodiment.
Detailed Description
In order to make the technical solutions of the present disclosure better understood by those of ordinary skill in the art, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings.
It should be noted that the terms "first," "second," and the like in the description and claims of the present disclosure and in the above-described drawings are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the disclosure described herein are capable of operation in sequences other than those illustrated or otherwise described herein. The implementations described in the exemplary embodiments below are not intended to represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.
Fig. 1 is a flowchart illustrating a data synchronization method for instant messaging according to an exemplary embodiment, which may be applied to a server, as shown in fig. 1. The data synchronization method of instant messaging can comprise the following steps.
In step S11, the session group corresponding to the target account is acquired.
In an embodiment of the present disclosure, the target account may be an account of an instant messaging application, and the subsequently determined target session data to be synchronized, that is, session data generated by the target account interacting with other accounts by logging in the instant messaging application. The server stores session groups of a plurality of accounts. The session groups of each account may be distinguished by the account identification of the respective account. .
In the embodiment of the present disclosure, the server further stores a session list of a plurality of accounts, and the session list of each account stores session data of each account. The session group in the server contains a mapping list, which may point to a list of sessions for each account.
In step S12, among the session groups, the target session group and the target mapping list in the target session group are determined.
In the embodiment of the present disclosure, the session group corresponding to the target account may include a plurality of session groups, but not all the session groups corresponding to the target account are session groups required for this data synchronization, and therefore, it is necessary to identify a target session group required for this data synchronization from among the plurality of session groups corresponding to the target account. The target session group is a changed session group or the target session group is an entire session group. Similarly, the target session group includes a plurality of mapping lists, and not all mapping lists in the target session group are necessarily mapping lists required for this data synchronization, so that the target mapping list required for this data synchronization needs to be determined in the target session group.
In step S13, target session data to be synchronized in the session list is determined according to the target mapping list.
In the embodiment of the present disclosure, because the mapping list is used to point to the session list corresponding to the target account, the target mapping list required by the data synchronization this time is pointed to, and the session data stored in the session list pointed to is the target session data required by the data synchronization this time.
In step S14, the target session data is transmitted to the terminal corresponding to the target account.
In the embodiment of the disclosure, the server determines the target session data required by the data synchronization from the large amount of session data stored this time, and transmits the target session data to the terminal corresponding to the target account, thereby implementing the function of synchronizing the session data from the server to the terminal.
The data synchronization scheme of instant messaging provided by the embodiment of the disclosure is applied to a server. And acquiring a session group corresponding to the target account, wherein the session group comprises a mapping list, the mapping list is used for pointing to a session list corresponding to the target account, and session data are stored in the session list. In the session group, a target session group and a target mapping list in the target session group are determined. The target session group is a changed session group or the target session group is an entire session group. And then, determining target session data to be synchronized in the session list according to the target mapping list, and further transmitting the target session data to a terminal corresponding to the target account.
The server of the embodiment of the disclosure stores session data and session packets of instant messaging. The session packet contains a mapping list for determining session data, and the mapping list can point to a session list storing the session data. Therefore, the server may obtain the session group corresponding to the target account, and then determine which session groups include the mapping list required for this synchronization in the session group, that is, may determine the target session group from a plurality of session groups, and determine the target mapping list from a plurality of mapping lists in the target session group. After the target mapping list is determined, target session data to be synchronized can be determined according to the session list pointed by the target mapping list, and finally, the target session data are transmitted to the terminal, so that the session data of instant messaging are completed and synchronized to the terminal from the server. According to the embodiment of the disclosure, the server determines the target session data to be synchronized in the session list according to the mapping list in the session group, and transmits the target session data to the terminal at one time, so that the session data to be synchronized is prevented from being determined and transmitted by the server for multiple times, the occupation of system resources of the server is reduced, the processing pressure of the server is relieved, and network resources between the terminal and the server are saved.
The embodiment of the present disclosure may synchronize session data from a server to a terminal, and may include two data synchronization schemes, where in the first scheme, the terminal sends a data request to the server, and the server transmits target session data to the terminal according to the data request. And in the second scheme, the server actively transmits the target session data to the terminal. In the following, the two schemes described above will be described in detail.
In an exemplary embodiment of the present disclosure, for the first solution, before acquiring a session group corresponding to a target account, a server receives a data request sent by a terminal, where the data request includes the target account. That is, the server may also receive the target account when receiving the data request from the terminal. The data request indicates that the terminal desires to synchronize the session data from the server, and the target account in the data request indicates an account corresponding to the session data to be synchronized. The server receives the data request containing the target account from the terminal, can obtain the session group corresponding to the target account in a targeted manner, finally determines the target session data to be synchronized, and returns the target session data to the terminal. According to the embodiment of the invention, the data request is sent by the terminal, and the server receives the data request, so that the server can pertinently transmit the target session data to the terminal, and when the server receives the data request, the target session data to be synchronized is determined, thereby avoiding the server from frequently and actively determining the target session data to be synchronized of different accounts, reducing the resource occupation of the server, and reducing the operation pressure of the server.
In an exemplary embodiment of the present disclosure, the data request sent by the terminal includes a synchronization identifier in addition to the target account. The session packet also contains the setup time of the mapping list. In the session grouping, when the target session grouping and a target mapping list in the target session grouping are determined, when the synchronous identifier is a time identifier, determining the changed session grouping after the time represented by the time identifier as the target session grouping, wherein the target session grouping is the changed session grouping; and determining a mapping list which changes after time in the target session group as a target mapping list. The time mark represents the time of the session data corresponding to the target account, which is received by the terminal from the server last time. And if the terminal receives the session data corresponding to the target account from the server, the terminal takes the time of receiving the session data corresponding to the target account from the server last time as a time identifier, carries the time identifier in the data request and sends the data request to the server. The server receives the data request, and if the synchronization identifier in the data request is the time identifier, the server may determine that the terminal has synchronized the session data from the server, that is, the server does not need to determine all the session data corresponding to the target account as the target session data to be synchronized, and the server may determine the target session data from all the session data corresponding to the target account. In practical applications, before the server determines the target session data, it needs to determine the target session group from a plurality of session groups, and then determine the target mapping list from a plurality of mapping lists of the target session group. The basis of determining the target conversation group is the time represented by the time identifier, and the conversation group which is located after the time represented by the time identifier and changes is the target conversation group. And determining the basis of the target mapping list, namely the time represented by the time identifier, and determining the mapping list which changes after the time represented by the time identifier as the target mapping list. After the server of the embodiment of the present disclosure receives the data request with the synchronization identifier being the time identifier, it may determine the session packet that changes after the time represented by the time identifier as the target session packet, and determine the mapping list that changes after the time represented by the time identifier as the target mapping list. That is, the server may select a part of the session groups from the plurality of session groups as the target session groups according to the time identifier, select a part of the mapping list from the target session groups as the target mapping list according to the time identifier, and select a part of the session groups and a part of the mapping list in a targeted manner, thereby avoiding using all the session groups as the target session groups and using all the mapping list as the target mapping list, and improving the accuracy of the target session groups and the target mapping list.
In an exemplary embodiment of the present disclosure, in a session group, when a target session group and a target mapping list in the target session group are determined, when a synchronization identifier is a primary synchronization status identifier, all session groups corresponding to a target account are determined as the target session group, and at this time, the target session group is all session groups; determining all mapping lists in the target session group as target mapping lists; the initial synchronization state identification represents session data which are received by the terminal from the server for the first time and correspond to the target account. And if the terminal does not receive the session data corresponding to the target account from the server, the terminal carries the preset primary synchronization state identifier in the data request and sends the data request to the server. The server receives the data request, and if the synchronization identifier in the data request is the primary synchronization state identifier, the server may determine that the terminal has not synchronized session data from the server. After receiving the data request with the synchronization identifier being the initial synchronization status identifier, the server according to the embodiment of the present disclosure may determine all session groups corresponding to the target account as target session groups, and determine all mapping lists in the target session groups as target mapping lists. That is, the terminal does not synchronize session data from the server, the server takes all the session groups corresponding to the target account as the target session groups, and takes all the mapping lists in the target session groups as the target mapping lists, so that the situation that part of the session groups are taken as the target session groups and part of the mapping lists are taken as the target mapping lists is avoided, and the accuracy of the target session groups and the target mapping lists is improved.
In an exemplary embodiment of the present disclosure, the mapping list contains a storage address of the session data in the session list. And when determining the target session data to be synchronized in the session list according to the target mapping list, determining the target session data to be synchronized in the session list according to the storage address of the session data in the target mapping list. In practical applications, the mapping list may contain a pointer indicating the storage address of the session data in the session list. Each session data has a unique memory address in the session list. The target mapping list is determined, that is, the storage address of the target session data to be synchronized in the session list is determined, and then the target session data can be read out from the session list according to the storage address. The embodiment of the disclosure determines which session data in the session list are target session data to be synchronized according to the storage address of the session data contained in the mapping list in the session list. The server takes the storage address of the session data in the session list as key search information for determining the target session data to be synchronized, so that the target session data to be synchronized can be accurately determined.
In an exemplary embodiment of the present disclosure, for the second scheme, before the session group corresponding to the target account is acquired, the target account is locally read at the server according to a preset period. The server stores a plurality of accounts, can periodically read out a target account from the plurality of accounts, then obtains session packet data corresponding to the target account, determines a target session packet and a target mapping list in the target session packet in the session packet, determines target session data to be synchronized in the session list according to the target mapping list, and transmits the target session data to a terminal corresponding to the target account. The server of the embodiment of the disclosure can actively determine the target session data to be synchronized of the target account, and transmit the target session data to the terminal corresponding to the target account, thereby avoiding the terminal sending a data request to the server, reducing the number of times of interaction between the terminal and the server, and saving the network consumption between the terminal and the server.
In an exemplary embodiment of the present disclosure, the changed session group may include a session group that adds a mapping list and/or a session group that deletes a mapping list. As shown in fig. 2 and 3, fig. 2 shows a schematic diagram of a plurality of session packets at a certain time, and fig. 3 shows a schematic diagram of a plurality of session packets at another time. The time corresponding to fig. 2 is earlier than the time corresponding to fig. 3. The session packet may contain basic session information such as a name, an icon, and the like. The session packet may also contain a mapping list. However, the session packet does not contain session data. In fig. 2, the first session packet contains a mapping list ref01-ref 05. The second session packet contains a mapping list ref06-ref 08. The third session group contains mapping lists ref09, ref 10. In fig. 3, the fourth session group is added newly, and the first session group and the second session group are changed, and the third session group is not changed. Therefore, when the changed session packet is determined as the target session packet as described above, the fourth session packet, the first session packet, and the second session packet may be the target session packet. In particular, the newly added fourth session packet contains a mapping list ref11, ref 12. The first session packet is added with the mapping list ref13 and reduced with the mapping list ref 04. The mapping list ref06 is reduced in the second session packet.
Fig. 4 is a block diagram illustrating an instant messaging data synchronization apparatus according to an exemplary embodiment. The device is applied to the server, and particularly can comprise the following units.
A group acquiring unit 41 configured to perform acquiring a session group corresponding to a target account, where the session group includes a mapping list, where the mapping list is used to point to a session list corresponding to the target account, and session data is stored in the session list;
a target determining unit 42 configured to determine, among the session groups, a target session group and a target mapping list in the target session group, where the target session group is the session group that changes or is all the session groups;
a session determining unit 43 configured to perform determining target session data to be synchronized in the session list according to the target mapping list;
a session transmission unit 44 configured to perform transmission of the target session data to a terminal corresponding to the target account.
In an exemplary embodiment of the present disclosure, the apparatus further includes:
a request receiving unit, configured to execute receiving a data request sent by the terminal before the group obtaining unit 41 obtains the session group corresponding to the target account, where the data request includes the target account.
In an exemplary embodiment of the disclosure, the data request further includes a synchronization identifier, the session packet further includes a setup time of the mapping list, and the target determining unit 42 includes:
a target session group determination unit configured to perform, when the synchronization flag is a time flag, determining a session group that changes after a time indicated by the time flag as a target session group;
a target mapping list determination unit configured to perform determination of a mapping list, which changes after the time, in the target session group, as a target mapping list;
and the time identification represents the time of the session data corresponding to the target account, which is received by the terminal from the server last time.
In an exemplary embodiment of the present disclosure, the target session group determination unit is further configured to perform, when the synchronization identifier is a primary synchronization status identifier, determining all session groups corresponding to the target account as target session groups;
the target mapping list determining unit is further configured to perform determining all mapping lists in the target session group as a target mapping list;
the primary synchronization state identification represents session data which are received by the terminal from the server for the first time and correspond to the target account.
In an exemplary embodiment of the disclosure, the mapping list includes storage addresses of session data in the session list, and the session determining unit 43 is configured to determine target session data to be synchronized in the session list according to the storage addresses of the session data in the target mapping list.
In an exemplary embodiment of the present disclosure, the apparatus further includes:
an account reading unit configured to perform, before the group obtaining unit 41 obtains the session group corresponding to the target account, reading the target account locally at the server according to a preset period.
With regard to the apparatus in the above-described embodiment, the specific manner in which each unit performs the operation has been described in detail in the embodiment related to the method, and will not be described in detail here.
Fig. 5 is a block diagram illustrating an instant messaging data synchronization electronic device in accordance with an exemplary embodiment. For example, the electronic device 500 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, an exercise device, a personal digital assistant, and the like.
Referring to fig. 5, electronic device 500 may include one or more of the following components: a processing component 502, a memory 504, a power component 506, a multimedia component 508, an audio component 510, an input/output (I/O) interface 512, a sensor component 514, and a communication component 516.
The processing component 502 generally controls overall operation of the electronic device 500, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. The processing component 502 may include one or more processors 520 to execute instructions to perform all or a portion of the steps of the data synchronization method of instant messaging described above. Further, the processing component 502 can include one or more modules that facilitate interaction between the processing component 502 and other components. For example, the processing component 502 can include a multimedia module to facilitate interaction between the multimedia component 508 and the processing component 502.
The memory 504 is configured to perform operations to store various types of data to support operations at the electronic device 500. Examples of such data include instructions for any application or method operating on the electronic device 500, contact data, phonebook data, messages, images, videos, and so forth. The memory 504 may be implemented by any type or combination of volatile or non-volatile memory devices 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, magnetic or optical disks.
The power supply component 506 provides power to the various components of the electronic device 500. The power components 506 may include a power management system, one or more power sources, and other components associated with generating, managing, and distributing power for the electronic device 500.
The multimedia component 508 includes a screen that provides an output interface between the electronic device 500 and a user. In some embodiments, the screen may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive an input signal from a user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 508 includes a front facing camera and/or a rear facing camera. The front camera and/or the rear camera may receive external multimedia data when the electronic device 500 is in an operating mode, such as a shooting mode or a video mode. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
The audio component 510 is configured to perform outputting and/or inputting audio signals. For example, the audio component 510 includes a Microphone (MIC) configured to perform receiving external audio signals when the electronic device 500 is in an operational mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signals may further be stored in the memory 504 or transmitted via the communication component 516. In some embodiments, audio component 510 further includes a speaker for outputting audio signals.
The I/O interface 512 provides an interface between the processing component 502 and peripheral interface modules, which may be keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to: a home button, a volume button, a start button, and a lock button.
The sensor assembly 514 includes one or more sensors for providing various aspects of status assessment for the electronic device 500. For example, the sensor assembly 514 may detect an open/closed state of the electronic device 500, the relative positioning of components, such as a display and keypad of the electronic device 500, the sensor assembly 514 may detect a change in the position of the electronic device 500 or a component of the electronic device 500, the presence or absence of user contact with the electronic device 500, orientation or acceleration/deceleration of the electronic device 500, and a change in the temperature of the electronic device 500. The sensor assembly 514 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 514 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 514 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
The communication component 516 is configured to perform communications that facilitate wired or wireless means between the electronic device 500 and other devices. The electronic device 500 may access a wireless network based on a communication standard, such as WiFi, a carrier network (such as 2G, 3G, 4G, or 5G), or a combination thereof. In an exemplary embodiment, the communication component 516 receives a broadcast signal or broadcast related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 516 further includes a Near Field Communication (NFC) module to facilitate short-range communications. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, Ultra Wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
In an exemplary embodiment, the electronic device 500 may be implemented by one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), controllers, micro-controllers, microprocessors or other electronic components for performing the above-described data synchronization method of instant messaging.
In an exemplary embodiment, a computer-readable storage medium comprising instructions, such as the memory 504 comprising instructions, executable by the processor 520 of the electronic device 500 to perform the data synchronization method of instant messaging is also provided. Alternatively, the computer readable storage medium may be a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
In an exemplary embodiment, a computer program product is also provided, which comprises a computer program executable by the processor 520 of the electronic device 500 to perform the above-mentioned data synchronization method of instant messaging. Alternatively, the program code may be stored in a storage medium of the electronic device 500, which may be a non-transitory computer-readable storage medium, such as a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
Fig. 6 is a block diagram illustrating an electronic device for synchronizing data for instant messaging in accordance with an exemplary embodiment. For example, the electronic device 600 may be provided as a server. Referring to fig. 6, electronic device 600 includes a processing component 622 that further includes one or more processors, and memory resources, represented by memory 632, for storing instructions, such as applications, that are executable by processing component 622. The application programs stored in memory 632 may include one or more modules that each correspond to a set of instructions. In addition, the processing component 622 is configured to execute instructions to perform the data synchronization method of instant messaging described above.
The electronic device 600 may also include a power component 626 configured to perform power management of the electronic device 600, a wired or wireless network interface 650 configured to perform connecting the electronic device 600 to a network, and an input/output (I/O) interface 658. The electronic device 600 may operate based on an operating system stored in the memory 632, such as Windows Server, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, or the like.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (10)

1. A data synchronization method for instant messaging is applied to a server, and the method comprises the following steps:
acquiring a session group corresponding to a target account, wherein the session group comprises a mapping list, the mapping list is used for pointing to a session list corresponding to the target account, and session data are stored in the session list;
in the session group, determining a target session group and a target mapping list in the target session group, wherein the target session group is the changed session group, or the target session group is all the session groups;
determining target session data to be synchronized in the session list according to the target mapping list;
and transmitting the target session data to a terminal corresponding to the target account.
2. The method of claim 1, wherein prior to the obtaining the session group corresponding to the target account, the method further comprises:
and receiving a data request sent by the terminal, wherein the data request comprises the target account.
3. The method of claim 2, wherein the data request further includes a synchronization identifier, the session group further includes a setup time of the mapping list, and the determining, in the session group, a target session group and a target mapping list in the target session group includes:
when the synchronous identifier is a time identifier, determining a changed session group which is positioned after the time represented by the time identifier as a target session group;
determining a mapping list changed after the time in the target session group as a target mapping list;
and the time identification represents the time of the session data corresponding to the target account, which is received by the terminal from the server last time.
4. The method of claim 3, wherein determining a target session group and a target mapping list in the target session group in the session group further comprises:
when the synchronous identification is the primary synchronous state identification, all the session groups corresponding to the target account are determined as target session groups;
determining all mapping lists in the target session group as target mapping lists;
the primary synchronization state identification represents session data which are received by the terminal from the server for the first time and correspond to the target account.
5. The method according to claim 1, wherein the mapping list contains storage addresses of session data in the session list, and the determining target session data to be synchronized in the session list according to the target mapping list comprises:
and determining target session data to be synchronized in the session list according to the storage address of the session data in the target mapping list.
6. The method of claim 1, wherein prior to the obtaining the session group corresponding to the target account, the method further comprises:
and reading the target account locally at the server according to a preset period.
7. An instant messaging data synchronization device, applied to a server, the device comprising:
the group acquisition unit is configured to execute acquisition of a session group corresponding to a target account, wherein the session group comprises a mapping list, the mapping list is used for pointing to a session list corresponding to the target account, and session data are stored in the session list;
a target determining unit configured to determine, in the session groups, a target session group and a target mapping list in the target session group, where the target session group is the session group that changes or the target session group is all the session groups;
the session determining unit is configured to determine target session data to be synchronized in the session list according to the target mapping list;
and the session transmission unit is configured to transmit the target session data to a terminal corresponding to the target account.
8. An electronic device, comprising:
a processor;
a memory for storing the processor-executable instructions;
wherein the processor is configured to execute the instructions to implement the instant messaging data synchronization method of any one of claims 1 to 6.
9. A computer-readable storage medium, wherein instructions in the computer-readable storage medium, when executed by a processor of an electronic device, enable the electronic device to perform the data synchronization method of instant messaging according to any one of claims 1 to 6.
10. A computer program product comprising a computer program, characterized in that the computer program, when being executed by a processor, implements the method for data synchronization of instant messaging according to any one of claims 1 to 6.
CN202011643438.3A 2020-12-30 2020-12-30 Data synchronization method, apparatus, electronic device, storage medium, and program product Active CN112769677B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011643438.3A CN112769677B (en) 2020-12-30 2020-12-30 Data synchronization method, apparatus, electronic device, storage medium, and program product

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011643438.3A CN112769677B (en) 2020-12-30 2020-12-30 Data synchronization method, apparatus, electronic device, storage medium, and program product

Publications (2)

Publication Number Publication Date
CN112769677A true CN112769677A (en) 2021-05-07
CN112769677B CN112769677B (en) 2023-05-23

Family

ID=75698647

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011643438.3A Active CN112769677B (en) 2020-12-30 2020-12-30 Data synchronization method, apparatus, electronic device, storage medium, and program product

Country Status (1)

Country Link
CN (1) CN112769677B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115118735A (en) * 2022-06-08 2022-09-27 腾讯科技(深圳)有限公司 Data synchronization method, group management method, device, equipment and storage medium

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050198150A1 (en) * 2004-01-29 2005-09-08 Werner Carl E. Instant message mass update generated from website entry
CN103491055A (en) * 2012-06-12 2014-01-01 中兴通讯股份有限公司 Method for synchronizing information among clients, clients and server
US20140297727A1 (en) * 2013-02-28 2014-10-02 Tencent Technology (Shenzhen) Company Limited Method, system, server and client device for message sychronizing
CN104836719A (en) * 2014-02-11 2015-08-12 阿里巴巴集团控股有限公司 Method and system for synchronizing instant communication unread messages
CN105357105A (en) * 2015-11-06 2016-02-24 上海斐讯数据通信技术有限公司 Conversation speed increase device and method
CN109274510A (en) * 2018-09-06 2019-01-25 北京达佳互联信息技术有限公司 Message treatment method, device, client, server and storage medium
CN110138652A (en) * 2019-05-21 2019-08-16 北京达佳互联信息技术有限公司 A kind of session updates method, apparatus and client device
CN110365739A (en) * 2019-06-05 2019-10-22 平安科技(深圳)有限公司 Message synchronization method, apparatus, computer installation and computer readable storage medium
CN110391974A (en) * 2019-08-01 2019-10-29 北京云中融信网络科技有限公司 A kind of message synchronization method, server-side, terminal and system
CN110401709A (en) * 2019-07-23 2019-11-01 北京云中融信网络科技有限公司 Processing method, device and the storage medium of session in a kind of instant messaging application

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050198150A1 (en) * 2004-01-29 2005-09-08 Werner Carl E. Instant message mass update generated from website entry
CN103491055A (en) * 2012-06-12 2014-01-01 中兴通讯股份有限公司 Method for synchronizing information among clients, clients and server
US20140297727A1 (en) * 2013-02-28 2014-10-02 Tencent Technology (Shenzhen) Company Limited Method, system, server and client device for message sychronizing
CN104836719A (en) * 2014-02-11 2015-08-12 阿里巴巴集团控股有限公司 Method and system for synchronizing instant communication unread messages
CN105357105A (en) * 2015-11-06 2016-02-24 上海斐讯数据通信技术有限公司 Conversation speed increase device and method
CN109274510A (en) * 2018-09-06 2019-01-25 北京达佳互联信息技术有限公司 Message treatment method, device, client, server and storage medium
CN110138652A (en) * 2019-05-21 2019-08-16 北京达佳互联信息技术有限公司 A kind of session updates method, apparatus and client device
CN110365739A (en) * 2019-06-05 2019-10-22 平安科技(深圳)有限公司 Message synchronization method, apparatus, computer installation and computer readable storage medium
CN110401709A (en) * 2019-07-23 2019-11-01 北京云中融信网络科技有限公司 Processing method, device and the storage medium of session in a kind of instant messaging application
CN110391974A (en) * 2019-08-01 2019-10-29 北京云中融信网络科技有限公司 A kind of message synchronization method, server-side, terminal and system

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115118735A (en) * 2022-06-08 2022-09-27 腾讯科技(深圳)有限公司 Data synchronization method, group management method, device, equipment and storage medium
CN115118735B (en) * 2022-06-08 2023-12-01 腾讯科技(深圳)有限公司 Data synchronization method, group management method, device, equipment and storage medium

Also Published As

Publication number Publication date
CN112769677B (en) 2023-05-23

Similar Documents

Publication Publication Date Title
US11469962B2 (en) Method and apparatus for configuring information of indicating time-frequency position of SSB, and method and apparatus for determining time-frequency position of SSB
CN108064466B (en) Period information indication method of public control resource set of residual key system information
CN108496317B (en) Method and device for searching public resource set of residual key system information
CN109451847B (en) Paging message receiving method and device and paging configuration method and device
US11457437B2 (en) Method and apparatus for configuring information, base station and user equipment
WO2020097845A1 (en) Method and device for using network slice
CN107094094B (en) Application networking method and device and terminal
CN110945883B (en) Paging signaling receiving method and device and paging signaling sending method and device
US20230292269A1 (en) Method and apparatus for determining offset indication, and method and apparatus for determining offset
US20240063980A1 (en) System information reception method and apparatus, and system information transmission method and apparatus
CN107272896B (en) Method and device for switching between VR mode and non-VR mode
CN112291631A (en) Information acquisition method, device, terminal and storage medium
CN109451799B (en) Time domain information indication method of public control resource set of residual key system information
CN106506808B (en) Method and device for prompting communication message
CN106878654B (en) Video communication method and device
CN109245992B (en) Request processing method and device, electronic equipment and storage medium
CN112769677B (en) Data synchronization method, apparatus, electronic device, storage medium, and program product
US11297626B2 (en) Information indication method and apparatus, base station and user equipment
CN109451857B (en) Data transmission method and device
CN114430370B (en) Method, device, equipment and storage medium for determining network slice
CN109948012B (en) Serial number generation method and device and storage medium
CN109565649B (en) Method and device for transmitting synchronization indication information
CN115706966A (en) Method and device for connecting network and readable storage medium
CN109120499B (en) Information processing method and device
CN106484261B (en) Information acquisition method and device, information transmission method and device, and terminal

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant