An Embedded Database Remote Access System
By introducing a Transaction File Server (TFS) with network services into an embedded database system, the separation of data and operations is achieved, solving the problems of low cohesion, tight data coupling, and poor data sharing in existing technologies, and improving the stability and data consistency of the system.
Patent Information
- Application Number
- CN202411696670.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-25
- Publication Date
- 2025-10-31
- Estimated Expiration
- 2044-11-25
AI Technical Summary
Existing embedded database management systems suffer from low cohesion, tight coupling between data and operations, and poor data sharing, making it difficult to meet the needs of remote access and real-time data backup.
An embedded database remote access system is built using a transactional file server (TFS) based on network services. It includes three modules: database operation TFS, data service HTTP, and data transmission transport. This enables network communication and data transmission between the client and the server, and separates database data operations from application data operations.
It improves system stability and data security and reliability, solves the data consistency problem between different devices, and enables remote access and real-time data backup.
Smart Images

Figure CN119829588B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of embedded database technology, and specifically relates to an embedded database remote access system. Background Technology
[0002] With the continuous development of computer hardware and software technology, the demand for data storage and management in embedded systems has become increasingly prominent, leading to the widespread application of embedded database management systems. However, embedded database management systems often employ local access modes, which are insufficient to meet the needs of remote access and real-time data backup.
[0003] Chinese patent "CN115905406A Data Synchronization Method, Apparatus, Device and Medium Based on Embedded Database" discloses a method for synchronizing embedded database data between two devices. By using a data synchronization tool, the same data operations are performed on the two devices to achieve data synchronization between databases in different locations.
[0004] Chinese patent "CN115905406A Data Synchronization Method, Apparatus, Device and Medium Based on Embedded Database" achieves real-time hot backup of data between multiple embedded devices through external tools, but it has the following drawbacks:
[0005] 1) Low cohesion. It achieves communication between multiple embedded databases through external tools. The external tools and the database management system software are not designed in a unified manner. Therefore, the system has low cohesion, and the external tools can hardly give full play to the characteristics of the embedded database itself, making it difficult to improve data processing performance.
[0006] 2) Tight coupling of data and operations in the application software. In the implementation scheme of this patent, the database management system and the application software are located on the same device, and the data generated by the application software is closely related to the operations on the database, which reduces the security and reliability of the data in the system;
[0007] 3) Poor data sharing among multiple devices. This patent achieves data synchronization between geographically dispersed databases by performing the same data operations on multiple devices. In reality, it saves multiple independent backups on multiple devices. However, if an error occurs during data read / write on one device, it will lead to inconsistencies in the data across multiple devices. Summary of the Invention
[0008] (a) Technical problems to be solved
[0009] The technical problem to be solved by this invention is how to provide an embedded database remote access system to solve the problems of low cohesion, tight coupling between data and operation, and poor data sharing in the prior art.
[0010] (II) Technical Solution
[0011] To address the aforementioned technical problems, this invention proposes an embedded database remote access system. This system is implemented through a transactional file server (TFS) based on network services and includes three modules: database operation TFS, data service HTTP, and data transmission transport.
[0012] The TFS module for database operations provides database file operation services, allowing remote users to process database files over the network. In the embedded database local access mode, the application calls the runtime library to directly operate on the database files, while in the remote access mode, the runtime library submits operations involving database files to the transaction file server for processing.
[0013] The data service HTTP module is used to provide remote network services, maintain network services between clients and servers, and support multiple clients to access the database server simultaneously.
[0014] The data transmission transport module provides network data sending and receiving capabilities, establishing TCP connections between the client and server, executing data sending and termination, and ensuring the network transmission of underlying data.
[0015] (III) Beneficial Effects
[0016] This invention proposes an embedded database remote access system. Based on a local database management system, the system divides database file operations into two parts: operation requests and actual operations under TFS. While keeping the application essentially unchanged, the system transmits the client's operation requests to the server via network services and data transmission. After the server completes the corresponding processing, it returns the results, thereby providing remote database services to the client without requiring extensive modifications to the application.
[0017] This invention provides an embedded database remote access system. Compared with the prior art, the advantages of this invention are: it realizes the separation of data and operation, improves the security and reliability of data, and solves the data consistency problem between different devices by accessing server data remotely. Attached Figure Description
[0018] Figure 1 This is a schematic diagram of the embedded database management system for remote access in this invention;
[0019] Figure 2 Diagram showing the components of the remote access module;
[0020] Figure 3 Here is the flowchart for the instruction processing module;
[0021] Figure 4A functional diagram of the TFS module for database operations;
[0022] Figure 5 A functional composition diagram of the database network service module;
[0023] Figure 6 A functional composition diagram of the data transmission module;
[0024] Figure 7 This is a flowchart for remote database access. Detailed Implementation
[0025] To make the objectives, contents, and advantages of the present invention clearer, the specific embodiments of the present invention will be described in further detail below with reference to the accompanying drawings and examples.
[0026] This invention proposes an embedded database remote access system. This system builds a network-based data service within the database management system, providing users with a client / server working mode, enabling users to access data management services via the network, thus overcoming existing shortcomings.
[0027] 1) Combining network communication with data services tightly integrates network services with database services, achieving high software cohesion and improving system stability;
[0028] 2) By using a client / server model, database data and application data operations are deployed on different devices, achieving separation of data and operations and improving data security and reliability;
[0029] 3) It solves the problem of poor data sharing between different devices. System data is stored uniformly on the server side, and multiple devices access the same server through the network. Any changes to the server data will be detected by the software of all devices, ensuring data consistency among multiple devices.
[0030] This invention relates to an embedded database system that supports remote access, built upon a local database. The system components are shown in the attached figure. Figure 1 As shown, the database system and various applications are located on different device nodes that can be connected via a network.
[0031] The system of this invention is mainly implemented through a network-based transactional file server (TFS), including three modules: database operation TFS, data service HTTP, and data transmission transport. Its architecture is shown in the attached figure. Figure 2 As shown, the main functions of these three modules are summarized below.
[0032] The TFS module for database operations provides database file operation services, allowing remote users to process database files over a network. In embedded database local access mode, the application directly manipulates the database files by calling the runtime library. In remote access mode, the runtime library submits database file operations to the transaction file server for processing.
[0033] The data service HTTP module is used to provide remote network services, maintain network services between clients and servers, and support multiple clients to access the database server simultaneously.
[0034] The data transmission transport module provides network data sending and receiving capabilities, establishing TCP connections between the client and server, executing data sending and termination, and ensuring the network transmission of underlying data.
[0035] Based on the above three modules, the local embedded database management system can achieve remote access capability via a network. The method by which the application accesses the database remains unchanged, while the data flow from the application to the database file is as follows: Figure 3 As shown.
[0036] Module 1, "Database Operations TFS," is responsible for database disk read / write and secure transaction updates. It mainly includes: database file processing, transaction log file processing, read-only transaction processing, user login file processing, lock handling, and configuration file processing, as shown in the attached document. Figure 4 As shown.
[0037] 1) Database file processing is responsible for manipulating database file system files. Database files mainly include data files, index files, variable-length files, blob files, and other key files that store database data, as well as data dictionary files; the main operations include file creation, opening, closing, writing, reading, moving, and initialization.
[0038] 2) Transaction log file processing is responsible for operating on the transaction log files generated during database operations, mainly including operations such as creation, opening, closing, writing, reading, moving, renaming, and deleting;
[0039] 3) Read-only transaction processing is responsible for handling read-only transactions initiated by the client;
[0040] 4) User login file processing is responsible for user management, including creating user files when users log in and deleting files when users log out;
[0041] 5) Lock handling is responsible for handling client-initiated lock requests, mainly including table locks, index locks, and file locks;
[0042] 6) Configuration file handling is responsible for managing database configuration files, including TFS configuration files and database configuration files. File handling includes operations such as opening, closing, writing, and reading.
[0043] Module Two, "Data Service (HTTP)," provides network service capabilities for the embedded database management system. It mainly includes four components: basic HTTP services, HTTP service parsing, HTTP thread management, and remote connection handling, as shown in the attached diagram. Figure 5 As shown.
[0044] 1) The HTTP basic service component provides the system with basic HTTP services such as HTTP initialization, termination, startup, stop, and shutdown;
[0045] 2) The HTTP service parsing component performs preliminary parsing of the received HTTP requests, mainly including parameter initialization, command validity determination, parameter parsing, saving the obtained parameter information string into the parameter structure, and releasing parameters.
[0046] 3) The HTTP thread management component supports multi-user operation, primarily through three types of threads. The "http_srv" thread initializes the HTTP service, listens on the given service port, starts the con_srv thread, and handles resource cleanup after connection closure. The "con_srv" thread accepts external connection requests and allocates a new socket and thread (con thread) to handle the corresponding transactions. The "con" thread handles specific database request operations, such as opening and closing the database and performing CRUD (Create, Read, Update, Delete) data requests. After a transaction is completed, the thread enters the idle thread pool; if the number of threads is insufficient, new threads are created to provide service.
[0047] 4) The remote connection processing component is used to process remote service requests. It mainly includes obtaining HTTP requests, executing corresponding TFS operations for commands obtained by parsing the URL, encapsulating TFS processing results, and outputting processing results.
[0048] Module 3, "Data Transmission Transport," provides TCP-based data transmission capabilities for the embedded database management system. It utilizes a socket mechanism to implement functions such as transmission initiation, listening, connection reception, connection initiation, data reception, data transmission, connection termination, and transmission termination, as shown in the attached diagram. Figure 6 As shown.
[0049] This method enables remote access via a network, building upon local access to the database management system. The remote access working mode based on this method mainly includes two roles: server and client.
[0050] The server deploys database service software. After starting, this software configures TFS to local mode, starts the TFS service, listens on the given TFS port, and prepares to accept external connections. Upon connecting to an external connection, it creates a new thread to handle data service requests from clients. After executing the service request, it sends the result back to the client and then continues to wait for new data service requests. The client deploys application software. The application's operating mode is almost identical to local access. It only needs to configure TFS before opening the database, initializing it to remote access mode, and providing the server's IP address and port number when opening the database. The database opening, closing, and data operation interfaces are all consistent with local access.
[0051] In remote access mode, after the client and server establish a connection, the client uses the interface provided by the runtime library to operate the database. When it is necessary to read or write database files, the runtime library interface sends a request to the server through the TFS remote service and obtains the processing result. This process is shown in the attached figure. Figure 7 As shown, the client and server continuously interact during this process. Step 5 is the only process for local access, while the remaining steps are new processes for network access.
[0052] Key points of this invention:
[0053] This invention designs an embedded database remote access system. Based on a local database management system, the operation on the database file is divided into two parts: operation request and actual operation under TFS. With the application basically unchanged, the operation request of the client is transmitted to the server through network service and data transmission. After the server completes the corresponding processing, it returns the result, thereby providing remote database service to the client without extensive modification of the application.
[0054] Effects of the invention:
[0055] This invention provides an embedded database remote access system. Compared with the prior art, the advantages of this invention are: it realizes the separation of data and operation, improves the security and reliability of data, and solves the data consistency problem between different devices by accessing server data remotely.
[0056] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the technical principles of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.
Claims
1. An embedded database remote access system, characterized in that, The system is implemented through a transactional file server (TFS) based on network services, and includes three modules: database operations (TFS), data services (HTTP), and data transfer (transport). The TFS module for database operations provides database file operation services, allowing remote users to process database files over the network. In the embedded database local access mode, the application calls the runtime library to directly operate on the database files, while in the remote access mode, the runtime library submits operations involving database files to the transaction file server for processing. The data service HTTP module is used to provide remote network services, maintain network services between clients and servers, and support multiple clients to access the database server simultaneously. The data transmission transport module provides network data sending and receiving capabilities, establishes TCP connections between the client and server, performs data sending and termination, and ensures the network transmission of underlying data. in, The TFS module for database operations is responsible for database disk read / write and secure transaction updates, including: database file processing, transaction log file processing, read-only transaction processing, user login file processing, locking handling, and configuration file processing; The data service HTTP module provides network service capabilities for the embedded database management system, including four components: basic HTTP services, HTTP service parsing, HTTP thread management, and remote connection processing. The data transmission transport module provides TCP-based data transmission capabilities for the embedded database management system, and implements transmission initiation, listening, connection acceptance, connection initiation, data reception, data transmission, connection termination, and transmission termination through the socket mechanism; The HTTP basic service component provides the system with HTTP initialization, termination, startup, stop, and shutdown functions for HTTP services. The HTTP service parsing component performs preliminary parsing of received HTTP requests, including parameter initialization, command validity determination, parameter parsing, saving the obtained parameter information string into the parameter structure, and parameter release. The HTTP thread management component is used to support system support for multiple users; The remote connection processing component is used to process remote service requests, including obtaining HTTP requests, executing corresponding TFS operations for commands obtained by parsing URLs, encapsulating TFS processing results, and outputting processing results. The HTTP thread management component is supported by three types of threads: the "http_srv" thread is used to initialize the HTTP service, listen on the given service port, start con_srv, and handle resource reclamation after the connection is closed; the "con_srv" thread accepts external connection requests and allocates a new socket and thread for each external connection to handle the corresponding transaction; the "con" thread is used to handle specific database request operations; after the transaction is completed, the thread enters the idle thread pool; when the number of threads is insufficient, new threads are created to provide services.
2. The embedded database remote access system as described in claim 1, characterized in that, The database system and various applications reside on different device nodes connected via a network.
3. The embedded database remote access system as described in claim 1, characterized in that, Database file processing is responsible for manipulating database file system files; The transaction log file processing is responsible for handling the transaction log files generated during database operations; Read-only transaction processing is responsible for handling read-only transactions initiated by the client. User login file processing is responsible for managing users, including creating user files when users log in and deleting files when users log out. The locking mechanism is responsible for handling client-initiated locking requests, including table locking, index locking, and file locking. The configuration file handling is responsible for managing database configuration files, including TFS configuration files and database configuration files. File handling includes open, close, write, and read operations.
4. The embedded database remote access system as described in claim 3, characterized in that, Transaction log file operations include creating, opening, closing, writing, reading, moving, renaming, and deleting.
5. The embedded database remote access system as described in claim 1, characterized in that, The server deploys database service software. After starting, the software configures TFS to local mode, starts the TFS service, listens on the given TFS port, and prepares to receive external connections. After connecting to an external connection, it creates a new thread to handle data service requests from clients. After executing the service request, it sends the execution result back to the client and then continues to wait for new data service requests. The client deploys application software. The application's working mode is almost identical to local access. It only needs to configure TFS before opening the database, initialize it to remote access mode, and provide the server's IP address and port number when opening the database. The database opening, closing, and data operation interfaces are all consistent with local access.
6. The embedded database remote access system as described in claim 5, characterized in that, In remote access mode, after the client and server establish a connection, the client and server continuously interact: the client uses the interface provided by the runtime library to operate the database, and when it is necessary to read or write database files, the runtime library interface will send a request to the server through the TFS remote service and obtain the processing result.
Citation Information
Patent Citations
Data synchronization method and device based on embedded database, equipment and medium
CN115905406A
Database access test micro-service method and system based on micro-service architecture
CN117493201A
Method and device for checking a network supporting WAP terminals
WO2002067546A1