CN110851455A - Data landing method and device, mobile terminal and computer readable storage medium - Google Patents

Data landing method and device, mobile terminal and computer readable storage medium Download PDF

Info

Publication number
CN110851455A
CN110851455A CN201911075110.3A CN201911075110A CN110851455A CN 110851455 A CN110851455 A CN 110851455A CN 201911075110 A CN201911075110 A CN 201911075110A CN 110851455 A CN110851455 A CN 110851455A
Authority
CN
China
Prior art keywords
data
event
request
version number
data corresponding
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.)
Pending
Application number
CN201911075110.3A
Other languages
Chinese (zh)
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.)
Shangyu Software (shenzhen) Co Ltd
Original Assignee
Shangyu Software (shenzhen) 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 Shangyu Software (shenzhen) Co Ltd filed Critical Shangyu Software (shenzhen) Co Ltd
Priority to CN201911075110.3A priority Critical patent/CN110851455A/en
Publication of CN110851455A publication Critical patent/CN110851455A/en
Pending legal-status Critical Current

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/23Updating
    • G06F16/2365Ensuring data consistency and integrity
    • 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

Abstract

The invention discloses a data landing method, a device, a mobile terminal and a computer readable storage medium, wherein the data landing method comprises the following steps: if the access layer receives a request for modifying data sent by the application layer, modifying the data corresponding to the request in the cache layer, generating an event version number of a modified data event for modifying the data corresponding to the request in the cache layer, synchronizing the modified data event to the event queue, if the event consumption receives the modified data event sent by the event queue, acquiring a landing version number of the data corresponding to the modified data event based on the distributed cache system, executing a data landing operation of the data corresponding to the modified data event based on the event version number and the landing version number, reducing the pressure of landing storage by a data merging mode, and ensuring the safety and consistency of the data.

Description

