A data processing method and system

By circulating the write, read, and empty states in the one-way light gate, the problem of low data block cache recording efficiency and low space recycling efficiency is solved, and efficient data processing and stability are achieved.

CN115098454BActive Publication Date: 2024-08-27BEIJING TOPSEC NETWORK SECURITY TECH +2
View PDF 13 Cites 0 Cited by

Patent Information

Application Number
CN202210884028.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-07-26
Publication Date
2024-08-27
Estimated Expiration
2042-07-26

AI Technical Summary

Technical Problem

In one-way light gates, separate storage of data block cache records and data blocks leads to inefficiency, especially when the amount of data is large, and the space utilization rate is not high when data blocks are recycled.

Method used

By circulating between files to be written, files to be read, and files to be processed, and using the three states of writing, reading, and emptying, data writing, reading, and space recovery are realized to ensure data processing efficiency and stability.

Benefits of technology

It improves data processing efficiency, avoids workload accumulation, improves space utilization and system stability, and reduces system operation and maintenance costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115098454B
    Figure CN115098454B
Patent Text Reader

Abstract

The present application provides a data processing method and system, which is applied to a current file sequence including a file to be written, a file to be read and a file to be processed, and the method includes: judging whether write data is detected; when write data is detected, determining the file to be written corresponding to the write state, and writing the write data into the file to be written; when write data is not detected, judging whether a read instruction is detected; when a read instruction is detected, determining the file to be read corresponding to the read state, and reading the cached data in the file to be read. It can be seen that the method can improve the data processing efficiency and ensure that the data processing efficiency will not be reduced when the cache amount is large. At the same time, the method can also improve the utilization rate of space when reclaiming data information.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing, and in particular, to a data processing method and system. Background Art

[0002] One-way optical gates (also known as one-way network gates) are usually deployed between networks with different security levels. Through a one-way non-feedback transmission physical environment, data is transmitted from a low-security domain to a high-security domain. Currently, the file storage method that can implement file caching in a one-way optical gate still has the following shortcomings:

[0003] ① The number of data block cache records and data blocks is very large, which reduces the efficiency when the data volume is large;

[0004] ② The data block cache records are stored separately from the data blocks, which means that the location must be moved at least twice to read a data block. Especially when using a mechanical hard disk, the larger the data cache, the lower the efficiency;

[0005] ③ After the data block is read, the space of the data block needs to be reclaimed, which requires the internal machine to record the information of each reclaimed data block in the program. In particular, when the released space is smaller than the size of the data block to be written, the utilization rate of the released space is reduced. Summary of the invention

[0006] The purpose of the embodiments of the present application is to provide a data processing method and system, which can improve data processing efficiency and ensure that the data processing efficiency will not decrease when the cache size is large. At the same time, the method can also improve the utilization of space when recycling data information.

[0007] A first aspect of an embodiment of the present application provides a data processing method, which is applied to a current file sequence including a file to be written, a file to be read, and a file to be processed. The method includes:

[0008] Determine whether write data is detected;

[0009] When the write data is detected, determining a to-be-written file corresponding to the write state, and writing the write data into the to-be-written file;

[0010] When the write data is not detected, determining whether a read instruction is detected;

[0011] When the read instruction is detected, a to-be-read file corresponding to the read state is determined, and cache data in the to-be-read file is read.

[0012] In the above implementation process, the method is applied to the current file sequence including the files to be written, the files to be read and the files to be processed. Specifically, the method can give priority to judging whether the written data is detected; thereby judging whether to start the circulation cycle of the three files of writing, reading and empty, or to start the circulation cycle of the three files of reading, empty and writing, thereby ensuring that the data processing method can start to operate in the expected form. Then, when the written data is detected, the file to be written corresponding to the write state is determined, and the written data is written into the file to be written; it can be seen that the process can realize the writing of data, so that the written data waits to be read, and at the same time, the write state can be passed to the next cycle file, so that the process of data processing can be realized while realizing the process of data processing, and the effect of process circulation can be realized, avoiding the accumulation of workload and improving the overall processing efficiency. Then, when the written data is not detected, the method judges whether the read instruction is detected; it can be seen that the method can judge whether to start the circulation cycle of the three files of reading, empty and writing without starting the circulation cycle of the three files of writing, reading and empty, thereby ensuring the correct and effective operation of the data processing method and avoiding the failure of the method caused by non-writing events. Finally, when a read instruction is detected, the method determines the file to be read corresponding to the read state, and reads the cached data in the file to be read; the method can realize the flow cycle of read, empty and write while reading data, thereby realizing another data processing startup mode, thereby improving the stability and applicability of the method while improving data processing efficiency.

