CN113722389B - Data management method, device, electronic equipment and computer readable storage medium - Google Patents
Data management method, device, electronic equipment and computer readable storage medium Download PDFInfo
- Publication number
- CN113722389B CN113722389B CN202111026604.XA CN202111026604A CN113722389B CN 113722389 B CN113722389 B CN 113722389B CN 202111026604 A CN202111026604 A CN 202111026604A CN 113722389 B CN113722389 B CN 113722389B
- Authority
- CN
- China
- Prior art keywords
- data
- local cache
- request
- network database
- reading
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 50
- 238000013523 data management Methods 0.000 title claims abstract description 30
- 230000008014 freezing Effects 0.000 claims abstract description 24
- 238000007710 freezing Methods 0.000 claims abstract description 24
- 230000008569 process Effects 0.000 claims abstract description 13
- 239000000872 buffer Substances 0.000 claims description 49
- 238000012545 processing Methods 0.000 abstract description 8
- 238000004590 computer program Methods 0.000 description 10
- 238000004891 communication Methods 0.000 description 8
- 238000010586 diagram Methods 0.000 description 5
- 230000006870 function Effects 0.000 description 4
- 238000012986 modification Methods 0.000 description 3
- 230000004048 modification Effects 0.000 description 3
- 230000003287 optical effect Effects 0.000 description 3
- 238000005516 engineering process Methods 0.000 description 2
- 230000003993 interaction Effects 0.000 description 2
- 238000003491 array Methods 0.000 description 1
- 238000013473 artificial intelligence Methods 0.000 description 1
- 230000001413 cellular effect Effects 0.000 description 1
- 238000010276 construction Methods 0.000 description 1
- 238000013500 data storage Methods 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 238000010801 machine learning Methods 0.000 description 1
- 238000007726 management method Methods 0.000 description 1
- 239000013307 optical fiber Substances 0.000 description 1
- 230000004044 response Effects 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 230000001953 sensory effect Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 230000001360 synchronised effect Effects 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/25—Integrating or interfacing systems involving database management systems
- G06F16/254—Extract, transform and load [ETL] procedures, e.g. ETL data flows in data warehouses
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/24—Querying
- G06F16/245—Query processing
- G06F16/2455—Query execution
- G06F16/24552—Database cache management
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/27—Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Engineering & Computer Science (AREA)
- Databases & Information Systems (AREA)
- Theoretical Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Computational Linguistics (AREA)
- Computing Systems (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The disclosure provides a data management method, a data management device, electronic equipment and a computer readable storage medium, and relates to the technical field of computers, in particular to the technical field of data processing. The specific implementation scheme is as follows: acquiring a data request sent by a client; reading first data from a network database or a local cache and feeding back the first data to the client under the condition that the data request is a data reading request for the first data; writing the first data into a network database and adding state information and time information for the first data into a local cache under the condition that the data request is a data writing request for the first data; the state information is used for indicating that the state of the first data in the local cache is a frozen state in the process of writing the first data into the network database, and the time information is used for indicating the freezing duration of the first data in the local cache.
Description
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to the field of data processing technologies, and in particular, to a data management method, a data management device, an electronic device, and a computer readable storage medium.
Background
Data has become an increasingly important existence because of its ability to record objective events. For example, in the management of vehicle data, storage and retrieval of high-performance metadata are necessary components and functions to achieve the purposes of storage, playback, real-time track retrieval, and the like of vehicle tracks. At present, data storage is mostly realized based on some network databases, and client sides realize data reading and writing operations based on the network databases.
Disclosure of Invention
The present disclosure provides a data management method, apparatus, electronic device, and computer-readable storage medium.
According to a first aspect of the present disclosure, there is provided a data management method, comprising:
acquiring a data request sent by a client;
reading first data from a network database or a local cache and feeding back the first data to the client under the condition that the data request is a data reading request for the first data;
writing the first data into the network database and adding state information and time information for the first data into the local cache under the condition that the data request is a data writing request for the first data;
the state information is used for indicating that the state of the first data in the local cache is a frozen state in the process of writing the first data into the network database, and the time information is used for indicating the freezing duration of the first data in the local cache.
According to a second aspect of the present disclosure, there is provided a data management apparatus comprising:
the acquisition module is used for acquiring a data request sent by the client;
the reading module is used for reading the first data from a network database or a local cache and feeding back the first data to the client side when the data request is a data reading request for the first data;
the writing module is used for writing the first data into the network database and adding state information and time information for the first data into the local cache when the data request is a data writing request for the first data;
the state information is used for indicating that the state of the first data in the local cache is a frozen state in the process of writing the first data into the network database, and the time information is used for indicating the freezing duration of the first data in the local cache.
According to a third aspect of the present disclosure, there is provided an electronic device comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of the first aspect.
According to a fourth aspect of the present disclosure, there is provided a non-transitory computer readable storage medium storing computer instructions for causing the computer to perform the method of the first aspect.
According to a fifth aspect of the present disclosure, there is provided a computer program product comprising a computer program which, when executed by a processor, implements the method of the first aspect.
According to the technical scheme, when the server side obtains the data writing request for the first data, the state information and the time information for the first data are added in the local cache, so that the first data are in a frozen state in the local cache in the process of writing the first data into the network database, and the first data in the local cache can be prevented from being updated and tampered in the process of writing the first data into the network database, so that the data consistency of the local cache and the network database is ensured.
It should be understood that the description in this section is not intended to identify key or critical features of the embodiments of the disclosure, nor is it intended to be used to limit the scope of the disclosure. Other features of the present disclosure will become apparent from the following specification.
Drawings
The drawings are for a better understanding of the present solution and are not to be construed as limiting the present disclosure. Wherein:
FIG. 1 is a flow chart of a method of data management provided by an embodiment of the present disclosure;
FIG. 2 is a scene graph in which the data management method provided by embodiments of the present disclosure may be implemented;
FIG. 3 is a block diagram of a data management apparatus provided by an embodiment of the present disclosure;
fig. 4 is a block diagram of an electronic device used to implement a data management method of an embodiment of the present disclosure.
Detailed Description
Exemplary embodiments of the present disclosure are described below in conjunction with the accompanying drawings, which include various details of the embodiments of the present disclosure to facilitate understanding, and should be considered as merely exemplary. Accordingly, one of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present disclosure. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
The embodiment of the disclosure provides a data management method.
Referring to fig. 1, fig. 1 is a flowchart of a data management method according to an embodiment of the disclosure, as shown in fig. 1, the method includes the following steps:
step S101, a data request sent by a client is obtained.
It should be noted that, the data management method provided in the embodiment of the present disclosure may be applied to a server. The server side comprises a data management service, and the data management service is used for managing the network database and the data in the local cache of the server side. The local cache comprises a master cache and at least one slave cache, the data management service can automatically select the master cache (or called master node) by means of a shift protocol, the server can report the selected master cache to the client, and the client can know which of the local caches is the master cache, so that the client can automatically forward a write request to the master cache. It should be noted that only one master buffer is included in the local buffer, the buffers other than the master buffer are slave buffers, and the number of slave buffers is at least one.
In the embodiment of the disclosure, the main buffer may directly receive a data request, such as a data write request, sent by the client; or after the server receives the data request sent by the client, the data request is forwarded to the main buffer.
Step S102, when the data request is a data read request for first data, the first data is read from a network database or a local cache, and the first data is fed back to the client.
In the embodiment of the disclosure, the data request sent by the client may be a request for reading data, or may be a request for writing data, that is, a data read request and a data write request. If the data request sent by the client is a data read request for the first data, the server may read the first data from the network database or the local cache. For example, if the first data does not exist in the local cache, the server reads the first data from the network database; if the first data is stored in the local cache and the first data is not in a frozen state, the server side directly reads the first data from the local cache and feeds the read first data back to the client side, so that the data does not need to be read through a network database, the server side can read the data more quickly, and the feedback efficiency of the client side is improved.
Optionally, in a case where the data request is a data read request for first data, reading the first data from the network database or the local cache includes:
judging whether the first data is stored in the local cache or not under the condition that the data request is a data read request for the first data;
reading the first data from the local cache when the first data is stored in the local cache and the first data is not in a frozen state;
reading the first data from the network database under the condition that the first data is stored in the local cache and is in a frozen state;
and reading the first data from the network database under the condition that the first data is not stored in the local cache.
Specifically, when the server side obtains a data reading request for the first data, the server side may first determine whether the first data is stored in the local cache; if the first data is stored in the local cache and the first data in the local cache is not in a frozen state, the server side directly reads the first data from the local cache and feeds the first data back to the client side, so that the first data does not need to be read from a network database, and the time and the efficiency of data reading can be effectively improved; if the first data is stored in the local cache but the first data is in a frozen state, which means that the first data in the local cache cannot be read at the moment, the server reads the first data from the network database; if the local cache has no first data, the server side also reads the first data from the network database.
In the embodiment of the disclosure, the local cache is arranged at the server, so that the data can be stored in the network database and the local cache at the same time, and the consistency of the data is ensured; and when the server receives a data reading request of the client for the data, if the data is stored in the local cache and is not frozen, the data is directly read from the local cache, so that the data reading efficiency is improved, and if the data in the local cache is frozen, the data can be read from the network database, so that the effective response to the client is ensured.
Further, in the case where the first data is not stored in the local cache, the method further includes:
and writing the first data into the local cache.
Specifically, the server receives a data reading request for the first data, if the first data is not stored in the local cache, the server reads the first data from the network data, feeds the read first data back to the client, and further, the server can load the first data stored in the network database into the local cache so as to ensure the data consistency of the network database and the local cache.
Specifically, the server may write the first data stored in the network database into the master buffer based on a raft protocol, and copy and write the first data into each slave buffer based on the master buffer, so as to ensure data consistency of the master buffer and the slave buffers.
Step S103, in the case that the data request is a data write request for first data, writing the first data into the network database, and adding state information and time information for the first data into the local cache.
The state information is used for indicating that the state of the first data in the local cache is a frozen state in the process of writing the first data into the network database, and the time information is used for indicating the freezing duration of the first data in the local cache.
It is understood that the data write request for the first data refers to a data request that needs to write or store the first data to the server. When the server side obtains a data writing request aiming at the first data, the server side can analyze the data writing request to obtain the first data carried by the data writing request, write the first data into a network database, and write state information and time information aiming at the first data into a local cache. Based on the state information, the first data is in a frozen state in the local cache in the process of writing the first data into the network database, so that the first data in the local cache can be prevented from being updated and tampered and cannot be read in the process of writing the first data into the network database, and the data consistency between the local cache and the network database is ensured; and indicating the freezing time of the first data in the local cache based on the time information so as to avoid the first data from being in a frozen state all the time, and further, the first data can be thawed after the frozen state reaches the freezing time so as to ensure that the first data can be updated normally.
In an embodiment of the present disclosure, after the step S103, the method may further include:
and deleting the first data in the local cache after the freezing state of the first data in the local cache reaches the freezing time.
Specifically, the server writes the first data into the network database, and writes state information and time information for the first data into the local cache, so that the first data in the local cache is in a frozen state, and the freezing time of the first data in the frozen state is defined; alternatively, the freezing time period may be longer than a time period required for the first data to be written into the network database. When the freezing state of the first data in the local cache reaches the freezing time, deleting the first data in the local cache, and the state information and the time information of the first data, wherein the first data does not exist in the local cache, and further, the first data newly written in the network database is loaded into the local cache, so that the first data newly written in the network database can be loaded into the local cache, and the data consistency between the local cache and the network database is further ensured.
In the embodiment of the disclosure, as long as the network database is newly written with data, the data which is stored in the local cache and is the same as the data is frozen for a certain period of time, and during the freezing period, the data cannot be read from the local cache and can only be read through the network database, so that the correctness of the read data can be ensured; and after the freezing time is up, the frozen data in the local cache can be deleted, and newly written data is reloaded from the network database, so that the problem of overdue data cannot exist in the local cache, the data in the local cache is ensured to be deleted and reloaded from the network database after a certain time so as to ensure the correctness of the data in the local cache and the data consistency with the network data.
In an embodiment of the present disclosure, the local buffer includes a master buffer and at least one slave buffer, and adding state information and time information for the first data in the local buffer includes:
adding state information and time information for the first data in the master buffer, and copying the state information and time information for the first data into each slave buffer through the master buffer.
For example, referring to fig. 2, the local buffer includes a master buffer and three slave buffers, where after obtaining written state information and time information for first data, the master buffer is capable of copying the state information and time information for the first data into the other three slave buffers based on a raft protocol, so as to ensure data consistency between the master buffer and the slave buffers. Thus, the state of the first data in any one of the local caches is synchronous, and the first data in any one of the caches is in a frozen state and the freezing time is the same in the process of writing the first data into the network database; if the client receives a data reading request for the first data at this time, the first data in any buffer can not be read, but can only be read from the network database, so that the accuracy of data reading is ensured, and the first data in the buffer can be prevented from being updated or tampered.
Further, after the state information and the time information for the first data are copied into the slave buffer, when the frozen state of the first data reaches the frozen time, the state information and the time information for the first data in the slave buffer are deleted, and if the first data exist in the slave buffer, the first data can be deleted at the same time.
In addition, after the master buffer obtains the first data written or loaded, the first data can be copied into each slave buffer based on a shift protocol, so that the data consistency of the master buffer and the slave buffers is ensured.
According to an embodiment of the present disclosure, the present disclosure further provides a data management apparatus.
Referring to fig. 3, fig. 3 is a block diagram of a data management device according to an embodiment of the disclosure, and as shown in fig. 3, the data management device 300 includes the following modules:
an obtaining module 301, configured to obtain a data request sent by a client;
a reading module 302, configured to, in a case where the data request is a data read request for first data, read the first data from a network database or a local cache, and feed back the first data to the client;
a writing module 303, configured to, in a case where the data request is a data write request for first data, write the first data into the network database, and add status information and time information for the first data in the local cache;
the state information is used for indicating that the state of the first data in the local cache is a frozen state in the process of writing the first data into the network database, and the time information is used for indicating the freezing duration of the first data in the local cache.
Optionally, the reading module 302 is further configured to:
judging whether the first data is stored in the local cache or not under the condition that the data request is a data read request for the first data;
reading the first data from the local cache when the first data is stored in the local cache and the first data is not in a frozen state;
reading the first data from the network database under the condition that the first data is stored in the local cache and is in a frozen state;
and reading the first data from the network database under the condition that the first data is not stored in the local cache.
Optionally, in a case where the first data is not stored in the local cache, the writing module 303 is further configured to:
and writing the first data into the local cache.
Optionally, the apparatus further comprises:
and the deleting module is used for deleting the first data in the local cache after the freezing state of the first data in the local cache reaches the freezing time.
Optionally, the local cache includes the master cache and at least one slave cache, and the writing module is further configured to:
adding state information and time information for the first data in the master buffer, and copying the state information and time information for the first data into each slave buffer through the master buffer.
It should be noted that, the data management apparatus 300 provided in the embodiments of the present disclosure can implement all the technical solutions of the embodiments of the data management method, so at least all the technical effects described above can be implemented, and the details are not repeated here.
In the technical scheme of the disclosure, the acquisition, storage, application and the like of the related user personal information all conform to the regulations of related laws and regulations, and the public sequence is not violated.
According to embodiments of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.
Fig. 4 illustrates a schematic block diagram of an example electronic device 400 that may be used to implement embodiments of the present disclosure. Electronic device 400 is intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. Electronic device 400 may also represent various forms of mobile devices, such as personal digital processing, cellular telephones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the disclosure described and/or claimed herein.
As shown in fig. 4, the electronic device 400 includes a computing unit 401 that can perform various suitable actions and processes according to a computer program stored in a Read Only Memory (ROM) 402 or a computer program loaded from a storage unit 408 into a Random Access Memory (RAM) 403. In RAM 403, various programs and data required for the operation of device 400 may also be stored. The computing unit 401, ROM 402, and RAM 403 are connected to each other by a bus 404. An input/output (I/O) interface 405 is also connected to bus 404.
Various components in electronic device 400 are connected to I/O interface 405, including: an input unit 406 such as a keyboard, a mouse, etc.; an output unit 407 such as various types of displays, speakers, and the like; a storage unit 408, such as a magnetic disk, optical disk, etc.; and a communication unit 409 such as a network card, modem, wireless communication transceiver, etc. The communication unit 409 allows the electronic device 400 to exchange information/data with other devices via a computer network, such as the internet, and/or various telecommunication networks.
The computing unit 401 may be a variety of general purpose and/or special purpose processing components having processing and computing capabilities. Some examples of computing unit 401 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various computing units running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 401 performs the respective methods and processes described above, such as a data management method. For example, in some embodiments, the data management method may be implemented as a computer software program tangibly embodied on a machine-readable medium, such as the storage unit 408. In some embodiments, part or all of the computer program may be loaded and/or installed onto the electronic device 400 via the ROM 402 and/or the communication unit 409. When a computer program is loaded into RAM 403 and executed by computing unit 401, one or more steps of the data management method described above may be performed. Alternatively, in other embodiments, the computing unit 401 may be configured to perform the above-described data management method by any other suitable means (e.g. by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuit systems, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), systems On Chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs, the one or more computer programs may be executed and/or interpreted on a programmable system including at least one programmable processor, which may be a special purpose or general-purpose programmable processor, that may receive data and instructions from, and transmit data and instructions to, a storage system, at least one input device, and at least one output device.
Program code for carrying out methods of the present disclosure may be written in any combination of one or more programming languages. These program code may be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus such that the program code, when executed by the processor or controller, causes the functions/operations specified in the flowchart and/or block diagram to be implemented. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package, partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. The machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and pointing device (e.g., a mouse or trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic input, speech input, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a background component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such background, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), and the internet.
The computer system may include a client and a server. The client and server are typically remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server may be a cloud server, a server of a distributed system, or a server incorporating a blockchain.
It should be appreciated that various forms of the flows shown above may be used to reorder, add, or delete steps. For example, the steps recited in the present disclosure may be performed in parallel, sequentially, or in a different order, provided that the desired results of the disclosed aspects are achieved, and are not limited herein.
The above detailed description should not be taken as limiting the scope of the present disclosure. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives are possible, depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present disclosure are intended to be included within the scope of the present disclosure.
Claims (10)
1. A data management method, comprising:
acquiring a data request sent by a client;
reading first data from a network database or a local cache and feeding back the first data to the client under the condition that the data request is a data reading request for the first data;
writing the first data into the network database and adding state information and time information for the first data into the local cache under the condition that the data request is a data writing request for the first data;
the state information is used for indicating that the state of the first data in the local cache is a frozen state in the process of writing the first data into the network database, and the time information is used for indicating the freezing duration of the first data in the local cache;
in the case that the data request is a data read request for first data, reading the first data from a network database or a local cache, comprising:
judging whether the first data is stored in the local cache or not under the condition that the data request is a data read request for the first data;
reading the first data from the local cache when the first data is stored in the local cache and the first data is not in a frozen state;
reading the first data from the network database under the condition that the first data is stored in the local cache and is in a frozen state;
and reading the first data from the network database under the condition that the first data is not stored in the local cache.
2. The method of claim 1, wherein in the event that the first data is not stored in the local cache, the method further comprises:
and writing the first data into the local cache.
3. The method of claim 1, wherein, in the event that the data request is a data write request for first data, writing the first data into the network database and adding state information and time information for the first data in the local cache, the method further comprises:
and deleting the first data in the local cache after the freezing state of the first data in the local cache reaches the freezing time.
4. The method of claim 1, wherein the local buffer comprises a master buffer and at least one slave buffer, the adding state information and time information for the first data in the local buffer comprising:
adding state information and time information for the first data in the master buffer, and copying the state information and time information for the first data into each slave buffer through the master buffer.
5. A data management apparatus comprising:
the acquisition module is used for acquiring a data request sent by the client;
the reading module is used for reading the first data from a network database or a local cache and feeding back the first data to the client side when the data request is a data reading request for the first data;
the writing module is used for writing the first data into the network database and adding state information and time information for the first data into the local cache when the data request is a data writing request for the first data;
the state information is used for indicating that the state of the first data in the local cache is a frozen state in the process of writing the first data into the network database, and the time information is used for indicating the freezing duration of the first data in the local cache;
the reading module is further configured to:
judging whether the first data is stored in the local cache or not under the condition that the data request is a data read request for the first data;
reading the first data from the local cache when the first data is stored in the local cache and the first data is not in a frozen state;
reading the first data from the network database under the condition that the first data is stored in the local cache and is in a frozen state;
and reading the first data from the network database under the condition that the first data is not stored in the local cache.
6. The apparatus of claim 5, wherein, in the case where the first data is not stored in the local cache, the writing module is further to:
and writing the first data into the local cache.
7. The apparatus of claim 5, wherein the apparatus further comprises:
and the deleting module is used for deleting the first data in the local cache after the freezing state of the first data in the local cache reaches the freezing time.
8. The apparatus of claim 5, wherein the local cache comprises a master cache and at least one slave cache, the write module further to:
adding state information and time information for the first data in the master buffer, and copying the state information and time information for the first data into each slave buffer through the master buffer.
9. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-4.
10. A non-transitory computer readable storage medium storing computer instructions for causing the computer to perform the method of any one of claims 1-4.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111026604.XA CN113722389B (en) | 2021-09-02 | 2021-09-02 | Data management method, device, electronic equipment and computer readable storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111026604.XA CN113722389B (en) | 2021-09-02 | 2021-09-02 | Data management method, device, electronic equipment and computer readable storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113722389A CN113722389A (en) | 2021-11-30 |
CN113722389B true CN113722389B (en) | 2024-03-01 |
Family
ID=78680989
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202111026604.XA Active CN113722389B (en) | 2021-09-02 | 2021-09-02 | Data management method, device, electronic equipment and computer readable storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113722389B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114546954A (en) * | 2022-02-14 | 2022-05-27 | 维沃移动通信有限公司 | Data processing method and device in distributed file system |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104572917A (en) * | 2014-12-29 | 2015-04-29 | 成都致云科技有限公司 | Method and device for locking data and distributed storage system |
CN112860452A (en) * | 2021-02-02 | 2021-05-28 | 浪潮云信息技术股份公司 | Method, device and computer readable medium for improving response speed of high concurrency condition |
CN113010535A (en) * | 2021-03-12 | 2021-06-22 | 北京百度网讯科技有限公司 | Cache data updating method, device, equipment and storage medium |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20170155741A1 (en) * | 2015-12-01 | 2017-06-01 | Le Holdings (Beijing) Co., Ltd. | Server, method, and system for providing service data |
-
2021
- 2021-09-02 CN CN202111026604.XA patent/CN113722389B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104572917A (en) * | 2014-12-29 | 2015-04-29 | 成都致云科技有限公司 | Method and device for locking data and distributed storage system |
CN112860452A (en) * | 2021-02-02 | 2021-05-28 | 浪潮云信息技术股份公司 | Method, device and computer readable medium for improving response speed of high concurrency condition |
CN113010535A (en) * | 2021-03-12 | 2021-06-22 | 北京百度网讯科技有限公司 | Cache data updating method, device, equipment and storage medium |
Non-Patent Citations (1)
Title |
---|
煤矿建设生产中的网络数据库新技术探讨;王晓健;程桦;;西部探矿工程(第02期);第263-265页 * |
Also Published As
Publication number | Publication date |
---|---|
CN113722389A (en) | 2021-11-30 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US20150186218A1 (en) | Performing a background copy process during a backup operation | |
CN110674053A (en) | SSD data storage node management method and device, computer equipment and storage medium | |
US20210049087A1 (en) | Data monitoring methods, apparatuses, electronic devices, and computer readable storage media | |
CN113961510B (en) | File processing method, device, equipment and storage medium | |
CN113656501B (en) | Data reading method, device, equipment and storage medium | |
CN113722389B (en) | Data management method, device, electronic equipment and computer readable storage medium | |
CN113127382A (en) | Data reading method, device, equipment and medium for additional writing | |
CN113553216B (en) | Data recovery method and device, electronic equipment and storage medium | |
CN107870872B (en) | Method and apparatus for managing cache | |
CN113010535B (en) | Cache data updating method, device, equipment and storage medium | |
CN112948410A (en) | Data processing method, device, equipment and medium | |
CN112613964A (en) | Account checking method, account checking device, account checking equipment and storage medium | |
CN113760176A (en) | Data storage method and device | |
CN116383207A (en) | Data tag management method and device, electronic equipment and storage medium | |
CN113986134B (en) | Method for storing data, method and device for reading data | |
CN115510036A (en) | Data migration method, device, equipment and storage medium | |
CN116594563A (en) | Distributed storage capacity expansion method and device, electronic equipment and storage medium | |
CN113220237B (en) | Distributed storage method, device, equipment and storage medium | |
CN112631517B (en) | Data storage method and device, electronic equipment and storage medium | |
CN114417070A (en) | Method, device and equipment for converging data authority and storage medium | |
CN114500443A (en) | Message pushing method, device, system, electronic equipment and storage medium | |
CN115840663A (en) | Method, electronic device and computer program product for flashing metadata | |
CN113051244A (en) | Data access method and device, and data acquisition method and device | |
CN112860796A (en) | Method, apparatus, device and storage medium for synchronizing data | |
CN112711572A (en) | Online capacity expansion method and device suitable for sub-warehouse and sub-meter |
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 |