File read-write time control method and device, equipment, storage medium and product
By replacing the tested file with a one-way pipeline file and using its blocking characteristics to control the blocking time, the problem of file system read and write operation timeout simulation is solved, and the real simulation of file system testing is realized.
Patent Information
- Application Number
- CN202510570244.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-30
- Publication Date
- 2025-08-15
AI Technical Summary
The prior art is difficult to simulate the timeout failure of the read and write operation of the file system in a practical environment, resulting in difficulty in testing the file system.
By replacing the measured file with a one-way pipeline file as the target file, using its blocking characteristics, the blocking time of the target file is controlled to simulate the read and write operation timeout, including waiting for the blocking time after the write operation before performing the read operation.
Real simulation of file system read and write operation timeout failures is realized, and the requirements for file system testing are met, especially the testing conditions of node disaster inspection programs in cloud platforms.
Smart Images

Figure CN120492335A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of test engineering technology, and in particular to a method, device, equipment, storage medium and product for controlling file reading and writing time. Background Art
[0002] File system testing involves evaluating the performance, stability, and reliability of a file system through a series of tests. A file system is the software component of an operating system responsible for managing files and directories on storage devices. Therefore, testing a file system can help ensure that it performs as expected in real-world applications.
[0003] In existing technology, file system testing typically involves reading and writing files to determine if the file system is functioning properly. When a read or write operation times out, the file system is considered faulty. The program collects the number of errors over a period of time and triggers an alarm when threshold 1 is reached, or a disaster when threshold 2 is reached. However, realistically simulating this disaster detection mechanism is difficult in testing engineering. In real-world environments, it's virtually impossible to control file system failure factors, making it impossible to simulate file read or write timeout failures. Summary of the Invention
[0004] The present invention provides a method, device, equipment, storage medium and product for controlling file reading and writing time, so as to realize simulation of file reading and writing timeout failure.
[0005] According to one aspect of the present invention, a method for controlling file read and write time is provided, comprising:
[0006] Determine the blocking time corresponding to the tested file and the tested file, and replace the tested file with a target file; wherein the target file is a one-way pipe file;
[0007] In response to a write operation command, performing a write operation on the target file;
[0008] A process detection is performed on the target file. If a write operation process for the target file is detected, a read operation is performed on the target file after waiting for the blocking time.
[0009] Furthermore, after waiting for the blocking time and then performing a read operation on the target file, the method further includes:
[0010] Return to the step of executing a write operation on the target file in response to the write operation command.
[0011] Furthermore, determining the blocking time corresponding to the tested file and the tested file includes:
[0012] Obtain a configuration script, and extract a first parameter and a second parameter from the configuration script;
[0013] The first parameter is determined as the tested file, and the second parameter is determined as the blocking time.
[0014] Furthermore, the process detection is performed on the target file, including:
[0015] Obtaining a process interface file of the target file;
[0016] The write operation process characteristic information of the target file is detected in the process interface file.
[0017] Furthermore, after waiting for the blocking time and then performing a read operation on the target file, the method further includes:
[0018] The target data read from the target file is acquired, and the target data is written into a preset file.
[0019] Furthermore, after replacing the tested file with the target file, the method further includes:
[0020] In response to a read operation command, performing a read operation on the target file;
[0021] A process detection is performed on the target file. If a read operation process for the target file is detected, a write operation is performed on the target file after waiting for the blocking time.
[0022] According to another aspect of the present invention, a device for controlling file read and write time is provided, comprising:
[0023] A tested file replacement module is used to determine the blocking time corresponding to the tested file and replace the tested file with a target file; wherein the target file is a one-way pipe file;
[0024] A write operation execution module, configured to execute a write operation on the target file in response to a write operation command;
[0025] The read operation execution module is used to perform process detection on the target file, and if a write operation process for the target file is detected, execute a read operation on the target file after waiting for the blocking time.
[0026] Optionally, the device further includes a loop module, configured to return to the step of executing a write operation on the target file in response to the write operation command.
[0027] Optionally, the tested file replacement module is also used to:
[0028] Obtain a configuration script, and extract a first parameter and a second parameter from the configuration script;
[0029] The first parameter is determined as the tested file, and the second parameter is determined as the blocking time.
[0030] Optionally, the read operation execution module is further configured to:
[0031] Obtaining a process interface file of the target file;
[0032] The write operation process characteristic information of the target file is detected in the process interface file.
[0033] Optionally, the device further includes a data writing module, configured to obtain target data read from the target file and write the target data into a preset file.
[0034] Optionally, the device also includes a second read operation module and a second write operation execution module, the second read operation module is used to perform a read operation on the target file in response to a read operation command; the second write operation execution module is used to perform a process detection on the target file, and if a read operation process for the target file is detected, the write operation on the target file is performed after waiting for the blocking time.
[0035] According to another aspect of the present invention, an electronic device is provided, comprising:
[0036] at least one processor; and
[0037] a memory communicatively connected to the at least one processor; wherein,
[0038] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the method for controlling file read and write time according to any embodiment of the present invention.
[0039] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the file reading and writing time control method described in any embodiment of the present invention when executed.
[0040] According to another aspect of the present invention, a computer program product is provided, which includes a computer program / instruction, and when the computer program / instruction is executed by a processor, the steps of the method for controlling file reading and writing time according to any embodiment of the present invention are implemented.
[0041] The present invention discloses a method for controlling file read and write time. First, the blocking time corresponding to the tested file and the tested file are determined, and the tested file is replaced with a target file; wherein the target file is a unidirectional pipe file; then, in response to a write operation command, a write operation is performed on the target file; finally, a process detection is performed on the target file. If a write operation process for the target file is detected, the read operation is performed on the target file after waiting for the blocking time. The present invention replaces the tested file with the target file, and utilizes the characteristic of the target file as a unidirectional pipe file to simulate a read and write operation timeout of the tested file by controlling the blocking time of the target file.
[0042] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present invention, nor is it intended to limit the scope of the present invention. Other features of the present invention will become readily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0044] Figure 1 This is a flowchart of a method for controlling file read and write time provided in accordance with the first embodiment of the present invention;
[0045] Figure 2 This is a flowchart of a method for controlling file read and write time provided in accordance with a second embodiment of the present invention;
[0046] Figure 3 This is a schematic diagram of the structure of a device for controlling file reading and writing time provided according to a third embodiment of the present invention;
[0047] Figure 4 It is a structural diagram of an electronic device for implementing the method for controlling file reading and writing time according to the fourth embodiment of the present invention. DETAILED DESCRIPTION
[0048] In order to enable those skilled in the art to better understand the solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the embodiments described are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of the present invention.
[0049] It should be noted that the terms "first", "second", etc. in the description and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0050] Example 1
[0051] Figure 1 This is a flowchart of a method for controlling file read and write time provided in the first embodiment of the present invention. This embodiment is applicable to the case of testing a file system. The method can be executed by a device for controlling file read and write time. The device for controlling file read and write time can be implemented in the form of hardware and / or software. The device for controlling file read and write time can be configured in an electronic device. Figure 1 As shown, the method includes:
[0052] S110 , determining the blocking time corresponding to the tested file and replacing the tested file with the target file.
[0053] Among them, the target file is a unidirectional pipe file.
[0054] In this embodiment, the file under test is the test object when testing the file system, the blocking time is the pre-set blocking time for the read and write operations of the file under test, and the target file is a one-way pipe file used to replace the file under test and simulate the read and write timeout phenomenon of the file under test.
[0055] Specifically, a pipe file is a special file type used for inter-process communication (IPC). It can be unidirectional (half-duplex) or bidirectional (full-duplex). Unidirectional pipe files are mainly used for one-way data transmission between two processes, that is, data can only flow from one process to another, not the other way around. When writing data to a unidirectional pipe file without reading from it, write blocking occurs; conversely, when reading data from a unidirectional pipe file without writing to it, read blocking occurs.
[0056] Preferably, by utilizing the characteristics of a one-way pipe file, after replacing the file under test with the target file, the read and write operation timeout of the file under test can be simulated by controlling the blocking time of the target file, thereby realizing the test of the file system. The blocking time corresponding to the file under test and the file under test can be pre-set, and the blocking time corresponding to the file under test can be determined by extracting specific parameters in the configuration script.
[0057] S120: In response to the write operation command, perform a write operation on the target file.
[0058] The write operation command may be a write data instruction for a target file.
[0059] In this embodiment, the business side can initiate a write operation command by calling a write operation command line, thereby performing a write operation on the target file. At this time, since the target file is a one-way pipe file, when there is only a write operation but no read operation, a blockage will occur. The blockage will not be released until there is a read operation on the target file.
[0060] S130: Perform a process detection on the target file. If a write operation process for the target file is detected, perform a read operation on the target file after waiting for a blocking time.
[0061] In this embodiment, a process detection can be performed on the target file to find the write operation process for the target file. If a write operation process for the target file is detected, the read operation on the target file is performed after waiting for the blocking time according to a preset blocking time, thereby releasing the write blocking of the target file.
[0062] Alternatively, a method for detecting a process that is performing a write operation on a target file may be performed by detecting process signature information for the target file in a process interface file of the target file to detect the process performing the write operation on the target file. For example, in a Linux system, the process interface file of the target file may be the / proc / folder, which stores information about all processes. The process signature information for the write operation may be the contents of the cmdline of the corresponding process in the / proc / folder. By detecting the / proc / process / cmdline file, the complete command line parameters when the process was started can be extracted, thereby detecting whether a process performing the write operation on the target file exists.
[0063] Furthermore, after performing the read operation on the target file after waiting for the blocking time, the method may also return to the step of performing the write operation on the target file in response to the write operation command.
[0064] Specifically, when a write operation on the target file is detected, wait for a preset blocking time, and then perform a read operation on the target, thereby releasing the write blocking of the target file. After that, you can continue to perform a write operation on the target file, and then perform a process detection on the target file. Repeat the above steps to periodically simulate file system failures, thereby meeting the testing requirements of the disaster detection program of the nodes in the cloud platform.
[0065] Furthermore, after performing a read operation on the target file after waiting for the blocking time, the following steps may be performed: obtaining target data read from the target file, and writing the target data into a preset file.
[0066] Specifically, in this embodiment, only the write and read operations on the target file are of interest, and the specific data content of the write / read operations is not of concern. If the data content is of interest, the read data can be written to a preset file. For example, when writing data to the target file, a corresponding write process is found, and after a preset blocking time, the data in the target file is read and then written to the preset file.
[0067] Furthermore, after replacing the tested file with the target file, you can also: respond to the read operation command, perform a read operation on the target file; perform a process detection on the target file, and if a read operation process for the target file is detected, wait for the blocking time and then perform a write operation on the target file.
[0068] Specifically, to simulate a read or write timeout on the file under test, not only can a write operation be performed on the target file, detecting the write process on the target file, and then performing a read operation on the target file after a blocking period, but also a read operation can be performed on the target file, and then a process detection is performed on the target file. If a read process is detected, then the write operation is performed after a blocking period. That is, after performing a read operation on the target file, due to the characteristics of a unidirectional pipe file, when there is only a read operation and no write operation, a read block will occur, which can also simulate a read or write timeout on the file under test.
[0069] The present invention discloses a method for controlling file read and write time. First, the blocking time corresponding to the tested file and the tested file are determined, and the tested file is replaced with a target file; wherein the target file is a unidirectional pipe file; then, in response to a write operation command, a write operation is performed on the target file; finally, a process detection is performed on the target file. If a write operation process for the target file is detected, the read operation is performed on the target file after waiting for the blocking time. The present invention replaces the tested file with the target file, and utilizes the characteristic of the target file as a unidirectional pipe file to simulate a read and write operation timeout of the tested file by controlling the blocking time of the target file.
[0070] Example 2
[0071] Figure 2 This is a flowchart of a method for controlling file read and write time provided by the second embodiment of the present invention. This embodiment is a refinement of the above embodiment. Figure 2 As shown, the method includes:
[0072] S210: Obtain a configuration script, extract a first parameter and a second parameter in the configuration script, determine the first parameter as the tested file, and determine the second parameter as the blocking time.
[0073] The configuration script is a script file used to set the tested file and the blocking time, and includes two parameters, namely a first parameter and a second parameter, which represent the tested file and the blocking time respectively.
[0074] In this embodiment, the configuration script can be used to set the test file and blocking time by passing parameters. The desired test file and blocking time are written into the corresponding locations of the configuration script as the first parameter and the second parameter, respectively. The test file and blocking time can then be determined by extracting the first and second parameters from the configuration file.
[0075] Furthermore, a more complex control method can be set for the blocking time. For example, the second parameter can be set to "3×3,2×0,5×3", which means that the blocking time for the first three times is 3 seconds, the next two times is 0 seconds, and the next five times is 3 seconds. This complex control method can be used to achieve trigger conditions for different file failures.
[0076] S220: Replace the file under test with the target file.
[0077] Among them, the target file is a unidirectional pipe file.
[0078] In this embodiment, since the target file is a one-way pipe file, it can only transmit data in one direction. When writing data to the target file without reading from it, a write block will occur; conversely, when reading data from the target file without writing to it, a read block will occur. After determining the file under test, the file under test can be replaced with the target file. By utilizing the target file's characteristic as a one-way pipe file, after the replacement, the read and write operation timeout of the file under test can be simulated by controlling the target file's blocking time, thereby achieving a test of the file system.
[0079] S230: In response to the write operation command, perform a write operation on the target file.
[0080] The write operation command may be a write data instruction for a target file.
[0081] In this embodiment, the business side can initiate a write operation command by calling a write operation command line, thereby performing a write operation on the target file. At this time, since the target file is a one-way pipe file, when there is only a write operation but no read operation, a blockage will occur. The blockage will not be released until there is a read operation on the target file.
[0082] S240: Obtain a process interface file of the target file, detect characteristic information of a write operation process of the target file in the process interface file, and if a write operation process for the target file is detected, perform a read operation on the target file after waiting for a blocking time.
[0083] The process interface files are a series of special files that provide an interface between the kernel and the process runtime information in the form of virtual files. The write operation process characteristic information can be characteristic information related to the write operation process of the target file that can identify the write operation process, such as a process ID.
[0084] In this embodiment, a process performing a write operation on a target file can be detected by detecting the write operation process characteristic information of the target file in the process interface file of the target file. For example, in a Linux system, the process interface file of the target file can be the / proc / folder, which stores information about all processes. The write operation process characteristic information can be the cmdline content of the corresponding process in the / proc / folder. By detecting the / proc / process / cmdline file, the complete command line parameters when the process was started can be extracted, thereby detecting whether there is a process performing a write operation on the target file.
[0085] Furthermore, if a write operation process for the target file is detected, the read operation on the target file can be performed after waiting for a preset blocking time, thereby releasing the write blocking of the target file.
[0086] The file read and write time control method provided by the embodiment of the present invention replaces the tested file with the target file and utilizes the characteristics of the target file as a one-way pipe file. It can realize the simulation of the read and write operation timeout of the tested file by controlling the blocking time of the target file.
[0087] Example 3
[0088] Figure 3 This is a schematic diagram of a device for controlling file read and write time according to the third embodiment of the present invention. Figure 3 As shown, the device includes: a tested file replacement module 310, a write operation execution module 320 and a read operation execution module 330.
[0089] The tested file replacement module 310 is used to determine the tested file and the blocking time corresponding to the tested file, and replace the tested file with the target file; wherein the target file is a unidirectional pipe file.
[0090] The write operation execution module 320 is configured to execute a write operation on a target file in response to a write operation command.
[0091] The read operation execution module 330 is used to perform a process detection on the target file. If a write operation process for the target file is detected, the module waits for a blocking time and then performs a read operation on the target file.
[0092] Optionally, the device further includes a loop module for returning to the step of executing a write operation on the target file in response to the write operation command.
[0093] Optionally, the tested file replacement module 310 is further configured to:
[0094] A configuration script is obtained, and a first parameter and a second parameter in the configuration script are extracted; the first parameter is determined as the file to be tested, and the second parameter is determined as the blocking time.
[0095] Optionally, the read operation execution module 330 is further configured to:
[0096] Obtain a process interface file of a target file; and detect process characteristic information of a write operation of the target file in the process interface file.
[0097] Optionally, the device further includes a data writing module, configured to obtain target data read from a target file and write the target data into a preset file.
[0098] Optionally, the device also includes a second read operation module and a second write operation execution module, the second read operation module is used to perform a read operation on the target file in response to a read operation command; the second write operation execution module is used to perform a process detection on the target file, and if a read operation process for the target file is detected, the write operation is performed on the target file after waiting for a blocking time.
[0099] The file read and write time control device provided by the embodiment of the present invention can execute the file read and write time control method provided by any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0100] Example 4
[0101] Figure 4A schematic diagram of the structure of an electronic device 10 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or claimed herein.
[0102] like Figure 4 As shown, the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., which is communicatively connected to the at least one processor 11. The memory stores a computer program that can be executed by the at least one processor. The processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 into the random access memory (RAM) 13. Various programs and data required for the operation of the electronic device 10 can also be stored in the RAM 13. The processor 11, ROM 12, and RAM 13 are connected to each other via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0103] Multiple components in the electronic device 10 are connected to the I / O interface 15, including an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a magnetic disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.
[0104] The processor 11 can be any general-purpose and / or specialized processing component with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various specialized artificial intelligence (AI) computing chips, various processors that run machine learning model algorithms, a digital signal processor (DSP), and any other suitable processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as the method for controlling file read and write times.
[0105] In some embodiments, the method for controlling file read and write time can be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program can be loaded and / or installed on the electronic device 10 via ROM 12 and / or communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of controlling file read and write time described above can be performed. Alternatively, in other embodiments, processor 11 can be configured to execute the method for controlling file read and write time by any other appropriate means (e.g., by means of firmware).
[0106] Various embodiments of the systems and techniques described herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), system-on-chip systems (SOCs), programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include being implemented in one or more computer programs that are executable and / or interpreted on a programmable system that includes at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0107] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when the computer program is executed by the processor, the functions / operations specified in the flowcharts and / or block diagrams are implemented. The computer program may be executed entirely on the machine, partially on the machine, as a stand-alone software package, partially on the machine and partially on a remote machine, or entirely on a remote machine or server.
[0108] In the context of the present invention, computer-readable storage media can be tangible media that can contain or store a computer program for use with an instruction execution system, device or equipment or used in combination with an instruction execution system, device or equipment. Computer-readable storage media can include but are not limited to electronic, magnetic, optical, electromagnetic, infrared or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, computer-readable storage media can be machine-readable signal media. More specific examples of machine-readable storage media can include electrical connections based on one or more lines, portable computer disks, hard disks, random access memories (RAM), read-only memories (ROM), erasable programmable read-only memories (EPROM or flash memory), optical fibers, portable compact disk read-only memories (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0109] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0110] The systems and techniques described herein can be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, 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: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0111] A computing system may include clients and servers. The clients and servers are typically remote from each other and typically interact via a communication network. This client-server relationship arises through computer programs running on the respective computers, creating a client-server relationship. The server may be a cloud server, also known as a cloud computing server or cloud host. This server is a hosting product within the cloud computing service ecosystem that addresses the management difficulties and limited scalability of traditional physical hosting and VPS services.
Claims
1. A method for controlling file reading and writing time, characterized in that: include: Determine the blocking time corresponding to the tested file and the tested file, and replace the tested file with a target file; wherein the target file is a one-way pipe file; In response to a write operation command, performing a write operation on the target file; A process detection is performed on the target file. If a write operation process for the target file is detected, a read operation is performed on the target file after waiting for the blocking time.
2. The method according to claim 1, characterized in that After waiting for the blocking time and performing a read operation on the target file, the method further includes: Return to the step of executing a write operation on the target file in response to the write operation command.
3. The method according to claim 1, characterized in that Determining a tested file and a blocking time corresponding to the tested file includes: Obtain a configuration script, and extract a first parameter and a second parameter from the configuration script; The first parameter is determined as the tested file, and the second parameter is determined as the blocking time.
4. The method according to claim 1, wherein Performing process detection on the target file includes: Obtaining a process interface file of the target file; The write operation process characteristic information of the target file is detected in the process interface file.
5. The method according to claim 1, characterized in that After waiting for the blocking time and performing a read operation on the target file, the method further includes: The target data read from the target file is acquired, and the target data is written into a preset file.
6. The method according to claim 1, characterized in that After replacing the tested file with the target file, the method further includes: In response to a read operation command, performing a read operation on the target file; A process detection is performed on the target file. If a read operation process for the target file is detected, a write operation is performed on the target file after waiting for the blocking time.
7. A device for controlling file reading and writing time, characterized in that: include: A tested file replacement module is used to determine the blocking time corresponding to the tested file and replace the tested file with a target file; wherein the target file is a one-way pipe file; A write operation execution module, configured to execute a write operation on the target file in response to a write operation command; The read operation execution module is used to perform process detection on the target file, and if a write operation process for the target file is detected, execute a read operation on the target file after waiting for the blocking time.
8. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the file reading and writing time control method according to any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the method for controlling file reading and writing time according to any one of claims 1 to 6 when executed.
10. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instructions are executed by a processor, the steps of the method for controlling file reading and writing time according to any one of claims 1 to 6 are implemented.