Method and system for data storage and read management based on SQLite

CN116821947BActive Publication Date: 2026-10-23HUIZHIAN INFORMATION TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202211578701.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-05
Publication Date
2026-10-23
Estimated Expiration
2042-12-05

AI Technical Summary

Technical Problem

计算机等用户端自身兼容支持的数据类型较多,其中的一部分类型的数据并不与SQLite数据库兼容,这使得用户端并不能将自身的所有数据均存储在SQLite数据库中,以及用户端也不能将从SQLite数据库读取得到的数据直接进行处理,这样降低用户端与SQLite数据库之间的数据交互直接性和全面性,无法通过SQLite数据库对用户端提供及时可靠的数据存储与读取服务

Benefits of technology

[0044]相比于现有技术,该基于SQLite的数据存储与读取管理方法和系统将通过验证处理确定具备连接权限的用户端连接到SQLite数据库,并构建关于用户端的数据缓存区间;利用数据缓存区间,将用户端需要存储的数据或者从SQLite数据库定位得到的用户端需要读取的数据进行中介缓存,这样在数据缓存区间中对需要存储的数据和需要读取的数据进行数据格式转换,使其能够分别与SQLite数据库和用户端兼容,保证用户端与SQLite数据库之间能够进行任意格式的数据交互,以及提高用户端与SQLite数据库之间的数据交互直接性和全面性,避免在数据交互过程中发生数据掉帧或者被篡改的情况。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116821947B_ABST
    Figure CN116821947B_ABST
Patent Text Reader

Abstract

The application provides a SQLite-based data storage and reading management method and system, determines a user terminal with connection permission to connect to a SQLite database through a verification process, and constructs a data cache interval about the user terminal; the data cache interval is used to mediate cache data required to be stored by the user terminal or data required to be read by the user terminal from the SQLite database, so that the data required to be stored and the data required to be read are subjected to data format conversion in the data cache interval, and can be compatible with the SQLite database and the user terminal respectively, so that the user terminal and the SQLite database can be capable of data interaction in any format, and the directness and comprehensiveness of data interaction between the user terminal and the SQLite database are improved, and the situation that data is dropped or tampered with in the data interaction process is avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the technical field of database management, and in particular to a data storage and retrieval management method and system based on SQLite. Background Technology

[0002] As a lightweight database, SQLite imposes restrictions on the format of stored data; only data with a predetermined format can be stored in SQLite. While computer clients support a wide range of data types, some of these are incompatible with SQLite. This prevents clients from storing all their data in SQLite and from directly processing data retrieved from it. Consequently, the directness and comprehensiveness of data interaction between clients and SQLite are reduced, hindering the provision of timely and reliable data storage and retrieval services through SQLite. Summary of the Invention

[0003] To address the shortcomings of existing technologies, this invention provides a data storage and retrieval management method and system based on SQLite. The method connects a user client, verified through authentication, to an SQLite database and constructs a data cache interval for the user client. This cache interval serves as an intermediary for caching data that the user client needs to store or data retrieved from the SQLite database. Within the cache interval, data formats are converted to ensure compatibility with both the SQLite database and the user client. This guarantees data exchange between the user client and the SQLite database in any format, improves the directness and comprehensiveness of data interaction between them, and prevents data loss or tampering during data exchange.

[0004] This invention provides a data storage and retrieval management method based on SQLite, comprising the following steps:

[0005] Step S1: Verify the connection request to the SQLite database to determine whether the client that issued the connection request has connection permission; construct a data cache range for the client with connection permission based on the client's historical access records in the SQLite database.

[0006] Step S2: When the user needs to store data in the SQLite database, the data to be stored is placed in the data cache area corresponding to the user and the data is converted into a storage format compatible with the SQLite database; then the storage format data is marked and stored in the corresponding area of ​​the SQLite database.

[0007] Step S3: When the user needs to read data from the SQLite database, the corresponding data is located in the SQLite database according to the user's data read request; the located data is placed in the corresponding data cache area of ​​the user; the located data is converted to obtain a read format compatible with the user, and the read format data is returned to the user.

[0008] Step S4: Based on the real-time data storage and retrieval records of the user terminal, obtain the current data storage / retrieval status of the user terminal; and adjust the connection relationship between the user terminal and the SQLite database according to the data storage / retrieval status.

[0009] Further, in step S1, the connection request to the SQLite database is verified to determine whether the client issuing the connection request has connection permissions; based on the historical access records of the client with connection permissions in the SQLite database, a data cache range for the client with connection permissions is constructed, including:

[0010] The terminal identity information of the user terminal is extracted from the connection request sent by the user terminal to the SQLite database. The terminal identity information is compared with a preset identity information whitelist. If the terminal identity information exists in the preset identity information whitelist, it is determined that the user terminal has the permission to connect to the SQLite database; otherwise, it is determined that the user terminal does not have the permission to connect to the SQLite database.

