CN110633324B - Method, apparatus, electronic device and computer readable medium for synchronizing data - Google Patents

Method, apparatus, electronic device and computer readable medium for synchronizing data Download PDF

Info

Publication number
CN110633324B
CN110633324B CN201910883026.8A CN201910883026A CN110633324B CN 110633324 B CN110633324 B CN 110633324B CN 201910883026 A CN201910883026 A CN 201910883026A CN 110633324 B CN110633324 B CN 110633324B
Authority
CN
China
Prior art keywords
data
cache
database
identifier
state value
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.)
Active
Application number
CN201910883026.8A
Other languages
Chinese (zh)
Other versions
CN110633324A (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.)
Sinochem Information Technology Co Ltd
Original Assignee
Sinochem 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 Sinochem Information Technology Co Ltd filed Critical Sinochem Information Technology Co Ltd
Priority to CN201910883026.8A priority Critical patent/CN110633324B/en
Publication of CN110633324A publication Critical patent/CN110633324A/en
Application granted granted Critical
Publication of CN110633324B publication Critical patent/CN110633324B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • G06F16/275Synchronous replication

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Computing Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

Embodiments of the present disclosure disclose methods, apparatuses, electronic devices, and computer-readable media for synchronizing data. One embodiment of the method comprises: receiving input data input by a user on a target terminal; acquiring a data identifier of the input data; determining whether the data identifier exists in the cache of the target terminal according to the data identifier; in response to determining that the data identifier exists in the cache of the target terminal, determining whether a state value of the data identifier in the cache changes; in response to determining that the change occurs, determining whether the data identifier and the input data exist in a database of data stored on the target terminal according to the data identifier; and synchronously saving the data identifier in the database and the state value of the data identifier in the cache in response to determining that the data identifier and the input data exist in the database. The embodiment realizes synchronous storage of the data identification and the state value of the data identification in the cache and the database.

Description

