A Ubiquitous Data Access System Based on Hash Association

By adopting a ubiquitous data access system based on Hash association in the software development process, complex problems of database table structure design and adjustment in the existing technology are solved, efficient and flexible data access operations are achieved, and the risks of software development and system operation are reduced.

CN119782313APending Publication Date: 2025-04-08NORTHLAB (SHENYANG) INC LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411859390.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-17
Publication Date
2025-04-08

AI Technical Summary

Technical Problem

The existing technology needs to design and adjust the database table structure during software development, resulting in high development complexity and high cost. When changing business scenarios for software systems that have been launched online, the database table structure needs to be modified, which increases the system operation risk.

Method used

It provides a ubiquitous data access system based on Hash association, which realizes data access operations through the interface functions and data access modules of the client and server without the need to design or adjust the database table structure. The data access module uses a Hash bucket structure and SM3 password hash algorithm for data storage and retrieval.

Benefits of technology

It reduces the complexity and cost of database table structure design and adjustment during software development, improves the efficiency and flexibility of data access operations, reduces the software development workload caused by business demand adjustment, and avoids system operation risks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119782313A_ABST
    Figure CN119782313A_ABST
Patent Text Reader

Abstract

The present invention provides a ubiquitous data access system based on Hash association, and relates to the field of data access technology. The system includes a client, a server, and a data access module; wherein the client is responsible for sending an operation request to the server through an interface function of the server and receiving its response; the server sets up a TCP communication channel, parses and converts the operation request sent by the client through the server interface function, and implements the data access operation by calling the interface component of the data access module, and finally returns the processing result of the data storage operation to the client; the data access module is responsible for receiving and parsing the data access command request initiated by the server, and executing the corresponding data access operation. The system does not require the design of the database table structure, nor does it have the situation of adjusting the database table structure, and can flexibly adapt to the data access requirements of different businesses through a ubiquitous data structure.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data access technology, and in particular to a ubiquitous data access system based on Hash association. Background Art

[0002] In the software development process, data access is the basis of development. Engineers often use relational databases to store and manage data. Therefore, database design, as a key part of software design, is a prerequisite for software to have good performance and scalability.

[0003] Usually, database design requires highly skilled and experienced engineers to complete it. Once the design is completed, the cost of subsequent adjustments and modifications is often very high. When the database table structure needs to be modified for a software system that has already been put into operation, not only does it require modification of the database table structure, but it also involves a lot of coding work, which brings extremely high risks to the continued stable operation of the software and requires a large number of people to carry out testing work. Summary of the invention

[0004] The technical problem to be solved by the present invention is to provide a ubiquitous data access system based on Hash association in view of the deficiencies of the above-mentioned prior art. It does not require database table structure design or database table structure adjustment, and can flexibly adapt to the data access needs of different businesses through a ubiquitous data structure.

[0005] To solve the above technical problems, the technical solution adopted by the present invention is: a ubiquitous data access system based on Hash association, including a client, a server and a data access module;

[0006] The client is responsible for sending operation requests to the server through the server interface function and receiving its response; the server builds a TCP communication channel based on an open source framework, parses and converts the operation request sent by the client through the server interface function, and implements data access operations by calling the interface component of the data access module, and finally returns the processing result of the data storage operation to the client;

[0007] The data access module is responsible for receiving and parsing data access command requests initiated by the server and executing corresponding data access operations.

[0008] Preferably, the client is responsible for sending operation requests to the server including query, creation, modification and deletion of records.

[0009] Preferably, the server-side interface function includes three items: return type, function name and function parameters, wherein: the return type is defined as a JSON data structure, the function name is fixed as operateTable, and the function parameters include the operation type operateType, the information attribute identifier key, the information category type, the data value value and the hash value; wherein the data value value is the data value of the newly created record, which is only used when a new record is created, and includes both text characters and data files; the hash value is the original hash value of the record to be modified or deleted, which is only used when modifying or deleting the record.

[0010] Preferably, the operation type operateType of the server-side interface function is divided into four types: select, update, delete, and insert; the information attribute identifier key is a string representing a unique identifier of the information attribute; the information category is an identifier of a certain category to which the corresponding information attribute belongs, which is customized by the client.

[0011] Preferably, the server uses the established TCP communication channel to receive the operateType, key, type, value, and hash parameter values ​​passed by the client, and converts them into corresponding operation commands. The command format is dataop-ot${operateType}-key${key}-type${type}-value${value}-hash${hash}, where the part referenced by "${}" represents the parameter value corresponding to the record operation request passed in by the client.