[0011] Based on the terminal identity information of the user terminal with connection permissions, the corresponding historical access records are extracted from the access logs of the SQLite database; based on the historical access records, the historical average data volume stored and the historical average data volume read during the historical access process of the user terminal to the SQLite database are determined; and based on the larger of the historical average data volume stored and the historical average data volume read, a data cache interval for the user terminal is constructed in the virtual storage space corresponding to the SQLite database.

[0012] Further, in step S2, when the user needs to store data in the SQLite database, the data to be stored is placed in the data cache area corresponding to the user, and the data is converted into a storage format compatible with the SQLite database; then, after marking the storage format data, it is stored in the corresponding area of ​​the SQLite database, including:

[0013] When a user needs to store data in the SQLite database, the data to be stored is copied and backed up and placed in the corresponding data cache area of ​​the user; it is then determined whether the current data format of the data to be stored is compatible with the SQLite database.

[0014] If compatible, the terminal identity information of the corresponding source user terminal is added to the data that needs to be stored, and then it is directly transferred from the data cache area to the corresponding area of ​​the SQLite database.

[0015] If incompatible, the data to be stored is converted into a storage format compatible with the SQLite database format and with unchanged data precision; then, the terminal identity information of the corresponding source user is added to the storage format data, and it is directly transferred from the data cache area to the corresponding area of ​​the SQLite database.

[0016] Further, in step S3, when the user needs to read data from the SQLite database, the corresponding data is located in the SQLite database according to the user's data read request; the located data is placed in the data cache area corresponding to the user; the located data is converted to obtain a read format compatible with the user, and the read format data is returned to the user, including:

[0017] When a user needs to read data from the SQLite database, the user's data read request is parsed to obtain the data code feature information of the data that the user needs to read; based on the data code feature information, the corresponding data is located in the SQLite database.

[0018] The data obtained from the location is copied and backed up and placed in the corresponding data cache area of ​​the user terminal; it is then determined whether the current data format of the data obtained from the location is compatible with the user terminal.

[0019] If compatible, the located data will be directly transferred from the data cache area to the user terminal;

[0020] If incompatible, the located data is converted into a read format that is compatible with the user's format and retains the same data precision; then the read format data is directly returned from the data cache area to the user.

[0021] Further, in step S4, the current data storage / reading status of the user terminal is obtained based on the real-time data storage and read records of the user terminal; and the connection relationship between the user terminal and the SQLite database is adjusted according to the data storage / reading status, including:

[0022] The system retrieves the number of data storage times and the number of data read times during the current connection process between the user client and the SQLite database. If the number of data storage times or the number of data read times is greater than a preset threshold, the system determines that the user client is currently in an abnormal data storage / reading state; otherwise, the system determines that the user client is currently in a normal data storage / reading state.

[0023] If the client is currently in a data storage / reading abnormal state, the connection between the client and the SQLite database is terminated; if the client is currently in a data storage / reading abnormal state, the connection between the client and the SQLite database remains unchanged.

[0024] This invention also provides a data storage and retrieval management system based on SQLite, including:

[0025] The client-side authentication and connection processing module is used to authenticate and process connection requests to the SQLite database, determine whether the client that issued the connection request has connection permissions, and construct a data cache range for the client with connection permissions based on the client's historical access records in the SQLite database.

[0026] The data storage processing module is used to place the data to be stored in the corresponding data cache area of ​​the user terminal when the user terminal needs to store data in the SQLite database, and convert the data into a storage format compatible with the SQLite database; then, after marking the storage format data, it is stored in the corresponding area of ​​the SQLite database.

[0027] The data reading and processing module is used to locate the corresponding data in the SQLite database according to the data reading request of the user terminal when the user terminal needs to read data from the SQLite database; place the located data in the corresponding data cache area of ​​the user terminal; convert the located data to obtain data in a reading format compatible with the user terminal; and return the reading format data to the user terminal.

[0028] The client connection change module is used to obtain the current data storage / reading status of the client based on the client's real-time data storage and read records; and to adjust the connection relationship between the client and the SQLite database based on the data storage / reading status.

[0029] Furthermore, the client authentication and connection processing module verifies connection requests to the SQLite database, determining whether the client issuing the request has connection permissions; based on the historical access records of the client with connection permissions in the SQLite database, it constructs a data cache range for the client with connection permissions, including:

[0030] The terminal identity information of the user terminal is extracted from the connection request sent by the user terminal to the SQLite database. The terminal identity information is compared with a preset identity information whitelist. If the terminal identity information exists in the preset identity information whitelist, it is determined that the user terminal has the permission to connect to the SQLite database; otherwise, it is determined that the user terminal does not have the permission to connect to the SQLite database.

[0031] Based on the terminal identity information of the user terminal with connection permissions, the corresponding historical access records are extracted from the access logs of the SQLite database; based on the historical access records, the historical average data volume stored and the historical average data volume read during the historical access process of the user terminal to the SQLite database are determined; and based on the larger of the historical average data volume stored and the historical average data volume read, a data cache interval for the user terminal is constructed in the virtual storage space corresponding to the SQLite database.

