Remote access system for embedded database

By introducing a transaction file server TFS based on network services into the embedded database system, the existing system has been solved, the problems of low cohesion, tight coupling of data and operations, and poor data sharing are achieved, off-site database access and data consistency are improved, and system stability and data security are improved.

CN119829588AActive Publication Date: 2025-04-15BEIJING INST OF COMP TECH & APPL
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202411696670.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-25
Publication Date
2025-04-15
Estimated Expiration
2044-11-25

AI Technical Summary

Technical Problem

The existing embedded database systems have problems such as low cohesion, tight coupling of data and operations, and poor data sharing, which are difficult to meet the needs of off-site access and real-time data backup.

Method used

An embedded database remote access system is designed, and it is implemented through a transaction file server TFS based on network services, including three modules: database operation TFS, data service http and data transmission transport, to realize the separation of data and operations and remote data access.

Benefits of technology

It improves the stability of the system and the security and reliability of data, solves the problem of data consistency between different devices, and realizes off-site database services without requiring a large number of modifications to applications.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119829588A_ABST
    Figure CN119829588A_ABST
Patent Text Reader

Abstract

The invention relates to an embedded database remote access system, and belongs to the technical field of embedded databases. On the basis of a local database management system, operation on a database file is divided into an operation request and an actual operation under a TFS, under the condition that an application program is basically kept unchanged, the operation request of a client side is transmitted to a server side through network service and data transmission, and the server side returns a result after completing corresponding processing. Therefore, remote database service is provided for the client, and a large number of application programs do not need to be modified. Separation of data and operation is achieved, safety and reliability of the data are improved, and the problem of data consistency among different devices is solved by remotely accessing server data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of embedded databases, and in particular relates to a remote access system for embedded databases. Background Art

[0002] With the continuous development of computer hardware and software technology, the demand for data storage and management in embedded systems has gradually become prominent, and the application of embedded database management systems has become more and more extensive. Embedded database management systems mostly use local access mode, which is difficult to meet the needs of remote access and real-time data backup.

[0003] Chinese patent "CN115905406A Data synchronization method, device, equipment and medium based on embedded database" discloses a method for synchronizing embedded database data between two devices. Through a data synchronization tool, the same data operation is performed on the two devices to achieve data synchronization between remote databases.

[0004] The Chinese patent "CN115905406A Data synchronization method, device, equipment and medium based on embedded database" uses external tools to achieve real-time data hot backup between multiple embedded devices, which has the following defects:

[0005] 1) Low cohesion. It uses external tools to achieve communication between multiple embedded databases. The external tools and database management system software are not designed in a unified way. Therefore, the system has low cohesion and it is difficult for external tools to fully utilize the characteristics of the embedded database itself, making it difficult to improve data processing performance.

[0006] 2) Tight coupling of data and operations in 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 between multiple devices. This patent implements data synchronization between remote databases by performing the same data operations on multiple devices. In fact, it saves multiple independent backups on multiple devices. When errors occur in data reading and writing on one device, it will lead to data inconsistency between multiple devices. Summary of the invention

[0008] 1. Technical issues to be resolved

[0009] The technical problem to be solved by the present invention is how to provide an embedded database remote access system to solve the problems of low cohesion, tight coupling of data and operation, and poor data sharing in the prior art.

[0010] (II) Technical solution

[0011] In order to solve the above technical problems, the present invention proposes an embedded database remote access system, which is implemented by a transaction file server TFS based on network services, including three modules: database operation TFS, data service http and data transmission transport;

[0012] The database operation TFS module is used to provide database file operation services, allowing remote users to process database files through the network; in the local access mode of the embedded database, the application calls the runtime library to directly operate the database file, while in the remote access mode, the runtime library submits the operations involving the database file to the transaction file server for processing;

[0013] Data service http module, used to provide remote network services, maintain network services between clients and servers, and support multiple clients accessing the database server at the same time;

[0014] The data transmission transport module is used to provide network data sending and receiving capabilities, establish a TCP connection between the client and the server, execute data sending and termination, and ensure the network transmission of the underlying data.

[0015] (III) Beneficial effects

[0016] The present invention proposes an embedded database remote access system. The present invention designs an embedded database remote access system. Based on a local database management system, the operation on a database file is divided into two parts: an operation request and an actual operation under TFS. When an application program remains basically unchanged, the operation request of a client is transmitted to a server through network services and data transmission. After the server completes corresponding processing, the result is returned, thereby providing a remote database service for the client without a large number of modifications to the application program.

[0017] The present invention provides an embedded database remote access system. Compared with the prior art, the present invention has the advantages of achieving separation of data and operation, improving the security and reliability of data, and solving the problem of data consistency between different devices by remotely accessing server data. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] Figure 1 It is a schematic diagram of the composition of the embedded database management system during remote access of the present invention;

[0019] Figure 2 Access module composition diagram for remote access;