[0013] Further, when writing the write data into the file to be written, or reading the cache data in the file to be read, the method further includes:

[0014] Determine the pending files corresponding to the empty state;

[0015] Reclaim the historical data space in the file to be processed.

[0016] In the above implementation process, when writing the write data into the file to be written or reading the cached data in the file to be read, the method determines the file to be processed corresponding to the empty state; then, the historical data space in the file to be processed is reclaimed. It can be seen that by implementing this implementation method, the space of the file to be processed can be reclaimed while reading or writing, thereby realizing the simultaneous operation of reading, writing and recycling, and further facilitating the subsequent circulation cycle of the three states of reading, writing and emptying.

[0017] Furthermore, the method further comprises:

[0018] After the write data is written or the cache data is read, the read state is converted to the empty state, the empty state is converted to the write state, and the write state is converted to the read state.

[0019] In the above implementation process, the method can convert the read state to the empty state, the empty state to the write state, and the write state to the read state after the write data is written or the cache data is read. It can be seen that the method can circulate the state in the order of read, empty, and write, and then mark the files corresponding to the three states of read, empty, and write as files to be read, files to be processed, and files to be written, thereby completing the replacement of file types, and then performing different data processing on the three files in the next cycle, ensuring that the contents of the three files are always alternating, ensuring the overall data processing efficiency.

[0020] Furthermore, before the step of determining whether the written data is detected, the method further includes:

[0021] Creating a current file sequence including a first file, a second file and a third file;

[0022] Setting three states, namely, a write state, a read state, and an empty state, on the first file;

[0023] When writing data is detected, determining the second file as a to-be-processed file corresponding to the empty state, and writing the writing data into the first file;

[0024] When a read instruction is detected, the third file is determined as a file to be processed corresponding to the empty state, the second file is determined as a file to be written corresponding to the write state, and the write data in the first file is read; wherein the first file is a file to be read, and the write data is cached data.

[0025] In the above implementation process, the method needs to pre-suggest the current file sequence before judging whether the step of writing data is detected, and initially create three empty files and set them as three files in a sequential cycle, and at the same time assign write state, read state and empty state to the first file; it can be seen that the process can create a loop process with "three" as the base, and realize the writing of the process method basis through state overwriting, so as to provide the basis of all data attributes for the subsequent progressive initialization process. Then, when writing data is detected, the second file is determined as a to-be-processed file corresponding to the empty state, and the writing data is written into the first file; it can be seen that the method can give priority to detecting writing data, and when writing data appears, the state label is moved sequentially, so as to form the effect of reading and writing one file and emptying one file, ensuring the writing of data and the space recovery and retention of the second file, thereby ensuring the smooth progress of the data processing method. Then, when the method detects the read instruction, the third file is determined as the to-be-processed file corresponding to the empty state, the second file is determined as the to-be-written file corresponding to the write state, and the writing data in the first file is read; wherein, the first file is the to-be-read file, and the writing data is the cache data. It can be seen that this method can use the read state to drive the write state and the empty state, so that the three states are distributed on three files, and then the initialization of data attributes and method flows can be realized during data processing, ensuring the parallelism of data processing and process settings, and improving the overall data processing efficiency and stability.

[0026] Furthermore, the step of setting the three states of write state, read state and empty state on the first file includes:

[0027] The three states of write state, read state and empty state are set on the first file, and the historical data space in the first file is recovered.

[0028] In the above implementation process, the method can set the three states of write state, read state, and empty state on the first file in the most initial state, and recycle the historical data space in the first file, so as to realize the initial initialization of the process layer of the method, thereby avoiding the problem of incomplete initialization caused by residual data in the first file.

[0029] A second aspect of an embodiment of the present application provides a data processing system, wherein a current file sequence including a file to be written, a file to be read, and a file to be processed is provided in the data processing system, and the data processing system comprises:

[0030] A judging unit, used for judging whether written data is detected;

[0031] A writing unit, configured to determine a to-be-written file corresponding to a write state when the write data is detected, and write the write data into the to-be-written file;

[0032] The judging unit is further configured to judge whether a read instruction is detected when the write data is not detected;

[0033] The reading unit is used to determine the to-be-read file corresponding to the read state and read the cached data in the to-be-read file when the read instruction is detected.

[0034] In the above implementation process, the data processing system is provided with a current file sequence including a file to be written, a file to be read and a file to be processed. Specifically, the data processing system can determine whether the write data is detected by the judgment unit; thereby determining whether to start the circulation cycle of the three files of write, read and empty, or to start the circulation cycle of the three files of read, empty and write, thereby ensuring that the data processing system can start to operate in the expected form. When the write data is detected by the writing unit, the file to be written corresponding to the write state is determined, and the write data is written into the file to be written; it can be seen that the process can realize the writing of data, so that the written data waits to be read, and at the same time, the write state can be passed to the next cycle file, so that the process of data processing can be realized while realizing the process of data processing, and the effect of process circulation can be realized, avoiding the accumulation of workload and improving the overall processing efficiency. When the write data is not detected by the judgment unit, it is determined whether the read instruction is detected; it can be seen that the system can judge whether to start the circulation cycle of the three files of read, empty and write without starting the circulation cycle of the three files of write, read and empty, thereby ensuring the correct and effective operation of the data processing system and avoiding system failure caused by non-write events. When the reading unit detects a read instruction, it determines the file to be read corresponding to the read state and reads the cached data in the file to be read. The system can realize the circulation of reading, emptying and writing while reading data, thereby realizing another data processing startup mode, thereby improving the stability and applicability of the system while improving the data processing efficiency.

[0035] Furthermore, the data processing system further includes:

[0036] a determining unit, configured to determine a to-be-processed file corresponding to an empty state when writing the write data into the to-be-written file or reading cache data in the to-be-read file;

[0037] The recycling unit is used to recycle the historical data space in the file to be processed.

[0038] In the above implementation process, the data processing system can determine the to-be-processed file corresponding to the empty state by the determination unit when writing the write data into the to-be-written file or reading the cached data in the to-be-read file; and then reclaim the historical data space in the to-be-processed file by the recovery unit. It can be seen that by implementing this implementation method, the system can reclaim the space of the to-be-processed file while reading or writing, thereby realizing the simultaneous operation of reading, writing and recycling, and further facilitating the subsequent circulation cycle of the three states of reading, writing and emptying.

[0039] Furthermore, the data processing system further includes:

[0040] A conversion unit is used to convert the read state into the empty state, convert the empty state into the write state, and convert the write state into the read state after the write data is written or the cache data is read.

[0041] In the above implementation process, the data processing system can convert the read state to the empty state, the empty state to the write state, and the write state to the read state through the conversion unit after the write data is written or the cache data is read. It can be seen that the system can perform a state circulation cycle in the order of read, empty, and write, and then mark the files corresponding to the three states of read, empty, and write as files to be read, files to be processed, and files to be written, thereby completing the replacement of file types, and then performing different data processing on the three files in the next cycle, ensuring that the contents of the three files are always alternating, ensuring the overall data processing efficiency.

[0042] Furthermore, the data processing system further includes:

[0043] A creating unit, used for creating a current file sequence including a first file, a second file and a third file before the step of determining whether writing data is detected;

[0044] A setting unit, used for setting three states of a write state, a read state, and an empty state on the first file;

[0045] The determining unit is further configured to, when writing data is detected, determine the second file as a to-be-processed file corresponding to the empty state, and write the writing data into the first file;

[0046] The determination unit is also used to, when a read instruction is detected, determine the third file as a file to be processed corresponding to the empty state, determine the second file as a file to be written corresponding to the write state, and read the write data in the first file; wherein the first file is a file to be read, and the write data is cached data.