Method, apparatus, electronic device and computer readable medium for synchronizing data
Technical Field
Embodiments of the present disclosure relate to the field of computer technologies, and in particular, to a method, an apparatus, an electronic device, and a computer-readable medium for synchronizing data.
Background
At present, in the application scenarios of enterprise-level office and business systems, business list data is not dynamically and automatically updated in real time, and some latest real-time data are often obtained by manual refreshing, for example, to obtain the latest proxy list data, the list needs to be frequently refreshed, so that frequent access to a database is caused, and the system capacity is difficult to bear if the frequency of regular refreshing is too high; if the performance of the system is considered and the refreshing frequency is reduced, the user cannot obtain the latest information in time, and the user experience is reduced. In addition to the scene of scene refreshing by the foreground page, the asynchronous collaborative process between the background service units, that is, the publishing and subscribing scene of the event, also needs to refresh the data set in time to obtain the latest data state.
Disclosure of Invention
This summary is provided to introduce a selection of concepts in a simplified form that are further described below in the detailed description. This summary is not intended to identify key features or essential features of the claimed subject matter, nor is it intended to be used to limit the scope of the claimed subject matter.
Some embodiments of the present disclosure propose methods, apparatuses, electronic devices and computer-readable media for synchronizing data
In a first aspect, some embodiments of the present disclosure provide a method for synchronizing data, the method comprising: receiving input data input by a user on a target terminal; acquiring a data identifier of the input data; determining whether the data identifier exists in the cache of the target terminal according to the data identifier; in response to determining that the data identifier exists in the cache of the target terminal, determining whether a state value of the data identifier in the cache changes; in response to the determination that the change occurs, determining whether the data identifier and the input data exist in a database of data stored on the target terminal according to the data identifier; and in response to the fact that the data identification and the input data exist in the database of the data stored on the target terminal, synchronously storing the data identification and the state value of the data identification in the database into the cache.
In some embodiments, the above method further comprises: and in response to the fact that the data identification does not exist in the cache of the target terminal, determining whether the data identification and the state value of the data identification exist in a database of the data stored on the target terminal or not according to the data identification.
In some embodiments, the above method further comprises: in response to determining that the data identifier and the input data do not exist in a database storing data, generating a data identifier of the input data and a state value of the data identifier in a cache of the target terminal; and synchronously storing the data identifier of the input data and the state value of the data identifier into the database.
In some embodiments, the above method further comprises: and responding to the fact that the change does not occur, and sending prompt information which is used for representing that the state value of the data identification of the input data is not updated to the target terminal.
In some embodiments, the above method further comprises: receiving data input by a user on a target input page; determining whether said data exists in said database; in response to determining that the data does not exist in the database, generating a data identifier of the data and a state value of the data identifier according to the data; and synchronously storing the data identifier of the data in the database and the state value of the data identifier into the cache.
In some embodiments, the above method further comprises: and updating the state value of the data identifier of the data in response to determining that the data exists in the database.
In some embodiments, the above method further comprises: when the state value of the data identifier in the cache of the target terminal is larger than or equal to a preset threshold value, generating prompt information for deleting the data identifier corresponding to the state value of the data identifier in the cache of the target terminal; and sending the prompt information to the terminal equipment for monitoring data.
In a second aspect, some embodiments of the present disclosure provide an apparatus for synchronizing data, the apparatus comprising: a first receiving unit configured to receive input data input by a user on a target terminal; an acquisition unit configured to acquire a data identification of the input data; a cache determining and existence unit configured to determine whether the data identifier exists in the cache of the target terminal according to the data identifier; a determining change unit configured to determine whether a state value of the data identifier in the cache changes in response to determining that the data identifier exists in the cache of the target terminal; a database determination existence unit configured to determine whether a state value of the data identifier in the cache changes in response to a determination that the data identifier exists in the cache of the target terminal; and a cache synchronization unit configured to synchronously store the data identifier and the state value of the data identifier in the database into the cache in response to determining that the data identifier and the input data exist in the database of the data stored on the target terminal.
In a third aspect, some embodiments of the present disclosure provide an electronic device, comprising: one or more processors; a storage device having one or more programs stored thereon which, when executed by one or more processors, cause the one or more processors to implement a method according to any one of the first aspects.
In a fourth aspect, some embodiments of the disclosure provide a computer readable medium having a computer program stored thereon, where the program, when executed by a processor, performs the method as in any one of the first aspect.
One of the above-described various embodiments of the present disclosure has the following advantageous effects: first by receiving input data entered by a user at a target terminal. And then acquiring the data identification of the input data. And then determining whether the input data exists in the cache of the target terminal. And then determining whether the state value of the data identifier in the cache changes. And then determining whether the data identification and the input data exist in a database of the data stored on the target terminal. And finally, synchronously storing the data identifier in the database and the state value of the data identifier in the cache. The synchronous storage of the data identification and the state value of the data identification in the cache and the database is realized.
Drawings
The above and other features, advantages, and aspects of embodiments of the present disclosure will become more apparent by referring to the following detailed description when taken in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numbers refer to the same or similar elements. It should be understood that the drawings are schematic and that elements and features are not necessarily drawn to scale.
FIG. 1 is a schematic diagram of one application scenario of a method for synchronizing data, in accordance with some embodiments of the present disclosure;
FIG. 2 is a flow diagram of some embodiments of a method for synchronizing data according to the present disclosure;
FIG. 3 is a flow diagram of further embodiments of a method for synchronizing data according to the present disclosure;
FIG. 4 is a schematic block diagram of some embodiments of an apparatus for synchronizing data according to the present disclosure;
FIG. 5 is a schematic block diagram of an electronic device suitable for use in implementing some embodiments of the present disclosure.
Detailed Description
Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While certain embodiments of the disclosure are shown in the drawings, it is to be understood that the disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete. It should be understood that the drawings and the embodiments of the disclosure are for illustration purposes only and are not intended to limit the scope of the disclosure.
It should be noted that, for convenience of description, only the portions related to the related invention are shown in the drawings. The embodiments and features of the embodiments in the present disclosure may be combined with each other without conflict.
It should be noted that the terms "first", "second", and the like in the present disclosure are only used for distinguishing different devices, modules or units, and are not used for limiting the order or interdependence relationship of the functions performed by the devices, modules or units.
It is noted that references to "a" or "an" in this disclosure are intended to be illustrative rather than limiting, and that those skilled in the art will appreciate that references to "one or more" are intended to be exemplary and not limiting unless the context clearly indicates otherwise.
The names of messages or information exchanged between devices in the embodiments of the present disclosure are for illustrative purposes only, and are not intended to limit the scope of the messages or information.
The present disclosure will be described in detail below with reference to the accompanying drawings in conjunction with embodiments.
FIG. 1 is a schematic diagram of one application scenario of a method for synchronizing data, in accordance with some embodiments of the present disclosure; in the application scenario of fig. 1, the execution subject may be a thread. The execution main body receives input data input by a user on a target terminal, and acquires a data identifier of the input data. And determining whether the data identifier exists in the cache, if so, determining whether the state value of the data identifier changes, if so, determining whether the data identifier and the input data exist in the database, and if so, storing the data identifier and the state value into the cache. And if the data identifier does not exist, determining whether the data identifier and the state value exist in the database, and if the data identifier and the state value do not exist, generating the data identifier and the state value in a cache, and synchronously storing the data identifier and the state value in the database. By way of example, it may be that a worker modifies a person's name on a corporate person registry and the input data may be the name to be modified. For example, originally "Zhang shan", modified to "Zhang shan". Here, the data identification may be the employee's job number, e.g., "0001". When the worker clicks on save and/or refresh after modification, the executive entity will find the buffer zone to look for "0001" and the status value will change because the data is modified. The execution subject searches the database for the job number "0001", and if the database does not contain the job number "0001", the job number "0001" and the state value corresponding to the job number are generated in the cache region. And storing the generated job number, state value and name into a database.
The execution main body may be hardware or software. When the execution main body is hardware, the execution main body can be implemented as a distributed cluster consisting of a plurality of servers or terminal devices, and can also be implemented as a single server or a single terminal device. When the execution body is embodied as software, it may be implemented as a plurality of software or software modules for providing distributed services, for example, or as a single software or software module. But also a thread or process. And is not particularly limited herein.
With continued reference to fig. 2, a flow 200 of some embodiments of a method for synchronizing data in accordance with the present disclosure is shown. The method for synchronizing data comprises the following steps:
step 201, receiving input data input by a user on a target terminal.
In some embodiments, the executive may receive input data entered by the user on the target terminal. The target terminal can be a terminal capable of viewing and modifying internal data inside the enterprise. Such as a company data monitoring personnel computer. The input data may be employee information added or modified. Employee information may include, but is not limited to, at least one of the following: job number, name, department, job title, etc. For example, a piece of employee information is added. The job number may be "1001" and the name may be "lie".
Step 202, acquiring the data identifier of the input data.
In some embodiments, the execution subject obtains a data identification of the input data. The data identification is typically an identification corresponding to the input data. Taking the above example as an example, the data identifier may be a job number.
Step 203, determining whether the data identifier exists in the cache of the target terminal according to the data identifier.
In some embodiments, the execution subject may search, according to the obtained data identifier, whether the data identifier exists in the cache region. Taking the above example as an example, a piece of employee information is added, and since the job number and the name are both added, the data identifier does not exist in the cache area. If the name in the employee information is modified, for example, the name of the employee with the employee number "0001" is modified to "lie". Because the job number is already present and the name is modified, the data identification is present.
Step 204, in response to determining that the data identifier exists in the cache of the target terminal, determining whether a state value of the data identifier in the cache changes.
In some embodiments, the execution subject may determine whether a state value of the data identifier changes according to the data identifier. The above state value is generally used to represent the time from the last use of the data, and the state value is larger as the time is longer, for example, when a piece of data is newly added, the state value may be "1". As an example, the input data may be to modify a name in the employee information, e.g., to modify the name of an employee with an employee number of "0001" as "lie". Because the job number is already present and the name is modified, the data identification is present, but the input data is not. The state value of the data identity typically changes. And if no input data exist, only refreshing the page of the display data on the target terminal. Then the data identity is already present and the input data is also already present and the state value of the data identity is not normally changed.
In some optional implementation manners of some embodiments, in response to determining that the data identifier does not exist in the cache of the target terminal, whether the data identifier and the input data exist in a database storing data on the target terminal is determined according to the data identifier. For example, if the staff adds the staff information to the target terminal or the staff directly adds the staff information to the database, the data identifier may not exist in the cache.
Step 205, in response to determining that the change occurs, determining whether the data identifier and the input data exist in a database of data stored on the target terminal according to the data identifier.
In some embodiments, the execution subject may search the database for the presence of the data identifier according to the data identifier when the status value of the data identifier changes. As an example, the input data may be a name in the modified employee information, and the status value of the data identification will typically change. The data identification described above, e.g., job number "0001", is typically found in a database. The input data is typically not found in the database.
In some optional implementations of some embodiments, in response to determining that no change has occurred, sending, to the target terminal, a prompt that a state value of a data identifier characterizing the input data is not updated. The prompt information may be information indicating that the state value of the data identifier representing the input data is not updated, for example, "state value is not updated".
Step 206, in response to determining that the data identifier and the input data exist in the database, synchronously saving the data identifier and the state value of the data identifier in the database into the cache.
In some embodiments, the data identification and the input data are based on the presence of the data in the database. And synchronously storing the data identifier in the database and the state value of the data identifier in the cache. As an example, when the staff directly adds the staff information to the database and refreshes the staff information on the target terminal, the data identifier and the input data corresponding to the input data may not exist in the cache, but the data identifier and the input data corresponding to the input data may exist in the database. At this time, the data identifier corresponding to the input data in the database and the state value of the data identifier may be saved in the cache.
In some optional implementation manners of some embodiments, in response to determining that the data identifier and the input data do not exist in the stored number database, generating a data identifier of the input data and a state value of the data identifier in a cache of the target terminal; and synchronously storing the data identifier of the input data and the state value of the data identifier into the database. For example, when the staff adds the staff information to the target terminal, the data identifier and the input data may not exist in the database. The execution subject may invoke a thread to generate a data identifier of the input data and a state value of the data identifier in the cache according to the input data. And storing the generated data identification and the state value of the data identification into the database.
In some optional implementations of some embodiments, further reference may be made to fig. 3, which illustrates a flow 300 of further embodiments of a method for synchronizing data according to the present disclosure. The method for synchronizing data includes the steps of:
step 301, receiving data input by a user on a target input page.
In some embodiments, the execution principal may receive user input data on the target input page. The target input page may be a page where data operations may be performed on the database. The data operations include, but are not limited to, at least one of: a lookup operation, an add operation, a modify operation, and a delete operation. The data may be data in a database table, for example. Employee names in an employee information table.
Step 302, determining whether the data exists in the database.
In some embodiments, the database is queried for the data received in step 301 to determine whether the data exists in the database. Here, the execution agent may look up the data in a database.
Step 303, in response to determining that the data does not exist in the database, generating a data identifier of the data and a status value of the data identifier according to the data.
In some embodiments, based on determining that the data does not exist in the database, the execution principal may generate a data identifier of the data and a status value of the data identifier from the data.
In some optional implementations of some embodiments, the status value of the data identification of the data is updated in response to determining that the data exists in the database. Here, when the data exists in the database, the execution principal generally updates the state value of the data identifier of the data. For example, the status value of the data identifier of the data is originally "10", and the executing entity may update the status value of the data identifier of the data to "1" because the lookup operation is performed on the data.
Step 304, synchronously storing the data identifier of the data in the database and the state value of the data identifier into the cache.
In some embodiments, the data identifier of the data and the state value of the data identifier generated in step 303 are saved in the cache.
In some optional implementation manners of some embodiments, when the state value of the data identifier in the cache of the target terminal is greater than or equal to a preset threshold, prompt information for deleting the data identifier corresponding to the state value of the data identifier in the cache of the target terminal is generated. And sending the prompt information to the terminal equipment for monitoring data. Here, the preset threshold may be set manually. The prompt information may be information for prompting deletion of the data identification, for example, "please delete the present data identification". The terminal device for monitoring data may be a device having the authority to monitor data, for example, a computer of a staff member for monitoring data inside an enterprise.
Some embodiments of the present disclosure disclose a method for synchronizing data, which enables synchronous storage of data identifiers and state values of the data identifiers in a cache and a database. Therefore, the memory consumption is reduced when the data is quickly searched and refreshed, and the working efficiency is improved.
With further reference to fig. 4, as an implementation of the above-described method for the above-described figures, the present disclosure provides some embodiments of an apparatus for synchronizing data, which correspond to those of the method embodiments described above for fig. 2, and which may be applied in particular to various electronic devices.
As shown in fig. 4, an apparatus 400 for synchronizing data of some embodiments includes: a first receiving unit 401, an obtaining unit 402, a cache determination existence unit 403, a determination change unit 404, a database determination existence unit 405, and a cache synchronization unit 406. A first unit 401 configured to receive input data input by a user on a target terminal; an obtaining unit 402 configured to obtain a data identifier of the input data; a cache determination existence unit 403 configured to determine whether the data identifier exists in the cache of the target terminal according to the data identifier; a change determining unit 404 configured to determine whether a state value of the data identifier in the cache changes in response to determining that the data identifier exists in the cache of the target terminal; a database determination existence unit 405 configured to determine whether the data identifier and the input data exist in a database storing data on the target terminal according to the data identifier in response to determining that the change occurs; a buffer synchronization unit 406, configured to, in response to determining that the data identifier and the input data exist in a database storing data on the target terminal, synchronously store the data identifier in the database and a state value of the data identifier in the buffer.
In some embodiments, the apparatus 400 for synchronizing data further comprises: and the cache determining and non-existing unit is configured to respond to the fact that the data identifier does not exist in the cache of the target terminal, and determine whether the data identifier and the state value of the data identifier exist in a database storing data on the target terminal or not according to the data identifier.
In some embodiments, the apparatus 400 for synchronizing data further comprises: a database determination existence unit configured to generate a data identifier of the input data and a state value of the data identifier in a cache of the target terminal in response to a determination that the data identifier and the input data do not exist in a database storing data; and the database synchronization unit is configured to synchronously save the data identifier of the input data and the state value of the data identifier into the database.
In some embodiments, the apparatus 400 for synchronizing data further comprises: and the unit for determining no change sends prompt information that the state value of the data identification for representing the input data is not updated to the target terminal in response to the determination that no change occurs.
In some embodiments, the apparatus 400 for synchronizing data further comprises: a second receiving unit configured to receive data input by a user on the target input page; a determination unit configured to determine whether the data exists in the database; a generating unit configured to generate a data identifier of the data and a state value of the data identifier according to the data in response to determining that the data does not exist in the database; and the storage unit is configured to synchronously store the data identifier of the data in the database and the state value of the data identifier into the cache.
In some embodiments, the apparatus 400 for synchronizing data further comprises: an updating unit configured to update a state value of a data identifier of the data in response to determining that the data exists in the database.
In some embodiments, the apparatus 400 for synchronizing data further comprises: the prompt unit is configured to generate prompt information for deleting the data identifier corresponding to the state value of the data identifier in the cache of the target terminal when the state value of the data identifier in the cache of the target terminal is larger than or equal to a preset threshold value; and the sending unit is configured to send the prompt information to the terminal equipment for monitoring data.
Referring now to fig. 5, a block diagram of an electronic device (e.g., the terminal device of fig. 1) 500 suitable for use in implementing some embodiments of the present disclosure is shown. The terminal device in some embodiments of the present disclosure may include, but is not limited to, mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and the like, and fixed terminals such as digital TVs, desktop computers, and the like. The terminal device shown in fig. 5 is only an example, and should not bring any limitation to the functions and the use range of the embodiments of the present disclosure.
As shown in fig. 5, electronic device 500 may include a processing means (e.g., central processing unit, graphics processor, etc.) 501 that may perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)502 or a program loaded from a storage means 508 into a Random Access Memory (RAM) 503. In the RAM 503, various programs and data necessary for the operation of the electronic apparatus 500 are also stored. The processing device 501, the ROM 502, and the RAM 503 are connected to each other through a bus 504. An input/output (I/O) interface 505 is also connected to bus 504.
Generally, the following devices may be connected to the I/O interface 505: input devices 506 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; output devices 507 including, for example, a Liquid Crystal Display (LCD), speakers, vibrators, and the like; a storage device 508 including, for example, a memory card; and a communication device 509. The communication means 509 may allow the electronic device 500 to communicate with other devices wirelessly or by wire to exchange data. While fig. 5 illustrates an electronic device 500 having various means, it is to be understood that not all illustrated means are required to be implemented or provided. More or fewer devices may alternatively be implemented or provided. Each block shown in fig. 5 may represent one device or may represent multiple devices as desired.
In particular, according to some embodiments of the present disclosure, the processes described above with reference to the flow diagrams may be implemented as computer software programs. For example, some embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer-readable medium, the computer program comprising program code for performing the method illustrated by the flow chart. In some such embodiments, the computer program may be downloaded and installed from a network via the communication means 509, or installed from the storage means 508, or installed from the ROM 502. The computer program, when executed by the processing device 501, performs the above-described functions defined in the methods of some embodiments of the present disclosure.
It should be noted that the computer readable medium described above in some embodiments of the present disclosure may be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In some embodiments of the disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In some embodiments of the present disclosure, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, RF (radio frequency), etc., or any suitable combination of the foregoing.
In some embodiments, the clients, servers may communicate using any currently known or future developed network Protocol, such as HTTP (HyperText Transfer Protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), the Internet (e.g., the Internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed network.
The computer readable medium may be embodied in the electronic device; or may be separate and not incorporated into the electronic device. The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: receiving input data input by a user on a target terminal; acquiring a data identifier of the input data; determining whether the input data exists in the cache of the target terminal according to the data identification; in response to determining that the input data exists in the cache of the target terminal, determining whether a state value of the data identifier in the cache changes; in response to the determination that the change occurs, determining whether the data identifier and the state value of the data identifier exist in a database storing data on the target terminal according to the data identifier; and responding to the data identification and the state value of the data identification in a database for storing data on the target terminal, calling a cache service, and synchronously storing the data identification and the state value of the data identification in the database into the cache.
Computer program code for carrying out operations for embodiments of the present disclosure may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + +, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in some embodiments of the present disclosure may be implemented by software, and may also be implemented by hardware. The described units may also be provided in a processor, which may be described as: a processor includes a first receiving unit, an obtaining unit, a cache existence determining unit, a change determining unit, a database existence determining unit, and a cache synchronizing unit. Here, the names of these units do not constitute a limitation to the unit itself in some cases, and for example, the acquiring unit may also be described as "a unit that acquires the data identification of the input data described above".
The functions described herein above may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), system on a chip (SOCs), Complex Programmable Logic Devices (CPLDs), and the like.
The foregoing description is only exemplary of the preferred embodiments of the disclosure and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the invention in the embodiments of the present disclosure is not limited to the specific combinations of the above-mentioned features, and other embodiments in which the above-mentioned features or their equivalents are combined arbitrarily without departing from the spirit of the invention are also encompassed. For example, the above features and (but not limited to) the features with similar functions disclosed in the embodiments of the present disclosure are mutually replaced to form the technical solution.