Data landing method and device, mobile terminal and computer readable storage medium
Technical Field
The present invention relates to the field of data processing, and in particular, to a data landing method and apparatus, a mobile terminal, and a computer-readable storage medium.
Background
With the development of services, data gauge modules are larger and larger, data modification is higher and higher, the pressure of frequent landing of data on landing storage is increased day by day, the existing technical implementation generally includes that a cache layer is added between a service logic layer and a landing storage layer, and the number of requests for the landing storage layer is reduced by utilizing efficient memory operation of the cache layer. The data is cached in the cache layer, the service layer is regularly eliminated to the floor storage layer, the pressure of the floor storage layer is reduced through the data coverage of the memory of the cache layer, however, in the prior art, if the floor storage module is modified every time, the pressure of the floor storage module is greatly increased, and if the floor storage module is simply combined through the cache layer, the floor safety of the data cannot be controlled.
The above is only for the purpose of assisting understanding of the technical aspects of the present invention, and does not represent an admission that the above is prior art.
Disclosure of Invention
The invention mainly aims to provide a data landing method, a data landing device, a mobile terminal and a computer readable storage medium, and aims to solve the technical problem that after data are combined, the data landing safety cannot be controlled in the prior art.
In order to achieve the above object, the present invention provides a data landing method, which comprises the following steps:
if the access layer receives a request for modifying data sent by the application layer, modifying the data corresponding to the request in the cache layer;
generating an event version number of a modified data event for modifying the data corresponding to the request in a cache layer, and synchronizing the modified data event to an event queue;
if the event consumption receives the modified data event sent by the event queue, acquiring a floor version number of data corresponding to the modified data event based on a distributed cache system;
and executing data landing operation of the data corresponding to the modified data event based on the event version number and the landing version number.
Preferably, if the event version number is less than or equal to the landing version number, terminating the data landing operation of the data corresponding to the modified data event;
and if the event version number is greater than the landing version number, continuing to execute the data landing operation of the data corresponding to the modified data event.
Preferably, an event version number set of data corresponding to the modified data event in the cache layer is obtained;
acquiring a target event version number with the maximum event version number in the event version number set, and landing target data corresponding to the target event version number on a storage system;
and updating the floor version number of the data corresponding to the modified data event in the distributed cache system to be the target event version number of the data.
Preferably, if the access layer receives a request for modifying data from the application layer, the request attribute of the request for modifying data is determined;
and modifying the data corresponding to the request in a cache layer based on the request attribute of the request for modifying the data.
Preferably, if the request attribute of the data modification request is a data replacement request, data corresponding to the data replacement request is replaced in the cache layer.
Preferably, if the request attribute of the data modification request is an additional modification request, the application layer determines whether data corresponding to the additional modification request exists in the cache layer;
and if the data corresponding to the additional modification request exists in the cache layer, modifying the data corresponding to the additional modification request in the cache layer.
Preferably, if the data corresponding to the additional modification request does not exist in the cache layer, the data corresponding to the additional modification request is pulled from the database to the cache layer, and the data corresponding to the additional modification request is modified in the cache layer.
In addition, in order to achieve the above object, the present invention further provides a data landing apparatus, including:
the modification module is used for modifying data corresponding to a request in a cache layer if the access layer receives the request for modifying data sent by an application layer;
a generating module, configured to generate an event version number of a modified data event for modifying the data corresponding to the request in a cache layer, and synchronize the modified data event to an event queue;
the acquisition module is used for acquiring the floor version number of data corresponding to the modified data event based on a distributed cache system if the event consumption receives the modified data event sent by the event queue;
and the execution module is used for executing data landing operation of the data corresponding to the modified data event based on the event version number and the landing version number.
Preferably, the execution module is further configured to:
if the event version number is less than or equal to the landing version number, terminating the data landing operation of the data corresponding to the modified data event;
and if the event version number is greater than the landing version number, continuing to execute the data landing operation of the data corresponding to the modified data event.
Preferably, the execution module is further configured to:
acquiring an event version number set of data corresponding to the modified data event in the cache layer;
acquiring a target event version number with the maximum event version number in the event version number set, and landing target data corresponding to the target event version number on a storage system;
and updating the floor version number of the data corresponding to the modified data event in the distributed cache system to be the target event version number of the data.
Preferably, the modification module is further configured to:
if the access layer receives a data modification request sent by an application layer, judging the request attribute of the data modification request;
and modifying the data corresponding to the request in a cache layer based on the request attribute of the request for modifying the data.
Preferably, the modification module is further configured to:
and if the request attribute of the data modification request is a data replacement request, replacing the data corresponding to the data replacement request in a cache layer.
Preferably, the modification module is further configured to:
if the request attribute of the data modification request is an additional modification request, the application layer judges whether data corresponding to the additional modification request exists in the cache layer;
and if the data corresponding to the additional modification request exists in the cache layer, modifying the data corresponding to the additional modification request in the cache layer.
Preferably, the modification module is further configured to:
and if the data corresponding to the additional modification request does not exist in the cache layer, pulling the data corresponding to the additional modification request from the database to the cache layer, and modifying the data corresponding to the additional modification request in the cache layer.
In addition, to achieve the above object, the present invention also provides a mobile terminal, including: the data landing program is stored on the memory and can run on the processor, and when being executed by the processor, the data landing program realizes the steps of the data landing method.
In addition, to achieve the above object, the present invention further provides a computer readable storage medium, which stores a data landing program, and the data landing program realizes the steps of the data landing method when being executed by a processor.
According to the method, if the access layer receives the data modification request sent by the application layer, the data corresponding to the modification request is modified in the cache layer, the event version number of the data modification event of the data corresponding to the modification request is generated in the cache layer, the data modification event is synchronized to the event queue, if the event consumption receives the data modification event sent by the event queue, the ground version number of the data corresponding to the data modification event is obtained based on the distributed cache system, the data ground operation of the data corresponding to the data modification event is executed based on the event version number and the ground version number, the ground storage pressure is reduced in a data merging mode, and the data safety and consistency are guaranteed.
Drawings
Fig. 1 is a schematic structural diagram of a mobile terminal in a hardware operating environment according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating a first embodiment of a landing method according to the present invention;
fig. 3 is a detailed flow chart of the first embodiment.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
As shown in fig. 1, fig. 1 is a schematic structural diagram of a mobile terminal in a hardware operating environment according to an embodiment of the present invention.
The mobile terminal of the embodiment of the invention can be a PC, and can also be a mobile terminal device with a data landing function, such as a smart phone, a tablet computer and the like.
As shown in fig. 1, the mobile terminal may include: a processor 1001, such as a CPU, a network interface 1004, a user interface 1003, a memory 1005, a communication bus 1002. Wherein a communication bus 1002 is used to enable connective communication between these components. The user interface 1003 may include a Display screen (Display), an input unit such as a Keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface, a wireless interface. The network interface 1004 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface). The memory 1005 may be a high-speed RAM memory or a non-volatile memory (e.g., a magnetic disk memory). The memory 1005 may alternatively be a storage device separate from the processor 1001.
Optionally, the mobile terminal may further include a camera, a Radio Frequency (RF) circuit, a sensor, an audio circuit, a WiFi module, and the like. Such as light sensors, motion sensors, and other sensors. Specifically, the light sensor may include an ambient light sensor that may adjust the brightness of the display screen according to the brightness of ambient light, and a proximity sensor that may turn off the display screen and/or the backlight when the mobile terminal is moved to the ear. As one of the motion sensors, the gravity acceleration sensor can detect the magnitude of acceleration in each direction (generally, three axes), detect the magnitude and direction of gravity when the mobile terminal is stationary, and can be used for applications (such as horizontal and vertical screen switching, related games, magnetometer attitude calibration), vibration recognition related functions (such as pedometer and tapping) and the like for recognizing the attitude of the mobile terminal; of course, the mobile terminal may also be configured with other sensors such as a gyroscope, a barometer, a hygrometer, a thermometer, and an infrared sensor, which are not described herein again.
Those skilled in the art will appreciate that the mobile terminal architecture shown in fig. 1 is not intended to be limiting of mobile terminals and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components.
As shown in fig. 1, a memory 1005, which is a kind of computer storage medium, may include therein an operating system, a network communication module, a user interface module, and a data console program.
In the mobile terminal shown in fig. 1, the network interface 1004 is mainly used for connecting to a backend server and communicating with the backend server; the user interface 1003 is mainly used for connecting a client (user side) and performing data communication with the client; and the processor 1001 may be used to invoke the data console program stored in the memory 1005.
In this embodiment, the data console device includes: the system comprises a memory 1005, a processor 1001 and a data grounding program which is stored on the memory 1005 and can run on the processor 1001, wherein when the processor 1001 calls the data grounding program stored in the memory 1005, the following operations are executed:
if the access layer receives a request for modifying data sent by the application layer, modifying the data corresponding to the request in the cache layer;
generating an event version number of a modified data event for modifying the data corresponding to the request in a cache layer, and synchronizing the modified data event to an event queue;
if the event consumption receives the modified data event sent by the event queue, acquiring a floor version number of data corresponding to the modified data event based on a distributed cache system;
executing data landing operation of data corresponding to the modified data event based on the event version number and the landing version number
Further, the processor 1001 may call the data console program stored in the memory 1005, and further perform the following operations:
if the event version number is less than or equal to the landing version number, terminating the data landing operation of the data corresponding to the modified data event;
and if the event version number is greater than the landing version number, continuing to execute the data landing operation of the data corresponding to the modified data event.
Further, the processor 1001 may call the data console program stored in the memory 1005, and further perform the following operations:
acquiring an event version number set of data corresponding to the modified data event in the cache layer;
acquiring a target event version number with the maximum event version number in the event version number set, and landing target data corresponding to the target event version number on a storage system;
and updating the floor version number of the data corresponding to the modified data event in the distributed cache system to be the target event version number of the data.
Further, the processor 1001 may call the data console program stored in the memory 1005, and further perform the following operations:
if the access layer receives a data modification request sent by an application layer, judging the request attribute of the data modification request;
and modifying the data corresponding to the request in a cache layer based on the request attribute of the request for modifying the data.
Further, the processor 1001 may call the data console program stored in the memory 1005, and further perform the following operations:
and if the request attribute of the data modification request is a data replacement request, replacing the data corresponding to the data replacement request in a cache layer.
Further, the processor 1001 may call the data console program stored in the memory 1005, and further perform the following operations:
if the request attribute of the data modification request is an additional modification request, the application layer judges whether data corresponding to the additional modification request exists in the cache layer;
and if the data corresponding to the additional modification request exists in the cache layer, modifying the data corresponding to the additional modification request in the cache layer.
Further, the processor 1001 may call the data console program stored in the memory 1005, and further perform the following operations:
and if the data corresponding to the additional modification request does not exist in the cache layer, pulling the data corresponding to the additional modification request from the database to the cache layer, and modifying the data corresponding to the additional modification request in the cache layer.
The invention also provides a data landing method, and referring to fig. 2, fig. 2 is a schematic flow chart of a first embodiment of the data landing method of the invention.
Step S100, if the access layer receives a request for modifying data sent by the application layer, modifying data corresponding to the request in the cache layer;
in this embodiment, the application layer may be software for implementing any function, and various modified data processing requests need to be generated, the access layer includes an access port for implementing at least one modified data processing logic, and may be configured to map modified data processing requests in different data structure forms transmitted by the application layer into the cache layer, and the cache layer is configured to process and cache the data processing requests transmitted by the access layer.
Specifically, as shown in fig. 3, if the access layer receives a data modification request sent from the application layer, such as a data modification request for writing data, deleting data, reading data, and changing data, and the access layer maps the received data modification request sent from the application layer to the cache layer, the data corresponding to the request is modified in the cache layer.
Further, step S100 further includes:
step S110, if the access layer receives the request for modifying data sent by the application layer, the request attribute of the request for modifying data is judged;
step S120, modifying the data corresponding to the request in the cache layer based on the request attribute of the request for modifying data.
In this step, it can be understood that all the data that needs to be modified must be in the cache layer, and multiple nodes perform atomic modification based on the same cache layer, so as to ensure that the current latest data is always in the cache layer, and thus, the current latest data can always be obtained when subsequent operations are performed.
Specifically, if the access layer receives a request for modifying data sent from the application layer, the request attribute of the request for modifying data is determined, where the request attribute of the request for modifying data includes a request for replacing data and a request for additional modification, it can be understood that, if the request attribute of the request for modifying data is a request for replacing data, the data can be directly replaced in the cache layer, and if the request attribute of the request for modifying data is a request for additional modification, the application layer needs to first determine whether data corresponding to the request for additional modification exists in the cache layer, so as to ensure that all data to be modified must be in the cache layer, and multiple nodes perform atomic modification based on the same cache layer, so as to ensure that all data in the cache layer are current and latest data, so as to ensure that the current and latest data can always be obtained when performing subsequent operations.
Step S200, generating an event version number of a modified data event for modifying the data corresponding to the request in a cache layer, and synchronizing the modified data event to an event queue;
in this embodiment, as shown in fig. 3, a message queue module is added inside the mobile terminal, where the message queue module includes an event queue, and the message queue module decouples data production and data, and may cache events based on the message queue, specifically, when a modified data event corresponding to a modified data request is executed in a cache layer, an event version number of the modified data event of the data corresponding to the modified data request is generated, where the event version number is numbered based on the time of the modified data event, and meanwhile, the modified data event is synchronized to the event queue, and the modified data event within a period of time is cached in the event queue.
Step S300, if the event consumption receives the modified data event sent by the event queue, acquiring a floor version number of data corresponding to the modified data event based on a distributed cache system;
in this embodiment, if the event consumption receives the modified data event sent by the event queue, merging the modified data event within a period of time to store the data corresponding to the modified data event on the ground, optionally, setting a delay processing time of event consumption, that is, after merging the modified data event within a period of time to store the data corresponding to the modified data event on the ground, merging the modified data event within a period of time again to store the data corresponding to the modified data event on the ground, optionally, setting the delay processing time of event consumption based on the number of modified data events in the event queue, that is, monitoring the number of modified data events in the event queue in real time, and then the delay processing time of event consumption is the time when the number of modified data events in the event queue exceeds the preset number of modified data events, the preset modified data event number may be an average number of modified data events buffered from the beginning to the present in the event queue, and is not limited herein.
Specifically, if the event consumption receives a modified data event sent by an event queue, a landing version number of data corresponding to the modified data event sent by the event queue in the distributed cache system is obtained, wherein the landing version number of the data corresponds to the landing storage time of the data.
And step S400, executing data landing operation of the data corresponding to the modified data event based on the event version number and the landing version number.
In this embodiment, after the modified data event sent by the event queue is received by event consumption, the data landing version number of the data corresponding to the modified data event is obtained based on the distributed cache system, and then the data landing operation of the data corresponding to the modified data event is executed based on the event version number and the landing version number, specifically, the event version number of the data corresponding to the modified data event is compared with the landing version number, if the event version number is smaller than the landing version number, it indicates that the data corresponding to the modified data event falls to the ground, and if the event version number is greater than the landing version number, it indicates that the data corresponding to the modified data event is modified and updated again after falling to the ground, and then the data after being modified and updated again.
In this embodiment, if the access layer receives a request for modifying data sent from the application layer, the data corresponding to the request is modified in the cache layer, then an event version number of a modified data event of the data corresponding to the request is generated in the cache layer, and the modified data event is synchronized to the event queue, if the event consumption receives the modified data event sent from the event queue, a landing version number of the data corresponding to the modified data event is obtained based on the distributed cache system, and finally a data landing operation of the data corresponding to the modified event is executed based on the event version number and the landing version number, so that the pressure of data landing storage is reduced by means of data merging, and the consistency and the security of the data are ensured.
Based on the first embodiment, a second embodiment of the data landing method of the present invention is proposed, in this embodiment, step S300 further includes:
step S310, if the event version number is less than or equal to the landing version number, terminating the data landing operation of the data corresponding to the modified data event;
step S320, if the event version number is greater than the landing version number, continuing to perform the data landing operation of the data corresponding to the modified data event.
In this embodiment, it can be understood that, if the event version number is less than or equal to the floor version number, the data floor operation of the data corresponding to the modification event is terminated, for example, the data "X" is terminated, when the event consumption receives the modified data event sent by the event queue, the floor version number of the data "X" in the distributed cache system is 97, when the event consumption receives the modified data event with the modified data event version number of 96 sent by the event queue, the consumption module obtains the floor version number of the data "X" as 97 based on the distributed cache system, and at this time, the modified data event version number 96 is less than the floor version number 97, which indicates that the modified data event with the modified data event version number of 96 has expired, the data floor operation of the data corresponding to the modified data event with the modified event version number of 96 is terminated, that is, the modified data event, and then, the consumption event continuously consumes the modified data event with the modified data event version number of 97 sent from the event queue, at this time, the modified data event version number 97 is equal to the floor version number 97, which indicates that the modified data event with the modified data event version number of 97 is expired, and the modified data event with the modified event version number of 97 is discarded.
And then, the consumption event continuously consumes the modified data event with the modified data event version number of 98 sent from the event queue, at the moment, the event version number 98 is greater than the landing version number 97, and then the data landing operation of the data corresponding to the modified data event is continuously executed.
In this embodiment, if the event version number is less than or equal to the floor version number, the data floor operation of the data corresponding to the modified data event is terminated, and if the event version number is greater than the floor version number, the data floor operation of the data corresponding to the modified data event is continuously executed, so that the pressure of floor storage of the data is reduced by means of data merging, and the consistency and the security of the data are ensured.
Based on the second embodiment, a third embodiment of the data landing method of the present invention is proposed, in this embodiment, step S320 further includes:
step S321, obtaining an event version number set of data corresponding to the modified data event in the cache layer;
step S322, obtaining the target event version number with the maximum event version number in the event version number set, and landing the target data corresponding to the target event version number to a storage system;
step S323, updating the floor version number of the data corresponding to the modification event in the distributed cache system to a target event version number of the data.
In this embodiment, it can be understood that, when data is continuously modified and updated, the access layer continuously receives a request for modifying data sent from the application layer, and continuously modifies data corresponding to the request in the cache layer; meanwhile, the event queue stores the modified data events continuously and synchronously, if the event version number of the modified data event sent by the event consumption receiving event queue is greater than the floor version number of the data corresponding to the modified data event in the distributed cache system, the event version number set of the data corresponding to the modified data event in the cache layer is obtained, and the target event version number with the maximum event version number in the event version number set is obtained, for example, the floor version number of data "X" is 97, and when the event version number 98 of the modified data event sent by the event consumption receiving event queue is greater than the floor version number 97 of the data corresponding to the modified data event in the distributed cache system, the event version number set of the data corresponding to the modified data event in the cache layer is 98 to 120, it can be understood that the event version number in the event version set is the maximum target event version number 120, then the latest version data with the event version number of 120 is dropped to the storage system, that is, the target data corresponding to the target event version number is dropped to the storage system, and then the floor version number of the data corresponding to the modification event in the distributed cache system is updated to the target event version number of the data, that is, the floor version number 97 stored in the current data "X" in the distributed cache system is updated to the target event version number 120 of the data "X".
In this embodiment, an event version number set of data corresponding to a modified data event in a cache layer is obtained, a target event version number with the largest event version number in the event version number set is obtained, target data corresponding to the target event version number is landed on a storage system, and a landing version number of data corresponding to the modified data event in a distributed cache system is updated to the target event version number of the data, so that pressure of landing storage of the data is reduced, and consistency and safety of the data are ensured.
Based on the first embodiment, a fourth embodiment of the data landing method of the present invention is proposed, in this embodiment, step S120 further includes:
step S121, if the request attribute of the data modification request is a data replacement request, replacing data corresponding to the data replacement request in a cache layer.
In this embodiment, if the request attribute of the modified data request is a data replacement request, replacing data corresponding to the data replacement request in the cache layer, for example, if the request sent by the application layer is a data replacement "X" request, if there is a data "X" in the cache layer, directly replacing the data "X", and if there is no data "X" in the cache layer, directly placing the data replacement "X" in the cache layer.
Further, step S120 further includes:
step S122, if the request attribute of the data modification request is an additional modification request, the application layer determines whether data corresponding to the additional modification request exists in the cache layer;
step S123, if the data corresponding to the additional modification request exists in the cache layer, modifying the data corresponding to the additional modification request in the cache layer.
In this step, if the request attribute of the request for modifying data is the request for additional modification, the application layer needs to first determine whether data corresponding to the request for additional modification exists in the cache layer, and if data corresponding to the request for additional modification exists in the cache layer, data corresponding to the request for additional modification in the cache layer is modified.
Further, step S122 further includes:
step S124, if the data corresponding to the additional modification request does not exist in the cache layer, pulling the data corresponding to the additional modification request from the database into the cache layer, and modifying the data corresponding to the additional modification request in the cache layer.
In this step, it can be understood that all the data that needs to be modified must be in the cache layer, and multiple nodes perform atomic modification based on the same cache layer, so as to ensure that the current latest data is always in the cache layer, and thus, the current latest data can always be obtained when subsequent operations are performed.
If the data corresponding to the additional modification request does not exist in the cache layer, the data corresponding to the additional modification request is pulled from the database to the cache layer, and it can be understood that all the data is stored in the database, and if the data corresponding to the additional modification request does not exist in the cache layer, the data corresponding to the additional modification request can be pulled from the database to the cache layer, and the data corresponding to the additional modification request can be modified in the cache layer.
In this embodiment, if the request attribute of the request for modifying data is an additional modification request, the application layer determines whether data corresponding to the additional modification request exists in the cache layer, if the data corresponding to the additional modification request exists in the cache layer, the data corresponding to the additional modification request is modified in the cache layer, and if the data corresponding to the additional modification request does not exist in the cache layer, the data corresponding to the additional modification request is pulled from the database to the cache layer, and the data corresponding to the additional modification request is modified in the cache layer, so that consistency of the data in the cache layer is ensured.
In addition, an embodiment of the present invention further provides a data landing device, where the data landing device includes:
the modification module is used for modifying data corresponding to a request in a cache layer if the access layer receives the request for modifying data sent by an application layer;
a generating module, configured to generate an event version number of a modified data event for modifying the data corresponding to the request in a cache layer, and synchronize the modified data event to an event queue;
the acquisition module is used for acquiring the floor version number of data corresponding to the modified data event based on a distributed cache system if the event consumption receives the modified data event sent by the event queue;
and the execution module is used for executing data landing operation of the data corresponding to the modified data event based on the event version number and the landing version number.
Further, the execution module is further configured to:
if the event version number is less than or equal to the landing version number, terminating the data landing operation of the data corresponding to the modified data event;
and if the event version number is greater than the landing version number, continuing to execute the data landing operation of the data corresponding to the modified data event.
Further, the execution module is further configured to:
acquiring an event version number set of data corresponding to the modified data event in the cache layer;
acquiring a target event version number with the maximum event version number in the event version number set, and landing target data corresponding to the target event version number on a storage system;
and updating the floor version number of the data corresponding to the modified data event in the distributed cache system to be the target event version number of the data.
Further, the modification module is further configured to:
if the access layer receives a data modification request sent by an application layer, judging the request attribute of the data modification request;
and modifying the data corresponding to the request in a cache layer based on the request attribute of the request for modifying the data.
Further, the modification module is further configured to:
and if the request attribute of the data modification request is a data replacement request, replacing the data corresponding to the data replacement request in a cache layer.
Further, the modification module is further configured to:
if the request attribute of the data modification request is an additional modification request, the application layer judges whether data corresponding to the additional modification request exists in the cache layer;
and if the data corresponding to the additional modification request exists in the cache layer, modifying the data corresponding to the additional modification request in the cache layer.
Further, the modification module is further configured to:
and if the data corresponding to the additional modification request does not exist in the cache layer, pulling the data corresponding to the additional modification request from the database to the cache layer, and modifying the data corresponding to the additional modification request in the cache layer.
In addition, an embodiment of the present invention further provides a computer-readable storage medium, where a data landing program is stored on the computer-readable storage medium, and when the data landing program is executed by a processor, the data landing program implements the steps of the data landing method described above.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or system. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solution of the present invention essentially or contributing to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) as described above and includes several instructions for enabling a mobile terminal device (such as a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present invention.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (10)

1. A data landing method is characterized by comprising the following steps:
if the access layer receives a request for modifying data sent by the application layer, modifying the data corresponding to the request in the cache layer;
generating an event version number of a modified data event for modifying the data corresponding to the request in a cache layer, and synchronizing the modified data event to an event queue;
if the event consumption receives the modified data event sent by the event queue, acquiring a floor version number of data corresponding to the modified data event based on a distributed cache system;
and executing data landing operation of the data corresponding to the modified data event based on the event version number and the landing version number.
2. The data landing method of claim 1, wherein the step of performing the data landing operation for modifying data corresponding to the data event based on the event version number and the landing version number comprises:
if the event version number is less than or equal to the landing version number, terminating the data landing operation of the data corresponding to the modified data event;
and if the event version number is greater than the landing version number, continuing to execute the data landing operation of the data corresponding to the modified data event.
3. The method according to claim 2, wherein if the event version number is greater than the landing version number, the step of continuing to perform the data landing operation for modifying the data corresponding to the data event comprises:
acquiring an event version number set of data corresponding to the modified data event in the cache layer;
acquiring a target event version number with the maximum event version number in the event version number set, and landing target data corresponding to the target event version number on a storage system;
and updating the floor version number of the data corresponding to the modified data event in the distributed cache system to be the target event version number of the data.
4. The method as claimed in claim 1, wherein if the access layer receives a request for modifying data from the application layer, the step of modifying the data corresponding to the request in the cache layer comprises:
if the access layer receives a data modification request sent by an application layer, judging the request attribute of the data modification request;
and modifying the data corresponding to the request in a cache layer based on the request attribute of the request for modifying the data.
5. The data grounding method of claim 4, wherein the request attribute of the request for modifying data is a request for replacing data, and the step of modifying data corresponding to the request in the cache layer based on the request attribute of the request for modifying data comprises:
and if the request attribute of the data modification request is a data replacement request, replacing the data corresponding to the data replacement request in a cache layer.
6. The data grounding method of claim 4, wherein the request attribute of the request for modifying data is an additional request for modifying data, and the step of modifying the data corresponding to the request in the cache layer based on the request attribute of the request for modifying data further comprises:
if the request attribute of the data modification request is an additional modification request, the application layer judges whether data corresponding to the additional modification request exists in the cache layer;
and if the data corresponding to the additional modification request exists in the cache layer, modifying the data corresponding to the additional modification request in the cache layer.
7. The data grounding method of claim 6, wherein after the step of the application layer determining whether the data corresponding to the additional modification request exists in the cache layer, the method further comprises:
and if the data corresponding to the additional modification request does not exist in the cache layer, pulling the data corresponding to the additional modification request from the database to the cache layer, and modifying the data corresponding to the additional modification request in the cache layer.
8. A data landing device, comprising:
the modification module is used for modifying data corresponding to a request in a cache layer if the access layer receives the request for modifying data sent by an application layer;
a generating module, configured to generate an event version number of a modified data event for modifying the data corresponding to the request in a cache layer, and synchronize the modified data event to an event queue;
the acquisition module is used for acquiring the floor version number of data corresponding to the modified data event based on a distributed cache system if the event consumption receives the modified data event sent by the event queue;
and the execution module is used for executing data landing operation of the data corresponding to the modified data event based on the event version number and the landing version number.
9. A mobile terminal, characterized in that the mobile terminal comprises: memory, a processor and a data grounding program stored on the memory and executable on the processor, the data grounding program when executed by the processor implementing the steps of the data grounding method according to any one of claims 1 to 7.
10. A computer-readable storage medium, having stored thereon a data grounding program, which when executed by a processor, implements the steps of the data grounding method of any one of claims 1 to 7.
CN201911075110.3A 2019-11-06 2019-11-06 Data landing method and device, mobile terminal and computer readable storage medium Pending CN110851455A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911075110.3A CN110851455A (en) 2019-11-06 2019-11-06 Data landing method and device, mobile terminal and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911075110.3A CN110851455A (en) 2019-11-06 2019-11-06 Data landing method and device, mobile terminal and computer readable storage medium

Publications (1)

Publication Number Publication Date
CN110851455A true CN110851455A (en) 2020-02-28

Family

ID=69598789

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911075110.3A Pending CN110851455A (en) 2019-11-06 2019-11-06 Data landing method and device, mobile terminal and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN110851455A (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103647669A (en) * 2013-12-16 2014-03-19 上海证券交易所 System and method for guaranteeing distributed data processing consistency
US20180332139A1 (en) * 2013-11-27 2018-11-15 At&T Intellectual Property I, L.P. Server-side scheduling for media transmissions
CN110247942A (en) * 2018-03-09 2019-09-17 腾讯科技(深圳)有限公司 A kind of data transmission method for uplink, device and readable medium

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180332139A1 (en) * 2013-11-27 2018-11-15 At&T Intellectual Property I, L.P. Server-side scheduling for media transmissions
CN103647669A (en) * 2013-12-16 2014-03-19 上海证券交易所 System and method for guaranteeing distributed data processing consistency
CN110247942A (en) * 2018-03-09 2019-09-17 腾讯科技(深圳)有限公司 A kind of data transmission method for uplink, device and readable medium

Similar Documents

Publication Publication Date Title
CN107257954B (en) Apparatus and method for providing screen mirroring service
US20150082231A1 (en) Method and terminal for displaying desktop
CN109857486B (en) Method, device, equipment and medium for processing program page data
CN108595203B (en) Application function execution method, mobile terminal and computer readable storage medium
CN112509524B (en) Ink screen quick refreshing method, device, equipment and computer readable storage medium
US10310722B2 (en) Method and electronic device for controlling scroll speed of content
KR102540111B1 (en) Electronic device and method for operating electronic device
CN108401026B (en) Block chain-based data storage method, system and computer-readable storage medium
US11119644B2 (en) Electronic device and method for displaying content in response to scrolling inputs
CN107908487B (en) Task control management method, device and equipment and computer readable storage medium
CN111124573A (en) Message notification method and electronic equipment
CN107734023B (en) Static resource file downloading method, mobile terminal and computer readable storage medium
CN110971507B (en) Information display method and electronic equipment
CN111090489A (en) Information control method and electronic equipment
CN111309390A (en) Method for acquiring configuration information and electronic equipment
EP2928219A1 (en) Restriction information distribution apparatus and restriction information distribution system
CN109639880B (en) Weather information display method and terminal equipment
CN109618278B (en) Positioning method and mobile terminal
CN110851455A (en) Data landing method and device, mobile terminal and computer readable storage medium
CN110995842A (en) Method, device and equipment for downloading service data and storage medium
CN109032651B (en) Application updating method, intelligent terminal and computer readable storage medium
CN112732548B (en) Interface testing method and device
CN108052416B (en) Method and terminal for acquiring historical installation record information of application program
CN112332996A (en) Terminal network distribution method, device, equipment and computer readable storage medium
CN113835846B (en) Method and device for creating k8s cluster and computer-readable storage medium

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20200228

RJ01 Rejection of invention patent application after publication