[0047] In the above implementation process, the data processing system can create a current file sequence including the first file, the second file and the third file through the creation unit before judging whether the step of writing data is detected, and set the three states of writing state, reading state and empty state on the first file through the setting unit; it can be seen that the process can create a cyclic process with "three" as the base, and realize the writing of the process system foundation through state overwriting, thereby providing the basis of all data attributes for the subsequent progressive initialization process. When the determination unit detects the writing data, the second file is determined as the to-be-processed file corresponding to the empty state, and the writing data is written into the first file; it can be seen that the system can detect the writing data first, and when the writing data appears, the state label is moved sequentially, thereby forming the effect of reading and writing one file and emptying one file, ensuring the writing of data and the space recovery and retention of the second file, thereby ensuring the smooth progress of the data processing system. When the determination unit detects the read instruction, the third file is determined as the to-be-processed file corresponding to the empty state, the second file is determined as the to-be-written file corresponding to the writing state, and the writing data in the first file is read; wherein, the first file is the to-be-read file, and the writing data is the cache data. It can be seen that the system can use the read state to drive the write state and the empty state, so that the three states are distributed on three files, and then the initialization of data attributes and system processes can be realized during the data processing process, ensuring the parallelism of data processing and process settings, and improving the overall data processing efficiency and stability.

[0048] Furthermore, the setting unit is specifically used to set three states, namely, a write state, a read state, and an empty state, on the first file, and reclaim the historical data space in the first file.

[0049] In the above implementation process, the system can set the three states of write state, read state and empty state on the first file in the most initial state, and recycle the historical data space in the first file, so as to realize the initial initialization of the method flow layer, thereby avoiding the problem of incomplete initialization caused by residual data in the first file.

[0050] A third aspect of an embodiment of the present application provides an electronic device, including a memory and a processor, wherein the memory is used to store a computer program, and the processor runs the computer program to enable the electronic device to execute any data processing method described in any one of the first aspects of the embodiments of the present application.

[0051] A fourth aspect of an embodiment of the present application provides a computer-readable storage medium storing computer program instructions. When the computer program instructions are read and executed by a processor, the data processing method described in any one of the first aspects of the embodiment of the present application is executed. BRIEF DESCRIPTION OF THE DRAWINGS

[0052] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments of the present application will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0053] Figure 1 A flowchart of a data processing method provided in an embodiment of the present application;

[0054] Figure 2 A schematic diagram of the structure of a data processing system provided in an embodiment of the present application;

[0055] Figure 3 A schematic diagram of a unidirectional data stream before being stored in a circular queue file provided in an embodiment of the present application;

[0056] Figure 4 A schematic diagram of storing one-way session data provided by an embodiment of the present application;

[0057] Figure 5 A schematic diagram of a file circulation relationship provided in an embodiment of the present application. DETAILED DESCRIPTION

[0058] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application.

[0059] It should be noted that similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings. At the same time, in the description of this application, the terms "first", "second", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.

[0060] Example 1

[0061] Please see Figure 1 , Figure 1 A flow chart of a data processing method is provided for this embodiment. The data processing method is applied to a current file sequence including a file to be written, a file to be read, and a file to be processed. Specifically, the method includes:

[0062] S101: Create a current file sequence including a first file, a second file and a third file.

[0063] S102: Set three states, namely, write state, read state, and empty state, on the first file, and reclaim the historical data space in the first file.

[0064] S103: When writing data is detected, the second file is determined as a to-be-processed file corresponding to an empty state, and the writing data is written into the first file.

[0065] S104. When a read instruction is detected, the third file is determined as a file to be processed corresponding to an empty state, the second file is determined as a file to be written corresponding to a write state, and the write data in the first file is read; wherein the first file is a file to be read, and the write data is cached data.

[0066] S105, determine whether write data is detected, if so, execute step S106; if not, execute step S107.

[0067] S106 , determining a file to be written corresponding to the write state, writing the write data into the file to be written, and executing step S109 .

[0068] S107, determine whether a read instruction is detected, if so, execute step S108; if not, end this process.

[0069] S108, determining a file to be read corresponding to the read state, reading cached data in the file to be read, and executing step S109.

[0070] S109: Determine the to-be-processed files corresponding to the empty state.

[0071] S110, reclaiming the historical data space in the file to be processed.

[0072] S111. After the write data is written or the cache data is read, the read state is converted to the empty state, the empty state is converted to the write state, and the write state is converted to the read state.