[0032] Furthermore, when a user needs to store data in the SQLite database, the data storage processing module places the data to be stored in the corresponding data cache area of ​​the user and converts the data into a storage format compatible with the SQLite database; then, after marking the storage format data, it stores it in the corresponding area of ​​the SQLite database, including:

[0033] When a user needs to store data in the SQLite database, the data to be stored is copied and backed up and placed in the corresponding data cache area of ​​the user; it is then determined whether the current data format of the data to be stored is compatible with the SQLite database.

[0034] If compatible, the terminal identity information of the corresponding source user terminal is added to the data that needs to be stored, and then it is directly transferred from the data cache area to the corresponding area of ​​the SQLite database.

[0035] If incompatible, the data to be stored is converted into a storage format compatible with the SQLite database format and with unchanged data precision; then, the terminal identity information of the corresponding source user is added to the storage format data, and it is directly transferred from the data cache area to the corresponding area of ​​the SQLite database.

[0036] Furthermore, when the user client needs to read data from the SQLite database, the data reading and processing module locates the corresponding data in the SQLite database according to the user client's data reading request; places the located data in the corresponding data cache area on the user client; converts the located data to obtain a read format compatible with the user client, and returns the read format data to the user client, including:

[0037] When a user needs to read data from the SQLite database, the user's data read request is parsed to obtain the data code feature information of the data that the user needs to read; based on the data code feature information, the corresponding data is located in the SQLite database.

[0038] The data obtained from the location is copied and backed up and placed in the corresponding data cache area of ​​the user terminal; it is then determined whether the current data format of the data obtained from the location is compatible with the user terminal.

[0039] If compatible, the located data will be directly transferred from the data cache area to the user terminal;

[0040] If incompatible, the located data is converted into a read format that is compatible with the user's format and retains the same data precision; then the read format data is directly returned from the data cache area to the user.

[0041] Furthermore, the user-end connection change module obtains the current data storage / reading status of the user-end based on the user-end's real-time data storage and read records; and adjusts the connection relationship between the user-end and the SQLite database according to the data storage / reading status, including:

[0042] The system retrieves the number of data storage times and the number of data read times during the current connection process between the user client and the SQLite database. If the number of data storage times or the number of data read times is greater than a preset threshold, the system determines that the user client is currently in an abnormal data storage / reading state; otherwise, the system determines that the user client is currently in a normal data storage / reading state.

[0043] If the client is currently in a data storage / reading abnormal state, the connection between the client and the SQLite database is terminated; if the client is currently in a data storage / reading abnormal state, the connection between the client and the SQLite database remains unchanged.

[0044] Compared to existing technologies, this SQLite-based data storage and retrieval management method and system verifies the connection permissions of user clients to the SQLite database and constructs a data cache interval for the user client. Using this data cache interval, data that the user client needs to store or data that the user client needs to retrieve from the SQLite database is cached as an intermediary. This process converts the data formats of the data to be stored and retrieved within the data cache interval, ensuring compatibility with both the SQLite database and the user client. This guarantees that the user client and the SQLite database can exchange data in any format, improves the directness and comprehensiveness of data interaction between the user client and the SQLite database, and prevents data loss or tampering during data exchange.

[0045] Other features and advantages of the invention will be set forth in the description which follows, and will be apparent in part from the description, or may be learned by practicing the invention. The objects and other advantages of the invention may be realized and obtained by means of the structures particularly pointed out in the written description, claims, and drawings.

[0046] The technical solution of the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. Attached Figure Description

[0047] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0048] Figure 1 This is a flowchart illustrating the SQLite-based data storage and retrieval management method provided by the present invention.

[0049] Figure 2 This is a schematic diagram of the structure of the SQLite-based data storage and retrieval management system provided by the present invention. Detailed Implementation

[0050] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0051] See Figure 1 This is a flowchart illustrating the SQLite-based data storage and retrieval management method provided in an embodiment of the present invention. The SQLite-based data storage and retrieval management method includes the following steps:

[0052] Step S1: Verify the connection request to the SQLite database to determine whether the client that issued the connection request has connection permission; construct a data cache range for the client with connection permission based on the client's historical access records in the SQLite database.

[0053] Step S2: When the client needs to store data in the SQLite database, the data to be stored is placed in the data cache area corresponding to the client, and the data is converted into a storage format compatible with the SQLite database; then the storage format data is marked and stored in the corresponding area of ​​the SQLite database.

[0054] Step S3: When the client needs to read data from the SQLite database, the corresponding data is located in the SQLite database according to the client's data read request; the located data is placed in the corresponding data cache area of ​​the client; the located data is converted to obtain a read format compatible with the client, and the read format data is returned to the client.

[0055] Step S4: Based on the real-time data storage and retrieval records of the user terminal, obtain the current data storage / retrieval status of the user terminal; and adjust the connection relationship between the user terminal and the SQLite database according to the data storage / retrieval status.