Claims (5)

1. A method for synchronizing data, comprising:
receiving input data input by a user on a target terminal, wherein the target terminal is a terminal capable of viewing and modifying data, and the input data is added or modified employee information;
acquiring a data identifier of the input data;
determining whether the data identifier exists in the cache of the target terminal or not according to the data identifier;
in response to determining that the data identifier exists in the cache of the target terminal, determining whether a state value of the data identifier in the cache changes, wherein the state value represents the time of the data from the last use;
in response to the determination that the change occurs, determining whether the data identifier and the input data exist in a database of data stored on the target terminal according to the data identifier;
in response to determining that the data identifier and the input data exist in a database of data stored on the target terminal, synchronously storing the data identifier in the database and the state value of the data identifier in the cache;
in response to determining that the data identifier and the input data do not exist in a database storing data, generating a data identifier of the input data and a state value of the data identifier in a cache of the target terminal;
synchronously storing the data identification of the input data and the state value of the data identification into the database;
receiving data input by a user on a target input page, wherein the target input page is a page for performing data operation on a database;
determining whether the data is present in the database;
in response to determining that the data does not exist in the database, generating a data identifier of the data and a state value of the data identifier according to the data;
synchronously storing the data identification of the data in the database and the state value of the data identification into the cache;
in response to determining that the data exists in the database, updating a state value of a data identification of the data;
when the state value of the data identifier in the cache of the target terminal is larger than or equal to a preset threshold value, generating prompt information for deleting the data identifier corresponding to the state value of the data identifier in the cache of the target terminal;
and sending the prompt information to the terminal equipment for monitoring data.
2. The method of claim 1, wherein the method further comprises:
and in response to the fact that the data identification does not exist in the cache of the target terminal, determining whether the data identification and the state value of the data identification exist in a database storing data on the target terminal according to the data identification.
3. An apparatus for synchronizing data, comprising:
a first receiving unit configured to receive input data input by a user on a target terminal, wherein the target terminal is a terminal capable of viewing and modifying data, and the input data is added or modified employee information;
an acquisition unit configured to acquire a data identification of the input data;
a cache determining existence unit configured to determine whether the data identifier exists in the cache of the target terminal according to the data identifier;
a determining and changing unit configured to determine whether a state value of the data identifier in a cache of the target terminal changes in response to determining that the data identifier exists in the cache, wherein the state value represents a time from a last use of data;
a database determination existence unit configured to determine whether a state value of the data identifier in a cache of the target terminal changes in response to determining that the data identifier exists in the cache;
a cache synchronization unit configured to synchronously save the data identifier in the database and the state value of the data identifier in the cache in response to determining that the data identifier and the input data exist in the database storing data on the target terminal; in response to determining that the data identifier and the input data do not exist in a database storing data, generating a data identifier of the input data and a state value of the data identifier in a cache of the target terminal; synchronously storing the data identification of the input data and the state value of the data identification into the database; receiving data input by a user on a target input page, wherein the target input page is a page for performing data operation on a database; determining whether the data is present in the database; in response to determining that the data does not exist in the database, generating a data identifier of the data and a state value of the data identifier according to the data; synchronously storing the data identification of the data in the database and the state value of the data identification into the cache; in response to determining that the data exists in the database, updating a state value of a data identification of the data; when the state value of the data identifier in the cache of the target terminal is larger than or equal to a preset threshold value, generating prompt information for deleting the data identifier corresponding to the state value of the data identifier in the cache of the target terminal; and sending the prompt information to the terminal equipment for monitoring data.
4. An electronic device, comprising: one or more processors;
storage means having one or more programs stored thereon which, when executed by the one or more processors, cause the one or more processors to implement the method of any of claims 1-2.
5. A computer-readable medium, on which a computer program is stored, wherein the program, when executed by a processor, implements the method of any one of claims 1-2.
CN201910883026.8A 2019-09-18 2019-09-18 Method, apparatus, electronic device and computer readable medium for synchronizing data Active CN110633324B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910883026.8A CN110633324B (en) 2019-09-18 2019-09-18 Method, apparatus, electronic device and computer readable medium for synchronizing data

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910883026.8A CN110633324B (en) 2019-09-18 2019-09-18 Method, apparatus, electronic device and computer readable medium for synchronizing data