[0073] In this embodiment, the method adopts the design idea of ​​combining a circular queue with a file cache, and uses the session ID and three sequence numbers as the file names of the three files, thereby forming a file circular queue, that is, the files form a ring in the following manner.

[0074] For example: “ID1-1” ==》“ID1-2” ==》“ID1-3” ==》“ID1-1”.

[0075] Specifically, the schematic diagram of the unidirectional data flow before being stored in the circular queue file is as follows Figure 3 shown.

[0076] visible, Figure 3 The unidirectional data flow will be stored in the file circular queue. For example, "file circular queue ID1" indicates the file circular queue of session ID1, and the same applies to other queues.

[0077] In this embodiment, the schematic diagram after storing the one-way session data is as follows: Figure 4 shown.

[0078] like Figure 4 As shown, the data of each session will be stored in two different files in turn, where

[0079] ① "ID1-1": "ID1" indicates the first file queue (corresponding to the first one-way session), "-1" indicates the first file in the file queue, and the file name is: "ID1-1";

[0080] ② "ID1-2": "ID1" indicates the first file queue (corresponding to the first one-way session), "-2" indicates the second file in the file queue, and the file name is: "ID1-2";

[0081] ③ "ID1-3": "ID1" indicates the first file queue (corresponding to the first one-way session), "-3" indicates the third file in the file queue, and the file name is: "ID1-3";

[0082] ④1-1, 1-2, 1-3: "1" indicates the first unidirectional session, "-1", "-2", "-3" indicate data blocks 1, 2, and 3 in the first unidirectional session respectively;

[0083] ⑤The relationship between the file names and data blocks of other file queues is similar.

[0084] It can be seen that this idea allows writing files and reading files to be performed in different files, and adjusts the file cache quantity and time parameters according to the business scenario to achieve the goal of optimally matching the business.

[0085] In this embodiment, the method can achieve fast writing and reading of unidirectional data in a file by using a file circular queue technical idea.

[0086] ① The internal terminal program sets the three files in a file circular queue to three states: readable file, writable file, and empty file, referred to as: read, write, and empty;

[0087] ② The three states rotate in cycles on the three files "ID1-1", "ID1-2" and "ID1-3";

[0088] ③ The circular relationship between the three states and three files is shown as follows Figure 5 shown.

[0089] For example, the method (file circular queue reading, writing, empty state circulation situation) may include the following steps:

[0090] ① Initial state: The three states of read, write and empty are all on the ID1-1 file, corresponding to ① in the figure.

[0091] ②Write data state: After triggering the write data state, push the empty state forward, that is, empty = ID1-2, write = ID1-1, read = ID1-1, corresponding to ② in the figure.

[0092] ③ Read data state: After the read data state is triggered, the write state and the empty state are pushed forward, that is, empty = ID1-3, write = ID1-2, read = ID1-1, corresponding to ③ in the figure.

[0093] ④ Empty state (reclaiming historical data space): The empty state is only triggered by the write state and the read state, and serves only as an isolation state between write and read.

[0094] ⑤ During the process of continuous writing and reading of data, the three states of read, write and empty are continuously cycled on the file names "ID1-1", "ID1-2" and "ID1-3".

[0095] In this embodiment, the method allows the three states to circulate in the three files during the special processing of the repeated cycle. At this time, because the historical data is still stored in the file, when the historical data rotates in the empty state, it is directly cleared through the operating system file operation or rebuilt after the file is deleted.

[0096] In this embodiment, the execution subject of the method may be a computing system such as a computer or a server, and no limitation is made in this embodiment.

[0097] In this embodiment, the execution subject of the method may also be a smart device such as a smart phone, a tablet computer, etc., which is not limited in this embodiment.