[0056] The beneficial effects of the above technical solution are as follows: This SQLite-based data storage and retrieval management method determines whether a user client with connection permissions is connected to the SQLite database through verification processing, and constructs a data cache interval for the user client. Using this data cache interval, the data that the user client needs to store or the data that the user client needs to retrieve from the SQLite database is cached as an intermediary. In this way, the data format of the data to be stored and retrieved is converted within the data cache interval, making it compatible with both the SQLite database and the user client. This ensures that the user client and the SQLite database can perform data interaction in any format, and improves the directness and comprehensiveness of data interaction between the user client and the SQLite database, avoiding data loss or tampering during data interaction.

[0057] Preferably, in step S1, the connection request to the SQLite database is verified to determine whether the client issuing the connection request has connection permissions; based on the historical access records of the client with connection permissions in the SQLite database, a data cache range for the client with connection permissions is constructed, including:

[0058] The terminal identity information of the user is extracted from the connection request sent by the user to the SQLite database. The terminal identity information is compared with the preset identity information whitelist. If the terminal identity information exists in the preset identity information whitelist, it is determined that the user has the permission to connect to the SQLite database; otherwise, it is determined that the user does not have the permission to connect to the SQLite database.

[0059] Based on the terminal identity information of the user with connection permissions, the corresponding historical access records are extracted from the access logs of the SQLite database. Based on the historical access records, the historical average data volume stored and the historical average data volume read during the historical access process of the user to the SQLite database are determined. Based on the larger of the historical average data volume stored and the historical average data volume read, a data cache interval for the user is constructed in the virtual storage space corresponding to the SQLite database.

[0060] The beneficial effects of the above technical solution are as follows: By using the user's terminal identity information as a basis, the connection permissions between the user and the SQLite database are determined. This ensures that the SQLite database only connects to authenticated user terminals, improving the data security of the SQLite database. Furthermore, based on the user's historical access records to the SQLite database, the average historical data storage volume and average historical data retrieval volume during the user's historical access to the SQLite database are determined. The larger of these two volumes is used as a benchmark to construct a data cache interval corresponding to the user terminal. This provides a dedicated data caching intermediary for each user terminal connected to the SQLite database and fully utilizes the virtual storage space corresponding to the SQLite database. This avoids allocating a data cache interval that is too small to meet the user's data storage and retrieval needs, or allocating a data cache interval that is too large, resulting in a waste of virtual storage space.

[0061] Preferably, in step S2, when the user needs to store data in the SQLite database, the data to be stored is placed in the data cache area corresponding to the user, and the data is converted into a storage format compatible with the SQLite database; then, after marking the storage format data, it is stored in the corresponding area of ​​the SQLite database, including:

[0062] When a client needs to store data in this SQLite database, the data to be stored is copied and backed up and placed in the corresponding data cache area of ​​the client; it is then determined whether the current data format of the data to be stored is compatible with the SQLite database.

[0063] If compatible, the terminal identity information of the corresponding source user terminal is added to the data that needs to be stored, and then it is directly transferred from the data cache range to the corresponding range of the SQLite database.

[0064] If incompatible, the data to be stored will be converted into a storage format compatible with the SQLite database format and with unchanged data precision. Then, the terminal identity information of the corresponding source user terminal will be added to the storage data, and it will be directly transferred from the data cache area to the corresponding area of ​​the SQLite database.

[0065] The beneficial effects of the above technical solution are as follows: When a user needs to store data in an SQLite database, the data is first cached in the corresponding data cache area of ​​the user. Then, the data format is judged to determine whether it is compatible with the SQLite database. This facilitates the subsequent conversion of the data format in the data cache area, while ensuring that the precision of the converted data remains unchanged. This prevents the data precision from decreasing during the transfer of data from the user to the SQLite database, thus maintaining the reliability and integrity of the data, as well as the storage compatibility of the SQLite database with data from the user.

[0066] Preferably, in step S3, when the client needs to read data from the SQLite database, the corresponding data is located in the SQLite database according to the client's data read request; the located data is placed in the corresponding data cache area of ​​the client; the located data is converted to obtain a read format compatible with the client, and the read format data is returned to the client, including:

[0067] When a client needs to read data from the SQLite database, the client's data read request is parsed and processed to obtain the data code feature information of the data that the client needs to read; based on the data code feature information, the corresponding data is located in the SQLite database.

[0068] The located data is copied and backed up and placed in the corresponding data cache area of ​​the user terminal; it is then determined whether the current data format of the located data is compatible with the user terminal.

[0069] If compatible, the located data will be directly transferred from the data cache area to the user terminal;

[0070] If incompatible, the located data will be converted into a read format that is compatible with the client's format and retains the same precision; then the read format data will be returned directly from the data cache to the client.

