A method, system, device and medium for controlling data flushing
By adopting batch, asynchronous down-sweep and overall response mechanisms in the distributed file system, combined with the entire strip down-sweep mechanism of the data cache layer, the problem of data security and performance in the distributed file system is solved, and the data is realized Fast persistence and safe response.
Patent Information
- Application Number
- CN202110779540.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-07-09
- Publication Date
- 2025-02-14
- Estimated Expiration
- 2041-07-09
AI Technical Summary
In a distributed file system, how to ensure data security while taking into account performance, especially in scenarios such as system power outages and simultaneous failures of multiple nodes.
Batch, asynchronous down-sweep and overall response mechanisms are adopted, combined with the entire strip down-sweep mechanism of the data cache layer to ensure rapid persistence and safe response of data.
Through synergy, rapid persistence and secure response of data are achieved, solving the problem that traditional technology cannot maintain data security in multiple nodes and simultaneous failure scenarios.
Smart Images

Figure CN113609094B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of distributed file systems, and more specifically, to a method, system, computer device and readable medium for controlling data flushing. Background Art
[0002] A distributed file system refers to a file system that manages physical storage resources that are not necessarily directly connected to local nodes, but are connected to nodes through a computer network. For distributed file systems (object storage), it is very important to ensure data security and balance performance when using the HDFS (Hadoop Distributed File System) protocol to write. In general distributed file systems, multi-cache memory caches are used to ensure data security within the fault domain, but it is impossible to rely on memory caches to maintain data security in scenarios where multiple nodes fail simultaneously, such as systemic power outages. For storage services, balancing data security and performance is a major challenge for storage systems. Summary of the invention
[0003] In view of this, the purpose of the embodiments of the present invention is to propose a method, system, computer device and computer-readable storage medium for controlling data flushing. The present invention adopts a batch, asynchronous flushing and overall response mechanism for the cache write process; at the same time, a whole-band flushing mechanism is adopted in the data cache layer to accelerate data flushing and persistence; the collaboration of the two aspects ensures rapid data persistence and secure response.
[0004] Based on the above purpose, one aspect of an embodiment of the present invention provides a method for controlling data flushing, comprising the following steps: in response to receiving a write request, performing write operations on data packets in sequence, and determining whether the write operation of the current data packet is a cache write; in response to the write operation of the current data packet being a cache write, writing the data of the data packet into a data cache layer, and determining whether the size of the data reaches the size of a distributed object; in response to the size of the data reaching the size of a distributed object, persisting the data, and determining whether the number of batch structures currently to be confirmed exceeds a threshold; and in response to the number of batch structures currently to be confirmed exceeding a threshold, performing a range detection on the persisted data, and flushing according to the result of the range detection.
[0005] In some embodiments, the method also includes: determining whether the sum of the size of a confirmation packet corresponding to the current data packet and the size of response data in a batch structure to be confirmed corresponding to the current data packet exceeds a batch data threshold; and in response to the sum of the size of the confirmation packet and the size of the response data in the batch structure to be confirmed exceeding the batch data threshold, creating a new batch structure to be confirmed.
[0006] In some implementations, the method further includes: constructing a confirmation structure, and inserting the confirmation structure into the batch structure to be confirmed.
[0007] In some implementations, the method further includes: determining whether the current data packet is the last data packet; and in response to the current data packet being the last data packet, adding a last bit identifier to the to-be-confirmed batch structure corresponding to the current data packet.
[0008] In some implementations, the method further includes: in response to detecting the last digit marker, performing a range check on the persisted data.
[0009] In some implementations, the refreshing according to the result of the range detection further includes: modifying the value of a confirmation character of the data packet according to the result of the range detection, and returning the confirmation character to the client.
[0010] In some implementations, the method further includes: in response to the write operation of the current data packet not being a cache write, persisting the current data packet and returning a confirmation character to the client.
[0011] Another aspect of an embodiment of the present invention provides a system for controlling data flushing, including: a first judgment module, configured to, in response to receiving a write request, perform write operations on data packets in sequence, and determine whether the write operation of the current data packet is a cache write; a second judgment module, configured to, in response to the write operation of the current data packet being a cache write, write the data of the data packet to a data cache layer, and determine whether the size of the data reaches the size of a distributed object; a third judgment module, configured to, in response to the size of the data reaching the size of a distributed object, persist the data, and determine whether the number of batch structures currently to be confirmed exceeds a threshold; and an execution module, configured to, in response to the number of batch structures currently to be confirmed exceeding a threshold, perform range detection on the persisted data, and flush according to the result of the range detection.
[0012] According to another aspect of an embodiment of the present invention, a computer device is provided, comprising: at least one processor; and a memory, wherein the memory stores computer instructions executable on the processor, and the instructions implement the steps of the above method when executed by the processor.
[0013] According to another aspect of the embodiments of the present invention, a computer-readable storage medium is provided, which stores a computer program that implements the above method steps when executed by a processor.
[0014] The present invention has the following beneficial technical effects: in the face of the cache write process, a batch, asynchronous flushing and overall response mechanism is adopted; at the same time, a whole-band flushing mechanism is adopted in the data cache layer to accelerate data flushing and persistence; the collaboration of the two aspects ensures rapid data persistence and secure response. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other embodiments can be obtained based on these drawings without paying creative work.
[0016] Figure 1 A schematic diagram of an embodiment of a method for controlling data refresh provided by the present invention;
[0017] Figure 2 A schematic diagram of the hardware structure of an embodiment of a computer device for controlling data downloading provided by the present invention;
[0018] Figure 3 A schematic diagram of an embodiment of a computer storage medium for controlling data flushing provided by the present invention. DETAILED DESCRIPTION
[0019] In order to make the objectives, technical solutions and advantages of the present invention more clearly understood, the embodiments of the present invention are further described in detail below in combination with specific embodiments and with reference to the accompanying drawings.
[0020] It should be noted that all expressions using "first" and "second" in the embodiments of the present invention are for distinguishing two non-identical entities with the same name or non-identical parameters. It can be seen that "first" and "second" are only for the convenience of expression and should not be understood as limitations on the embodiments of the present invention. The subsequent embodiments will not explain this one by one.
[0021] A first aspect of the embodiments of the present invention provides an embodiment of a method for controlling data refresh. Figure 1 Shown is a schematic diagram of an embodiment of a method for controlling data refresh provided by the present invention.
[0022] like Figure 1 As shown, the embodiment of the present invention includes the following steps:
[0023] S1, in response to receiving a write request, performing write operations on data packets in sequence, and determining whether the write operation of the current data packet is a cache write;
[0024] S2, in response to the write operation of the current data packet being a cache write, writing the data of the data packet into the data cache layer, and determining whether the size of the data reaches the size of the distributed object;
[0025] S3, in response to the size of the data reaching the size of the distributed object, persisting the data, and determining whether the number of batch structures to be confirmed currently exceeds a threshold; and
[0026] S4. In response to the number of the current batch structures to be confirmed exceeding a threshold, a range detection is performed on the persisted data, and a refresh is performed according to the result of the range detection.
[0027] The embodiment of the present invention adopts a complete set of methods to ensure data security while taking into account performance for data written to HDFS. First, in the cache write process, a batch, asynchronous flushing and detection and overall response mechanism is set; at the same time, the whole stripe subordinate mechanism is adopted in the data cache layer to accelerate data flushing and persistence; the cooperation of the two aspects ensures fast data persistence and secure response.
[0028] Distributed File System (DFS) is a network server component that makes it easier for you to query and manage data on the network. Distributed File System is a way to combine files distributed on different computers into a single name space and make it easier to build a single, hierarchical multiple file server and server sharing on the network.
[0029] In response to receiving a write request, write operations are performed on the data packets in sequence, and it is determined whether the write operation of the current data packet is a cache write. The distributed file system client sends a write request to the distributed file system server. After receiving the write request, the distributed file system server processes the write service packet by packet, and determines whether it is a cache write when performing a write operation on each data packet.
[0030] In some embodiments, the method further includes: in response to the write operation of the current data packet not being a cache write, persisting the current data packet and returning a confirmation character to the client. If it is not a cache write, the data in the current data packet can be directly persisted, and an Ack is sent to the client to end the packet processing. Ack is a write response to the client. After the client receives the write response, it no longer protects the data that has been written to the response.
[0031] In response to the write operation of the current data packet being a cache write, the data of the data packet is written into the data cache layer, and it is determined whether the size of the data reaches the size of the distributed object. In response to the size of the data reaching the size of the distributed object, the data is persisted, and it is determined whether the number of batch structures to be confirmed currently exceeds a threshold. In response to the number of batch structures to be confirmed currently exceeding a threshold, a range detection is performed on the persisted data, and a flush is performed based on the result of the range detection. The data of the data packet is written into the data cache layer, and the data cache layer detects the size of the distributed object cache. If it is full of an object (e.g., 4M), the flushing and persistence of the data is triggered. If the number of batch structures to be confirmed currently exceeds a threshold, for example, the number of batch structures to be confirmed currently exceeds 2, a range detection flush is performed. The check range is the range of file writes: for example, it checks whether the data in the 8M-12M interval of the file is flushed, and returns success or failure.
[0032] In some embodiments, the step of refreshing according to the result of the range detection further includes: modifying the value of the confirmation character of the data packet according to the result of the range detection, and returning the confirmation character to the client. After obtaining the return result of the range detection, modifying and filling the return value of the confirmation character of each data packet, and then confirming the data packet to the client. This step is repeated, and sleep waiting is performed when the condition is not met.
[0033] In some embodiments, the method further includes: determining whether the sum of the size of the confirmation packet corresponding to the current data packet and the size of the response data in the to-be-confirmed batch structure corresponding to the current data packet exceeds a batch data threshold; and in response to the sum of the size of the confirmation packet and the size of the response data in the to-be-confirmed batch structure exceeding the batch data threshold, creating a new to-be-confirmed batch structure. The batch data threshold may be, for example, 16M. If the sum of the size of the confirmation packet corresponding to the current data packet and the size of the response data in the to-be-confirmed batch structure corresponding to the current data packet exceeds 16M, a new to-be-confirmed batch structure may be created and the new to-be-confirmed batch structure may be added to a queue.
[0034] In some embodiments, the method further includes: constructing a confirmation structure, and inserting the confirmation structure into the batch structure to be confirmed. The confirmation structure is inserted into the batch structure to be confirmed for use so that the batch structure to be confirmed can be flushed. A flush detection thread (flush_thread) can be constructed, and the flush detection thread is awakened when the confirmation structure is inserted into the batch structure to be confirmed.
[0035] In some embodiments, the method further includes: determining whether the current data packet is the last data packet; and in response to the current data packet being the last data packet, adding a last bit mark to the to-be-confirmed batch structure corresponding to the current data packet. If it is the last data packet, adding a last bit mark to last_packet in the to-be-confirmed batch structure corresponding to the current data packet.
[0036] In some embodiments, the method further includes: in response to detecting the last bit identifier, performing a range check on the persisted data. Similar to the case where the number of batch structures to be confirmed currently exceeds a threshold, when processing the last data packet, performing a range check on the persisted data, and releasing the flush detection thread after processing the data packet.
[0037] The embodiment of the present invention adopts a complete set of methods to ensure data security while taking into account performance for data written to HDFS. First, in the cache write process, a batch, asynchronous flushing and detection and overall response mechanism is set; at the same time, the whole stripe subordinate mechanism is adopted in the data cache layer to accelerate data flushing and persistence; the cooperation of the two aspects ensures fast data persistence and secure response.
[0038] It should be pointed out in particular that the various steps in the various embodiments of the above-mentioned method for controlling data refresh can be cross-linked, replaced, added, and deleted. Therefore, these reasonable permutations, combinations and transformations of the method for controlling data refresh should also fall within the scope of protection of the present invention, and the scope of protection of the present invention should not be limited to the embodiments.
[0039] Based on the above purpose, the second aspect of an embodiment of the present invention proposes a system for controlling data flushing, including: a first judgment module, configured to perform write operations on data packets in sequence in response to receiving a write request, and determine whether the write operation of the current data packet is a cache write; a second judgment module, configured to write the data of the data packet to the data cache layer in response to the write operation of the current data packet being a cache write, and determine whether the size of the data reaches the size of a distributed object; a third judgment module, configured to persist the data in response to the size of the data reaching the size of a distributed object, and determine whether the number of batch structures currently to be confirmed exceeds a threshold; and an execution module, configured to perform range detection on the persisted data in response to the number of batch structures currently to be confirmed exceeding a threshold, and flush according to the result of the range detection.
[0040] In some embodiments, the system also includes a fourth judgment module, configured to: determine whether the sum of the size of a confirmation packet corresponding to the current data packet and the size of response data in the batch structure to be confirmed corresponding to the current data packet exceeds a batch data threshold; and in response to the sum of the size of the confirmation packet and the size of the response data in the batch structure to be confirmed exceeding the batch data threshold, create a new batch structure to be confirmed.
[0041] In some embodiments, the system further comprises a construction module configured to: construct a confirmation structure, and insert the confirmation structure into the batch structure to be confirmed.
[0042] In some embodiments, the system further includes a fifth judgment module configured to: judge whether the current data packet is the last data packet; and in response to the current data packet being the last data packet, add a last bit identifier to the to-be-confirmed batch structure corresponding to the current data packet.
[0043] In some embodiments, the system further includes a detection module configured to: in response to detecting the last digit identifier, perform a range detection on the persisted data.
[0044] In some implementations, the execution module is configured to: modify the value of a confirmation character of the data packet according to a result of the range detection, and return the confirmation character to the client.
[0045] In some implementations, the system further includes: in response to the write operation of the current data packet not being a cache write, persisting the current data packet and returning a confirmation character to the client.
[0046] The embodiment of the present invention adopts a complete set of methods to ensure data security while taking into account performance for data written to HDFS. First, in the cache write process, a batch, asynchronous flushing and detection and overall response mechanism is set; at the same time, the whole stripe subordinate mechanism is adopted in the data cache layer to accelerate data flushing and persistence; the cooperation of the two aspects ensures fast data persistence and secure response.
[0047] Based on the above purpose, a third aspect of an embodiment of the present invention provides a computer device, comprising: at least one processor; and a memory, wherein the memory stores computer instructions that can be executed on the processor, and the instructions are executed by the processor to implement the following steps: S1, in response to receiving a write request, sequentially performing a write operation on a data packet, and determining whether the write operation of the current data packet is a cache write;
[0048] S2. In response to the write operation of the current data packet being a cache write, the data of the data packet is written into the data cache layer, and it is determined whether the size of the data reaches the size of the distributed object; S3. In response to the size of the data reaching the size of the distributed object, the data is persisted, and it is determined whether the number of batch structures to be confirmed currently exceeds a threshold; and S4. In response to the number of batch structures to be confirmed currently exceeding a threshold, a range detection is performed on the persisted data, and the data is refreshed according to the result of the range detection.
[0049] In some embodiments, the steps also include: determining whether the sum of the size of a confirmation packet corresponding to the current data packet and the size of response data in a batch structure to be confirmed corresponding to the current data packet exceeds a batch data threshold; and in response to the sum of the size of the confirmation packet and the size of the response data in the batch structure to be confirmed exceeding the batch data threshold, creating a new batch structure to be confirmed.
[0050] In some implementations, the step further includes: constructing a confirmation structure, and inserting the confirmation structure into the batch structure to be confirmed.
[0051] In some implementations, the steps further include: determining whether the current data packet is the last data packet; and in response to the current data packet being the last data packet, adding a last bit identifier to the to-be-confirmed batch structure corresponding to the current data packet.
[0052] In some implementations, the steps further include: in response to detecting the last digit marker, performing a range check on the persisted data.
[0053] In some implementations, the refreshing according to the result of the range detection further includes: modifying the value of a confirmation character of the data packet according to the result of the range detection, and returning the confirmation character to the client.
[0054] In some implementations, the steps further include: in response to the write operation of the current data packet not being a cache write, persisting the current data packet and returning a confirmation character to the client.
[0055] The embodiment of the present invention adopts a complete set of methods to ensure data security while taking into account performance for data written to HDFS. First, in the cache write process, a batch, asynchronous flushing and detection and overall response mechanism is set; at the same time, the whole stripe subordinate mechanism is adopted in the data cache layer to accelerate data flushing and persistence; the cooperation of the two aspects ensures fast data persistence and secure response.
[0056] like Figure 2 FIG. 1 is a schematic diagram of the hardware structure of an embodiment of the computer device for controlling data refresh provided by the present invention.
[0057] As Figure 2 Taking the device shown as an example, the device includes a processor 201 and a memory 202 , and may also include: an input device 203 and an output device 204 .
[0058] The processor 201, the memory 202, the input device 203 and the output device 204 may be connected via a bus or other means. Figure 2 The example of connecting through bus is taken in the following.
[0059] The memory 202 is a non-volatile computer-readable storage medium that can be used to store non-volatile software programs, non-volatile computer executable programs and modules, such as program instructions / modules corresponding to the method for controlling data flushing in the embodiment of the present application. The processor 201 executes various functional applications and data processing of the server by running the non-volatile software programs, instructions and modules stored in the memory 202, that is, the method for controlling data flushing in the above method embodiment is implemented.
[0060] The memory 202 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required by at least one function; the data storage area may store data created according to the use of the method for controlling data flushing, etc. In addition, the memory 202 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory 202 may optionally include a memory remotely arranged relative to the processor 201, and these remote memories may be connected to the local module via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0061] The input device 203 can receive input information such as user name and password. The output device 204 can include display devices such as display screens.
[0062] The program instructions / modules corresponding to one or more methods for controlling data flushing are stored in the memory 202 , and when executed by the processor 201 , the method for controlling data flushing in any of the above method embodiments is executed.
[0063] The method for controlling data flushing includes the following steps: in response to receiving a write request, performing write operations on data packets in sequence, and determining whether the write operation of the current data packet is a cache write; in response to the write operation of the current data packet being a cache write, writing the data of the data packet into a data cache layer, and determining whether the size of the data reaches the size of a distributed object; in response to the size of the data reaching the size of a distributed object, persisting the data, and determining whether the number of batch structures currently to be confirmed exceeds a threshold; and in response to the number of batch structures currently to be confirmed exceeding a threshold, performing a range detection on the persisted data, and flushing according to the result of the range detection.
[0064] In some embodiments, the method also includes: determining whether the sum of the size of a confirmation packet corresponding to the current data packet and the size of response data in a batch structure to be confirmed corresponding to the current data packet exceeds a batch data threshold; and in response to the sum of the size of the confirmation packet and the size of the response data in the batch structure to be confirmed exceeding the batch data threshold, creating a new batch structure to be confirmed.
[0065] In some implementations, the method further includes: constructing a confirmation structure, and inserting the confirmation structure into the batch structure to be confirmed.
[0066] In some implementations, the method further includes: determining whether the current data packet is the last data packet; and in response to the current data packet being the last data packet, adding a last bit identifier to the to-be-confirmed batch structure corresponding to the current data packet.
[0067] In some implementations, the method further includes: in response to detecting the last digit marker, performing a range check on the persisted data.
[0068] In some implementations, the refreshing according to the result of the range detection further includes: modifying the value of a confirmation character of the data packet according to the result of the range detection, and returning the confirmation character to the client.
[0069] In some implementations, the method further includes: in response to the write operation of the current data packet not being a cache write, persisting the current data packet and returning a confirmation character to the client.
[0070] Any embodiment of a computer device that executes the above-mentioned method for controlling data flushing can achieve the same or similar effect as any corresponding embodiment of the above-mentioned method.
[0071] The present invention also provides a computer-readable storage medium, which stores a computer program that performs the above method when executed by a processor.
[0072] like Figure 3FIG. 1 is a schematic diagram of an embodiment of a computer storage medium for controlling data downloading provided by the present invention. Figure 3 Taking the computer storage medium shown as an example, the computer readable storage medium 3 stores a computer program 31 that performs a method for controlling data flushing when executed by the processor. The method for controlling data flushing includes the following steps: in response to receiving a write request, writing operations on data packets in sequence, and determining whether the write operation of the current data packet is a cache write; in response to the write operation of the current data packet being a cache write, writing the data of the data packet into the data cache layer, and determining whether the size of the data reaches the size of the distributed object; in response to the size of the data reaching the size of the distributed object, persisting the data, and determining whether the number of the current batch structures to be confirmed exceeds a threshold; and in response to the number of the current batch structures to be confirmed exceeding a threshold, performing a range detection on the persisted data, and flushing according to the result of the range detection.
[0073] In some embodiments, the method also includes: determining whether the sum of the size of a confirmation packet corresponding to the current data packet and the size of response data in a batch structure to be confirmed corresponding to the current data packet exceeds a batch data threshold; and in response to the sum of the size of the confirmation packet and the size of the response data in the batch structure to be confirmed exceeding the batch data threshold, creating a new batch structure to be confirmed.
[0074] In some implementations, the method further includes: constructing a confirmation structure, and inserting the confirmation structure into the batch structure to be confirmed.
[0075] In some implementations, the method further includes: determining whether the current data packet is the last data packet; and in response to the current data packet being the last data packet, adding a last bit identifier to the to-be-confirmed batch structure corresponding to the current data packet.
[0076] In some implementations, the method further includes: in response to detecting the last digit marker, performing a range check on the persisted data.
[0077] In some implementations, the refreshing according to the result of the range detection further includes: modifying the value of a confirmation character of the data packet according to the result of the range detection, and returning the confirmation character to the client.
[0078] In some implementations, the method further includes: in response to the write operation of the current data packet not being a cache write, persisting the current data packet and returning a confirmation character to the client.
[0079] Finally, it should be noted that a person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the program of the method for controlling data flushing can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, the storage medium of the program can be a magnetic disk, an optical disk, a read-only storage memory (ROM) or a random access memory (RAM), etc. The above-mentioned computer program embodiments can achieve the same or similar effects as any of the above-mentioned method embodiments corresponding thereto.
[0080] The above are exemplary embodiments disclosed in the present invention, but it should be noted that various changes and modifications may be made without departing from the scope disclosed in the embodiments of the present invention as defined in the claims. The functions, steps and / or actions of the method claims according to the disclosed embodiments described herein do not need to be performed in any particular order. In addition, although the elements disclosed in the embodiments of the present invention may be described or required in individual form, they may also be understood as multiple unless explicitly limited to the singular.
[0081] It should be understood that, as used herein, the singular forms "a", "an" are intended to include the plural forms as well, unless the context clearly supports an exception. It should also be understood that, as used herein, "and / or" refers to any and all possible combinations including one or more of the associated listed items.
[0082] The serial numbers of the embodiments disclosed in the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0083] A person skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware or by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.
[0084] A person skilled in the art should understand that the discussion of any of the above embodiments is only exemplary and is not intended to imply that the scope of the disclosure of the embodiments of the present invention (including the claims) is limited to these examples; under the concept of the embodiments of the present invention, the technical features in the above embodiments or different embodiments can also be combined, and there are many other changes in different aspects of the embodiments of the present invention as above, which are not provided in detail for the sake of simplicity. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the embodiments of the present invention should be included in the protection scope of the embodiments of the present invention.
Claims
1. A method for controlling data refresh, characterized in that: The following steps are involved: In response to receiving a write request, performing write operations on the data packets in sequence, and determining whether the write operation of the current data packet is a cache write; In response to the write operation of the current data packet being a cache write, writing the data of the data packet into the data cache layer, and determining whether the size of the data reaches the size of the distributed object; In response to the size of the data reaching the size of the distributed object, persisting the data, and determining whether the number of batch structures to be confirmed currently exceeds a threshold; and determining whether the current data packet is the last data packet; in response to the current data packet being the last data packet, adding a last bit identifier to the batch structure to be confirmed corresponding to the current data packet; In response to the number of batch structures to be confirmed currently exceeding a threshold or detecting the last digit identifier, a range detection is performed on the persisted data, and a refresh is performed according to the result of the range detection, and the value of the confirmation character of the data packet is modified according to the result of the range detection, and the confirmation character is returned to the client.
2. The method according to claim 1, characterized in that The method also includes: Determine whether the sum of the size of the confirmation packet corresponding to the current data packet and the size of the response data in the to-be-confirmed batch structure corresponding to the current data packet exceeds the batch data threshold; and In response to the sum of the size of the confirmation packet and the size of the response data in the batch structure to be confirmed exceeding the batch data threshold, a new batch structure to be confirmed is created.
3. The method according to claim 2, characterized in that The method also includes: Construct a confirmation structure, and insert the confirmation structure into the batch structure to be confirmed.
4. The method according to claim 1, characterized in that: The method also includes: In response to the write operation of the current data packet not being a cache write, the current data packet is persisted and a confirmation character is returned to the client.
5. A system for controlling data refresh, characterized in that: include: A first determination module is configured to, in response to receiving a write request, sequentially perform a write operation on the data packet and determine whether the write operation of the current data packet is a cache write; A second judgment module is configured to write the data of the data packet into the data cache layer in response to the write operation of the current data packet being a cache write, and judge whether the size of the data reaches the size of the distributed object; A third judgment module is configured to persist the data in response to the size of the data reaching the size of the distributed object, and to judge whether the number of the batch structures to be confirmed currently exceeds a threshold; and determining whether the current data packet is the last data packet; in response to the current data packet being the last data packet, adding a last bit identifier to the batch structure to be confirmed corresponding to the current data packet; The execution module is configured to perform a range detection on the persisted data in response to the number of the current batch structures to be confirmed exceeding a threshold or detecting the last digit identifier, and to perform a down refresh according to the result of the range detection, modify the value of the confirmation character of the data packet according to the result of the range detection, and return the confirmation character to the client.
6. A computer device, characterized in that: include: at least one processor; as well as A memory storing computer instructions executable on the processor, wherein the instructions, when executed by the processor, implement the steps of the method according to any one of claims 1 to 4.
7. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 4 are implemented.
Citation Information
Patent Citations
Message synchronization method and system
CN106598762A
Method, system and device for controlling data brushing speed and medium
CN111708484A