[0098] It can be seen that the data processing method described in the present embodiment can be implemented by combining the one-way data reading and writing characteristics with the file circular queue, which can effectively solve the problems of multi-session, large data volume, and low efficiency of reclaiming storage space. At the same time, the write, read, and empty (reclaiming historical data space) states of the three states of the file circular queue do not affect each other, and the write, read, and empty (reclaiming historical data space) of the file data are effectively separated, which improves the data comprehensive processing speed. The hard disk address continuity of file storage and reading is good, especially completing historical data recovery at one time, further improving the reliability and stability of data cache. It can be seen that the method is simple and easy to implement, and can effectively provide the data cache comprehensive capacity of the one-way optical gate, reduce the probability of data loss of the terminal machine in the one-way optical gate caused by data congestion of the data recipient, improve the reliable ability of the one-way optical gate to provide services to the outside, and reduce the cost of system operation and maintenance.

[0099] Example 2

[0100] Please see Figure 2 , Figure 2FIG. 1 is a schematic diagram of a data processing system provided in this embodiment. Figure 2 As shown, the data processing system includes:

[0101] A determination unit 210, used to determine whether write data is detected;

[0102] The writing unit 220 is used to determine a to-be-written file corresponding to the writing state when writing data is detected, and write the writing data into the to-be-written file;

[0103] The judging unit 210 is further used to judge whether a read instruction is detected when no write data is detected;

[0104] The reading unit 230 is used to determine the to-be-read file corresponding to the read state and read the cached data in the to-be-read file when a read instruction is detected.

[0105] As an optional implementation, the data processing system further includes:

[0106] A determination unit 240, configured to determine a to-be-processed file corresponding to an empty state when writing write data into a to-be-written file or reading cache data in a to-be-read file;

[0107] The recovery unit 250 is used to recover the historical data space in the file to be processed.

[0108] As an optional implementation, the data processing system further includes:

[0109] The conversion unit 260 is used to convert the read state into the empty state, convert the empty state into the write state, and convert the write state into the read state after the write data is written or the cache data is read.

[0110] As an optional implementation, the data processing system further includes:

[0111] A creating unit 270, used for creating a current file sequence including a first file, a second file and a third file before the step of determining whether writing data is detected;

[0112] A setting unit 280, used to set three states of a write state, a read state, and an empty state on the first file;

[0113] The determination unit 240 is further configured to, when writing data is detected, determine the second file as a to-be-processed file corresponding to an empty state, and write the writing data into the first file;

[0114] The determination unit 240 is also used to, when a read instruction is detected, determine the third file as a file to be processed corresponding to an empty state, determine the second file as a file to be written corresponding to a write state, and read the write data in the first file; wherein the first file is the file to be read and the write data is cached data.

[0115] As an optional implementation, the setting unit 280 is specifically used to set the three states of write state, read state, and empty state on the first file, and reclaim the historical data space in the first file.

[0116] In this embodiment, the explanation of the data processing system can refer to the description in Embodiment 1, and will not be further elaborated in this embodiment.

[0117] It can be seen that the data processing system described in the present embodiment can be implemented by using a file circular queue in combination with the one-way data read-write characteristics, which can effectively solve the problems of multi-session, large data volume, and low efficiency of reclaiming storage space. At the same time, the write, read, and empty (reclaiming historical data space) states of the three states of the file circular queue do not affect each other, and the write, read, and empty (reclaiming historical data space) of the file data are effectively separated, which improves the data comprehensive processing speed. The hard disk address continuity of file storage and reading is good, especially completing historical data recovery at one time, further improving the reliability and stability of data cache. It can be seen that the method is simple and easy to implement, and can effectively provide the data cache comprehensive capacity of the one-way optical gate, reduce the probability of data loss of the terminal machine in the one-way optical gate caused by data congestion of the data recipient, improve the reliable ability of the one-way optical gate to provide services to the outside, and reduce the cost of system operation and maintenance.

[0118] An embodiment of the present application provides an electronic device, including a memory and a processor, the memory is used to store a computer program, and the processor runs the computer program to enable the electronic device to execute the data processing method in Embodiment 1 of the present application.

[0119] An embodiment of the present application provides a computer-readable storage medium storing computer program instructions. When the computer program instructions are read and executed by a processor, the data processing method in Embodiment 1 of the present application is executed.

[0120] In several embodiments provided in the present application, it should be understood that the disclosed system and method can also be implemented in other ways. The system embodiments described above are merely schematic. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the systems, methods and computer program products according to multiple embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of a code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or the flowchart, and the combination of boxes in the block diagram and / or the flowchart can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.

[0121] In addition, the functional modules in the various embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.