Publications (2)

Publication Number Publication Date
CN110633324A CN110633324A (en) 2019-12-31
CN110633324B true CN110633324B (en) 2022-07-26

Family

ID=68972785

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910883026.8A Active CN110633324B (en) 2019-09-18 2019-09-18 Method, apparatus, electronic device and computer readable medium for synchronizing data

Country Status (1)

Country Link
CN (1) CN110633324B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105656663A (en) * 2015-12-22 2016-06-08 北京奇虎科技有限公司 Software update method and device
CN107122410A (en) * 2017-03-29 2017-09-01 武汉斗鱼网络科技有限公司 A kind of buffering updating method and device
CN107644071A (en) * 2017-09-18 2018-01-30 广州爱九游信息技术有限公司 Buffering updating method, device and data-storage system
CN108959341A (en) * 2018-04-04 2018-12-07 阿里巴巴集团控股有限公司 A kind of method, device and equipment that data are synchronous
CN109101528A (en) * 2018-06-21 2018-12-28 深圳市买买提信息科技有限公司 Data processing method, data processing equipment and electronic equipment
CN109558421A (en) * 2018-10-29 2019-04-02 中国建设银行股份有限公司 Data processing method, system, device and storage medium based on caching

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106980625B (en) * 2016-01-18 2020-08-04 阿里巴巴集团控股有限公司 Data synchronization method, device and system

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105656663A (en) * 2015-12-22 2016-06-08 北京奇虎科技有限公司 Software update method and device
CN107122410A (en) * 2017-03-29 2017-09-01 武汉斗鱼网络科技有限公司 A kind of buffering updating method and device
CN107644071A (en) * 2017-09-18 2018-01-30 广州爱九游信息技术有限公司 Buffering updating method, device and data-storage system
CN108959341A (en) * 2018-04-04 2018-12-07 阿里巴巴集团控股有限公司 A kind of method, device and equipment that data are synchronous
CN109101528A (en) * 2018-06-21 2018-12-28 深圳市买买提信息科技有限公司 Data processing method, data processing equipment and electronic equipment
CN109558421A (en) * 2018-10-29 2019-04-02 中国建设银行股份有限公司 Data processing method, system, device and storage medium based on caching