[0012] Preferably, the data access module includes a data structure definition component, a Hash bucket component and a data operation interface component;

[0013] The data structure definition component designs a general data access table structure, and each record includes four fields: id, key, type and value; wherein id is the unique identification value of the record stored in the data storage table, key represents the information attribute identifier, type represents the information category, and value represents the data value corresponding to the information category;

[0014] The Hash bucket component includes two parts: Hash calculation and Hash storage. The Hash calculation uses the SM3 cryptographic hash algorithm to jointly calculate the Hash value of the three fields of key, type, and value in the data access table structure; the calculated Hash value is stored in the Hash bucket in the form of data records. The Hash bucket structure consists of two fields: id and hash. The id is the unique identification value of the Hash bucket data record, corresponding to the unique identification value id of the data access table, and the hash is the calculated Hash value;

[0015] The data operation interface component provides a data access interface, parses the operation commands transmitted from the server, and executes the corresponding operation commands.

[0016] Preferably, the data operation interface component executes the corresponding operation command specifically including:

[0017] s0: Get the data access request parameters passed by the server, including operationType, key, type, value, and hash;

[0018] s1: Execute the corresponding operation according to the obtained operation type opetateType;

[0019] (1) When optionType is insert, calculate the hash value corresponding to the passed data structure:

[0020] When the Hash value corresponding to the input data structure is the same as the Hash value in the Hash bucket, it is not stored;

[0021] When the Hash value corresponding to the input data structure does not overlap with the Hash value in the Hash bucket, the new data is stored in the data access table and the Hash value is stored in the Hash bucket;

[0022] (2) When the opetateType is update, the unique identifier id of the data access table is found through the passed hash value, the corresponding data record of the data access table is updated through the id, the original hash value in the hash bucket is deleted, and the hash value is recalculated according to the new key, type, and value and stored in the hash bucket;

[0023] (3) When opetateType is delete, the unique identifier id of the data access table is found through the passed hash value, the data record corresponding to the data access table is deleted through the id, and the original hash value in the hash bucket is deleted;

[0024] (4) When opetateType is select, the data records corresponding to the data access table are read through the passed key and type; the passed key and type can be empty; when empty, the value of all corresponding records is read;

[0025] s2: Returns the result of the data access operation to the server.

[0026] The beneficial effect of adopting the above technical solution is that: the ubiquitous data access system based on Hash association provided by the present invention, in the process of software development, by using the data storage module provided by the present invention, the software development work no longer needs to design the database table structure, which accelerates the software development process and greatly improves the efficiency and flexibility of the software system in data access operations. For software systems that have been put into operation, when the business scenario changes, software developers only need to focus on business scenario code development without modifying the database table structure, which greatly reduces the software development workload caused by business demand adjustments and avoids the system operation risks caused by business upgrades. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] Figure 1 A structural block diagram of a ubiquitous data access system based on Hash association provided by an embodiment of the present invention;

[0028] Figure 2 A schematic diagram of the data access module structure provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0029] The specific implementation of the present invention is further described in detail below in conjunction with the accompanying drawings and examples. The following examples are used to illustrate the present invention, but are not intended to limit the scope of the present invention.

[0030] This embodiment takes the maintenance of user data information by an enterprise as an example, and adopts the ubiquitous data access system based on Hash association of the present invention to realize the access of user data.

[0031] In this embodiment, a ubiquitous data access system based on Hash association is provided. Figure 1 As shown, it includes a client, a server and a data access module;

[0032] The client is responsible for sending operation requests to the server through the server's interface function and receiving its response; the server builds a TCP communication channel based on an open source framework (e.g. Netty), parses and converts the operation request sent by the client through the server's interface function, and implements data access operations by calling the interface component of the data access module, and finally returns the processing result of the data storage operation to the client;

[0033] The data access module is the core module of the ubiquitous data access system of the present invention, and is responsible for receiving and parsing data access command requests initiated by the server and executing corresponding data access operations.

[0034] In this embodiment, the client is responsible for sending operation requests to the server including query, creation, modification and deletion of records.