[0020] Figure 3 It is the flow chart of instruction processing module;

[0021] Figure 4Functional composition diagram of TFS module for database operation;

[0022] Figure 5 This is the functional composition diagram of the database network service module;

[0023] Figure 6 This is the functional composition diagram of the data transmission module;

[0024] Figure 7 Flowchart for remote database access. DETAILED DESCRIPTION

[0025] 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.

[0026] The present invention proposes an embedded database remote access system, which builds a network-based data service inside the database management system, provides a client / server working mode for users, and enables users to obtain data management services through the network, thereby solving the existing defects:

[0027] 1) Combining network communication with data services, so that network services and database services are closely integrated, achieving high cohesion of the software and improving system stability;

[0028] 2) Through the client / server model, database data and application data operations are deployed on different devices, realizing the separation of data and operations and improving the security and reliability of data;

[0029] 3) Solved the problem of poor data sharing between different devices. System data is uniformly stored on the server side. Multiple devices access the same server through the network. Any changes in server data will be perceived by all device software, ensuring the consistency of data between multiple devices.

[0030] The present invention is used to construct an embedded database system supporting remote access based on a local database, and the system composition is as shown in the attached figure. Figure 1 As shown, the database system and each application are located on different device nodes that can be connected through a network.

[0031] The system of the present invention is mainly implemented by a transactional file server (TFS) based on network services, 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 as follows.

[0032] The database operation TFS module is used to provide database file operation services, allowing remote users to process database files through the network. In the local access mode of the embedded database, the application calls the runtime library to directly operate the database file, while in the remote access mode, the runtime library submits the operations involving the database file 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 accessing the database server at the same time.

[0034] The data transmission transport module is used to provide network data sending and receiving capabilities, establish a TCP connection between the client and the server, execute data sending and termination, and ensure the network transmission of the underlying data.

[0035] Relying on the above three modules, the local embedded database management system can have the ability of remote access based on the network. At this time, the method of application accessing the database remains unchanged, and the data flow from the application to the database file is as shown in the attached figure. Figure 3 shown.

[0036] Module 1 is "Database Operation TFS", which is responsible for database hard disk reading and writing and security transaction update functions, mainly including: database file processing, transaction log file processing, read-only transaction processing, user login file processing, blocking processing and configuration file processing, as shown in the attached Figure 4 shown.

[0037] 1) Database file processing is responsible for operating database file system files. Database files mainly include data files, index files, variable-length files, blob files and other key files storing database data and 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 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 processing 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) Blocking processing is responsible for processing blocking requests initiated by clients, mainly including table blocking, index blocking, and file blocking;

[0042] 6) Configuration file processing is responsible for managing database configuration files. Configuration files include TFS configuration files and database configuration files. File processing includes operations such as opening, closing, writing and reading.

[0043] Module 2 is "data service http", which provides network service capabilities for embedded database management systems. It mainly includes four components: HTTP basic service, HTTP service parsing, HTTP thread management and remote connection processing. Figure 5 shown.

[0044] 1) HTTP basic service components provide the system with basic HTTP services such as HTTP initialization, termination, start, stop, and shutdown;

[0045] 2) The HTTP service parsing component performs preliminary parsing of the received http request, 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 is used to support the system's support for multiple users, which is mainly supported by three threads. The "http_srv" thread is used to initialize the http service, listen to the given service port, start con_srv, and handle resource recovery after the connection is closed; the "con_srv" thread accepts external connection requests and allocates a new socket and thread (con thread) for the external connection to handle the corresponding transaction; the "con" thread is used to handle specific database request operations, such as opening and closing the database and adding, deleting, modifying, and querying data requests. When the transaction is completed, the thread enters the idle thread pool; when the number of threads is insufficient, a new thread is created to provide services.

[0047] 4) The remote connection processing component is used to process remote service requests, mainly including obtaining http requests, executing corresponding TFS operations for the commands obtained by parsing the URL, encapsulating TFS processing results and outputting processing results.

[0048] Module 3 is "Data transmission transport", which provides the embedded database management system with data transmission capability based on TCP. It implements the functions of transmission start, start monitoring, receive connection, initiate connection, receive data, send data, disconnect and end transmission through the socket mechanism. Figure 6 shown.

[0049] The method realizes remote access based on the network on the basis of local access to the database management system. The remote access working mode based on the method mainly includes two roles: the server and the client.

[0050] The server deploys database service software, which configures TFS to local mode after startup, starts TFS service, listens to the given TFS port, and prepares to receive external connections. After connecting to the outside, it creates a new thread to process data service requests from the client. After executing the service request, it feeds back the execution result to the client, and then continues to wait for new data service requests. The client deploys application software, and the application working mode is almost the same as the local one. It only needs to configure TFS before opening the database, initialize it to remote access mode, and provide the IP address and port number of the server when opening the database. The database opening, closing and data operation interfaces are 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 needs 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. The process is shown in the attached figure. Figure 7 As shown, the client and the server continue to interact in this process, wherein step 5 is the only process for local access, and the remaining steps are new processes for network access.

