CN109871411B - Method, device, electronic equipment and medium for synchronizing data - Google Patents

Method, device, electronic equipment and medium for synchronizing data Download PDF

Info

Publication number
CN109871411B
CN109871411B CN201910123483.7A CN201910123483A CN109871411B CN 109871411 B CN109871411 B CN 109871411B CN 201910123483 A CN201910123483 A CN 201910123483A CN 109871411 B CN109871411 B CN 109871411B
Authority
CN
China
Prior art keywords
change data
data
change
data file
file
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
CN201910123483.7A
Other languages
Chinese (zh)
Other versions
CN109871411A (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.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp 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 Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN201910123483.7A priority Critical patent/CN109871411B/en
Publication of CN109871411A publication Critical patent/CN109871411A/en
Application granted granted Critical
Publication of CN109871411B publication Critical patent/CN109871411B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application discloses a method, a device, electronic equipment and a medium for synchronizing data. In the application, after the synchronization instruction is acquired, the first change data and the first location identifier are added to the change data file, and then the change data file added with the first change data and the first location identifier is synchronized to the local disk. By applying the technical scheme, the corresponding position identification can be added to the data with changed data content in the relational database, and the changed data and the position identification are synchronized to the local disk. Therefore, the defect that the data cannot be stored for a long time due to the fact that the data are stored in the memory of the electronic equipment in the related art is avoided. Thereby improving user experience.

Description

Method, device, electronic equipment and medium for synchronizing data
Technical Field
The present application relates to data processing technologies, and in particular, to a method, an apparatus, an electronic device, and a medium for synchronizing data.
Background
With the increasing popularity of internet informatization, enterprises will have more and more data information. For example, mail data information, user data information, web page data information, etc. Taking the example of an internet retail business, each time a consumer purchases a batch of goods on his web page using an electronic terminal, it is necessary to generate a piece of consumption data information about the consumer. Further, in the related art, enterprises generally adopt a relational database to store various data information of the enterprises facing massive data information. The relational database is a database based on a relational model, and is used for processing data by means of mathematical concepts and methods such as set algebra.
However, in the related art, after synchronizing data from a relational database, the data cannot be generally saved for a long time, thereby affecting user experience.
Disclosure of Invention
The embodiment of the invention provides a method, a device, electronic equipment and a medium for synchronizing data.
According to an aspect of the embodiment of the present application, a method for synchronizing data is provided, which is characterized by including:
acquiring a synchronization instruction, wherein the synchronization instruction carries first change data, and the change data is data with changed data content in a relational database;
adding the first change data and a corresponding first position identifier to a change data file, wherein the first position identifier is used for marking the position of the first change data in the change data file;
and synchronizing the first change data and the change data file with the first position identifier to a local disk.
Optionally, in another embodiment based on the above method of the present application, the acquiring a synchronization instruction includes:
receiving the synchronization instruction sent by the relational database; or alternatively, the first and second heat exchangers may be,
when the first change data are detected to exist in the relational database, a first request instruction is sent to the relational database, and the first request instruction is used for acquiring the first change data;
And receiving the synchronous instruction sent by the relational database.
Optionally, in another embodiment of the method according to the present application, after synchronizing the data file added with the first change data and the first location identifier to the local disk, the method further includes:
when a second request instruction is received, the first change data is called from the change data file based on the second request instruction and the first position identifier;
and sending the first change data.
Optionally, in another embodiment of the method according to the present application, the retrieving the first change data from the change data file based on the second request instruction and the first location identifier includes:
analyzing the second request instruction, and determining a calling time period and a calling object;
determining the first change data according to the calling time and the calling object;
and calling the first change data from the change data file based on the first position identification.
Optionally, in another embodiment of the method according to the present application, after the sending the first change data, the method further includes:
And adjusting the first change data based on the reservation information carried in the second request instruction, wherein the reservation information is used for indicating whether the first change data is reserved in the change data file.
Optionally, in another embodiment based on the above method of the present application, before the step of obtaining the synchronization instruction, the method further includes:
establishing a change data index table, wherein the change data index table is used for searching each piece of change data;
recording the first position identification to the change data index table;
and adding the first change data and a change data index table for recording the first position identification into the change data file.
Optionally, in another embodiment of the method according to the present application, after synchronizing the data file added with the first change data and the first location identifier to the local disk, the method further includes:
and when the residual storage space of the local disk is detected to be lower than a preset threshold value, clearing second change data and a corresponding second position mark, wherein the second change data is the change data with the earliest synchronization time in the local disk, and the second position mark is used for marking the position of the second change data in a change data file.
According to another aspect of an embodiment of the present application, there is provided an apparatus for synchronizing data, including:
the acquisition module is configured to acquire a synchronous instruction, wherein the synchronous instruction carries first change data, and the change data is data with changed data content in a relational database;
an adding module configured to add the first change data and a corresponding first location identifier to a change data file, where the first location identifier is used to mark a location of the first change data in the change data file;
and the synchronization module is configured to synchronize the change data file added with the first change data and the first position identifier to the local disk.
According to still another aspect of the embodiments of the present application, there is provided an electronic device including:
a memory for storing executable instructions; and
and the display is used for displaying with the memory to execute the executable instructions so as to complete the operation of any method for synchronizing data.
According to still another aspect of the embodiments of the present application, there is provided a computer-readable storage medium storing computer-readable instructions that, when executed, perform the operations of any of the above-described methods of synchronizing data.
In the application, after a synchronization instruction is acquired, first change data and a first position identifier are added to a change data file, and then the change data file added with the first change data and the first position identifier is synchronized to a local disk. By applying the technical scheme, the corresponding position identification can be added to the data with changed data content in the relational database, and the changed data and the position identification are synchronized to the local disk. Therefore, the defect that the data cannot be stored for a long time due to the fact that the data are stored in the memory of the electronic equipment in the related art is avoided. Thereby improving user experience.
The technical scheme of the present application is described in further detail below through the accompanying drawings and examples.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments of the application and, together with the description, serve to explain the principles of the application.
The present application will be more clearly understood from the following detailed description with reference to the accompanying drawings, in which:
FIG. 1 is a flow chart of one embodiment of a method of synchronizing data of the present application.
FIG. 2 is a flow chart of one embodiment of a method of synchronizing data of the present application.
Fig. 3 is a flow chart of yet another embodiment of a method of synchronizing data of the present application.
FIG. 4 is a flow chart of one embodiment of a method of synchronizing data of the present application.
Fig. 5 is a flow chart of the synchronizing data of the present application.
Fig. 6 is a schematic structural diagram of an apparatus for synchronizing data according to the present application.
Fig. 7 is a schematic diagram of an electronic device according to the present application.
Detailed Description
Various exemplary embodiments of the present application will now be described in detail with reference to the accompanying drawings. It should be noted that: the relative arrangement of the components and steps, numerical expressions and numerical values set forth in these embodiments do not limit the scope of the present application unless it is specifically stated otherwise.
Meanwhile, it should be understood that the sizes of the respective parts shown in the drawings are not drawn in actual scale for convenience of description.
The following description of at least one exemplary embodiment is merely exemplary in nature and is in no way intended to limit the application, its application, or uses.
Techniques, methods, and apparatus known to one of ordinary skill in the relevant art may not be discussed in detail, but are intended to be part of the specification where appropriate.
It should be noted that: like reference numerals and letters denote like items in the following figures, and thus once an item is defined in one figure, no further discussion thereof is necessary in subsequent figures.
It should be noted that all directional indicators (such as up, down, left, right, front, and rear … …) in the embodiments of the present application are merely used to explain the relative positional relationship, movement, etc. between the components in a specific posture (as shown in the drawings), and if the specific posture is changed, the directional indicator is correspondingly changed.
In addition, descriptions such as those related to "first," "second," and the like, are provided for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated in this application. Thus, a feature defining "a first" or "a second" may explicitly or implicitly include at least one such feature. In the description of the present application, the meaning of "plurality" is at least two, such as two, three, etc., unless explicitly defined otherwise.
In the present application, unless explicitly specified and limited otherwise, the terms "coupled," "secured," and the like are to be construed broadly, and for example, "secured" may be either permanently attached or removably attached, or integrally formed; can be mechanically or electrically connected; either directly or indirectly, through intermediaries, or both, may be in communication with each other or in interaction with each other, unless expressly defined otherwise. The specific meaning of the terms in this application will be understood by those of ordinary skill in the art as the case may be.
In addition, the technical solutions of the embodiments of the present application may be combined with each other, but it is necessary to be based on the fact that those skilled in the art can implement the technical solutions, and when the technical solutions are contradictory or cannot be implemented, the combination of the technical solutions should be considered to be absent, and is not within the scope of protection claimed in the present application.
A method for synchronizing data according to an exemplary embodiment of the present application is described below with reference to fig. 1 to 5. It should be noted that the following application scenario is only shown for the convenience of understanding the spirit and principles of the present application, and embodiments of the present application are not limited in any way in this respect. Rather, embodiments of the present application may be applied to any scenario where applicable.
The application provides a method, a device, a target terminal and a medium for synchronizing data.
Fig. 1 schematically shows a flow diagram of a method of synchronizing data according to an embodiment of the present application. As shown in fig. 1, the method includes:
s101, acquiring a synchronous instruction, wherein the synchronous instruction carries first change data, and the change data is data with changed data content in a relational database.
Firstly, it should be noted that the method for acquiring the synchronous instruction is not particularly limited in the present application. For example, the synchronization instruction may be generated by the electronic device after the detection of the reaching of the predetermined condition, or may be received by the electronic device.
In the present application, the change data carried in the synchronization instruction may be data in which the data content is changed in the relational database. Further, a relational database is a database based on a relational model, and the relational database processes data in the database by means of mathematical concepts and methods such as set algebra. In relational databases, data is typically stored in rows and columns to facilitate a user's retrieval of the data in the database with a Query (Query).
Further, the relational database is not particularly limited in this application, and for example, the relational database using this application may be MYSQL, SQLITE, MARIADB or the like.
In the present application, the data type of the change data is not specifically limited, that is, the change data may be consumption data type information, enterprise commodity type data information, or the like. In one possible preferred embodiment, the data type of the change data in the present application may be order-like data information generated by the consumer from the enterprise product. When the type of the change data is order type data information, the change data can be data information generated when the order type data information is changed.
For example, after the user a purchases a corresponding commodity on a website of a certain enterprise by using the electronic terminal, the server generates order type data information a for the action. Further, after a period of time, the user A needs to change the delivery address for personal reasons, and then the user A needs to log in the website of the enterprise again, and after finding the data information A, one item of the delivery address in the data information A is modified. For this behavior, after the user a modifies the data content of the data information a, the relational database generates corresponding modification data concerning the user a.
S102, adding the first change data and a corresponding first position identifier to the change data file, wherein the first position identifier is used for marking the position of the first change data in the change data file.
Optionally, in the present application, after the synchronization instruction carrying the first change data is obtained, the first change data and the corresponding first location identifier may be further added to the change data file. Wherein the first location identifier is used to mark the location of the first change data in the change data file.
S103, synchronizing the added first change data and the change data file of the first position mark to the local disk.
Optionally, in the present application, after the first change data and the corresponding first location identifier are added to the change data file, the change data file to which the first change data and the first location identifier are added may be further synchronized to the local disk.
In the related art, after a user synchronizes to corresponding data from a relational database, the data is typically stored in a memory of an electronic device. So that the business party can extract the data from the memory of the electronic equipment after the business party needs to use the data. It is understood that the present application employs synchronizing the first change data and the change data file of the first location identifier to the local disk. And further, the problem of insufficient synchronous data caused by less memory storage capacity of the electronic equipment can be avoided.
It should be noted that, in the present application, the capacity of the local disk is not specifically limited, that is, the appropriate disk capacity is selected according to the amount of data information of different enterprises. In one possible preferred embodiment, a local disk with a larger capacity may be selected.
Further, the first location identifier in the present application needs to be stored in the change data file in synchronization with the first change data. So as to avoid the disadvantage that the business side consumes the user time caused by repeated searching when more data information exists in the follow-up changed data file.
In the application, after a synchronization instruction is acquired, first change data and a first position identifier are added to a change data file, and then the change data file added with the first change data and the first position identifier is synchronized to a local disk. By applying the technical scheme, the corresponding position identification can be added to the data with changed data content in the relational database, and the changed data and the position identification are synchronized to the local disk. Therefore, the defect that the data cannot be stored for a long time due to the fact that the data are stored in the memory of the electronic equipment in the related art is avoided. Thereby improving user experience.
Further optionally, in an embodiment of the present application, in S101 (acquiring a synchronization instruction), a specific embodiment is further included, as shown in fig. 2, including:
s201, receiving a synchronous instruction sent by a relational database.
Optionally, in the method for obtaining the synchronization instruction, the synchronization instruction carrying the first change data may be generated by the relational database, and after the synchronization instruction is generated by the relational database, the synchronization instruction may be sent to the electronic device.
In this application, the synchronization instruction carrying the first change data may be generated by the relational database, and then sent to the electronic device at the first time. The relational database may not select to send the synchronization instruction carrying the first change data at the first time after generating the synchronization instruction, but may select to send the synchronization instruction after receiving the related request instruction of the electronic device, so that the electronic device receives the synchronization instruction sent by the relational database.
S202, when the first change data exists in the relational database, a first request instruction is sent to the relational database, and the first request instruction is used for acquiring the first change data.
And receiving first change data sent by the relational database, and generating a synchronous instruction based on the first change data.
Optionally, in the method for obtaining the synchronization instruction, the electronic device may send a first request instruction for obtaining the first change data to the relational database after detecting that the first change data is generated in the relational database, and generate the synchronization instruction based on the first change data after receiving the first change data.
In the present application, the time for detecting whether the first change data exists in the relational database is not limited. For example, the electronic device may monitor whether the first change data exists in the relational database in real time, or may detect whether the first change data exists in the relational database after every preset time period. Likewise, the preset time period is not specifically limited in this application. I.e. the preset time period may be 10 minutes, and the preset time period may be 5 minutes.
Further, after receiving the first change data, the present application may generate a synchronization instruction for synchronizing the first change data to the local disk, and store the first change data in the synchronization instruction.
It should be noted that, in the present application, S201 and S202 are implementation steps independent from each other. That is, in one possible embodiment in the present application, the step S203 and subsequent steps may be continued after the step S201 is first performed. Alternatively, after the step of S202 is first performed, the step S203 and subsequent steps may be completed.
S203, adding the first change data and the corresponding first position identification to the change data file.
S204, synchronizing the added first change data and the change data file of the first position mark to the local disk.
S205, when the residual storage space of the local disk is detected to be lower than a preset threshold value, clearing second change data and a corresponding second position mark, wherein the second change data is the change data with the earliest synchronization time in the local disk, and the second position mark is used for marking the position of the second change data in a change data file.
Optionally, in this application, in order to prevent the problem of influencing the operation efficiency caused by overload of the local disk. After the first change data and the change data file of the first position identifier are added to the local disk, the method can further detect the residual storage space of the local disk in the electronic equipment. And after detecting that the residual storage space is lower than a preset threshold value, traversing all the change data in the local disk, and clearing the second change data with earliest synchronization time out of the local disk so as to save the occupied space of the local disk.
It should be noted that, in the present application, the preset threshold is not specifically limited, that is, the preset threshold may be five percent, and the preset threshold may also be three percent. The specific variation of the preset threshold value does not affect the protection scope of the application.
Likewise, when the local disk is cleared from the second change data with the earliest synchronization time, the local disk also needs to be cleared from the second position identifier for marking the position of the second change data in the change data file, and it can be understood that the action can further achieve the purpose of saving the occupied space of the local disk.
In the method, after first change data and a first position identifier are added to a change data file, the change data file added with the first change data and the first position identifier is synchronized to a local disk, and after the fact that the residual storage space of the local disk is lower than a preset threshold value is detected, the earliest change data of the synchronization time is cleared. By applying the technical scheme, the data with changed data content in the relational database and the corresponding position identification can be synchronized to the local disk, and when the fact that the residual storage space of the local disk is insufficient is further detected, the data with earliest synchronization time is cleared. Therefore, the defect that the operation efficiency is affected due to the fact that excessive data are stored in the local disk in the related art is avoided. Thereby improving user experience.
Further optionally, in an embodiment of the present application, after S103 (synchronizing the data file to which the first change data and the first location identifier are added to the local disk), a specific embodiment is further included, as shown in fig. 3, including:
s301, acquiring a synchronous instruction.
S302, adding the first change data and the corresponding first position identification into a change data file.
S303, synchronizing the added first change data and the change data file of the first position mark to the local disk.
S304, when a second request instruction is received, the first change data is called from the change data file based on the second request instruction and the first position identification.
Optionally, in the present application, after synchronizing the change data file added with the first change data and the first location identifier to the local disk, it may be detected whether a second request instruction for retrieving the first change data from the change data file is received, and when the second request instruction is received, the first change data may be retrieved according to the request content of the second request instruction.
In one possible embodiment of the present application, based on the second request instruction and the first location identifier, the specific operation manner of retrieving the first change data from the change data file may be generated by implementing the following steps:
And analyzing the second request instruction, and determining a calling time period and a calling object.
Alternatively, in the present application, the second request instruction for retrieving the first change data from the change data file may be parsed first, where the retrieved time period and the retrieved object carried in the second request instruction are obtained.
Further, since it is possible for the same user to generate a corresponding plurality of change data in different time periods. Therefore, in this application, it is necessary to determine the fetch time period and the fetch object required in the request instruction at the same time.
For example, when the user B purchases a corresponding commodity on the website of a certain enterprise by using the electronic terminal thereof at the time of 8 days 2018.12.12, the server generates order type data information B for the action. Further, after the user a has placed a bill for 3 hours, the user B logs in to the website of the enterprise at 11 on the same day because the user a needs to change the delivery address for personal reasons, and after the data information B is found, one item of the delivery address in the data information B is modified. For this behavior, after the user B modifies the data content of the data information B, the relational database generates change data about the user B at 11 points on 2018.12.12. Furthermore, when the user B needs to modify the contact for personal reasons at 9 days 2018.12.13, the user B logs in the website of the enterprise again at 9 days next, and modifies one of the contact in the data information B after finding the data information B. For this behavior, after the user B modifies the data content of the data information B again, the relational database generates change data about the user B at 9 points on 2018.12.13.
And determining the first change data according to the calling time and the calling object.
Optionally, after the second request instruction is parsed to obtain the calling time period and the calling object, the first change data may be further determined according to the calling time period and the calling object.
Also from the above example, it can be appreciated that when the retrieval time period obtained in the analysis of the second request instruction is 2018.12.12 days and the retrieval target is user b, it is determined that the first change data is change data about the change delivery address generated by user b at 11 th day 2018.12.12. When the calling time period obtained by analyzing the second request instruction is 2018.12.13 days and the calling object is user B, the first changing data is determined to be the changing data about the changing contact way generated by the user B at the point of 2018.12.13 days 9.
And calling the first change data from the change data file based on the first position identification.
Optionally, after determining the first change data, the present application may determine the position of the first change data in the change data file by querying a first position identifier corresponding to the first change data, so as to call the first change data from the change data file.
S305, transmitting first change data.
Optionally, in the present application, after the first change data is called from the change data file, the called first change data may be sent to the corresponding service data obtaining party according to the sending object in the second request instruction.
S306, adjusting the first change data based on the reservation information carried in the second request instruction, wherein the reservation information is used for indicating whether the first change data is reserved in the change data file.
Optionally, in this application, after the first change data is sent, further according to the reservation information carried in the second request instruction and used for indicating whether to reserve the first change data in the change data file, whether to send the first change data is selected, and then the first change data is cleared.
In the method, after the first change data and the first position identifier are added to the change data file, the change data file added with the first change data and the first position identifier is synchronized to the local disk, and after the first change data is sent, whether the first change data is reserved or not is selected based on a second request instruction. By applying the technical scheme, after the data of the change of the data content in the relational database and the corresponding position identification are synchronized to the local disk, whether the first change data is reserved in the local disk for a long time or not can be selected based on the reserved information. Thereby the effective data information is stored in the local disk in a targeted way. Thereby reducing unnecessary losses.
Further optionally, in an embodiment of the present application, before S101 (acquiring the synchronization instruction), a specific embodiment is further included, as shown in fig. 4, including:
s401, a change data index table is established, and the change data index table is used for searching each change data.
Optionally, in the present application, a change data index table for searching each change data in the change data file may be first established. It can be understood that when the service data acquirer extracts the change data from the relational database from the electronic device, the defect of user experience degradation caused by too long query time is avoided because the change data is more. The service data acquirer can determine corresponding change data based on inquiring a pre-established change data index table. Thus saving inquiry time and improving working efficiency.
S402, acquiring a synchronous instruction.
S403, the first position identification is recorded in a change data index table.
Alternatively, the first location identifier for marking the location of the first change data in the change data file may be recorded in the change data index table. So that each service data acquirer can acquire corresponding change data by inquiring the change data index table.
S404, adding the first change data and a change data index table recording the first position identification to the change data file.
S405, synchronizing the added first change data and the change data file of the first position mark to the local disk.
In an alternative embodiment of the present application, as shown in fig. 5, first, the first change data may be acquired from the relational database, further, after the first change data is acquired, a first location identifier 21 corresponding to the first change data may be generated, and the first location identifier 21 may be recorded in the change data index table 11. Further, the change data index table 11 may be added to the change data file, and the change data file to which the first change data and the first location identifier are added may be synchronized to the local disk in a memory map file method mmap.
In the present application, a change data index table for searching each change data is first established, and after a first change data and a change data index table recorded with a first position identifier are added to a change data file, the change data file added with the first change data and the change data index table is synchronized to a local disk. By applying the technical scheme, after the data of the change of the data content in the relational database and the corresponding position identification are synchronized to the local disk, the service data acquisition party can find the corresponding change data by inquiring the pre-established change data index table. Therefore, the time for inquiring the data by the user is reduced, and the user experience is improved.
In another embodiment of the present application, as shown in fig. 6, the present application further provides an apparatus for synchronizing data, where the apparatus includes an acquisition module 601, an adding module 602, and a synchronization module 603, where,
the acquiring module 601 is configured to acquire a synchronization instruction, where the synchronization instruction carries first change data, where the change data is data with changed data content in a relational database;
an adding module 602 configured to add the first change data and a corresponding first location identifier to a change data file, where the first location identifier is used to mark a location of the first change data in the change data file;
the synchronization module 603 is configured to synchronize the change data file added with the first change data and the first location identifier to the local disk.
In the application, after a synchronization instruction is acquired, first change data and a first position identifier are added to a change data file, and then the change data file added with the first change data and the first position identifier is synchronized to a local disk. By applying the technical scheme, the corresponding position identification can be added to the data with changed data content in the relational database, and the changed data and the position identification are synchronized to the local disk. Therefore, the defect that the data cannot be stored for a long time due to the fact that the data are stored in the memory of the electronic equipment in the related art is avoided. Thereby improving user experience.
In another embodiment of the present application, the synchronization module 603 further includes a receiving unit, a sending unit, where:
and the receiving unit is configured to receive the synchronous instruction sent by the relational database. Or alternatively, the first and second heat exchangers may be,
and the sending unit is configured to send a first request instruction to the relational database when the first change data exists in the relational database, wherein the first request instruction is used for acquiring the first change data.
And the receiving unit is configured to receive the first change data sent by the relational database and generate the synchronous instruction based on the first change data.
In another embodiment of the present application, the method further includes a receiving module 604, where:
the receiving module 604 is configured to, when receiving a second request instruction, retrieve the first change data from the change data file based on the second request instruction and the first location identifier.
A receiving module 604 is configured to send the first change data.
In another embodiment of the present application, the receiving module 604 further includes a parsing unit, a determining unit, and a retrieving unit, where:
And the analyzing unit is configured to analyze the second request instruction and determine a calling time period and a calling object.
And a determining unit configured to determine the first modification data according to the retrieval time and the retrieval object.
And a calling unit configured to call the first change data from the change data file based on the first location identifier.
In another embodiment of the present application, the method further comprises an adjusting module 605, wherein:
the adjustment module 605 is configured to adjust the first change data based on the reservation information carried in the second request instruction, where the reservation information is used to indicate whether to reserve the first change data in the change data file.
In another embodiment of the present application, further comprising, a setup module 606, wherein:
the establishing module 606 is configured to establish a change data index table, where the change data index table is used to find each piece of change data.
A build module 606 is configured to record the first location identification to the change data index table.
A creation module 606 is configured to add the first change data and a change data index table recording the first location identification to the change data file.
In another embodiment of the present application, further comprising a purge module 607, wherein:
the clearing module 607 is configured to clear second change data and a corresponding second location identifier after detecting that the remaining storage space of the local disk is lower than a preset threshold, where the second change data is the change data with the earliest synchronization time in the local disk, and the second location identifier is used to mark a location of the second change data in the change data file.
Fig. 7 is a block diagram of a logic structure of an electronic device, according to an example embodiment. For example, the electronic device 700 may be a mobile phone, computer, digital broadcast terminal, messaging device, game console, tablet device, medical device, exercise device, personal digital assistant, or the like.
Referring to fig. 7, an electronic device 700 may include one or more of the following components: a processor 701 and a memory 702.
Processor 701 may include one or more processing cores, such as a 4-core processor, an 8-core processor, and the like. The processor 701 may be implemented in at least one hardware form of DSP (Digital Signal Processing ), FPGA (Field-Programmable Gate Array, field programmable gate array), PLA (Programmable Logic Array ). The processor 701 may also include a main processor, which is a processor for processing data in an awake state, also referred to as a CPU (Central Processing Unit ); a coprocessor is a low-power processor for processing data in a standby state. In some embodiments, the processor 701 may integrate a GPU (Graphics Processing Unit, image processor) for rendering and drawing of content required to be displayed by the display screen. In some embodiments, the processor 701 may also include an AI (Artificial Intelligence ) processor for processing computing operations related to machine learning.
Memory 702 may include one or more computer-readable storage media, which may be non-transitory. The memory 702 may also include high-speed random access memory, as well as non-volatile memory, such as one or more magnetic disk storage devices, flash memory storage devices. In some embodiments, a non-transitory computer readable storage medium in memory 702 is used to store at least one instruction for execution by processor 701 to implement the method of interactive special effects synchronization data provided by the method embodiments herein.
In some embodiments, the electronic device 700 may further optionally include: a peripheral interface 703 and at least one peripheral. The processor 701, the memory 702, and the peripheral interface 703 may be connected by a bus or signal lines. The individual peripheral devices may be connected to the peripheral device interface 703 via buses, signal lines or a circuit board. Specifically, the peripheral device includes: at least one of radio frequency circuitry 704, touch display 705, camera 706, audio circuitry 707, positioning component 708, and power supply 709.
A peripheral interface 703 may be used to connect I/O (Input/Output) related at least one peripheral device to the processor 701 and memory 702. In some embodiments, the processor 701, memory 702, and peripheral interface 703 are integrated on the same chip or circuit board; in some other embodiments, either or both of the processor 701, the memory 702, and the peripheral interface 703 may be implemented on separate chips or circuit boards, which is not limited in this embodiment.
The Radio Frequency circuit 704 is configured to receive and transmit RF (Radio Frequency) signals, also referred to as electromagnetic signals. The radio frequency circuitry 704 communicates with a communication network and other communication devices via electromagnetic signals. The radio frequency circuit 704 converts an electrical signal into an electromagnetic signal for transmission, or converts a received electromagnetic signal into an electrical signal. Optionally, the radio frequency circuit 704 includes: antenna systems, RF transceivers, one or more amplifiers, tuners, oscillators, digital signal processors, codec chipsets, subscriber identity module cards, and so forth. The radio frequency circuitry 704 may communicate with other terminals via at least one wireless communication protocol. The wireless communication protocol includes, but is not limited to: metropolitan area networks, various generations of mobile communication networks (2G, 3G, 4G, and 5G), wireless local area networks, and/or WiFi (Wireless Fidelity ) networks. In some embodiments, the radio frequency circuitry 704 may also include NFC (Near Field Communication ) related circuitry, which is not limited in this application.
The display screen 705 is used to display a UI (User Interface). The UI may include graphics, text, icons, video, and any combination thereof. When the display 705 is a touch display, the display 705 also has the ability to collect touch signals at or above the surface of the display 705. The touch signal may be input to the processor 701 as a control signal for processing. At this time, the display 705 may also be used to provide virtual buttons and/or virtual keyboards, also referred to as soft buttons and/or soft keyboards. In some embodiments, the display 705 may be one, providing a front panel of the electronic device 700; in other embodiments, the display 705 may be at least two, respectively disposed on different surfaces of the electronic device 700 or in a folded design; in still other embodiments, the display 705 may be a flexible display disposed on a curved surface or a folded surface of the electronic device 700. Even more, the display 705 may be arranged in a non-rectangular irregular pattern, i.e. a shaped screen. The display 705 may be made of LCD (Liquid Crystal Display ), OLED (Organic Light-Emitting Diode) or other materials.
The camera assembly 706 is used to capture images or video. Optionally, the camera assembly 706 includes a front camera and a rear camera. Typically, the front camera is disposed on the front panel of the terminal and the rear camera is disposed on the rear surface of the terminal. In some embodiments, the at least two rear cameras are any one of a main camera, a depth camera, a wide-angle camera and a tele camera, so as to realize that the main camera and the depth camera are fused to realize a background blurring function, and the main camera and the wide-angle camera are fused to realize a panoramic shooting and Virtual Reality (VR) shooting function or other fusion shooting functions. In some embodiments, camera assembly 706 may also include a flash. The flash lamp can be a single-color temperature flash lamp or a double-color temperature flash lamp. The dual-color temperature flash lamp refers to a combination of a warm light flash lamp and a cold light flash lamp, and can be used for light compensation under different color temperatures.
The audio circuit 707 may include a microphone and a speaker. The microphone is used for collecting sound waves of users and environments, converting the sound waves into electric signals, and inputting the electric signals to the processor 701 for processing, or inputting the electric signals to the radio frequency circuit 704 for voice communication. For purposes of stereo acquisition or noise reduction, the microphone may be multiple, and disposed at different locations of the electronic device 700. The microphone may also be an array microphone or an omni-directional pickup microphone. The speaker is used to convert electrical signals from the processor 701 or the radio frequency circuit 704 into sound waves. The speaker may be a conventional thin film speaker or a piezoelectric ceramic speaker. When the speaker is a piezoelectric ceramic speaker, not only the electric signal can be converted into a sound wave audible to humans, but also the electric signal can be converted into a sound wave inaudible to humans for ranging and other purposes. In some embodiments, the audio circuit 707 may also include a headphone jack.
The location component 708 is operative to locate a current geographic location of the electronic device 700 for navigation or LBS (Location Based Service, location-based services). The positioning component 708 may be a positioning component based on the United states GPS (Global Positioning System ), the Beidou system of China, the Granati system of Russia, or the Galileo system of the European Union.
The power supply 709 is used to power the various components in the electronic device 700. The power supply 709 may be an alternating current, a direct current, a disposable battery, or a rechargeable battery. When the power supply 709 includes a rechargeable battery, the rechargeable battery may support wired or wireless charging. The rechargeable battery may also be used to support fast charge technology.
In some embodiments, the electronic device 700 further includes one or more sensors 710. The one or more sensors 710 include, but are not limited to: acceleration sensor 711, gyroscope sensor 712, pressure sensor 713, fingerprint sensor 714, optical sensor 715, and proximity sensor 716.
The acceleration sensor 711 can detect the magnitudes of accelerations on three coordinate axes of the coordinate system established with the electronic device 700. For example, the acceleration sensor 711 may be used to detect the components of the gravitational acceleration in three coordinate axes. The processor 701 may control the touch display screen 705 to display a user interface in a landscape view or a portrait view according to the gravitational acceleration signal acquired by the acceleration sensor 711. The acceleration sensor 711 may also be used for the acquisition of motion data of a game or a user.
The gyro sensor 712 may detect a body direction and a rotation angle of the electronic device 700, and the gyro sensor 712 may collect a 3D motion of the user on the electronic device 700 in cooperation with the acceleration sensor 711. The processor 701 may implement the following functions based on the data collected by the gyro sensor 712: motion sensing (e.g., changing UI according to a tilting operation by a user), image stabilization at shooting, game control, and inertial navigation.
The pressure sensor 713 may be disposed at a side frame of the electronic device 700 and/or at an underlying layer of the touch display screen 705. When the pressure sensor 713 is disposed at a side frame of the electronic device 700, a grip signal of the user on the electronic device 700 may be detected, and the processor 701 performs left-right hand recognition or quick operation according to the grip signal collected by the pressure sensor 713. When the pressure sensor 713 is disposed at the lower layer of the touch display screen 705, the processor 701 controls the operability control on the UI interface according to the pressure operation of the user on the touch display screen 705. The operability controls include at least one of a button control, a scroll bar control, an icon control, and a menu control.
The fingerprint sensor 714 is used to collect a fingerprint of the user, and the processor 701 identifies the identity of the user according to the fingerprint collected by the fingerprint sensor 714, or the fingerprint sensor 714 identifies the identity of the user according to the collected fingerprint. Upon recognizing that the user's identity is a trusted identity, the processor 701 authorizes the user to perform relevant sensitive operations including unlocking the screen, viewing encrypted information, downloading software, paying for and changing settings, etc. The fingerprint sensor 714 may be provided on the front, back, or side of the electronic device 700. When a physical key or vendor Logo is provided on the electronic device 700, the fingerprint sensor 714 may be integrated with the physical key or vendor Logo.
The optical sensor 715 is used to collect the ambient light intensity. In one embodiment, the processor 701 may control the display brightness of the touch display 705 based on the ambient light intensity collected by the optical sensor 715. Specifically, when the intensity of the ambient light is high, the display brightness of the touch display screen 705 is turned up; when the ambient light intensity is low, the display brightness of the touch display screen 705 is turned down. In another embodiment, the processor 701 may also dynamically adjust the shooting parameters of the camera assembly 706 based on the ambient light intensity collected by the optical sensor 715.
A proximity sensor 716, also referred to as a distance sensor, is typically provided on the front panel of the electronic device 700. The proximity sensor 716 is used to capture the distance between the user and the front of the electronic device 700. In one embodiment, when the proximity sensor 716 detects that the distance between the user and the front face of the electronic device 700 gradually decreases, the processor 701 controls the touch display 705 to switch from the bright screen state to the off screen state; when the proximity sensor 716 detects that the distance between the user and the front surface of the electronic device 700 gradually increases, the processor 701 controls the touch display screen 705 to switch from the off-screen state to the on-screen state.
Those skilled in the art will appreciate that the structure shown in fig. 7 is not limiting of the electronic device 700 and may include more or fewer components than shown, or may combine certain components, or may employ a different arrangement of components.
In an exemplary embodiment, there is also provided a non-transitory computer readable storage medium including instructions, such as memory 704 including instructions, executable by processor 720 of electronic device 700 to perform the above-described video playback method, the method comprising: monitoring the first use time length of the target display screen, wherein the use time length is the total time length of the use time from when the display screen is started for the first time; determining a current display brightness value of a first area in the target display screen based on the first using time, wherein the first area is a first color luminous area; when the current display brightness value of the first area of the target display screen is detected to be lower than a preset display brightness threshold value, the current display brightness of the first area of the target display screen is adjusted according to a preset display strategy. Optionally, the above instructions may also be executed by the processor 720 of the electronic device 700 to perform the other steps involved in the above-described exemplary embodiments. For example, the non-transitory computer readable storage medium may be ROM, random Access Memory (RAM), CD-ROM, magnetic tape, floppy disk, optical data storage device, etc.
In an exemplary embodiment, there is also provided an application/computer program product comprising one or more instructions executable by the processor 720 of the electronic device 700 to perform a method of synchronizing data as described above, the method comprising: acquiring a synchronization instruction, wherein the synchronization instruction carries first change data, and the change data is data with changed data content in a relational database; adding the first change data and a corresponding first position identifier to a change data file, wherein the first position identifier is used for marking the position of the first change data in the change data file; and synchronizing the first change data and the change data file with the first position identifier to a local disk. Optionally, the above instructions may also be executed by the processor 720 of the electronic device 700 to perform the other steps involved in the above-described exemplary embodiments.
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 adaptations, 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 is to be understood that the present disclosure is not limited to the precise arrangements and instrumentalities shown in the drawings, and that various modifications and changes may be effected without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (9)

1. A method of synchronizing data, comprising:
establishing a change data index table, and acquiring a synchronous instruction, wherein the synchronous instruction carries first change data, the change data is data with changed data content in a relational database, and the change data index table is used for searching each change data;
adding the first change data and a corresponding first position identifier to a change data file, wherein the first position identifier is used for marking the position of the first change data in the change data file;
synchronizing the first change data and the change data file of the first position identifier to a local disk;
wherein adding the first change data and the corresponding first location identifier to the change data file includes:
recording the first position identification to the change data index table;
and adding the first change data and the change data index table of the first position identifier to the change data file.
2. The method of claim 1, wherein the acquiring the synchronization instruction comprises:
receiving the synchronization instruction sent by the relational database; or alternatively, the first and second heat exchangers may be,
when the first change data are detected to exist in the relational database, a first request instruction is sent to the relational database, and the first request instruction is used for acquiring the first change data;
and receiving the synchronous instruction sent by the relational database.
3. The method of claim 1 or 2, further comprising, after said synchronizing the data file to which the first change data and the first location identification are added to the local disk:
when a second request instruction is received, the first change data is called from the change data file based on the second request instruction and the first position identifier;
and sending the first change data.
4. The method of claim 3, wherein the retrieving the first change data from the change data file based on the second request instruction and the first location identification comprises:
analyzing the second request instruction, and determining a calling time period and a calling object;
Determining the first change data according to the calling time and the calling object;
and calling the first change data from the change data file based on the first position identification.
5. The method of claim 3, further comprising, after said sending said first change data:
and adjusting the first change data based on the reservation information carried in the second request instruction, wherein the reservation information is used for indicating whether the first change data is reserved in the change data file.
6. The method of claim 1, further comprising, after said synchronizing the data file to which the first change data and the first location identification are added to the local disk:
and when the residual storage space of the local disk is detected to be lower than a preset threshold value, clearing second change data and a corresponding second position mark, wherein the second change data is the change data with the earliest synchronization time in the local disk, and the second position mark is used for marking the position of the second change data in a change data file.
7. An apparatus for synchronizing data, comprising:
The acquisition module is configured to establish a change data index table, acquire a synchronous instruction, wherein the synchronous instruction carries first change data, the change data is data with changed data content in a relational database, and the change data index table is used for searching each change data;
an adding module configured to add the first change data and a corresponding first location identifier to a change data file, where the first location identifier is used to mark a location of the first change data in the change data file;
the synchronization module is configured to synchronize the change data file added with the first change data and the first position identifier to a local disk;
wherein the adding module is specifically configured to record the first location identifier to the change data index table; and adding the first change data and the change data index table of the first position identifier to the change data file.
8. An electronic device, comprising:
a memory for storing executable instructions; the method comprises the steps of,
a display for displaying with the memory to execute the executable instructions to perform the operations of the method of synchronizing data of any one of claims 1-6.
9. A computer readable storage medium storing computer readable instructions which, when executed, perform the operations of the method of synchronizing data of any one of claims 1-6.
CN201910123483.7A 2019-02-18 2019-02-18 Method, device, electronic equipment and medium for synchronizing data Active CN109871411B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910123483.7A CN109871411B (en) 2019-02-18 2019-02-18 Method, device, electronic equipment and medium for synchronizing data

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910123483.7A CN109871411B (en) 2019-02-18 2019-02-18 Method, device, electronic equipment and medium for synchronizing data

Publications (2)

Publication Number Publication Date
CN109871411A CN109871411A (en) 2019-06-11
CN109871411B true CN109871411B (en) 2023-05-09

Family

ID=66918898

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910123483.7A Active CN109871411B (en) 2019-02-18 2019-02-18 Method, device, electronic equipment and medium for synchronizing data

Country Status (1)

Country Link
CN (1) CN109871411B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112181938B (en) * 2019-07-05 2024-06-14 杭州海康威视数字技术股份有限公司 Database cleaning method, device and computer readable storage medium

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107180116A (en) * 2017-06-28 2017-09-19 努比亚技术有限公司 A kind of data synchronizing processing method, mobile terminal and computer-readable recording medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10282255B2 (en) * 2015-07-15 2019-05-07 Microsoft Technology Licensing, Llc Coordinating file synchronization between a sync engine and another application that supports document collaboration

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107180116A (en) * 2017-06-28 2017-09-19 努比亚技术有限公司 A kind of data synchronizing processing method, mobile terminal and computer-readable recording medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
ECS-DBMS中的更新传播技术及其测试与分析;杨旭海等;《陕西天文台台刊》;20001230(第02期);全文 *

Also Published As

Publication number Publication date
CN109871411A (en) 2019-06-11

Similar Documents

Publication Publication Date Title
CN110944374B (en) Communication mode selection method and device, electronic equipment and medium
CN110147503B (en) Information issuing method and device, computer equipment and storage medium
CN111104402A (en) Method, device, electronic equipment and medium for searching data
CN109902089B (en) Query method and device using heterogeneous index, electronic equipment and medium
CN111949879A (en) Method and device for pushing message, electronic equipment and readable storage medium
CN110853124B (en) Method, device, electronic equipment and medium for generating GIF dynamic diagram
CN110597801B (en) Database system and establishing method and device thereof
CN110471614B (en) Method for storing data, method and device for detecting terminal
CN111192072A (en) User grouping method and device and storage medium
CN111159551B (en) User-generated content display method and device and computer equipment
CN111064657B (en) Method, device and system for grouping concerned accounts
CN111008083B (en) Page communication method and device, electronic equipment and storage medium
CN109871411B (en) Method, device, electronic equipment and medium for synchronizing data
CN111428080B (en) Video file storage method, video file search method and video file storage device
CN113051485B (en) Group searching method, device, terminal and storage medium
CN112597417B (en) Page updating method and device, electronic equipment and storage medium
CN111641853B (en) Multimedia resource loading method and device, computer equipment and storage medium
CN111125095B (en) Method, device, electronic equipment and medium for adding data prefix
CN110708582B (en) Synchronous playing method, device, electronic equipment and medium
CN110928867B (en) Data fusion method and device
CN113836426A (en) Information pushing method and device and electronic equipment
CN110427362B (en) Method and device for acquiring database types
CN109918566B (en) Query method, query device, electronic equipment and medium
CN110545299B (en) Content list information acquisition method, content list information providing method, content list information acquisition device, content list information providing device and content list information equipment
CN111159168A (en) Data processing method and device

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