A method to shorten the file writing time in VxWorks7 embedded operating system
By introducing the background cache writing mechanism into the VxWorks7 embedded operating system and optimizing the cache parameters and callback functions of the dosFs file system, the problem of slow file writing speed is solved, the file writing time is significantly shortened, and the hard disk writing speed and system are improved. real-time.
Patent Information
- Application Number
- CN202110949912.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-08-18
- Publication Date
- 2024-08-30
- Estimated Expiration
- 2041-08-18
AI Technical Summary
The VxWorks operating system is slow to write files to the hard disk, affecting the real-time performance of applications. The existing dosFs file system cannot meet the extreme requirements of hard disk access speed.
By setting cache parameters, enabling background writing data, setting the callback function entry address, performing dosFs file system initialization and installing file system search and instantiator functions, the background cache writing mechanism is introduced and the caching mechanism of the dosFs file system is optimized.
It effectively shortens the time for writing files under the VxWorks embedded operating system, increases the hard disk writing speed, and improves the real-time performance of the system.
Smart Images

Figure CN113655962B
Abstract
Description
Technical Field
[0001] The invention belongs to the field of computers, and in particular relates to a method for shortening file writing time under a VxWorks7 embedded operating system. Background Art
[0002] In recent years, with the continuous improvement of hard disk capacity and access speed and the widespread application of VxWorks real-time operating system in multimedia and unmanned fields, more and more "recording" functions have been added in the development of embedded VxWorks operating system applications, writing large amounts of data to the hard disk for playback, backup and monitoring purposes, which puts higher requirements on the write speed of the hard disk.
[0003] VxWorks operating system generally uses rawFs and dosFs file systems for fast storage devices. RawFs treats the entire block device as a large file, does not have a hierarchical view, and has poor flexibility; dosFs file system manages directories, subdirectories, and included files through different levels of settings, has visualization, and supports the allocation of continuous files, high device access efficiency, flexible data management methods, good compatibility, and has been widely used in VxWorks operating system.
[0004] With the upgrading of VxWorks operating system, dosFs file system is also constantly changing. However, with the rapid development of multimedia in recent years and the progress of hard disk in terms of capacity and access speed, the processing of data file records in application development is gradually seeking the limit of hard disk access speed. In this case, the dosFs file system alone still cannot meet the real-time requirements of some application data records. Summary of the invention
[0005] 1. Technical issues to be resolved
[0006] The technical problem to be solved by the present invention is how to provide a method for shortening the file writing time under the VxWorks7 embedded operating system, so as to solve the problem that the VxWorks operating system writes files to the hard disk slowly, affecting the real-time performance of the application.
[0007] (II) Technical solution
[0008] In order to solve the above technical problems, the present invention proposes a method for shortening the file writing time under the VxWorks7 embedded operating system, the method comprising the following steps:
[0009] S1. Set cache parameters;
[0010] S2, set background data write enable;
[0011] S3, set the callback function entry address;
[0012] S4, execute dosFs file system initialization;
[0013] S5. Install file system search and instantiator functions.
[0014] Furthermore, the step S1 specifically includes:
[0015] S11, setting the maximum number of cache files;
[0016] S12, set the cluster cache size;
[0017] S13. Set the data cache size.
[0018] Furthermore, the maximum number of cache files is 20; the cluster cache size is 0x10000; and the data cache size is 0x200000.
[0019] Furthermore, the step S2 includes: setting the backgrndFlushEnabled variable to 1.
[0020] Furthermore, the step S3 specifically includes:
[0021] S31, set the update cache entry descriptor function entry address: hook the dosFsCacheMount function entry address into dosFsCacheMountRtn;
[0022] S32. Set the entry address of the function for creating a hard disk cache: hook the entry address of the dosFsCacheCreate function into the callback function dosFsCacheCreateRtn.
[0023] Furthermore, the dosFsCacheCreate function in step S32 will use the parameter settings in step S1 when executed.
[0024] Furthermore, the step S4 specifically includes:
[0025] S41, passing the parameters in step S1 into the dosFs file system initialization function dosFsInit;
[0026] S42, execute the dosFs file initialization function to reset the file system.
[0027] Furthermore, the step S42 calls the dosFsCacheCreate function in the step S32.
[0028] Furthermore, the step S5 specifically includes:
[0029] S51, installing a file system search function to detect the validity of the file system initialization in step S4;
[0030] S52, install and create dosFs device function;
[0031] S53, execute the callback function dosFsCacheCreateRtn to create the cache mechanism dosFsCacheCreateInternal and the background cache task dosFsCacheFlushTsk.
[0032] Furthermore, the step S52 calls the dosFsCacheMount function in the step S31.
[0033] (III) Beneficial effects
[0034] The present invention proposes a method for shortening the file writing time under the VxWorks7 embedded operating system, which resets the dosFs file system and adds a background cache writing mechanism, effectively solving the speed of writing files to the hard disk in the VxWorks embedded operating system and shortening the execution time of writing files. The present invention improves the hard disk writing speed through the memory cache mechanism and shortens the operation time of writing data to the hard disk. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] Figure 1 Creating a cache mechanism process for the present invention;
[0036] Figure 2 It is a schematic diagram of the method of the present invention. DETAILED DESCRIPTION
[0037] In order to make the purpose, content and advantages of the present invention more clear, the specific implementation methods of the present invention are further described in detail below in conjunction with the drawings and examples.
[0038] The present invention relates to a technical method for shortening the hard disk writing time under the VxWorks7 embedded operating system. The VxWorks7 embedded real-time operating system is an upgraded version of the VxWorks operating system released by Wind River in recent years. Its file system still uses dosFs, which is far from reaching the hard disk limit when writing data to the hard disk. In addition, the frequent non-continuous writing of files makes the hard disk access efficiency very low, and occupies a lot of system time, resulting in the real-time performance of the application software being affected. The present invention proposes a technical method for improving the hard disk writing speed and shortening the operation time of writing data to the hard disk through a memory cache mechanism, thereby solving the problem of long hard disk writing operation time in actual applications, which affects the real-time performance of the system.
[0039] The technical problem to be solved by the present invention is to solve the problem that the VxWorks operating system writes files to the hard disk slowly, thus affecting the real-time performance of the application, on the mainstream dosFs file system of the VxWorks embedded operating system.
[0040] To solve the above problem, the present invention proposes a memory data caching mechanism, which comprises the following steps:
[0041] S1. Set cache parameters;
[0042] S2, set background data write enable;
[0043] S3, set the callback function entry address;
[0044] S4, execute dosFs file system initialization;
[0045] S5. Install file system search and instantiator functions.
[0046] Furthermore, the step S1 includes the following steps:
[0047] S11. Set the maximum number of cache files to 20
[0048] S12, set the cluster cache size to 0x10000
[0049] S13, set the data cache size to 0x200000
[0050] Furthermore, the step S2 comprises the following steps:
[0051] S21, set the background write data enable: set the backgrndFlushEnabled variable to 1
[0052] Furthermore, step S3 includes the following steps:
[0053] S31. Set the update cache entry descriptor function entry address: hook the dosFsCacheMount function entry address into dosFsCacheMountRtn, which will be called in step S52.
[0054] S32, set the entry address of the hard disk cache creation function: hook the entry address of the dosFsCacheCreate function into the callback function dosFsCacheCreateRtn, which will be called during the initialization of the dosFs file system (this step is in S42), and the parameter settings in step S1 will be used when the function is executed.
[0055] Furthermore, the step S4 comprises the following steps:
[0056] S41, passing the parameters in step S1 into the dosFs file system initialization function dosFsInit, which is a system function.
[0057] S42, execute dosFs file initialization function to reset the file system
[0058] Furthermore, the step S5 comprises the following steps:
[0059] S51, installing a file system search function to detect the validity of the file system initialization in step S4;
[0060] S52, install and create dosFs device function;
[0061] S53, execute the callback function dosFsCacheCreateRtn to create the cache mechanism dosFsCacheCreateInternal and the background cache task dosFsCacheFlushTsk.
[0062] Through the above steps, the dosFs file system was reset and a background cache write mechanism was added, which effectively solved the speed of writing files to the hard disk in the VxWorks embedded operating system and shortened the execution time of writing files.
[0063] In combination with the illustrated description, in order to shorten the time for writing files under the VxWorks operating system and improve the speed of writing files, a background cache mechanism is created to solve this problem. The content of the present invention is further described below.
[0064] 1. Set cache parameters
[0065] S11. Set the maximum number of cache files to 20
[0066] S12, set the cluster cache size to 0x10000
[0067] S13, set the data cache size to 0x200000
[0068] 2. Set background data write enable
[0069] 3. Set the callback function entry address
[0070] S31, set update cache entry descriptor function entry address
[0071] S32, set the entry address of the function to create the hard disk cache
[0072] 4. Execute dosFs file initialization.
[0073] S41, pass the parameters in step S1 into the dosFs file initialization function
[0074] S42, execute dosFs file initialization function to reset the file system
[0075] 5. Install file system search and instantiator functions
[0076] S51, installing a file system search function to detect the validity of the file system initialization in step S4;
[0077] S52, install and create dosFs device function;
[0078] S53, executing the callback function to create a cache mechanism and background cache tasks.
[0079] By using the above technical solution, the above operation steps are added to the VxWorks operating system for execution, successfully solving the problem of long execution time for writing files.
[0080] The present invention belongs to a technical method for shortening the execution time of writing files in a VxWorks operating system and improving the speed of writing files. The characteristics of the present invention are: first, adopting the dosFs file system format; second, introducing a cache mechanism; and third, creating a background hard disk writing task.
[0081] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the technical principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A method for shortening the file writing time under the VxWorks7 embedded operating system, characterized in that: The method comprises the following steps: S1. Set cache parameters; S2, set background data write enable; S3, set the callback function entry address; S4, execute dosFs file system initialization; S5, install file system search and instantiator functions; in, The step S1 specifically includes: S11, setting the maximum number of cache files; S12, set the cluster cache size; S13, setting data cache size; The step S3 specifically includes: S31, set the update cache entry descriptor function entry address: hook the dosFsCacheMount function entry address into dosFsCacheMountRtn; S32, setting the entry address of the hard disk cache creation function: hooking the entry address of the dosFsCacheCreate function into the callback function dosFsCacheCreateRtn; The step S4 specifically includes: S41, passing the parameters in step S1 into the dosFs file system initialization function dosFsInit; S42, executing the dosFs file initialization function to reset the file system; The step S5 specifically includes: S51, installing a file system search function to detect the validity of the file system initialization in step S4; S52, install and create dosFs device function; S53, execute the callback function dosFsCacheCreateRtn to create the cache mechanism dosFsCacheCreateInternal and the background cache task dosFsCacheFlushTsk.
2. The method for shortening the file writing time under the VxWorks7 embedded operating system as claimed in claim 1, characterized in that: The maximum number of cache files is 20; the cluster cache size is 0x10000; and the data cache size is 0x200000.
3. The method for shortening the file writing time under the VxWorks7 embedded operating system as claimed in claim 1, characterized in that: The step S2 includes: setting the backgrndFlushEnabled variable to 1.
4. The method for shortening the file writing time under the VxWorks7 embedded operating system as claimed in claim 1, characterized in that: The dosFsCacheCreate function in step S32 will use the parameter settings in step S1 when executed.
5. The method for shortening the file writing time under the VxWorks7 embedded operating system as claimed in claim 1, characterized in that: The step S42 calls the dosFsCacheCreate function in the step S32.
6. The method for shortening the file writing time under the VxWorks7 embedded operating system as claimed in claim 1, characterized in that: The step S52 calls the dosFsCacheMount function in the step S31.
Citation Information
Patent Citations
VxWorks-operating-system-based file storage structure and storage method
CN102521410A
Data access control method of block device of VxWorks system driver layer
CN104318152A