[0071] The beneficial effects of the above technical solution are as follows: When a user needs to read data from an SQLite database, the data to be read is first located in the SQLite database. Then, the read data is cached in the corresponding data cache area of ​​the user, and the data format is checked for compatibility with the user. This facilitates subsequent data format conversion in the data cache area while ensuring that the accuracy of the converted data remains unchanged. This prevents a decrease in data accuracy during the transfer of data from the SQLite database to the user, maintaining the reliability and integrity of the data, as well as the compatibility of the user's reading of data from the SQLite database.

[0072] Preferably, in step S4, the current data storage / reading status of the user terminal is obtained based on the real-time data storage and read records of the user terminal; and the connection relationship between the user terminal and the SQLite database is adjusted according to the data storage / reading status, including:

[0073] The system retrieves the number of data storage and data retrieval operations during the current connection between the user client and the SQLite database. If the number of data storage operations or the number of data retrieval operations exceeds a preset threshold, the system determines that the user client is currently in an abnormal data storage / retrieval state; otherwise, the system determines that the user client is currently in a normal data storage / retrieval state.

[0074] If the client is currently in a data storage / reading abnormal state, the connection between the client and the SQLite database will be terminated; otherwise, the connection between the client and the SQLite database will remain unchanged.

[0075] The beneficial effects of the above technical solution are as follows: By using the above method, based on the number of data storage and data reading times during the current connection process between the user terminal and the SQLite database, it is possible to determine whether the current data storage / reading status between the user terminal and the SQLite database is normal. This facilitates terminating the connection between the user terminal and the SQLite database if the user terminal is currently in an abnormal data storage / reading state, thereby preventing the user terminal from frequently storing and reading data from the SQLite database and affecting the normal data storage and reading process of other user terminals on the SQLite database.

[0076] See Figure 2 This is a schematic diagram of the structure of a SQLite-based data storage and retrieval management system provided in an embodiment of the present invention. The SQLite-based data storage and retrieval management system includes:

[0077] The client-side authentication and connection processing module is used to authenticate and process connection requests to the SQLite database, determine whether the client that issued the connection request has connection permissions, and construct a data cache range for the client with connection permissions based on the client's historical access records in the SQLite database.

[0078] The data storage processing module is used to place the data to be stored in the corresponding data cache area of ​​the user client when the client needs to store data in the SQLite database, and convert the data into a storage format compatible with the SQLite database; after marking the storage format data, it is stored in the corresponding area of ​​the SQLite database.

[0079] The data reading and processing module is used to locate the corresponding data in the SQLite database according to the user's data reading request when the user needs to read data from the SQLite database; place the located data in the corresponding data cache area of ​​the user; convert the located data to obtain a reading format compatible with the user; and return the reading format data to the user.

[0080] The client connection change module is used to obtain the current data storage / reading status of the client based on the client's real-time data storage and read records; and to adjust the connection relationship between the client and the SQLite database based on the data storage / reading status.

[0081] The beneficial effects of the above technical solution are as follows: This SQLite-based data storage and retrieval management system will determine whether a user client with connection permissions is connected to the SQLite database through verification processing, and construct a data cache interval for the user client. Using this data cache interval, the data that the user client needs to store or the data that the user client needs to retrieve from the SQLite database is cached as an intermediary. In this way, the data to be stored and retrieved is converted into different formats within the data cache interval, making it compatible with both the SQLite database and the user client. This ensures that the user client and the SQLite database can perform data interaction in any format, and improves the directness and comprehensiveness of data interaction between the user client and the SQLite database, avoiding data loss or tampering during data interaction.

[0082] Preferably, the client authentication and connection processing module verifies connection requests to the SQLite database, determining whether the client issuing the request has connection permissions; based on the historical access records of the client with connection permissions in the SQLite database, it constructs a data cache range for the client with connection permissions, including:

[0083] The terminal identity information of the user is extracted from the connection request sent by the user to the SQLite database. The terminal identity information is compared with the preset identity information whitelist. If the terminal identity information exists in the preset identity information whitelist, it is determined that the user has the permission to connect to the SQLite database; otherwise, it is determined that the user does not have the permission to connect to the SQLite database.

[0084] Based on the terminal identity information of the user with connection permissions, the corresponding historical access records are extracted from the access logs of the SQLite database. Based on the historical access records, the historical average data volume stored and the historical average data volume read during the historical access process of the user to the SQLite database are determined. Based on the larger of the historical average data volume stored and the historical average data volume read, a data cache interval for the user is constructed in the virtual storage space corresponding to the SQLite database.

[0085] The beneficial effects of the above technical solution are as follows: By using the user's terminal identity information as a basis, the connection permissions between the user and the SQLite database are determined. This ensures that the SQLite database only connects to authenticated user terminals, improving the data security of the SQLite database. Furthermore, based on the user's historical access records to the SQLite database, the average historical data storage volume and average historical data retrieval volume during the user's historical access to the SQLite database are determined. The larger of these two volumes is used as a benchmark to construct a data cache interval corresponding to the user terminal. This provides a dedicated data caching intermediary for each user terminal connected to the SQLite database and fully utilizes the virtual storage space corresponding to the SQLite database. This avoids allocating a data cache interval that is too small to meet the user's data storage and retrieval needs, or allocating a data cache interval that is too large, resulting in a waste of virtual storage space.

