A data management method and device, a server, and a storage medium
By combining node data tables, model name data tables, and model value data tables, the problem of high database complexity when the number of nodes or models changes is solved, enabling flexible data storage and retrieval while saving database resources.
Patent Information
- Application Number
- CN202111094885.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-17
- Publication Date
- 2026-01-27
- Estimated Expiration
- 2041-09-17
AI Technical Summary
Existing technologies require modifications to database tables when the number of nodes or models changes during node data storage, resulting in high database complexity, poor flexibility, and the need to add new tables when expanding fields, leading to high resource consumption.
Data is stored in three tables: a node data table, a model name data table, and a model value data table. The node identifier, model name, and specific data content are stored separately. This avoids storing data directly by field. Only the model name data table is expanded with additional fields, and the three data tables are used for related storage.
It enables database table structure to be modified without changing the number of nodes or models, improving database flexibility and resource utilization efficiency, simplifying database operations, and reducing the workload of maintenance code.
Smart Images

Figure CN113849507B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to data storage technology, and more particularly to a data management method, apparatus, server and storage medium. Background Technology
[0002] In existing technology applications, there are generally two methods for storing node data: The first is a one-to-one correspondence between nodes and database fields, where the number of fields corresponds to the number of nodes. When the number of nodes changes, it is necessary to add or delete fields in the database, and too many fields will also affect database query efficiency. For example, if there are 1,000 nodes, the corresponding table structure will have 1,000 fields. Furthermore, a large number of node models will result in a large number of database tables, making management inconvenient and increasing the complexity of the corresponding logic code. When using this method for data persistence, a large number of nodes within a single model requires a large number of corresponding database fields, increasing database complexity; changes to a single node model require modifications to the database tables, resulting in poor flexibility; a large number of node models require a large number of data tables for data storage, consuming database server resources; and as the number of node models increases, new tables need to be added for data management, increasing the amount of maintenance code. The second data persistence method is to use an extended table. With this method, as the number of fields to be extended increases, the data in the extended table will increase exponentially. Summary of the Invention
[0003] This invention provides a data management method, apparatus, server, and storage medium to achieve efficient management of node data.
[0004] In a first aspect, embodiments of the present invention provide a data management method, the method comprising:
[0005] Receive a data processing request, and when the request type of the data processing request is a data storage request, determine at least one target node identifier value in the data processing request;
[0006] The target model name value and the target node name value are determined based on the target node identifier value and the pre-determined node data table;
[0007] The target node attribute name is determined based on the target model name value and the target node name value, combined with a pre-determined model name data table.
[0008] Based on the target encoding value, target model name value, and target node attribute name of the information sending end corresponding to the data processing request, determine the storage location of the data content in the model value data table in the data processing request, and store it accordingly.
[0009] Secondly, embodiments of the present invention also provide a data management device, the device comprising:
[0010] A request receiving module is used to receive data processing requests, and when the request type of the data processing request is a data storage request, it determines at least one target node identifier value in the data processing request.
[0011] The name value determination module is used to determine the target model name value and the target node name value based on the target node identifier value and a pre-determined node data table;
[0012] The attribute name determination module is used to determine the target node attribute name based on the target model name value and the target node name value in combination with a pre-determined model name data table;
[0013] The storage module is used to determine the storage location of the data content in the model value data table in the data processing request based on the target encoding value, target model name value and target node attribute name of the information sending end corresponding to the data processing request, and to store it accordingly.
[0014] Thirdly, embodiments of the present invention also provide a server, the server comprising:
[0015] One or more processors;
[0016] Memory, used to store one or more programs.
[0017] When the one or more programs are executed by the one or more processors, the one or more processors implement a data management method as described in any of the embodiments of the present invention.
[0018] Fourthly, embodiments of the present invention also provide a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements a data management method as described in any of the embodiments of the present invention.
[0019] This invention provides a data management method, apparatus, server, and storage medium. By receiving a data processing request, when the request type is a data storage request, the method determines at least one target node identifier value in the data processing request; based on the target node identifier value and a pre-determined node data table, it determines a target model name value and a target node name value; based on the target model name value and the target node name value and a pre-determined model name data table, it determines a target node attribute name; based on the target encoding value, target model name value, and target node attribute name of the information sending end corresponding to the data processing request, it determines the storage location of the data content in the data processing request in the model value data table and stores it accordingly. This solves the problem of needing to modify database tables when the number of nodes or models changes during data expansion. All data is stored through a node data table, a model name data table, and a model value data table, with each piece of data stored separately in each table. During data storage, different information is obtained by querying different data tables to determine the final storage location of the data. By storing different content in different data tables and then associating the various data tables, it avoids the problem of high database complexity and poor flexibility caused by storing data directly by field. When there is a need for expansion, there is no need to create a new expansion table. You only need to add the fields to be expanded in the model name data table, and then store them in the corresponding data table in the model value data table. Attached Figure Description
[0020] Figure 1 This is a flowchart of a data management method according to Embodiment 1 of the present invention;
[0021] Figure 2 This is a flowchart of a data management method according to Embodiment 2 of the present invention;
[0022] Figure 3 This is a schematic diagram of the structure of a data management device according to Embodiment 3 of the present invention;
[0023] Figure 4 This is a schematic diagram of the structure of a server according to Embodiment 4 of the present invention. Detailed Implementation
[0024] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings. It should be understood that the described embodiments are merely some embodiments of this application, and not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of this application without creative effort are within the scope of protection of this application.
[0025] In the following description, when referring to the accompanying drawings, the same numbers in different drawings denote the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.
[0026] In the description of this application, it should be understood that the terms "first," "second," "third," etc., are used only to distinguish similar objects and are not necessarily used to describe a specific order or sequence, nor should they be construed as indicating or implying relative importance. Those skilled in the art can understand the specific meaning of the above terms in this application according to the specific circumstances. Furthermore, in the description of this application, unless otherwise stated, "multiple" refers to two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. The character " / " generally indicates that the preceding and following related objects have an "or" relationship.
[0027] Example 1
[0028] Figure 1 A flowchart illustrating a data management method according to Embodiment 1 of this application is provided. This method is applicable to situations involving the storage, querying, and other management of node data. The method provided in this embodiment can be executed by a computer device with a server deployed, and includes the following steps:
[0029] S101. Receive a data processing request. When the request type of the data processing request is a data storage request, determine at least one target node identifier value in the data processing request.
[0030] In this embodiment, a data processing request can be specifically understood as communication information requesting corresponding data processing. A data storage request can be specifically understood as communication information requesting data storage. A target node identifier value can be specifically understood as the identifier value of the node that needs to be stored; each node has a corresponding unique identifier value, and the node that needs to be stored is the target node.
[0031] Specifically, taking a server as the execution device as an example, the server receives data processing requests sent by various devices it communicates with. Different types of data processing requests carry different information, and the data format of the data processing requests can also be set according to the different types. By analyzing the received data processing requests, the request type is determined. If the request type is a data storage request, this data processing request carries the identification information of the sender that sent this data processing request, that is, the target node identification value of the target node to which the data needs to be stored. The data processing request is parsed to determine the included target node identification value.
[0032] S102. Determine the target model name value and the target node name value based on the target node identifier value and the pre-determined node data table.
[0033] In this embodiment, the node data table can be understood as a data table that stores the relevant data of each node. The relevant data of a node can be the node's identifier value, the node's name value, the model name value to which the node belongs, etc. The target model name value can be understood as the model name value corresponding to the target node. This application takes the management of data in the TR069 protocol (CPE WAN management protocol) as an example. Accordingly, the model name is a general term for the name of the TR069 node data model. The TR069 node data model is a node model in a fixed format that the TR069 protocol converts base station configuration parameters according to functional categories. The model name value refers to the specific model name stored under the model name field. The target node name value can be understood as the node name value corresponding to the target node.
[0034] Specifically, for each target node identifier in the data processing request, the node data table is searched based on this target node identifier to determine the target model name value and target node name value corresponding to this target node identifier value.
[0035] It should be noted that the data storage in this application involves storing node data. Therefore, when requesting data storage, the sending end of the data processing request will include the relevant node data in the data processing request, and a single data processing request can carry multiple target node identifier values, simultaneously processing multiple target node identifier values to store the relevant data. Furthermore, before receiving a data processing request of type data storage, the server can first send an instruction message to the sending end, instructing each sending end to establish a communication connection with the server and perform data processing. Alternatively, each sending end can automatically send a data processing request after power-on.
[0036] S103. Determine the target node attribute name based on the target model name value and the target node name value, combined with the pre-determined model name data table.
[0037] In this embodiment, the model name data table can be specifically understood as a data table that stores model name values and the names and data values of each node corresponding to each model name value. The target node attribute name can be specifically understood as the attribute name corresponding to the target node name value, with the target node attribute name and attribute name value corresponding one-to-one as key-value pairs.
[0038] Specifically, the model name data table is searched based on the target model name value to determine the attribute name values corresponding to the target model name value. The attribute name values are then filtered based on the target node name value to determine the target node attribute names corresponding to the target node name value.
[0039] S104. Based on the target encoding value, target model name value, and target node attribute name of the information sending end corresponding to the data processing request, determine the storage location of the data content in the model value data table in the data processing request, and store it accordingly.
[0040] In this embodiment, the information sender can be specifically understood as a communication node requesting node data storage, such as a base station. The target encoding value can be specifically understood as the encoding value of the information sender, used to uniquely identify the identity of the information sender. Data content refers to the specific data information that needs to be stored. The model value data table can be specifically understood as a data table storing specific data values. In this application, data is stored through three data tables. The node data table and the model name data table store name-type data, while the model value data table stores the specific data values. That is, the actual data content is stored in the model value data table, but when this data value is obtained, its meaning is not clear. It is necessary to combine it with the model name data table to determine the meaning, and when querying the model name data table, the node data table is needed.
[0041] Specifically, the target encoding value of the information sending end that sends the data processing request is determined. Based on the target encoding value and the target model name, the model value data table is searched to determine the number of rows where the target node is stored in the model value data table. Then, based on the target node attribute name, the data in each column of the model value data table is filtered to determine the number of columns to be stored. Based on the number of rows and columns, the storage location is determined, and the data content is written to the storage location in the model value data table to realize data storage.
[0042] It is important to know that the target node identifier value in the data processing request can be one or multiple. For each target node identifier, the storage location of the corresponding data content in the model value data table is determined in the same way, and the corresponding data is stored accordingly.
[0043] This invention provides a data management method that solves the problem of needing to modify database tables when the number of nodes or models changes during data expansion. All data is stored in a node data table, a model name data table, and a model value data table, with each data entry stored separately in each table. During data storage, different information is retrieved by querying different data tables to determine the final storage location of the data. By storing different content in different data tables and then associating them, the method avoids the high database complexity and poor flexibility caused by storing data directly by field. When expansion is needed, there is no need to create a new expansion table; simply add the fields to be expanded to the model name data table and store them accordingly in the model value data table.
[0044] Example 2
[0045] Figure 2 This is a flowchart illustrating a data management method according to Embodiment 2 of the present invention. The technical solution of this embodiment is further refined based on the above technical solution, and specifically includes the following steps:
[0046] S201. Construct a node data table based on the node identifier and at least one corresponding node identifier value, the model name and model name value corresponding to each node identifier value, and the node name and corresponding node name value.
[0047] In this embodiment, the node identifier value can be specifically understood as the identifier value of the node, used to uniquely identify the node. The node identifier, model name, and each node name are used as fields in the data table to determine the data to be stored in the node data table. For the node identifier, the node identifier value for different nodes is determined. For each node identifier value, the corresponding model name value under the model name and the corresponding node name value in the node name are determined. The node data table is constructed based on the above data.
[0048] For example, an embodiment of this application provides a node data table, as shown in Table 1.
[0049]
[0050]
[0051] In this table, Node is the node identifier, ModeName is the model name, and En_name is the node name. The node name in this application uses the English name as an example. Device1.Ethernet.Interface.{i}.Name and Device1.Ethernet.Interface.{i}.Password are the node identifier values, baseEnb1 and baseEnb2 are the model name values, and name and Password are the node name values. As shown in Table 1, the node data table can also include Ch_name (Chinese name), RW (readability / writeability), Data_type (transmission data type), and Is_available (availability). The name is the Chinese name value, RW and R are readability / writeability values, String is the transmission type value, and TRUE is the availability value.
[0052] S202. Construct a model name data table based on the model name and at least one corresponding model name value, at least one node attribute name corresponding to each model name value, and the attribute name value corresponding to each node attribute name.
[0053] In this embodiment, the node attribute name can be specifically understood as the attribute name corresponding to the node name value. The model name and each node attribute name are used as fields in a data table to determine the data to be stored in the model name data table. For each model name, the corresponding model name value is determined. For each model name value, one or more corresponding node attribute names and the corresponding attribute name values under each node attribute name are determined. The model name data table is constructed based on the above data.
[0054] For example, an embodiment of this application provides a model name data table, as shown in Table 2.
[0055]
[0056]
[0057] Wherein, ModeName is the model name, and columns1-columnN are node attribute names. baseEnb1 and baseAlarm are model name values, name and AlarmRaisedTime are attribute name values corresponding to node attribute name column1; cellId (cell ID) and AlarmIdentifier (alarm ID) are attribute name values corresponding to node attribute name column2... This application embodiment only exemplarily explains the meaning of some data, and those skilled in the art can understand the meaning of other similar data by referring to the above explanation. name, cellId, PLMNID, EnbId (sender ID, or base station ID), and Enable (status) are the attribute name values corresponding to the model name value baseEnb1. There is no necessary relationship between the attribute name values corresponding to each model name value. As can be seen from Table 1, the attribute name value corresponding to the node attribute name can be empty, that is, the number of node attribute names can be set more when constructing the model name data table. If there is no data at this time, the corresponding attribute name value can be set to empty (0). When data is added later, it can be written directly. The size of N can be set according to requirements. After setting the size of N to 0, the number of fields in the data table will be determined accordingly.
[0058] S203. Construct a model value data table based on at least one transmitter code and its corresponding transmitter code value, the model name and model name value corresponding to each transmitter code value, and at least one node attribute name and its corresponding node attribute value.
[0059] In this embodiment, the sender encoding value can be specifically understood as the identity identifier of the information sender, used to identify and distinguish different information senders. The sender encoding, model name, and node attribute name are used as fields in the data table to determine the data to be stored in the model value data table. For each sender encoding value, the corresponding sender encoding value is determined. For each sender encoding value, the corresponding model name value under the model name, one or more node attribute names, and the corresponding attribute name values under the node attribute names are determined. The model value data table is constructed based on the above data.
[0060] For example, an embodiment of this application provides a model value data table, as shown in Table 3.
[0061]
[0062] Wherein, serialNumber is the sender encoding, ModeName is the model name, and column1-columnN are node attribute names. B2001827311 and B2001827312 are sender encoding values, baseEnb1 and baseAlarm are model name values, ENB_001, 2021-09-09 12:13:45, and ENB_003 are different attribute name values corresponding to the node attribute name column1, etc. The meanings of the remaining data are not explained one by one here, but those skilled in the art can understand their meanings by referring to the above similar descriptions.
[0063] It should be noted that in this embodiment, steps S201-S203 are parallel steps, and there is no strict order in their execution. An information sending end includes m nodes, and these m nodes correspond to k models. The i-th model contains q... i There are nodes, i = 1, 2, ..., k, q1 + q2 + ... + q k =m. Three data tables are used to store relevant data for different nodes and different model types.
[0064] As an optional embodiment of this example, this optional embodiment further optimizes A1-A4:
[0065] A1. When new node data exists, determine the model name value to be added corresponding to the new node data.
[0066] In this embodiment, the newly added node data can be specifically understood as expanded node data, and the model name value to be added can be specifically understood as the model name value to which the newly added node data belongs.
[0067] When expanding the data in the data table, the corresponding model name value to be added is determined in advance based on the actual application of the new node data in use and the agreement between the information sending end and the server end. Users can manually input the new node data and the corresponding model name value to be added.
[0068] A2. Query the model name data table based on the model name value to be added.
[0069] A3. Determine if there is a model name value that matches the model name value to be added. If so, determine at least one candidate node attribute name and candidate attribute name value, and perform data addition processing based on each candidate node attribute name and candidate attribute name value, updating the model name data table and model value data table.
[0070] In this embodiment, the candidate node attribute name can be specifically understood as the node attribute name selected from the model name data table. The candidate attribute name value can be specifically understood as the attribute name value corresponding to the candidate node attribute name value.
[0071] Specifically, the model name data table includes one or more model name values. The model name value to be added is matched against these existing model name values. If a match is found, the node attribute names corresponding to this model name value are used as candidate node attribute names, and the attribute name values corresponding to these candidate node attribute names are also used as candidate attribute name values. Based on the attribute name values corresponding to the candidate node attribute names, it is determined whether the new node data should be added to the model name data table as a new node attribute name value. If so, the new node data is added to the model name data table as an attribute name value, updating the model name data table and simultaneously updating the model value data table to store the attribute name value corresponding to the new node data. Otherwise, the new data is added to the model name data table as a new model name value attribute name value, updating the model name data table. After updating the model name data table, the model value data table, which stores the specific data content, also needs to be updated.
[0072] As an optional embodiment of this example, this optional embodiment further optimizes the data addition processing based on the attribute names and attribute name values of each node, and the updating of the model name data table and the model value data table as follows: determine whether there are any candidate attribute name values corresponding to candidate node attribute names that are null; if so, determine the target storage location based on each candidate attribute name value that is null, and write the attribute name value corresponding to the newly added node data to the target storage location; otherwise, determine the new model name value based on the model name value to be added, update the model name data table based on the new model name value, and update the model value data table based on the new model name value and the sending end encoding value corresponding to the newly added node data.
[0073] In this embodiment, the target storage location can be specifically understood as the storage location corresponding to the attribute name value of the newly added node data.
[0074] Specifically, the process involves checking if the candidate node attribute name value is empty. If an empty value exists, it indicates that not all candidate node attribute names have been used. In this case, the attribute name value corresponding to the newly added node data can be added to the model name data table as the new attribute name value. One node attribute name is selected from the empty candidate attribute name values. For ease of data statistics, selection can be done sequentially from front to back (or from smallest to largest). For example, column16 can be selected from node attribute names column16-column20. The storage location corresponding to column16 is determined as the target storage location. The attribute name value corresponding to the newly added node data is written to the target storage location, updating the candidate attribute name value corresponding to column16 from empty to the attribute name value corresponding to the newly added node data. If no empty value exists, it indicates that all candidate node attribute names have been used. A new model name value is then determined based on the model name to be added. The model name value can be automatically generated or prompted for manual input by the user. The new model name value is then used as the new model name value in the model name data table and written to the corresponding field of the model name. Taking Table 2 as an example, the new model name value still corresponds to the column1-columnN fields. The attribute name values corresponding to each column field are written according to the actual data corresponding to the new model name value, thus completing the field expansion. When updating the model value data table, the sender encoding value corresponding to the newly added node data is predetermined. The sender encoding value and the new model name value are written as a new data entry into the model value data table, realizing data expansion. The expanded model value data table can store the data corresponding to the new model name value.
[0075] A4. Otherwise, update the model name data table according to the model name value to be added, and update the model value data table according to the model name value to be added and the sending end encoding value corresponding to the newly added node data.
[0076] Specifically, if no matching model name value exists, the new model name value is used as the new model name value in the model name data table and written to the corresponding field of the model name. Taking Table 2 as an example, the new model name value also corresponds to the column1-columnN fields, and the attribute name values corresponding to each column field are written according to the actual data corresponding to the new model name value, thus completing the field expansion.
[0077] Accordingly, after updating the model name data table, the model value data table, which stores the specific data content, is also updated. The sender encoding value corresponding to the newly added node data is pre-determined, and the sender encoding value and the model name value to be added are written as a new data entry into the model value data table, thus expanding the data. The expanded model value data table can then store the data corresponding to the model name value to be added.
[0078] It's important to know that if a new node identifier value is added, the node data table also needs to be expanded.
[0079] By storing all data in three data tables, the data management method provided in this application provides a fixed number of database fields when storing data. When the number of nodes within a single model changes, there is no need to modify the database table structure; only new configuration data needs to be added, increasing database flexibility. When there are many node models, storing a large amount of data in a single table reduces database resource consumption. When adding a new node model, only the model table data needs to be added; no new table needs to be created, and the logic code remains unchanged. When there is an expansion requirement, there is no need to create a new expansion table; simply add the fields to be expanded to the model name data table and then store the corresponding values in the model value data table.
[0080] By executing steps S201-S203, node data tables, model name data tables, and model value data tables are constructed. After the data tables are constructed, data can be stored and queried. The data tables only need to be constructed once for multiple data storage and queries, eliminating the need for repeated construction. It's also important to understand that data table expansion based on newly added node data can occur before or after data storage or querying. For example, data storage is performed at time t1, data table expansion is performed at time t2 based on newly added node data, and data querying is performed at time t3, where t1... <t2<t3。
[0081] S204. Receive a data processing request. If the request type of the data processing request is a data storage request, execute S205; if the request type of the data processing request is a data query request, execute S213.
[0082] S205. Determine at least one target node identifier value in the data processing request, and determine the target model name value and the target node name value based on the target node identifier value and the pre-determined node data table.
[0083] S206. Based on the target model name value, search the model name data table to obtain at least one attribute name value corresponding to the target node.
[0084] The model name data table stores the values of each model name and the attribute name values under the node attribute name field. By matching the target model name value with each model name value, the attribute name values corresponding to the matched model name values are determined as the attribute name values corresponding to the target node.
[0085] S207. Match and filter the attribute name values based on the target node name value to determine the candidate attribute name values corresponding to the target node name value.
[0086] In this embodiment, the candidate attribute name values can be specifically understood as the attribute name values in the model name data table that match the target node name value. The target node name value is matched and filtered against each attribute name value, and the matching attribute name values are determined as candidate attribute name values.
[0087] S208. Determine the node attribute name corresponding to the candidate attribute name value as the target node attribute name.
[0088] Determine the node attribute name corresponding to the candidate attribute name value, and set this node attribute name value as the target node attribute name.
[0089] S209. Based on the target encoding value and the target model name value, locate the model value data table to determine the number of target storage rows.
[0090] In this embodiment, the target number of stored rows can be specifically understood as the number of rows in the model value data table where the data content in the data processing request is stored. First, the sender's encoded value in the model value data table is matched against the target encoded value to obtain the number of rows where the sender's encoded value matches the target encoded value. The model name values of each obtained row are then matched against the target model name value, and the row containing the matching model name value is determined as the target number of stored rows.
[0091] S210. Determine the column attribute name corresponding to the target number of storage rows.
[0092] In this embodiment, column attribute names can be understood as the attribute names stored in different columns of the data table. By querying the model value data table, the column attribute names corresponding to the target number of stored rows can be directly determined.
[0093] S211. Filter the attribute names of each column according to the target node attribute name to obtain the target column number.
[0094] In this embodiment, the target column count can be specifically understood as the number of columns in the model value data table where the data content in the data processing request is stored. The target node attribute name is matched and filtered against the attribute names of each column, and the column containing the matching attribute name is determined as the target column count.
[0095] S212. Determine the positions corresponding to the target number of rows and columns as the storage positions of the data content in the model value data table in the data processing request, and store them accordingly.
[0096] In the model value data table, the target number of rows and the target number of columns can determine a unique location. This location is used as the storage location of the data content in the model value data table in the data processing request, and the data content is stored in this storage location.
[0097] For example, taking the target node identifier value as Device1.Ethernet.Interface.{i}.Name, the target encoding value of the information sender as B2001827311, and the data content to be stored as ENB_010 as an example, the data storage process is illustrated as follows: When the information sender requests data storage, it carries the target node identifier value Device1.Ethernet.Interface.{i}.Name in the data processing request. Based on the target node identifier value Device1.Ethernet.Interface.{i}.Name, it queries the node data table to determine that the target model name value is baseEnb1 and the target node name value is name. Based on the target model name value baseEnb1, it searches the model name data table to determine that the attribute name values include name, cellId, PLMNID, EnbId, and Enable. By matching the target node name value name with each attribute name value, it is determined that the target node attribute name corresponding to the target node name value name is column1. Based on the target code value B2001827311 and the target model name value baseEnb1, the model value data table is queried to determine the target storage row as the second row (calculated with the field as the first row). The column attribute names are further determined to be column1-columnN. Based on the target node attribute name column1, the column attribute names column1-columnN are filtered to determine the target column number as the third column. The storage location of the second row and third column is determined as the storage location of the data content. The data content is stored by replacing the original stored ENB_001 with the data content to be stored as ENB_010.
[0098] S213. Based on the target query code value and target query model name value in the data processing request, search the model value data table to determine at least one target query node attribute name and corresponding target query node attribute value.
[0099] In this embodiment, the target query code value can be specifically understood as the code value of the information sending end where the node is located when performing node data query; the target query model name value can be specifically understood as the model name value to which the node belongs when performing node data query. The target query node attribute name can be specifically understood as the node attribute name corresponding to the target query code value, such as column1; the target query node attribute value can be specifically understood as the node attribute value that matches the target query code value and the target query model name value when performing data query, such as ENB_001.
[0100] Specifically, the model value data table is first queried based on the target query code value to determine the sending end code value that matches the target query code value. Each sending end code value has a corresponding model name value. Then, the model name value that matches the target query model name value is determined from each model name value. Thus, a row of data can be uniquely identified in the model value data table. The node attribute name corresponding to this row of data is determined to be the target query node attribute name (e.g., column1-columnN), and the node attribute value corresponding to this row of data is the target query node attribute value (e.g., ENB_001, 001, 0001, 001...).
[0101] S214. Based on the target query model name value, search the model name data table to determine at least one target query node attribute name and its corresponding target query attribute name value.
[0102] In this embodiment, the target query attribute name value can be specifically understood as the attribute name value corresponding to the attribute name of the target query node.
[0103] Specifically, the target query model name value is matched with each model name value in the model name data table to obtain the row number where the target query model name value is located. The node attribute name corresponding to this row of data is determined as the target query node attribute name (e.g., column1-columnN), and the attribute name value corresponding to this row of data is used as the target query attribute name value (e.g., name, cellId, PLMNID, EnbId, Enable, etc.).
[0104] S215. Map each target query attribute name value to the target query node attribute value one-to-one using the target query node attribute name, and determine the target query attribute name value corresponding to each target query node attribute value.
[0105] For each target query node attribute name, determine its corresponding target query attribute name value and target query node attribute value, and map the target query attribute name value to the target query node attribute value one-to-one. This then determines the target query attribute name value corresponding to each target query node attribute value. For example, using the name and ENB_001 corresponding to column1, determine the mapping relationship between name and ENB_001.
[0106] S216. Use the attribute values of each target query node and the corresponding target query attribute name values as query results and provide feedback.
[0107] The target query node attribute value represents the specific data content (i.e., data value) obtained from the query, while the target query attribute name value represents the meaning or name of that specific data content. The combination of each target query node attribute value and its corresponding target query attribute name value forms the query result, which is then presented to the user performing the data query. This avoids issues arising from simply presenting the data content without understanding its meaning or type. The byte positions of the target query node attribute values and target query attribute name values can be set when generating the query results. When presenting the query results, it can be configured to display the results on the screen or directly send the results to a pre-defined data receiving terminal.
[0108] For example, by querying Tables 2 and 3, the target query node attribute name is determined to be column1, the corresponding target query node attribute value is ENB_001, the target query attribute name value is name, and the query result includes ENB_001 and name. ENB_001 can be used to determine the data content obtained by querying, and name can be used to determine that the meaning represented by the data content is an English name, that is, the English name of the information sender represented by the target query code value is ENB_001.
[0109] This invention provides a data management method that solves the problem of needing to modify database tables when the number of nodes or models changes during data expansion. It stores all data through a node data table, a model name data table, and a model value data table, separating each data entry into its respective table. By storing different content in different tables and then associating them, it avoids the high database complexity and poor flexibility caused by storing data directly by field. When expansion is needed, there is no need to add a new expansion table; only the fields to be expanded need to be added to the model name data table, and then stored accordingly in the model value data table. When a single model has a large number of nodes, only one new model needs to be added, without adding new tables, simplifying the database structure. When a single model node changes, only the data in the database tables needs to be modified, without adding or deleting fields, improving data storage flexibility. Even with a large number of node models, only three tables need to be managed, saving database server resources and simplifying database operations. Furthermore, when the number of node models increases, there is no need to add new database tables, and related maintenance code does not need to be modified, saving human development resources.
[0110] Example 3
[0111] Figure 3 This is a schematic diagram of a data management device provided in Embodiment 3 of the present invention. The device includes: a request receiving module 31, a name value determination module 32, an attribute name determination module 33, and a storage module 34.
[0112] The request receiving module 31 is used to receive data processing requests, and when the request type of the data processing request is a data storage request, it determines at least one target node identifier value in the data processing request.
[0113] The name value determination module 32 is used to determine the target model name value and the target node name value based on the target node identifier value and a pre-determined node data table;
[0114] The attribute name determination module 33 is used to determine the target node attribute name based on the target model name value and the target node name value in combination with a pre-determined model name data table;
[0115] Storage module 34 is used to determine the storage location of the data content in the model value data table in the data processing request based on the target encoding value, target model name value and target node attribute name of the information sending end corresponding to the data processing request, and to store it accordingly.
[0116] This invention provides a data management device that solves the problem of needing to modify database tables when the number of nodes or models changes during data expansion. It stores all data through a node data table, a model name data table, and a model value data table, separating each data entry into its respective table. By storing different content in different tables and then associating them, it avoids the high database complexity and poor flexibility caused by storing data directly by field. When expansion is needed, there is no need to create a new expansion table; simply add the fields to be expanded to the model name data table and store them accordingly in the model value data table.
[0117] Furthermore, the device also includes:
[0118] The first construction module is used to construct a node data table based on the node identifier and at least one corresponding node identifier value, the model name and model name value corresponding to each node identifier value, and the node name and corresponding node name value.
[0119] The second construction module is used to construct a model name data table based on the model name and at least one corresponding model name value, at least one node attribute name corresponding to each model name value, and the attribute name value corresponding to each node attribute name.
[0120] The third construction module is used to construct a model value data table based on at least one sender code and its corresponding sender code value, the model name corresponding to each sender code value and its model name value, and at least one node attribute name and its corresponding node attribute value.
[0121] Furthermore, the device also includes:
[0122] The new module is used to determine the model name value to be added corresponding to the new node data when new node data exists.
[0123] The query module is used to query the model name data table based on the model name value to be added;
[0124] The model name value judgment module is used to determine whether there is a model name value that matches the model name value to be added. If so, it determines at least one candidate node attribute name and candidate attribute name value, and performs data addition processing based on each candidate node attribute name and candidate attribute name value, updating the model name data table and the model value data table. Otherwise, it updates the model name data table based on the model name value to be added, and updates the model value data table based on the model name value to be added and the sending end encoding value corresponding to the newly added node data.
[0125] Furthermore, the model name value judgment module is specifically used to determine whether there are any candidate attribute name values corresponding to candidate node attribute names that are empty. If so, it determines the target storage location based on each candidate attribute name value that is empty, and writes the attribute name value corresponding to the newly added node data to the target storage location; otherwise, it determines a new model name value based on the model name value to be added, updates the model name data table based on the new model name value, and updates the model value data table based on the new model name value and the sending end encoding value corresponding to the newly added node data.
[0126] Furthermore, the attribute name determination module 33 includes:
[0127] The name value determination unit is used to look up the model name data table based on the target model name value to obtain at least one attribute name value corresponding to the target node;
[0128] The candidate name value determination unit is used to match and filter the attribute name value according to the target node name value, and determine the candidate attribute name value corresponding to the target node name value;
[0129] The attribute name determination unit is used to determine the node attribute name corresponding to the candidate attribute name value as the target node attribute name.
[0130] Furthermore, the storage module 34 includes:
[0131] The storage row number determination unit is used to look up the model value data table based on the target encoding value and the target model name value to determine the target storage row number;
[0132] A column attribute name determination unit is used to determine the column attribute name corresponding to the target number of storage rows;
[0133] The target column number determination unit is used to filter the column attribute names according to the target node attribute names to obtain the target column number;
[0134] The storage location determination unit is used to determine the location corresponding to the target number of storage rows and the target number of columns as the storage location of the data content in the model value data table in the data processing request.
[0135] Furthermore, the device also includes:
[0136] The query module is used to, when the request type of the data processing request is a data query request, search the model value data table according to the target query code value and the target query model name value in the data processing request, and determine at least one target query node attribute name and corresponding target query node attribute value;
[0137] The query name value determination module is used to search the model name data table based on the target query model name value, and determine at least one target query node attribute name and the corresponding target query attribute name value.
[0138] The mapping module is used to map each target query attribute name value to the target query node attribute value one by one using the target query node attribute name, thereby determining the target query attribute name value corresponding to each target query node attribute value.
[0139] The feedback module is used to take the attribute values of each target query node and the corresponding target query attribute name values as query results and provide feedback.
[0140] The data management device provided in the embodiments of the present invention can execute the data management method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of executing the method.
[0141] Example 4
[0142] Figure 4 This is a schematic diagram of the structure of a server provided in Embodiment 4 of the present invention, as shown below. Figure 4 As shown, the server includes a processor 40, a memory 41, an input device 42, and an output device 43; the number of processors 40 in the server can be one or more. Figure 4 Taking a processor 40 as an example; the processor 40, memory 41, input device 42, and output device 43 in the server can be connected via a bus or other means. Figure 4 Taking the example of a connection between China and Israel via a bus.
[0143] The memory 41, as a computer-readable storage medium, can be used to store software programs, computer-executable programs, and modules, such as program instructions / modules corresponding to the data management method in this embodiment of the invention (e.g., request receiving module 31, name value determination module 32, attribute name determination module 33, and storage module 34 in the data management device). The processor 40 executes various functional applications and data processing of the server by running the software programs, instructions, and modules stored in the memory 41, thereby implementing the aforementioned data management method.
[0144] The memory 41 may primarily include a program storage area and a data storage area. The program storage area may store the operating system and at least one application program required for a given function; the data storage area may store data created based on terminal usage. Furthermore, the memory 41 may include high-speed random access memory and non-volatile memory, such as at least one disk storage device, flash memory, or other non-volatile solid-state storage device. In some instances, the memory 41 may further include memory remotely located relative to the processor 40, which can be connected to a server via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
[0145] Input device 42 can be used to receive input numerical or character information, and to generate key signal inputs related to user settings and function control of the server. Output device 43 may include display devices such as a display screen.
[0146] Example 5
[0147] Embodiment 5 of the present invention also provides a storage medium containing computer-executable instructions, which, when executed by a computer processor, are used to perform a data management method, the method comprising:
[0148] Receive a data processing request, and when the request type of the data processing request is a data storage request, determine at least one target node identifier value in the data processing request;
[0149] The target model name value and the target node name value are determined based on the target node identifier value and the pre-determined node data table;
[0150] The target node attribute name is determined based on the target model name value and the target node name value, combined with a pre-determined model name data table.
[0151] Based on the target encoding value, target model name value, and target node attribute name of the information sending end corresponding to the data processing request, determine the storage location of the data content in the model value data table in the data processing request, and store it accordingly.
[0152] Of course, the computer-executable instructions provided in the embodiments of the present invention are not limited to the method operations described above, but can also perform related operations in the data management method provided in any embodiment of the present invention.
[0153] Based on the above description of the implementation methods, those skilled in the art can clearly understand that the present invention can be implemented using software and necessary general-purpose hardware, and of course, it can also be implemented using hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as a computer floppy disk, read-only memory (ROM), random access memory (RAM), flash memory, hard disk, or optical disk, etc., including several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments of the present invention.
[0154] It is worth noting that in the embodiments of the above data management device, the various units and modules included are only divided according to functional logic, but are not limited to the above division, as long as the corresponding functions can be achieved; in addition, the specific names of each functional unit are only for easy differentiation and are not used to limit the scope of protection of the present invention.
[0155] Note that the above description is merely a preferred embodiment of the present invention and the technical principles employed. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and various obvious changes, readjustments, and substitutions can be made without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in detail through the above embodiments, the present invention is not limited to the above embodiments, and may include many other equivalent embodiments without departing from the concept of the present invention, the scope of which is determined by the scope of the appended claims.
Claims
1. A data management method, characterized in that, include: Receive a data processing request, and when the request type of the data processing request is a data storage request, determine at least one target node identifier value in the data processing request; The target model name value and the target node name value are determined based on the target node identifier value and the pre-determined node data table; The target node attribute name is determined based on the target model name value and the target node name value, combined with a pre-determined model name data table. The model name data table contains node attribute names with empty attribute name values, which are used for data writing when data is added. Based on the target encoding value, target model name value, and target node attribute name of the information sending end corresponding to the data processing request, determine the storage location of the data content in the model value data table in the data processing request, and store it accordingly; Before receiving the data processing request, three data tables are constructed: a node data table, a model name data table, and a model value data table, including: Construct a node data table based on the node identifier and at least one corresponding node identifier value, the model name and model name value corresponding to each node identifier value, and the node name and its corresponding node name value; Construct a model name data table based on the model name and at least one corresponding model name value, at least one node attribute name corresponding to each model name value, and the attribute name value corresponding to each node attribute name; A model value data table is constructed based on at least one sender code and its corresponding sender code value, the model name corresponding to each sender code value and its model name value, and at least one node attribute name and its corresponding node attribute value. When new node data is added, determine the model name value to be added corresponding to the new node data; Query the model name data table based on the model name value to be added; Determine whether there is a model name value that matches the model name value to be added. If so, determine at least one candidate node attribute name and candidate attribute name value, and perform data addition processing based on each candidate node attribute name and candidate attribute name value to update the model name data table and model value data table.
2. The method according to claim 1, characterized in that, Also includes: If it is determined that there is no model name value that matches the model name value to be added, then the model name data table is updated according to the model name value to be added, and the model value data table is updated according to the model name value to be added and the sending end encoding value corresponding to the new node data.
3. The method according to claim 1, characterized in that, The step of adding data based on the attribute names and values of each candidate node, and updating the model name data table and model value data table, includes: Determine if there are any candidate node attribute names whose corresponding candidate attribute name values are empty. If so, determine the target storage location based on the empty candidate attribute name values and write the attribute name values corresponding to the newly added node data to the target storage location. Otherwise, a new model name value is determined based on the model name value to be added, the model name data table is updated based on the new model name value, and the model value data table is updated based on the new model name value and the sending end encoding value corresponding to the newly added node data.
4. The method according to claim 1, characterized in that, The step of determining the target node attribute name based on the target model name value and the target node name value in conjunction with a pre-determined model name data table includes: Based on the target model name value, look up the model name data table to obtain at least one attribute name value corresponding to the target node; The attribute name values are matched and filtered based on the target node name value to determine the candidate attribute name values corresponding to the target node name value; The node attribute name corresponding to the candidate attribute name value is determined as the target node attribute name.
5. The method according to claim 1, characterized in that, The step of determining the storage location of the data content in the model value data table in the data processing request based on the target encoding value, target model name value, and target node attribute name of the information sending end includes: The target number of storage rows is determined by searching the model value data table based on the target encoding value and the target model name value. Determine the column attribute name corresponding to the target number of storage rows; The number of target columns is obtained by filtering the column attribute names according to the target node attribute names; The positions corresponding to the target number of rows and columns are determined as the storage locations of the data content in the model value data table in the data processing request.
6. The method according to claim 1, characterized in that, Also includes: When the request type of the data processing request is a data query request, the model value data table is searched according to the target query code value and the target query model name value in the data processing request to determine at least one target query node attribute name and the corresponding target query node attribute value; Based on the target query model name value, search the model name data table to determine at least one target query node attribute name and its corresponding target query attribute name value; By mapping the target query attribute name value to the target query node attribute value one by one using the target query node attribute name, the target query attribute name value corresponding to each target query node attribute value is determined. The attribute values of each target query node and the corresponding target query attribute name values are used as query results and fed back.
7. A data management device, characterized in that, include: A request receiving module is used to receive data processing requests, and when the request type of the data processing request is a data storage request, it determines at least one target node identifier value in the data processing request. The name value determination module is used to determine the target model name value and the target node name value based on the target node identifier value and a pre-determined node data table; The attribute name determination module is used to determine the target node attribute name based on the target model name value and the target node name value in combination with a pre-determined model name data table. The model name data table contains node attribute names with empty attribute name values, which are used for data writing when data is added. The storage module is used to determine the storage location of the data content in the data processing request in the model value data table based on the target encoding value, target model name value and target node attribute name of the information sending end corresponding to the data processing request, and to store it accordingly; The first construction module, the second construction module, and the third construction module are used to construct three data tables—a node data table, a model name data table, and a model value data table—before receiving the data processing request. The first construction module is used to construct a node data table based on the node identifier and at least one corresponding node identifier value, the model name and model name value corresponding to each node identifier value, and the node name and corresponding node name value before receiving the data processing request. The second construction module is used to construct a model name data table based on the model name and at least one corresponding model name value, at least one node attribute name corresponding to each model name value, and the attribute name value corresponding to each node attribute name. The third construction module is used to construct a model value data table based on at least one transmitter encoding and its corresponding transmitter encoding value, the model name corresponding to each transmitter encoding value and its model name value, and at least one node attribute name and its corresponding node attribute value. The new module is used to determine the model name value to be added corresponding to the new node data when new node data exists. The query module is used to query the model name data table based on the model name value to be added; The model name value judgment module is used to determine whether there is a model name value that matches the model name value to be added. If so, it determines at least one candidate node attribute name and candidate attribute name value, and performs data addition processing based on each candidate node attribute name and candidate attribute name value, updating the model name data table and the model value data table.
8. A server, characterized in that, The server includes: One or more processors; Memory, used to store one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors implement a data management method as described in any one of claims 1-6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the program implements a data management method as described in any one of claims 1-6.
Citation Information
Patent Citations
Business function realization method and device, computer equipment and storage medium
CN107918548A