[0035] The server-side interface function includes three items: return type, function name and function parameters, among which: the return type is defined as a JSON data structure, the function name is fixed as operateTable, and the function parameters include the operation type operateType, the information attribute identifier key, the information category type, the data value value (optional, used when creating or modifying) and the hash value (optional); among which, the data value value is the data value of the newly created record, which is only used when creating a new record, including text characters and data files; the hash value is the original hash value of the record to be modified or deleted, which is only used when modifying or deleting the record.

[0036] In this embodiment, the operation type operateType of the server-side interface function is divided into four types: select, update, delete, and insert; the information attribute identifier key is a string representing the unique identifier of the information attribute; the information category is an identifier of a certain category to which the corresponding information attribute belongs, which is customized by the client.

[0037] In this embodiment, the server uses the established TCP communication channel to receive the operateType, key, type, value, and hash parameter values ​​passed by the client, and converts them into corresponding operation commands. The command format is dataop-ot${operateType}-key${key}-type${type}-value${value}-hash${hash}, where the part referenced by "${}" represents the parameter value corresponding to the record operation request passed in by the client.

[0038] The data access module includes a data structure definition component, a hash bucket component, and a data operation interface component. Figure 2 As shown; wherein, the data structure definition component designs a general data access table structure, and each record includes four fields: id, key, type and value; wherein id is the unique identification value of the record stored in the data storage table, key represents the information attribute identifier, type represents the information category, and value represents the data value corresponding to the information category;

[0039] The Hash bucket component includes two parts: Hash calculation and Hash storage. Hash calculation uses the SM3 cryptographic hash algorithm to jointly calculate the Hash value of the three fields of key, type, and value in the data access table structure; the calculated Hash value is stored in the Hash bucket in the form of data records. The Hash bucket structure consists of two fields: id and hash. The id is the unique identification value of the Hash bucket data record, corresponding to the unique identification value id of the data access table, and the hash is the calculated Hash value;

[0040] The data operation interface component provides a data access interface, parses the operation commands passed from the server, and executes the corresponding operation commands.

[0041] In this embodiment, the data operation interface component executes the corresponding operation command specifically including:

[0042] s0: Get the data access request parameters passed by the server, including operationType, key, type, value, and hash;

[0043] s1: Execute the corresponding operation according to the obtained operation type opetateType;

[0044] (1) When optionType is insert, calculate the hash value corresponding to the passed data structure:

[0045] When the Hash value corresponding to the input data structure is the same as the Hash value in the Hash bucket, it is not stored;

[0046] When the Hash value corresponding to the input data structure does not overlap with the Hash value in the Hash bucket, the new data is stored in the data access table and the Hash value is stored in the Hash bucket;

[0047] (2) When the opetateType is update, the unique identifier id of the data access table is found through the passed hash value, the corresponding data record of the data access table is updated through the id, the original hash value in the hash bucket is deleted, and the hash value is recalculated according to the new key, type, and value and stored in the hash bucket;

[0048] (3) When opetateType is delete, the unique identifier id of the data access table is found through the passed hash value, the data record corresponding to the data access table is deleted through the id, and the original hash value in the hash bucket is deleted;

[0049] (4) When opetateType is select, the data records corresponding to the data access table are read through the passed key and type; the passed key and type can be empty; when empty, the value of all corresponding records is read;

[0050] s2: Returns the result of the data access operation to the server.

[0051] In this embodiment, user data information, including "user number" and "user name", needs to be stored and maintained. When the client queries, creates, modifies, and deletes a user name, it needs to call the operateTable function, send the relevant parameters in Table 1, and receive the json return result data. Some examples are shown in Table 1:

[0052] Table 1 Example table of client query, creation, modification and deletion of user names

[0053]

[0054] The server receives the request from the client, parses and converts it into a data operation interface command, and calls the data operation interface to execute the relevant command, as shown in Table 2;

[0055] Table 2 Operations and corresponding commands

[0056]

[0057]

[0058] In this embodiment, the data access module receives the command passed in by the server and executes the corresponding command to access the data. After the command is executed, the data structure definition and storage data of the data access table are shown in Table 3;

[0059] Table 3 Data access table structure

[0060] id key type value 137232728428378773727323262 10002 name Wang Wu

[0061] After the command is executed, the data structure definition and storage data of the hash bucket are shown in Table 4;

[0062] Table 4 Hash bucket data structure

[0063]