[0086] Preferably, when a user needs to store data in the SQLite database, the data storage processing module places the data to be stored in the corresponding data cache area of ​​the user and converts the data into a storage format compatible with the SQLite database; then, after marking the storage format data, it stores it in the corresponding area of ​​the SQLite database, including:

[0087] When a client needs to store data in this SQLite database, the data to be stored is copied and backed up and placed in the corresponding data cache area of ​​the client; it is then determined whether the current data format of the data to be stored is compatible with the SQLite database.

[0088] If compatible, the terminal identity information of the corresponding source user terminal is added to the data that needs to be stored, and then it is directly transferred from the data cache range to the corresponding range of the SQLite database.

[0089] If incompatible, the data to be stored will be converted into a storage format compatible with the SQLite database format and with unchanged data precision. Then, the terminal identity information of the corresponding source user terminal will be added to the storage data, and it will be directly transferred from the data cache area to the corresponding area of ​​the SQLite database.

[0090] The beneficial effects of the above technical solution are as follows: When a user needs to store data in an SQLite database, the data is first cached in the corresponding data cache area of ​​the user. Then, the data format is judged to determine whether it is compatible with the SQLite database. This facilitates the subsequent conversion of the data format in the data cache area, while ensuring that the precision of the converted data remains unchanged. This prevents the data precision from decreasing during the transfer of data from the user to the SQLite database, thus maintaining the reliability and integrity of the data, as well as the storage compatibility of the SQLite database with data from the user.

[0091] Preferably, when a user client needs to read data from the SQLite database, the data reading and processing module locates the corresponding data in the SQLite database according to the user client's data reading request; places the located data in the corresponding data cache area of ​​the user client; converts the located data to obtain a read format compatible with the user client, and returns the read format data to the user client, including:

[0092] When a client needs to read data from the SQLite database, the client's data read request is parsed and processed to obtain the data code feature information of the data that the client needs to read; based on the data code feature information, the corresponding data is located in the SQLite database.

[0093] The located data is copied and backed up and placed in the corresponding data cache area of ​​the user terminal; it is then determined whether the current data format of the located data is compatible with the user terminal.

[0094] If compatible, the located data will be directly transferred from the data cache area to the user terminal;

[0095] If incompatible, the located data will be converted into a read format that is compatible with the client's format and retains the same precision; then the read format data will be returned directly from the data cache to the client.

[0096] The beneficial effects of the above technical solution are as follows: When a user needs to read data from an SQLite database, the data to be read is first located in the SQLite database. Then, the read data is cached in the corresponding data cache area of ​​the user, and the data format is checked for compatibility with the user. This facilitates subsequent data format conversion in the data cache area while ensuring that the accuracy of the converted data remains unchanged. This prevents a decrease in data accuracy during the transfer of data from the SQLite database to the user, maintaining the reliability and integrity of the data, as well as the compatibility of the user's reading of data from the SQLite database.

[0097] Preferably, the client connection change module obtains the current data storage / read status of the client based on the client's real-time data storage and read records; and adjusts the connection relationship between the client and the SQLite database according to the data storage / read status, including:

[0098] The system retrieves the number of data storage and data retrieval operations during the current connection between the user client and the SQLite database. If the number of data storage operations or the number of data retrieval operations exceeds a preset threshold, the system determines that the user client is currently in an abnormal data storage / retrieval state; otherwise, the system determines that the user client is currently in a normal data storage / retrieval state.

[0099] If the client is currently in a data storage / reading abnormal state, the connection between the client and the SQLite database will be terminated; otherwise, the connection between the client and the SQLite database will remain unchanged.

[0100] The beneficial effects of the above technical solution are as follows: By using the above method, based on the number of data storage and data reading times during the current connection process between the user terminal and the SQLite database, it is possible to determine whether the current data storage / reading status between the user terminal and the SQLite database is normal. This facilitates terminating the connection between the user terminal and the SQLite database if the user terminal is currently in an abnormal data storage / reading state, thereby preventing the user terminal from frequently storing and reading data from the SQLite database and affecting the normal data storage and reading process of other user terminals on the SQLite database.

[0101] As can be seen from the above embodiments, the SQLite-based data storage and retrieval management method and system will determine whether a user terminal with connection permissions is connected to the SQLite database through verification processing, and construct a data cache interval for the user terminal. Using the data cache interval, the data that the user terminal needs to store or the data that the user terminal needs to read from the SQLite database is cached in an intermediate manner. In this way, the data to be stored and the data to be read are converted in data cache interval to make them compatible with the SQLite database and the user terminal respectively. This ensures that the user terminal and the SQLite database can perform data interaction in any format, and improves the directness and comprehensiveness of data interaction between the user terminal and the SQLite database, avoiding data frame drops or tampering during data interaction.