[0052] The key points of the present invention are:

[0053] The present invention designs an embedded database remote access system. Based on the local database management system, the operation on the database file is divided into two parts: operation request and actual operation under TFS. When the application program remains basically unchanged, the operation request of the client is transmitted to the server through network service and data transmission. The server returns the result after completing the corresponding processing, thereby providing the client with a remote database service without modifying the application program in large quantities.

[0054] Effects of the present invention:

[0055] The present invention provides an embedded database remote access system. Compared with the prior art, the present invention has the advantages of achieving separation of data and operation, improving the security and reliability of data, and solving the problem of data consistency between different devices by remotely accessing server data.

[0056] 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. An embedded database remote access system, characterized in that: The system is implemented through the transaction file server TFS based on network services, including three modules: database operation TFS, data service http and data transmission transport; The database operation TFS module is used to provide database file operation services, allowing remote users to process database files through the network; in the local access mode of the embedded database, the application calls the runtime library to directly operate the database file, while in the remote access mode, the runtime library submits the operations involving the database file to the transaction file server for processing; Data service http module, used to provide remote network services, maintain network services between clients and servers, and support multiple clients accessing the database server at the same time; The data transmission transport module is used to provide network data sending and receiving capabilities, establish a TCP connection between the client and the server, execute data sending and termination, and ensure the network transmission of the underlying data.

2. The embedded database remote access system according to claim 1, characterized in that: The database system and various application programs are located on different device nodes connected through the network.

3. The embedded database remote access system according to claim 1, characterized in that: The database operation TFS module is responsible for database hard disk reading and writing and security transaction updates, including: database file processing, transaction log file processing, read-only transaction processing, user login file processing, blocking processing and configuration file processing; The data service http module provides network service capabilities for the embedded database management system, including four components: HTTP basic service, HTTP service parsing, HTTP thread management and remote connection processing; The data transmission transport module provides the embedded database management system with data transmission capabilities based on TCP, and realizes transmission start, start listening, receive connection, initiate connection, receive data, send data, disconnect and end transmission through the socket mechanism.

4. The embedded database remote access system as claimed in claim 3, characterized in that: Database file processing is responsible for operating database file system files; Transaction log file processing is responsible for operating transaction log files generated during database operations; Read-only transaction processing is responsible for processing read-only transactions initiated by clients; User login file processing is responsible for user management, including creating user files when users log in and deleting files when users log out; Blocking processing is responsible for handling blocking requests initiated by clients, including table blocking, index blocking, and file blocking; Configuration file processing is responsible for managing database configuration files, which include TFS configuration files and database configuration files. File processing includes open, close, write, and read operations.

5. The embedded database remote access system as claimed in claim 4, characterized in that: Database files include data files, index files, variable-length files, blob files, and data dictionary files; the main operations are file creation, opening, closing, writing, reading, moving, and initialization operations.

6. The embedded database remote access system as claimed in claim 4, characterized in that , ,Transaction log file operations include create, open, close, write, read, move, rename, and delete.

7. The embedded database remote access system as claimed in claim 3, characterized in that: HTTP basic service component provides the system with http initialization, termination, start, stop, and shutdown of http services; The HTTP service parsing component performs preliminary parsing of the received http request, including parameter initialization, command validity determination, parameter parsing, saving the obtained parameter information string into the parameter structure, and releasing the parameter function; HTTP thread management component is used to support the system to support 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 the URL, encapsulating TFS processing results, and outputting processing results.

8. The embedded database remote access system as claimed in claim 7, characterized in that: The HTTP thread management component is supported by three types of threads; the "http_srv" thread is used to initialize the http service, listen to the given service port, start con_srv, and handle resource recovery after the connection is closed; the "con_srv" thread accepts external connection requests and allocates a new socket and thread for the external connection to handle the corresponding transaction; the "con" thread is used to handle specific database request operations; when the transaction is completed, the thread enters the idle thread pool; when the number of threads is insufficient, a new thread is created to provide services.

9. The embedded database remote access system as claimed in claim 3, characterized in that: The server deploys database service software, which configures TFS to local mode after startup, starts TFS service, listens to the given TFS port, and prepares to receive external connections. After connecting to the outside, it creates a new thread to process data service requests from the client. After executing the service request, it feeds back the execution result to the client, and then continues to wait for new data service requests. The client deploys application software, and the application working mode is almost the same as the local one. 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 consistent with local access.

10. The embedded database remote access system according to claim 9, characterized in that: 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 and write database files, the runtime library interface will send a request to the server through the TFS remote service and obtain the processing results. During this process, the client and server continue to interact.

Citation Information

Patent Citations

  • Data synchronization method and device based on embedded database, equipment and medium

    CN115905406A

  • Distributed computing dependency management system

    CN113094242A

  • 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