Also Published As

Publication number Publication date
CN110633324A (en) 2019-12-31

Similar Documents

Publication Publication Date Title
CN110909521B (en) Online document information synchronous processing method and device and electronic equipment
CN111679990B (en) Test data generation method and device, readable medium and electronic equipment
CN112311656B (en) Message aggregation and display method and device, electronic equipment and computer readable medium
CN110781373B (en) List updating method and device, readable medium and electronic equipment
CN108011949B (en) Method and apparatus for acquiring data
CN114629911B (en) Method, device, equipment, medium and program product for processing domain name resolution request
CN111752939A (en) Data processing method, device, computer system and medium for multiple systems
CN111596992B (en) Navigation bar display method and device and electronic equipment
CN112131181A (en) Storage path display method and device and electronic equipment
CN110619101B (en) Method and apparatus for processing information
CN110633324B (en) Method, apparatus, electronic device and computer readable medium for synchronizing data
CN115269645A (en) Information query method and device, electronic equipment and computer readable medium
CN110941683B (en) Method, device, medium and electronic equipment for acquiring object attribute information in space
CN113824675B (en) Method and device for managing login state
CN112799863B (en) Method and device for outputting information
CN113971195A (en) Data synchronization method, device, electronic equipment and medium
CN113760929A (en) Data synchronization method and device, electronic equipment and computer readable medium
CN113760927A (en) Data processing method and device, electronic equipment and computer readable medium
CN111580890A (en) Method, apparatus, electronic device, and computer-readable medium for processing features
CN111212296A (en) Live broadcast room gift list configuration method, device, medium and electronic equipment
CN111787043A (en) Data request method and device
CN117692672B (en) Snapshot-based video information sending method and device, electronic equipment and medium
CN113157365B (en) Program running method, program running device, electronic equipment and computer readable medium
CN114006880B (en) Method and device for acquiring message receipt, electronic equipment and storage medium
CN110262756B (en) Method and device for caching data

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