A data reading and writing method based on layered shelf storage structure
Through the layered shelf storage structure and dynamic loading of data reading and writing function boxes, the problem of limited data reading capacity of domestic controllers in aircraft assembly is solved, efficient and stable data transmission and reading and writing are achieved, and the application of domestic systems is supported.
Patent Information
- Application Number
- CN202210712813.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-22
- Publication Date
- 2025-09-09
- Estimated Expiration
- 2042-06-22
AI Technical Summary
Domestic programmable controllers and servo control systems have problems with limited data reading, data loss and errors in aircraft digital assembly, which affect production progress and economic losses. In addition, the communication API interface has a single function and is not very versatile.
It adopts a layered shelf storage structure and constructs a multi-layer storage unit group. Each layer stores different data read and write function boxes. The required boxes are dynamically loaded and called to achieve large-scale data processing and transmission, reduce memory usage, and improve read and write efficiency and stability.
It achieves accurate and stable communication between the user's PC and the motion controller, reduces memory usage, improves data reading and writing speed and compatibility, and supports the application of domestically produced systems in aircraft assembly.
Smart Images

Figure HDA0003708673080000011 
Figure HDA0003708673080000012 
Figure HDA0003708673080000021
Abstract
Description
Technical Field
[0001] The present invention relates to the field of software technology, in particular to a data reading and writing method based on a layered shelf type storage structure. Background Art
[0002] Component assembly is a crucial step in the aircraft manufacturing process, largely determining the aircraft's final quality, manufacturing costs, and development cycle. It is the most critical technology in the entire aircraft manufacturing process. With the development of my country's aviation industry, aircraft assembly has achieved digital rapid docking and assembly, integrating applications such as aircraft digital measurement, attitude alignment platforms, industrial robots, and CNC positioners. However, the attitude alignment control system is currently restricted by foreign brands, posing a risk of control during subsequent maintenance upgrades. Domestic application is urgently needed.
[0003] With the increasingly urgent need to domesticate aviation weapon systems, domestically produced programmable logic controllers (PLCs) and servo control systems are increasingly being used in the digital, flexible assembly of aircraft. However, domestically produced controllers are generally characterized by a wide variety of types, a late start, and low maturity. The communication APIs they provide are limited in functionality and the amount of data they can read at a time is limited. Faced with the constant flow of data input and output at the assembly site, data loss and errors often occur when reading and writing large amounts of data in real time, resulting in limited versatility. If data transmission and control issues arise during the automated assembly of aircraft, production progress can be severely impacted, resulting in unforeseen economic losses. This issue severely restricts the application of domestically produced systems in the aircraft assembly field. Therefore, to address the current situation, it is necessary to implement secure data reading and writing on the user's PC and design an efficient data reading and writing method to ensure the correctness and stability of data transmission. Summary of the Invention
[0004] The purpose of the present invention is to overcome the above-mentioned shortcomings in the prior art and provide a data reading and writing method based on a layered shelf storage structure. By constructing a multi-layer shelf, different layers store different data reading and writing function boxes. When reading and writing data, only the required boxes on the shelf are selected and loaded into the memory for calling according to needs, so as to realize dynamic loading. It can reduce memory usage while realizing large-scale data processing, storage and transmission, improve reading and writing efficiency, and be compatible with different data storage devices. It can completely solve the shortcomings of the prior art, ensure the accuracy and stability of communication between the user's PC and the motion controller, and provide strong support for the application of domestically produced PLC and servo systems in aircraft digital assembly.
[0005] The data reading and writing method based on the hierarchical shelf storage structure is characterized in that the method is applied to a hierarchical storage architecture object, the hierarchical storage architecture object includes a shelf and a storage unit box; each layer of the shelf is a storage unit group, and each layer contains a number of independent basic storage unit boxes; the storage unit boxes are placed side by side in sequence; the hierarchical shelf storage structure contains at least one layer, the storage unit groups are arranged in parallel from top to bottom, the Nth layer of the shelf is the Nth layer storage unit group, N is a positive integer, the access priority layer decreases in sequence with the increase of the number of shelf layers, the storage unit groups of different layers of the shelf transmit the storage unit address to be accessed through the I / O address bus, the access relationship between layers follows the high-level access to the low-level, and each layer only has an access relationship with the adjacent layer, and cannot cross layers.
[0006] Preferably, the first-tier storage unit group is the storage layer closest to user PC applications, possessing the highest access priority. It is used to store general-purpose programs for reading and writing data and includes an information storage area and an information sharing area. The information storage area comprises several independent basic storage unit boxes, each of which stores a general-purpose program code that calls a program in the information storage area of the next-tier (second-tier) storage unit group. The information sharing area stores the loading code for the first-tier storage unit group. The loading code is binary, with the number of bits in the loading code matching the number of basic storage unit boxes in the first-tier storage unit group. Each bit in the binary loading code represents whether each basic storage unit box is called: 1 for called, 0 for not called. When in use, the user PC selects the required general-purpose program code from the first-tier storage unit group, generates the loading code, and stores it in the information sharing area to implement the desired function. The program code is modularly defined according to different functions to ensure unique input and output, and to avoid infinite loops. The user PC can only access the first-tier storage units via the I / O address bus, while the first-tier storage unit group can only access the next-tier (second-tier) storage unit group via the I / O address bus.
[0007] Preferably, the second-tier storage unit group is a connecting layer between the upper-tier (first-tier) storage unit group and the lower-tier (third-tier) storage unit group, and includes an information storage area and an information sharing area. The information storage area contains several independent basic storage unit boxes, each of which stores a program code for calling a program in the information storage area of the lower-tier (third-tier) storage unit group. The information sharing area stores the loading code for the second-tier storage unit group. The loading code is binary, with the number of bits matching the number of basic storage unit boxes in the second-tier storage unit group. Each bit represents whether each basic storage unit box is called, with 1 indicating a call and 0 indicating no call. The program code in the information storage area of the second-tier storage unit group is only callable by the first-tier storage unit group. The information required for program execution in the information storage area of the second-tier storage unit group is stored in the lower-tier (third-tier) storage unit group. The program code is modularly defined according to different functions to ensure unique input and output and the absence of dead loops. The second-layer storage unit group can only communicate with the upper-layer (first-layer) storage unit group and the lower-layer (third-layer) storage unit group through the I / O address bus.
[0008] Preferably, the Mth-tier storage unit group is the lowest-tier storage unit group on the shelf, where M is a positive integer greater than 2. This implements hardware-oriented data relationship establishment and includes an information storage area and an information sharing area. The information storage area contains several independent basic storage unit boxes, each of which stores an address mapping table, a data entity table, and a data status table for a hardware category. The address mapping relationships in the address mapping table are derived from hardware definitions; different hardware may establish different address mapping tables, linking addresses to data entities. The data entity table is used to store data type identifiers, value attributes, and relationships between data; and the data status table is used to store records of data query, insertion, deletion, and modification operations. The information sharing area stores the loading code for the Mth-tier storage unit group. The loading code is binary, with the number of bits matching the number of basic storage unit boxes in the Mth-tier storage unit group. Each bit represents whether each basic storage unit box is called, with 1 indicating called and 0 indicating not called. The program code in the information storage area of the Mth-tier storage unit group is only callable by the M-1th-tier storage unit group. The information required for program execution in the information storage area of the Mth-tier storage unit group is stored in the underlying hardware. The M-th layer storage unit group can only communicate with the upper layer (M-1 layer) storage unit group and the underlying hardware through the I / O address bus.
[0009] Preferably, the program code is modularly defined according to different functions to ensure unique input and output and the absence of dead loops.
[0010] Since different types of data occupy different spaces in the storage units of different hardware, and many hardware manufacturers have incomplete development of communication interfaces for PC applications, the quality and efficiency of soft component reading are unstable. The data reading and writing method based on the layered shelf storage structure limits the diversity of reading and writing to the bottom layer of the shelf. From the software level, the first-level storage unit group adopts secondary encapsulation to ensure the efficiency of data reading when there are many library categories and the data reading method is single data reading; the second-level storage unit group provides a read and write interface for the link device, and for addresses that cannot be linked, with the help of static link libraries and dynamic link libraries, it is possible to directly read the data at the address; the bottom-level storage unit group can realize the storage of address information and data values; by continuously adding shelves, the reading and writing stability of multi-type large-volume data for different hardware can be improved; through dynamic loading of shelf storage areas, it is possible to reduce memory usage and increase reading and writing speeds.
[0011] Compared with the prior art, the present invention has the following beneficial effects:
[0012] 1. The data reading and writing method based on the hierarchical shelf storage structure proposed in this invention performs hierarchical processing on the communication process between the user's PC and the underlying hardware. This allows for dynamic loading of programs based on the needs of the user's PC, establishing accurate and stable communication between the user's PC and the underlying hardware, while reducing memory usage and improving reading and writing speeds.
[0013] 2. The shelf constructed using this method can meet the different data reading and writing needs of technicians, and the encapsulated read and write interface has high portability and high reliability. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] Figure 1 A schematic diagram of a layered shelf storage structure provided in an embodiment of the present application;
[0015] Figure 2 A schematic diagram of calling different levels of shelves provided in an embodiment of the present application;
[0016] Figure 3 A flowchart of shelf establishment provided in an embodiment of the present application;
[0017] Figure 4 This is an implementation diagram provided for an embodiment of the present application. DETAILED DESCRIPTION
[0018] The present invention will be further described in detail below in conjunction with test examples and specific embodiments. However, this should not be understood as limiting the scope of the present invention to the following embodiments, and all technologies implemented based on the present invention fall within the scope of the present invention.
[0019] Example 1
[0020] In actual application scenarios, the user's PC software needs to communicate data with the hardware of a domestic manufacturer to implement batch reading and writing operations of different data types. The following describes in detail how to apply the "data reading and writing method based on a layered shelf storage structure" of the present invention to achieve accurate and stable data reading and writing while improving work efficiency.
[0021] like Figure 1 As shown, the layered shelf storage structure of the present invention includes a first-layer storage unit group, a second-layer storage unit group, and so on to the Nth-layer storage unit group. In this embodiment, the implementation process is described by taking the simplest three-layer shelf as an example. The I / O read and write relationship diagram of the storage unit groups of different layers of the present invention is shown in FIG. Figure 2 As shown, the user PC accesses the general program code in the first-level storage unit group, and the first-level storage unit group calls the execution program of the information storage area in the second-level storage unit group. In this embodiment, the second-level storage unit group accesses the address mapping table, data entity table and data status table of the information storage area in the third-level storage unit group.
[0022] According to the data reading and writing method based on the layered shelf storage structure provided by the present invention, the implementation process is as follows: Figure 3 、 Figure 4 As shown, the details are as follows:
[0023] Step 1: According to the data reading and writing requirements and combined with the hardware data storage characteristics, establish an address mapping table, a data entity table and a data status table. The address mapping relationship in the address mapping table is derived from the hardware definition. Different hardware can establish different address mapping tables to connect the relationship between addresses and data entities; the data entity table is used to store the type identification, value attributes and associations between data; the data status table is used to store records of data query, insertion, deletion and modification operations.
[0024] Step 2: Configure the index structure for data reading and writing based on hardware characteristics;
[0025] Step 3: Perform hardware read and write tests. The read and write tests need to cover as many read and write situations as possible, including data types and data volumes.
[0026] Step 4: Load into the shelf;
[0027] Step 5: Initialize all loading codes to 0, that is, all programs are not loaded by default and do not occupy memory;
[0028] Step 6: Determine the loading code according to the needs of the PC. The loading code is binary, and the number of bits is consistent with the number of basic storage unit boxes in the storage unit group. Each bit represents whether each basic storage unit box is called, 1 represents called, and 0 represents not called;
[0029] Step 7: Load the program's encoding file according to the loading code;
[0030] Step 8: Link and compile the loaded code to generate an externally callable library;
[0031] Step nine, call the external library;
[0032] Step 10: Read and write data
[0033] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A data reading and writing method based on a layered shelf storage structure, characterized in that: The method is applied to a hierarchical storage architecture object, wherein the hierarchical storage architecture object includes a shelf and a storage unit box; each layer of the shelf is a storage unit group, and each layer contains a plurality of independent basic storage unit boxes; the storage unit boxes are arranged side by side in sequence; the hierarchical shelf storage structure includes at least one layer, and the storage unit groups are arranged in parallel from top to bottom. The Nth layer of the shelf is the Nth layer of storage unit group, where N is a positive integer, and the access priority layer decreases as the number of shelf layers increases. The storage unit groups of different layers of the shelf transmit the storage unit addresses to be accessed via an I / O address bus, and the access relationship between layers follows the principle that the higher layer accesses the lower layer, and each layer only has an access relationship with the adjacent layer, and cross-layer access is not allowed; The data reading and writing process can be summarized as follows: First, according to the data reading and writing requirements, combined with the hardware data storage characteristics, establish an address mapping table, a data entity table and a data status table. The address mapping relationship in the address mapping table comes from the hardware definition. Different hardware can establish different address mapping tables to connect the relationship between addresses and data entities. The data entity table is used to store the type identification, value attributes and associations between data. The data status table is used to store records of data query, insertion, deletion and modification operations; secondly, according to the hardware characteristics, configure the index structure of data reading and writing, and then perform hardware Read and write test, the read and write test needs to cover as many reading and writing situations as possible, including data type and data amount, load the shelf, initialize all loading codes to 0, that is, all programs are in the default state of not loading and do not occupy memory; finally, according to the needs of the PC, determine the loading code, the loading code is binary, and the number of bits is consistent with the number of basic storage unit boxes in the storage unit group. Each bit represents whether each basic storage unit box is called, 1 represents call, and 0 represents not call. According to the loading code, the program encoding file is loaded, the loaded code is linked and compiled, and an externally callable library is generated to complete the reading and writing of data.
2. A data reading and writing method based on a layered shelf storage structure as described in claim 1, characterized in that: The first layer of storage unit groups on the shelf stores general programs with data reading and writing functions. The first layer of storage unit groups uses secondary encapsulation and has the highest access priority layer. The first layer of storage unit groups, used for storing general programs for data reading and writing, is the storage layer closest to user applications. The first-layer storage unit group includes an information storage area and an information sharing area. The information storage area includes several independent basic storage unit boxes, each storage unit box stores a general program code for calling a program in the information storage area in the next-layer storage unit group; the information sharing area stores the loading code of the first-layer storage unit group. The loading code is binary, and the number of bits of the loading code is consistent with the number of basic storage unit boxes in the first-layer storage unit group. Each bit of the binary loading code represents whether each basic storage unit box is called, 1 represents call, and 0 represents not call.
3. A data reading and writing method based on a layered shelf storage structure as described in claim 2, characterized in that: The second-layer storage unit group in the storage unit group is a connection layer between the upper-layer storage unit group and the lower-layer storage unit group, and has a secondary access priority layer. The second-layer storage unit group of the shelf executes the universal program code in the first-layer storage unit group, provides a read and write interface for the link device, and is oriented to addresses that cannot be linked. With the help of static link libraries and dynamic link libraries, it can directly read data from addresses that cannot be linked; The second-layer storage unit group includes an information storage area and an information sharing area. The information storage area includes a plurality of independent basic storage unit boxes. Each storage unit box stores a program code for calling a program in the information storage area of the next-layer storage unit group. The information sharing area stores a loading code of the second-layer storage unit group. The loading code is binary, and the number of bits is consistent with the number of basic storage unit boxes in the second-layer storage unit group. Each bit represents whether each basic storage unit box is called, 1 represents called, and 0 represents not called. The program codes in the information storage area of the second-level storage unit group are only called by the first-level storage unit group, and the information required for program execution in the information storage area of the second-level storage unit group is reflected in the next-level storage unit group.
4. A data reading and writing method based on a layered shelf storage structure as described in claim 1, characterized in that: The M-th layer storage unit group is the bottom layer storage unit group of the shelf, where M is a positive integer greater than 2, and implements hardware-oriented data relationship establishment. The bottom layer of the shelf stores the address mapping table, data entity table, and data status table required for the execution of the subroutine of the upper layer, and can obtain storage address information and data values; The M-th layer storage unit group includes an information storage area and an information sharing area; the information storage area includes a plurality of independent basic storage unit boxes, each of which stores an address mapping table, a data entity table, and a data status table for a category of hardware; the address mapping relationship in the address mapping table is derived from the hardware definition, and different hardware can establish different address mapping tables to connect the relationship between addresses and data entities; the data entity table is used to store data type identification, value attributes, and associations between data; The data status table is used to store records of data query, insertion, deletion, and modification operations. The information sharing area stores the loading code of the M-th layer storage unit group. The loading code is binary, and the number of bits is consistent with the number of basic storage unit boxes in the M-th layer storage unit group. Each bit represents whether each basic storage unit box is called, 1 represents called, and 0 represents not called; The program codes in the information storage area of the M-th layer storage unit group are only called by the M-1-th layer storage unit group, and the information required for program execution in the information storage area of the M-th layer storage unit group is embodied in the underlying hardware.
5. A data reading and writing method based on a layered shelf storage structure as described in claim 3, characterized in that: The program code and the general program code are modularly defined according to different functions to ensure unique input and output and the absence of dead loops.
Citation Information
Patent Citations
Performance optimization method and device for inter-process large-data-volume communication
CN110716814A