[0102] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Therefore, if these modifications and variations fall within the scope of the claims of this invention and their equivalents, this invention also intends to include these modifications and variations.

Claims

1. A data storage and retrieval management method based on SQLite, characterized in that, Includes the following steps: Step S1: Verify the connection request for the SQLite database and determine whether the client that issued the connection request has connection permission. Based on the historical access records of the user terminal with connection permissions in the SQLite database, a data cache interval for the user terminal with connection permissions is constructed, including: extracting the corresponding historical access records from the access logs of the SQLite database based on the terminal identity information of the user terminal with connection permissions; determining the historical average data volume stored and the historical average data volume read during the historical access process of the user terminal to the SQLite database based on the historical access records; and constructing a data cache interval for the user terminal in the virtual storage space corresponding to the SQLite database based on the larger of the historical average data volume stored and the historical average data volume read. Step S2: When the user needs to store data in the SQLite database, the data to be stored is placed in the data cache area corresponding to the user and the data is converted into a storage format compatible with the SQLite database; then the storage format data is marked and stored in the corresponding area of ​​the SQLite database. Step S3: When the user needs to read data from the SQLite database, the corresponding data is located in the SQLite database according to the user's data read request; the located data is placed in the corresponding data cache area of ​​the user; the located data is converted to obtain a read format compatible with the user, and the read format data is returned to the user. Step S4: Based on the real-time data storage and retrieval records of the user terminal, obtain the current data storage / retrieval status of the user terminal; and adjust the connection relationship between the user terminal and the SQLite database according to the data storage / retrieval status.

2. The data storage and retrieval management method based on SQLite as described in claim 1, characterized in that: In step S1, the connection request to the SQLite database is verified to determine whether the client issuing the connection request has connection permissions; based on the historical access records of the client with connection permissions in the SQLite database, a data cache range for the client with connection permissions is constructed, including: The terminal identity information of the user terminal is extracted from the connection request sent by the user terminal to the SQLite database. The terminal identity information is compared with a preset identity information whitelist. If the terminal identity information exists in the preset identity information whitelist, it is determined that the user terminal has the permission to connect to the SQLite database; otherwise, it is determined that the user terminal does not have the permission to connect to the SQLite database.

3. The data storage and retrieval management method based on SQLite as described in claim 2, characterized in that: In step S2, when the user needs to store data in the SQLite database, the data to be stored is placed in the data cache area corresponding to the user and the data is converted into a storage format compatible with the SQLite database. After the data in the storage format is further tagged, it is stored in the corresponding range of the SQLite database, including: When a user needs to store data in the SQLite database, the data to be stored is copied and backed up and placed in the corresponding data cache area of ​​the user; it is then determined whether the current data format of the data to be stored is compatible with the SQLite database. If compatible, the terminal identity information of the corresponding source user terminal is added to the data that needs to be stored, and then it is directly transferred from the data cache area to the corresponding area of ​​the SQLite database. If incompatible, the data to be stored is converted into a storage format compatible with the SQLite database format and with unchanged data precision; then, the terminal identity information of the corresponding source user is added to the storage format data, and it is directly transferred from the data cache area to the corresponding area of ​​the SQLite database.

4. The data storage and retrieval management method based on SQLite as described in claim 3, characterized in that: In step S3, when the user needs to read data from the SQLite database, the corresponding data is located in the SQLite database according to the user's data read request; the located data is placed in the corresponding data cache area of ​​the user. The data obtained from the location is converted to a reading format compatible with the user terminal, and the reading format data is returned to the user terminal, including: When a user needs to read data from the SQLite database, the user's data read request is parsed to obtain the data code feature information of the data that the user needs to read; based on the data code feature information, the corresponding data is located in the SQLite database. The data obtained from the location is copied and backed up and placed in the corresponding data cache area of ​​the user terminal; it is then determined whether the current data format of the data obtained from the location is compatible with the user terminal. If compatible, the located data will be directly transferred from the data cache area to the user terminal; If incompatible, the located data is converted into a read format that is compatible with the user's format and retains the same data precision; then the read format data is directly returned from the data cache area to the user.

5. The data storage and retrieval management method based on SQLite as described in claim 4, characterized in that: In step S4, the current data storage / reading status of the user terminal is obtained based on the real-time data storage and read records of the user terminal; And based on the data storage / reading status, adjust the connection between the user terminal and the SQLite database, including: The system retrieves the number of data storage times and the number of data read times during the current connection process between the user client and the SQLite database. If the number of data storage times or the number of data read times is greater than a preset threshold, the system determines that the user client is currently in an abnormal data storage / reading state; otherwise, the system determines that the user client is currently in a normal data storage / reading state. If the client is currently in a data storage / reading abnormal state, the connection between the client and the SQLite database is terminated; if the client is currently in a data storage / reading normal state, the connection between the client and the SQLite database remains unchanged.