[0064] This embodiment uses the user name as an example to illustrate the working process and principle of the data access system of the present invention. The types and contents of specific business data in the actual developed software system are ever-changing. The use of the data access system based on Hash association can not only realize ubiquitous data access operations, but also provide a universal data structure design. When building a new software system or upgrading an existing system, there is no need to design a data structure, which reduces the complexity and cost of software development.

[0065] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some or all of the technical features therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope defined by the claims of the present invention.

Claims

1. A ubiquitous data access system based on Hash association, characterized by: Includes client, server and data access modules; The client is responsible for sending an operation request to the server through the server's interface function and receiving its response; The server-side builds a TCP communication channel based on an open source framework, parses and converts the operation request sent by the client through the server-side interface function, implements the data access operation by calling the interface component of the data access module, and finally returns the processing result of the data storage operation to the client; The data access module is responsible for receiving and parsing data access command requests initiated by the server and executing corresponding data access operations.

2. The ubiquitous data access system based on Hash association according to claim 1, characterized in that: The client is responsible for sending operation requests to the server including query, creation, modification and deletion of records.

3. The ubiquitous data access system based on Hash association according to claim 2, characterized in that: The server-side interface function includes three items: return type, function name and function parameters, among which: the return type is defined as a JSON data structure, the function name is fixed as operateTable, and the function parameters include the operation type operateType, the information attribute identifier key, the information category type, the data value value and the hash value; among which, the data value value is the data value of the newly created record, which is only used when a new record is created, including text characters and data files; the hash value is the original hash value of the record to be modified or deleted, which is only used when modifying or deleting the record.

4. The ubiquitous data access system based on Hash association according to claim 3 is characterized in that: The operation type operateType of the server-side interface function is divided into four types: select, update, delete, and insert; the information attribute identifier key is a string representing the unique identifier of the information attribute; the information category is an identifier of a certain category to which the corresponding information attribute belongs, which is customized by the client.

5. The ubiquitous data access system based on Hash association according to claim 4 is characterized in that: The server uses the established TCP communication channel to receive the operateType, key, type, value, and hash parameter values ​​passed by the client, and converts them into corresponding operation commands. The command format is dataop-ot${operateType}-key${key}-type${type}-value${value}-hash${hash}, where the part referenced by "${}" represents the parameter value corresponding to the record operation request passed in by the client.

6. The ubiquitous data access system based on Hash association according to claim 5, characterized in that: The data access module includes a data structure definition component, a Hash bucket component and a data operation interface component; The data structure definition component designs a general data access table structure, and each record includes four fields: id, key, type and value; Where id is the unique identification value of the record stored in the data storage table, key represents the information attribute identifier, type represents the information category, and value represents the data value corresponding to the information category; The Hash bucket component includes two parts: Hash calculation and Hash storage. The Hash calculation uses the SM3 cryptographic hash algorithm to jointly calculate the Hash value of the three fields of key, type, and value in the data access table structure; the calculated Hash value is stored in the Hash bucket in the form of data records. The Hash bucket structure consists of two fields: id and hash. The id is the unique identification value of the Hash bucket data record, corresponding to the unique identification value id of the data access table, and the hash is the calculated Hash value; The data operation interface component provides a data access interface, parses the operation commands transmitted from the server, and executes the corresponding operation commands.

7. The ubiquitous data access system based on Hash association according to claim 6, characterized in that: The data operation interface component executes the corresponding operation command specifically including: s0: Get the data access request parameters passed by the server, including operationType, key, type, value, and hash; s1: Execute the corresponding operation according to the obtained operation type opetateType; (1) When optionType is insert, calculate the hash value corresponding to the passed data structure: When the Hash value corresponding to the input data structure is the same as the Hash value in the Hash bucket, it is not stored; When the Hash value corresponding to the input data structure does not overlap with the Hash value in the Hash bucket, the new data is stored in the data access table and the Hash value is stored in the Hash bucket; (2) When the opetateType is update, the unique identifier id of the data access table is found through the passed hash value, the corresponding data record of the data access table is updated through the id, the original hash value in the hash bucket is deleted, and the hash value is recalculated according to the new key, type, and value and stored in the hash bucket; (3) When opetateType is delete, the unique identifier id of the data access table is found through the passed hash value, the data record corresponding to the data access table is deleted through the id, and the original hash value in the hash bucket is deleted; (4) When opetateType is select, the data records corresponding to the data access table are read through the passed key and type; the passed key and type can be empty; when empty, the value of all corresponding records is read; s2: Returns the result of the data access operation to the server.