[0122] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0123] The above description is only an embodiment of the present application and is not intended to limit the scope of protection of the present application. For those skilled in the art, the present application may have various changes and variations. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application should be included in the scope of protection of the present application. It should be noted that similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in the subsequent drawings.

[0124] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

[0125] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

Claims

1. A data processing method, It is characterized in that Applied to a current file sequence including a file to be written, a file to be read, and a file to be processed, the method comprises: Creating a current file sequence including a first file, a second file and a third file; Setting three states, namely, a write state, a read state, and an empty state, on the first file; When writing data is detected, determining the second file as a to-be-processed file corresponding to the empty state, and writing the writing data into the first file; When a read instruction is detected, the third file is determined as a file to be processed corresponding to the empty state, the second file is determined as a file to be written corresponding to the write state, and the write data in the first file is read; wherein the first file is a file to be read, and the write data is cache data; Determine whether write data is detected; When the write data is detected, determining a to-be-written file corresponding to the write state, and writing the write data into the to-be-written file; When the write data is not detected, determining whether a read instruction is detected; When the read instruction is detected, a to-be-read file corresponding to the read state is determined, and cache data in the to-be-read file is read.

2. The data processing method according to claim 1, It is characterized in that When writing the write data into the file to be written, or reading the cache data in the file to be read, the method further includes: Determine the pending files corresponding to the empty state; Reclaim the historical data space in the file to be processed.

3. The data processing method according to claim 2, It is characterized in that The method further comprises: After the write data is written or the cache data is read, the read state is converted to the empty state, the empty state is converted to the write state, and the write state is converted to the read state.

4. The data processing method according to claim 1, It is characterized in that The step of setting the three states of write state, read state and empty state on the first file comprises: The three states of write state, read state and empty state are set on the first file, and the historical data space in the first file is recovered.

5. A data processing system, It is characterized in that The data processing system is provided with a current file sequence including files to be written, files to be read and files to be processed, and the data processing system comprises: A judging unit, used for judging whether written data is detected; A writing unit, configured to determine a to-be-written file corresponding to a write state when the write data is detected, and write the write data into the to-be-written file; The judging unit is further configured to judge whether a read instruction is detected when the write data is not detected; A reading unit, configured to determine a to-be-read file corresponding to the read state and read cached data in the to-be-read file when the read instruction is detected; Wherein, the data processing system further includes: A creating unit, used for creating a current file sequence including a first file, a second file and a third file before the step of determining whether writing data is detected; A setting unit, used for setting three states of a write state, a read state, and an empty state on the first file; The determining unit is further configured to, when writing data is detected, determine the second file as a to-be-processed file corresponding to the empty state, and write the writing data into the first file; The determination unit is also used to, when a read instruction is detected, determine the third file as a file to be processed corresponding to the empty state, determine the second file as a file to be written corresponding to the write state, and read the write data in the first file; wherein the first file is a file to be read, and the write data is cached data.

6. The data processing system according to claim 5, It is characterized in that The data processing system further comprises: a determining unit, configured to determine a to-be-processed file corresponding to an empty state when writing the write data into the to-be-written file or reading cache data in the to-be-read file; The recycling unit is used to recycle the historical data space in the file to be processed.

7. The data processing system according to claim 6, It is characterized in that The data processing system further comprises: A conversion unit is used to convert the read state into the empty state, convert the empty state into the write state, and convert the write state into the read state after the write data is written or the cache data is read.

8. An electronic device, It is characterized in that The electronic device comprises a memory and a processor, the memory is used to store a computer program, and the processor runs the computer program to enable the electronic device to perform the data processing method according to any one of claims 1 to 4.

9. A readable storage medium, It is characterized in that The readable storage medium stores computer program instructions, and when the computer program instructions are read and executed by a processor, the data processing method according to any one of claims 1 to 4 is executed.

Citation Information

Patent Citations

  • Peripheral device and image reading device

    CN102077165A

  • Method for supporting concurrent read-write of file in data de-duplication

    CN102467569A

  • Write buffer detector, addressing method of written data and parallel channel write method

    CN102521160A

  • Multi-media file reading method and multi-media file reading device

    CN105142004A

  • File reading method and device

    CN106354788A