6. A data storage and retrieval management system based on SQLite, characterized in that, include: The client-side authentication and connection processing module is used to authenticate and process connection requests to the SQLite database and determine whether the client that issued the connection request has the necessary connection permissions. Based on the historical access records of the user terminal with connection permissions in the SQLite database, a data cache interval for the user terminal with connection permissions is constructed, including: extracting the corresponding historical access records from the access logs of the SQLite database based on the terminal identity information of the user terminal with connection permissions; determining the historical average data volume stored and the historical average data volume read during the historical access process of the user terminal to the SQLite database based on the historical access records; and constructing a data cache interval for the user terminal in the virtual storage space corresponding to the SQLite database based on the larger of the historical average data volume stored and the historical average data volume read. The data storage processing module is used to place the data to be stored in the corresponding data cache area of ​​the user terminal when the user terminal needs to store data in the SQLite database, and convert the data into a storage format compatible with the SQLite database; then, after marking the storage format data, it is stored in the corresponding area of ​​the SQLite database. The data reading and processing module is used to locate the corresponding data in the SQLite database according to the data reading request of the user terminal when the user terminal needs to read data from the SQLite database; place the located data in the corresponding data cache area of ​​the user terminal; convert the located data to obtain data in a reading format compatible with the user terminal; and return the reading format data to the user terminal. The client connection change module is used to obtain the current data storage / reading status of the client based on the client's real-time data storage and read records; and to adjust the connection relationship between the client and the SQLite database based on the data storage / reading status.

7. The SQLite-based data storage and retrieval management system as described in claim 6, characterized in that: The client authentication and connection processing module verifies connection requests to the SQLite database, determining whether the client issuing the request has connection permissions. Based on the historical access records of the client with connection permissions in the SQLite database, it constructs a data cache range for the client with connection permissions, including: The terminal identity information of the user terminal is extracted from the connection request sent by the user terminal to the SQLite database. The terminal identity information is compared with a preset identity information whitelist. If the terminal identity information exists in the preset identity information whitelist, it is determined that the user terminal has the permission to connect to the SQLite database; otherwise, it is determined that the user terminal does not have the permission to connect to the SQLite database.

8. The SQLite-based data storage and retrieval management system as described in claim 7, characterized in that: When a user needs to store data in the SQLite database, the data storage processing module places the data to be stored in the corresponding data cache area of ​​the user and converts the data into a storage format compatible with the SQLite database. After the data in the storage format is further tagged, it is stored in the corresponding range of the SQLite database, including: When a user needs to store data in the SQLite database, the data to be stored is copied and backed up and placed in the corresponding data cache area of ​​the user; it is then determined whether the current data format of the data to be stored is compatible with the SQLite database. If compatible, the terminal identity information of the corresponding source user terminal is added to the data that needs to be stored, and then it is directly transferred from the data cache area to the corresponding area of ​​the SQLite database. If incompatible, the data to be stored is converted into a storage format compatible with the SQLite database format and with unchanged data precision; then, the terminal identity information of the corresponding source user is added to the storage format data, and it is directly transferred from the data cache area to the corresponding area of ​​the SQLite database.

9. The SQLite-based data storage and retrieval management system as described in claim 8, characterized in that: When a user needs to read data from the SQLite database, the data reading and processing module locates the corresponding data in the SQLite database according to the user's data reading request; and places the located data in the corresponding data cache area of ​​the user. The data obtained from the location is converted to a reading format compatible with the user terminal, and the reading format data is returned to the user terminal, including: When a user needs to read data from the SQLite database, the user's data read request is parsed to obtain the data code feature information of the data that the user needs to read; based on the data code feature information, the corresponding data is located in the SQLite database. The data obtained from the location is copied and backed up and placed in the corresponding data cache area of ​​the user terminal; it is then determined whether the current data format of the data obtained from the location is compatible with the user terminal. If compatible, the located data will be directly transferred from the data cache area to the user terminal; If incompatible, the located data is converted into a read format that is compatible with the user's format and retains the same data precision; then the read format data is directly returned from the data cache area to the user.

10. The SQLite-based data storage and retrieval management system as described in claim 9, characterized in that: The user terminal connection change module obtains the current data storage / reading status of the user terminal based on the real-time data storage and read records of the user terminal; And based on the data storage / reading status, adjust the connection between the user terminal and the SQLite database, including: The system retrieves the number of data storage times and the number of data read times during the current connection process between the user client and the SQLite database. If the number of data storage times or the number of data read times is greater than a preset threshold, the system determines that the user client is currently in an abnormal data storage / reading state; otherwise, the system determines that the user client is currently in a normal data storage / reading state. If the client is currently in a data storage / reading abnormal state, the connection between the client and the SQLite database is terminated; if the client is currently in a data storage / reading normal state, the connection between the client and the SQLite database remains unchanged.

Citation Information

Patent Citations

  • DDR4 (Double Data Rate 4) accelerated read-write device

    CN114721983A