Data management method and device, electronic device, and computer-readable storage medium

By building a tree-structured resource data model, the redundancy problem in resource package management is solved, flexible and efficient resource package management is achieved, and system maintenance costs are reduced.

CN119646299BActive Publication Date: 2025-09-16BEIJING BAIDU NETCOM SCI & TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411709406.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-26
Publication Date
2025-09-16
Estimated Expiration
2044-11-26

AI Technical Summary

Technical Problem

In the existing technology, the data model corresponding to each resource package is customized, resulting in a large number of redundant fields and repeated codes, making system maintenance difficult, and seriously wasting resources, making it difficult to flexibly manage multiple resource packages.

Method used

A tree-structured resource data model is used to build the resource data model through the correspondence between business attributes and resource packages. Each node corresponds to a resource class, and the field corresponds to the business attribute, achieving unified management.

Benefits of technology

It reduces resource package management costs, improves development efficiency, reduces the number of redundant fields and data tables, and simplifies system maintenance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119646299B_ABST
    Figure CN119646299B_ABST
Patent Text Reader

Abstract

The present disclosure provides a data management method and apparatus, an electronic device, and a computer-readable storage medium, and relates to the field of data processing technology, particularly to technical fields such as resource package management and unified data management. A specific implementation scheme is as follows: obtaining business attributes corresponding to multiple resource packages; the resource packages are used to implement at least one business function, and the business function corresponds to at least one business attribute; constructing a resource data model based on the correspondence between the business attributes and the resource packages and the hierarchical relationship between the business attributes; the resource data model is a tree structure; each node of the tree structure corresponds to at least one resource class; the resource class includes at least one field, and the field corresponds to at least one business attribute; and managing the resource data corresponding to the multiple resource packages based on the resource data model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of data processing technology, and in particular to technical fields such as resource package management and unified data management. Specifically, the present disclosure relates to a data management method and apparatus, an electronic device, and a computer-readable storage medium. Background Art

[0002] With the development of internet technology, users' production, life, and entertainment are increasingly dependent on internet products, such as data traffic, cloud platform resources, and online learning resources. To make it more convenient for users to use internet products, internet product providers package different internet products into resource packages, or product packages, for users to choose from.

[0003] The launch of resource packages is influenced by many factors, including the scale of Internet product platforms, user consumption behavior models, industry trend changes, social hot events, and changes in Internet products. Its biggest feature is the high level of changes, which places high demands on the flexibility of resource package configuration. Summary of the Invention

[0004] The present disclosure provides a data management method and device, an electronic device, and a computer-readable storage medium.

[0005] According to a first aspect of the present disclosure, there is provided a data management method, the method comprising:

[0006] Acquire business attributes corresponding to a plurality of resource packages; the resource packages are used to implement at least one business function, and the business function corresponds to at least one business attribute;

[0007] A resource data model is constructed based on the correspondence between the business attributes and the resource packages and the hierarchical relationship between the business attributes; the resource data model is a tree structure; each node of the tree structure corresponds to at least one resource class; the resource class includes at least one field, and the field corresponds to at least one business attribute;

[0008] Based on the resource data model, resource data corresponding to the plurality of resource packages are managed.

[0009] According to a second aspect of the present disclosure, there is provided a data management device, the device comprising:

[0010] A data acquisition module, configured to acquire business attributes corresponding to a plurality of resource packages; the resource packages are used to implement at least one business function, and the business function corresponds to at least one business attribute;

[0011] A data structure module is configured to construct a resource data model based on the correspondence between the business attributes and the resource packages and the hierarchical relationship between the business attributes; the resource data model is a tree structure; each node of the tree structure corresponds to at least one resource class; the resource class includes at least one field, and the field corresponds to at least one business attribute;

[0012] The data management module is used to manage the resource data corresponding to the plurality of resource packages based on the resource data model.

[0013] According to a third aspect of the present disclosure, an electronic device is provided, including:

[0014] at least one processor; and

[0015] A memory communicatively connected to the at least one processor; wherein,

[0016] The memory stores instructions that can be executed by the at least one processor. The instructions are executed by the at least one processor so that the at least one processor can execute the data management method.

[0017] According to a fourth aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable a computer to execute the above-mentioned data management method.

[0018] According to a fifth aspect of the present disclosure, a computer program product is provided, comprising a computer program, which implements the above-mentioned data management method when executed by a processor.

[0019] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present disclosure, nor are they intended to limit the scope of the present disclosure. Other features of the present disclosure will become readily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] The accompanying drawings are provided to facilitate a better understanding of the present invention and do not constitute a limitation of the present disclosure.

[0021] Figure 1 is a flow chart of a data management method provided by an embodiment of the present disclosure;

[0022] Figure 2 This is a flowchart of some steps of another data management method provided by an embodiment of the present disclosure;

[0023] Figure 3 This is a flowchart of some steps of another data management method provided by an embodiment of the present disclosure;

[0024] Figure 4This is a flowchart of some steps of another data management method provided by an embodiment of the present disclosure;

[0025] Figure 5 This is a flowchart of some steps of another data management method provided by an embodiment of the present disclosure;

[0026] Figure 6 This is a flowchart of some steps of another data management method provided by an embodiment of the present disclosure;

[0027] Figure 7 This is a flowchart of some steps of another data management method provided by an embodiment of the present disclosure;

[0028] Figure 8 is a structural diagram of a data management device provided by an embodiment of the present disclosure;

[0029] Figure 9 is a block diagram of an electronic device for implementing the data management method according to an embodiment of the present disclosure. DETAILED DESCRIPTION

[0030] The following description of exemplary embodiments of the present disclosure is made in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding. These details should be considered as merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.

[0031] The resource package in the embodiment of the present disclosure is equivalent to the concept of a package, which is a package of Internet products of different specifications.

[0032] In some specific implementations, in the field of communications, the resource package of the embodiment of the present disclosure may be a traffic package, such as a video traffic package, an APP (application) traffic package, a regional traffic package, a time period traffic package, a festival traffic package, and the like.

[0033] In some specific implementations, in the field of cloud technology, the resource package of the embodiment of the present disclosure may be a cloud platform resource package, such as a cloud product combination package, a product fixed usage deduction package, and the like.

[0034] In some specific implementations, in the field of online learning, the resource package of the embodiment of the present disclosure may be a course package, such as a general course package, a premium course package, a field course package, a new course limited-time package, etc.

[0035] In some related technologies, each resource package corresponds to a special data model that is customized and implemented.

[0036] Each data model has different fields. Therefore, different resource packages cannot be stored in the same table. That is, the data corresponding to a resource package can only be stored in one table.

[0037] At the same time, each data model needs to be customized to implement a set of matching verification logic. By using a separate set of calculation logic, it is used to verify whether the resource package meets the usage matching conditions and confirm whether the resource package can be used.

[0038] Each resource package is customized to implement a special data model, resulting in a large number of resource package classes in the program. These resource package classes have a large number of redundant fields, and the system model has a low degree of abstraction, which is very unfavorable for the long-term maintenance and upgrade of the system.

[0039] The data corresponding to a resource package is stored in one table. Multiple resource packages require the creation of thousands of new tables, and a large number of uncertain fields are redundant, resulting in serious waste of resources.

[0040] At the same time, a set of matching verification logic is developed separately each time, resulting in a large amount of redundant and repeated code stored in the system, which in turn makes long-term maintenance of the system difficult.

[0041] For example, if there are 50 resource packages, each with approximately 20 flexible configurations, there could be as many as 1,500 duplicate fields. A change to the meaning, logic, or algorithm of a field would require simultaneous upgrades across many code locations. Furthermore, 50 different data tables would need to be maintained, along with a complex mapping manager logic to determine which of these 50 tables is being accessed, placing a significant development burden on the system.

[0042] The data management method and device, electronic device, and computer-readable storage medium provided by the embodiments of the present disclosure are intended to solve at least one of the above technical problems in the prior art.

[0043] The data management method provided in the embodiments of the present disclosure can be executed by an electronic device such as a terminal device or a server. The terminal device can be an in-vehicle device, a user equipment (UE), a mobile device, a user terminal, a terminal, a cellular phone, a cordless phone, a personal digital assistant (PDA), a handheld device, a computing device, an in-vehicle device, a wearable device, etc. The method can be implemented by a processor calling computer-readable program instructions stored in a memory. Alternatively, the method can be executed by a server.

[0044] Figure 1 FIG. 1 shows a flow chart of a data management method provided by an embodiment of the present disclosure. Figure 1As shown in , the data management method provided by the embodiment of the present disclosure may include step S110, step S120, and step S130.

[0045] In step S110, business attributes corresponding to multiple resource packages are obtained;

[0046] In step S120, a resource data model is constructed based on the correspondence between business attributes and resource packages and the hierarchical relationship of business attributes;

[0047] In step S130 , resource data corresponding to the plurality of resource packages are managed based on the resource data model.

[0048] For example, a resource package is a package of an internet product that implements corresponding business functions for users. An internet product can implement at least one business function, so a resource package can implement at least one business function.

[0049] Each business function has corresponding business attributes, such as the ID (identification) corresponding to the business function, the billing method corresponding to the business function, the start time of the business function, the end time of the business function, the functional area corresponding to the business function, etc. The business attributes corresponding to the business function implemented by each resource package are the business attributes corresponding to the resource package.

[0050] Each business attribute has a corresponding business attribute value. For example, the ID corresponding to the business function is the business attribute, and the specific ID value is the business attribute value corresponding to the business attribute.

[0051] In some possible implementations, in step S110 , obtaining the service attributes corresponding to the resource package may be that a server of a service provider providing the resource package obtains the service attributes corresponding to the resource package.

[0052] In some possible implementations, the business attributes corresponding to multiple resource packages in the same field can be obtained, or the business attributes corresponding to multiple resource packages in different fields can be obtained. For example, the business attributes corresponding to multiple resource packages in the communications field can be obtained, or the business attributes corresponding to multiple resource packages in the communications field and the cloud technology field can be obtained.

[0053] That is to say, the data management method provided by the embodiment of the present disclosure can manage resource packages in one field as well as resource packages in different fields.

[0054] In some possible implementations, some business attributes are hierarchical. For example, if some internet products are billed in a hierarchical manner, the business attributes of the billing method corresponding to the resource package containing the internet product may include first-level billing items, second-level billing items, and third-level billing items. Similarly, other business attributes may also be hierarchical.

[0055] In some possible implementations, in step S120 , a resource data model is constructed based on the correspondence between the resource packages and the business attributes and the hierarchical relationship of the business attributes obtained in step S110 .

[0056] The resource data model is a tree structure. A tree structure, also known as a tree-like structure, is a hierarchical set of n (n >= 0) nodes. Nodes have a one-to-many relationship; a node can have multiple child nodes. However, with the exception of the root node, each node has exactly one predecessor node. The root node has no predecessor nodes and serves as the starting point for the entire tree. Leaf nodes have no successor nodes and are located at the bottom of the tree.

[0057] Each node of the resource data model corresponds to at least one class that can be implemented by a program, namely, a resource class.

[0058] A class is the basic unit of a program. A class can contain multiple fields. Fields are also called "member variables" and are used for data exchange within the class.

[0059] The fields of the resource class of the resource data model constructed in the data management method provided by the embodiment of the present disclosure are defined according to business attributes, that is, each resource class includes at least one field, and each field corresponds to at least one business attribute.

[0060] In some disclosed embodiments, fields can be defined according to business attributes, and the fields can be combined into resource classes according to the correspondence between business attributes and resource packages and the hierarchical relationship of business attributes, and the hierarchical relationship of resource classes can be determined. A tree structure, i.e., a resource data model, can be constructed based on the hierarchical relationship of resource classes.

[0061] Each resource class includes at least one field, and each field corresponds to at least one business attribute.

[0062] That is, each node of the tree structure corresponds to at least one resource class; each resource class includes at least one field, and each field corresponds to at least one business attribute.

[0063] In some possible implementations, in step S130, based on the resource data model, managing the resource data corresponding to multiple resource packages can be to instantiate the resource class of the resource data model according to the resource data corresponding to the resource packages, and to manage the resource data corresponding to the resource packages by managing the resource class.

[0064] Because the resource data model is a tree structure, all nodes are derived from the root node. Therefore, the resource classes corresponding to the nodes can also be derived from the resource classes corresponding to the root node. By managing the resource classes corresponding to the root node, unified management of all resource classes can be achieved. Specific processing for a resource class can be implemented based on the processing of that resource class, which greatly reduces management costs.

[0065] In the data management method provided in the embodiment of the present disclosure, a massive amount of flexible and personalized resource packages are modeled and integrated through an abstract data model, thereby improving the model abstraction, reducing the management cost of the resource packages, and thereby improving the development efficiency of developers.

[0066] The data management method provided by the embodiment of the present disclosure is described in detail below.

[0067] As described above, in some possible implementations, a resource data model is constructed based on the correspondence between business attributes and resource packages and the hierarchical relationship of business attributes.

[0068] Figure 2 The following is a flow chart showing an implementation method of constructing a resource data model based on the correspondence between business attributes and resource packages and the hierarchical relationship between business attributes. Figure 2 As shown, constructing a resource data model according to the correspondence between business attributes and resource packages and the hierarchical relationship of business attributes may include step S210, step S220, and step S230.

[0069] In step S210, the service attributes to be processed are divided into common service attributes and non-common service attributes according to the correspondence between the service attributes to be processed corresponding to the K-th layer child nodes of the tree structure and the resource packages to be processed corresponding to the K-th layer child nodes of the tree structure;

[0070] In step S220, the fields of the resource class corresponding to the K-th level child node of the tree structure are determined according to the common business attributes;

[0071] In step S230 , the to-be-processed service attributes corresponding to the K+1th layer child node of the tree structure and the to-be-processed resource packages corresponding to the K+1th layer child node of the tree structure are determined according to the non-common service attributes.

[0072] Wherein, K is an integer greater than or equal to 0.

[0073] In some possible implementations, in step S210, the common business attributes are the business attributes corresponding to all resource packages to be processed. For example, if each resource package has a unique ID that distinguishes it from other resource packages, the resource package ID is the common business attribute of all resource packages.

[0074] In some possible implementations, non-shared business attributes are other business attributes to be processed in addition to shared business attributes. These can be business attributes shared by some resource packages to be processed, or they can be business attributes unique to a particular resource package to be processed. For example, if not all resource packages have usage area restrictions, the business area corresponding to the business function can be a non-shared business attribute.

[0075] In some possible implementations, in step S220, the fields of the resource class corresponding to the K-th layer child node of the tree structure are determined based on the common business attributes. The fields of the resource class corresponding to the K-th layer child node are defined based on the common business attributes, and the obtained fields are combined to form the resource class corresponding to the K-th layer child node.

[0076] In some possible implementations, the resource class can be set as a polymorphic class, and the resource class corresponding to its child node can be set as the polymorphic subclass corresponding to the polymorphic class. Since the polymorphic subclass can inherit the fields of the polymorphic class, that is, the fields defined according to the common business attributes can be inherited, it is only necessary to set the fields corresponding to the non-common business attributes in the polymorphic subclass.

[0077] In some possible implementations, in step S230, since in the tree structure, the K-layer child nodes and the K+1-th layer child nodes are in a one-to-many relationship, a K-layer child node may correspond to more than one K+1-th layer child node.

[0078] In some possible implementations, when the resource packages to be processed corresponding to the K-th layer child nodes of multiple tree structures correspond to the same non-shared business attributes, the resource packages to be processed corresponding to the K-th layer child nodes of these multiple tree structures are used as the resource packages to be processed corresponding to a K+1-th layer child node of the tree structure, and the business attributes corresponding to the resource packages to be processed corresponding to the K-th layer child nodes of these multiple tree structures in the non-shared business attributes are used as the business attributes to be processed corresponding to the K+1-th layer child node.

[0079] That is to say, in some possible implementation methods, the non-shared business attributes may be business attributes shared by some resource packages to be processed. The business attributes to be processed corresponding to the K+1-th layer child node of the tree structure and the resource packages to be processed corresponding to the K+1-th layer child node of the tree structure are determined based on the non-shared business attributes. This may be to use this part of the resource packages to be processed as a resource package to be processed corresponding to a K+1-th layer child node, and to use the business attributes corresponding to this part of the resource packages to be processed in the non-shared business attributes as the business attributes to be processed corresponding to the K+1-th layer child node.

[0080] In some possible implementations, by analogy, the resource packages to be processed that have common non-shared business attributes are continued to be selected from the remaining resource packages to be processed as the resource packages to be processed corresponding to the K+1-th layer child node, and the above method is used to determine the business attributes to be processed corresponding to the K+1-th layer child node.

[0081] In some possible implementations, there may be one or more resource packages left to be processed that do not have a common non-shared service attribute.

[0082] In some possible implementations, when an independent resource package to be processed exists among the resource packages to be processed corresponding to the K-th layer child node of the tree structure, the independent resource package to be processed is used as the resource package to be processed corresponding to a K+1-th layer child node of the tree structure, and the service attributes corresponding to the independent resource package to be processed in the non-shared service attributes are used as the service attributes to be processed corresponding to the K+1-th layer child node;

[0083] The independent to-be-processed resource package is a to-be-processed resource package that does not have the same non-shared business attributes as the to-be-processed resource packages corresponding to the K-th layer child nodes of other tree structures.

[0084] That is, in some possible implementations, the non-shared service attributes may also be service attributes unique to a resource package to be processed. Determining the service attributes corresponding to the K+1th-level child node in the tree structure and the resource package to be processed corresponding to the K+1th-level child node in the tree structure based on the non-shared service attributes may include treating the resource package to be processed as the resource package to be processed corresponding to the K+1th-level child node, and using the service attributes corresponding to the resource package to be processed in the non-shared service attributes as the service attributes corresponding to the K+1th-level child node.

[0085] Specifically, when K is 0, the K-th level child node in the tree structure is the root node. The resource packages to be processed corresponding to the K-th level child node are all resource packages obtained in step S110, and the service attributes to be processed corresponding to the K-th level child node are all service attributes obtained in step S110. Common service attributes are service attributes common to all resource packages obtained in step S110, and non-common service attributes are service attributes other than the common service attributes among all service attributes obtained in step S110.

[0086] Define the fields of the resource class corresponding to the root node according to the common business attributes, and compose the obtained fields into the resource class corresponding to the root child node.

[0087] The resource packages with common non-shared business attributes are used as the resource packages to be processed corresponding to the child nodes (such as the first child node) of a root node, and the other business attributes corresponding to these multiple resource packages to be processed except the shared business attributes are used as the business attributes to be processed corresponding to the first child node.

[0088] Similarly, the business attributes to be processed corresponding to the first child node are divided into common business attributes and non-common business attributes, and the resource packages to be processed and the business attributes to be processed corresponding to the child nodes of the first child node are obtained in the same way as the root node is processed, and then the resource packages to be processed and the business attributes to be processed corresponding to the child nodes of the child nodes of the first child node are determined... until all the business attributes to be processed corresponding to the first child node have corresponding fields.

[0089] From the remaining resource packages, continue to select resource packages with common non-shared business attributes as the resource packages to be processed corresponding to the child nodes of a root node (such as the second child node). Use the above method to create the resource class corresponding to the second child node, and the resource class corresponding to the child node of the child node of the second child node...

[0090] If there are one or more resource packages left at the end, which, in addition to the common business attributes, do not have the same non-common business attributes as other resource packages, each of the one or more resource packages may be processed separately.

[0091] For each resource package, the resource package is treated as a child node of a root node, and the fields of the resource class corresponding to the child node are generated according to the non-common business attributes corresponding to the resource package.

[0092] The above-mentioned cyclic process can realize the establishment of a tree-structured data model, and ensure that the resource classes corresponding to all nodes in the tree structure, including the resource class corresponding to the root node, have any positive integer number of fields, and the business attributes corresponding to each field are different.

[0093] In other words, based on the tree structure, it is possible to globally support countless types of data packages, maintain only one class with no duplicate fields, share common business attributes through parent class fields, and maintain different business attributes through polymorphism. This eliminates the maintenance cost of a large number of redundant fields.

[0094] In some possible implementations, since some business attributes are business attributes with a hierarchical relationship and some business attributes are business attributes without a hierarchical relationship, the manner of defining the fields corresponding to the business attributes is different for different business attributes.

[0095] Figure 3 FIG. 1 shows a flow chart of an implementation method for determining the fields of the resource class corresponding to the K-th layer child node of the tree structure according to the common business attributes when the common business attributes are business attributes with a hierarchical relationship, as shown in FIG. Figure 3 As shown, in the case where the common business attributes are business attributes with a hierarchical relationship, determining the fields of the resource class corresponding to the K-th layer child node of the tree structure according to the common business attributes may include step S310.

[0096] In step S310, when the common business attributes are business attributes with a hierarchical relationship, the common attribute fields are set as polymorphic fields, and a custom polymorphic class corresponding to the common attribute fields is generated according to the hierarchical relationship of the common business attributes;

[0097] The common attribute field is a field of the resource class corresponding to the K-th level child node of the tree structure corresponding to the common business attribute, that is, a field defined according to the common business attribute.

[0098] In some possible implementations, in step S310 , a field defined according to a common business attribute is set as a polymorphic field. Specifically, the data type corresponding to the field can be set as a polymorphic class.

[0099] Polymorphism refers to providing a unified interface for entities of different data types. By setting a class as polymorphic, the operations supported by the class can be applied to other classes.

[0100] In some possible implementations, a custom polymorphic class corresponding to the common attribute fields and a polymorphic subclass of the custom polymorphic class may be generated according to the hierarchical relationship corresponding to the common business attributes.

[0101] If the billing item business attribute is a business attribute with a hierarchical structure, with first-level classification billing items, second-level classification billing items, third-level classification billing items..., then the billing item field can be defined according to the billing item, and the field can be set to a custom polymorphic class. A subclass of the custom polymorphic class can be derived based on the first-level classification billing item, and a subclass of the custom polymorphic class corresponding to the first-level classification billing item can be derived based on the second-level classification billing item, and so on, until the classes corresponding to all levels are generated.

[0102] By setting polymorphic fields, the hierarchical relationship of business attributes can be clearly represented through the class derivation relationship, making it easier for developers to manage the hierarchical relationship of business attributes.

[0103] In some possible implementations, a new resource class may be formed based on fields corresponding to other common business attributes and the polymorphic subclass of the custom polymorphic class. The resource class may also be a resource class corresponding to the K-th layer child node.

[0104] Similarly, a new resource class can be formed based on the fields corresponding to other common business attributes and the polymorphic subclass of the polymorphic subclass of the custom polymorphic class. This resource class can also serve as a resource class corresponding to the K-th layer child node.

[0105] By forming a new resource class, developers can manage resource packages with business attributes of the corresponding level directly by instantiating the corresponding resource class. For example, if the billing item business attribute is a business attribute with a hierarchical structure, a new resource class can be formed by using the other fields of the resource class corresponding to the K-th level child node of the tree structure and the derived polymorphic subclass of the first-level classification billing item to facilitate developers to manage resource packages using the first-level classification billing items.

[0106] Figure 4 A flowchart of an implementation method for determining the fields of the resource class corresponding to the K-th layer child node of the tree structure according to the common business attributes is shown in the case where the common business attributes are business attributes that do not have a hierarchical relationship, such as Figure 4 As shown, in the case where the common business attributes are business attributes without a hierarchical relationship, determining the fields of the resource class corresponding to the K-th layer child node of the tree structure according to the common business attributes may include step S410.

[0107] In step S410, when the common business attributes are business attributes that do not have a hierarchical relationship, the data type of the common attribute field is determined according to the business function corresponding to the common business attributes; when the data type of the common attribute field is a data type that is not defined in the predefined database, the common attribute field is set to a non-polymorphic field, and a non-polymorphic class corresponding to the common attribute field is generated.

[0108] The common attribute field is a field of the resource class corresponding to the K-th level child node of the tree structure corresponding to the common business attribute, that is, a field defined according to the common business attribute.

[0109] In some possible implementations, in step S410, determining the data type of the common attribute field based on the business function corresponding to the common business attribute may specifically be determining the data type of the common attribute field based on the business attribute value corresponding to the common business attribute. For example, the data type of the field corresponding to the business attribute of the resource package ID is set to character.

[0110] In some possible implementations, when the data type of the common attribute field is a data type not defined in a predefined database, the common attribute field is set as a non-polymorphic field, and a non-polymorphic class corresponding to the common attribute field is generated based on the business attribute value corresponding to the common business attribute, that is, the data type of the business attribute value corresponding to the common business attribute is combined based on the data type defined in the predefined database.

[0111] By setting non-polymorphic fields, you can combine data types not defined in the predefined database based on the data types defined in the predefined database, avoiding problems caused by introducing a new database.

[0112] In some possible implementations, when the common business attributes corresponding to the K-th level child nodes of the tree structure change, the resource class corresponding to the K-th level child nodes of the already generated tree structure can be modified according to the changes in business attributes to generate a new resource class to adapt to the changes in the common business attributes without regenerating the tree structure. The new resource class is also the resource class corresponding to the K-th level child nodes of the tree structure.

[0113] For example, in some specific implementations, the charging method for a certain business function implemented by a certain type of resource package (such as the pending resource package corresponding to the K-th level child node of the tree structure) was originally method A. Due to business upgrades and other reasons, the charging method of the business function was changed to method B, and method A and method B cannot be represented by the same field. After determining the corresponding resource class, the fields corresponding to the business attributes related to charging of the resource class can be modified to generate a new resource class to adapt to the change in charging method.

[0114] Similarly, when the resource package to be processed corresponding to the K-th level child node of the tree structure can realize new business functions and add new business attributes, it is also possible to add fields corresponding to the new business attributes on the basis of the original resource class to generate a new resource class to adapt to the increase in business functions.

[0115] In some specific implementations, the original resource class is not deleted to facilitate the management of the resource packages that have not been updated to provide services to users when the resource packages of some users are not updated in time.

[0116] As described above, in some possible implementations, when there is a new resource package, the resource package can be managed according to the service attributes corresponding to the resource package through the resource data model generated by the embodiment of the present disclosure.

[0117] Figure 5 The following is a flow chart showing how to determine the resource class corresponding to a new resource package. Figure 5 As shown, when there is a new resource package, determining the resource class corresponding to the resource package may include step S510.

[0118] In step S510, the business attributes corresponding to the resource package to be stored are obtained, and the resource class of the tree structure corresponding to the resource package to be stored is determined according to the fields corresponding to the business attributes in the tree structure.

[0119] In some possible implementations, in step S510 , the business attributes corresponding to the resource package to be stored are obtained. The method of obtaining the attributes is the same as that in step S110 and will not be repeated here.

[0120] In some possible implementations, based on the acquired business attributes and the corresponding fields in the resource data model, different business attributes may appear in different resource classes. The resource classes corresponding to these fields can be determined based on the node positions corresponding to the resource classes in the resource data model and the relationship between the nodes to determine the tree-structured resource classes corresponding to the resource package to be stored.

[0121] In some specific implementations, you can start from the root node, remove the business attributes corresponding to the root node's fields from the business attributes corresponding to the resource package to be stored, determine a child node of the root node based on the remaining business attributes, and remove the business attributes corresponding to the child node from the business attributes corresponding to the resource package to be stored, determine a child node of the child node of the root node based on the remaining business attributes, and so on, until all business attributes are removed, then the resource class corresponding to the last passed node is the resource class of the tree structure corresponding to the resource package to be stored.

[0122] Of course, in some specific implementations, the method provided in the embodiment of the present disclosure can also be used to expand the resource data model according to the resource package to be stored. That is, if there is no corresponding field for the business attribute corresponding to the resource package to be stored, the field can be defined according to the business attribute to generate a resource class and generate a node of the resource data model.

[0123] In this way, it is theoretically possible to achieve that all resource packages can be uniformly expressed through a "grand unified" resource data model, which greatly facilitates developers.

[0124] As described above, in some possible implementations, based on the resource data model, the management of resource data corresponding to multiple resource packages can be to instantiate the resource class of the resource data model according to the resource data corresponding to the resource package, and to manage the resource data corresponding to the resource package by managing the resource class.

[0125] Figure 6 A schematic diagram of a process for managing resource data corresponding to multiple resource packages based on a resource data model is shown. Figure 6 As shown, managing resource data corresponding to multiple resource packages may include step S610 and step S620.

[0126] In step S610, a data table is designed based on the resource data model;

[0127] In step S620, a database is generated based on the data table, and resource data corresponding to the plurality of resource packages are stored in the database.

[0128] In some possible implementations, in step S610 , the resource data model has a tree structure, and therefore, the data table designed based on the resource data model may also have a tree structure.

[0129] The fields in the data table are consistent with the fields in the resource data model, and the values ​​corresponding to the fields are the business attribute values ​​of the business attributes corresponding to the fields.

[0130] In some specific implementations, since each node of the resource data model has a corresponding resource class, a data table can be designed based on serialization technology.

[0131] In some possible implementations, in step S620 , a database is generated based on the data table, and the database is used to store resource data corresponding to the resource package.

[0132] In some possible implementations, the resource data corresponding to the multiple resource bundles may be stored in the database and the resource data corresponding to the multiple resource bundles may be obtained from the database based on serialization and deserialization technologies.

[0133] Serialization is a process of describing an object as a series of bytes, and deserialization is a process of reconstructing these bytes into an object.

[0134] In some specific implementation methods, the resource class can be instantiated according to the resource data corresponding to the resource package, and the data table can be designed based on serialization technology. The resource data corresponding to the resource package can be stored in the database based on serialization technology, and the data can be read and parsed from the database based on deserialization technology.

[0135] Because the resource data for all resource packages is based on a unified database table, the number of database tables is greatly reduced, minimizing resource waste. Furthermore, since each field is maintained in only one place in the database table, there is no redundant field globally, making database table management easier for developers.

[0136] Figure 7 FIG. 1 shows another flow chart of an implementation method for managing resource data corresponding to multiple resource packages based on a resource data model. Figure 7 As shown, managing resource data corresponding to multiple resource packages may include step S710 and step S720.

[0137] In step S710, based on the rewriting technology, the check method of the resource class of the resource data model is rewritten;

[0138] In step S720 , the business functions corresponding to the multiple resource packages are checked by executing the checking method of the resource class corresponding to the root node of the resource data model.

[0139] In some possible implementations, in step S710, a method, called the Check method, is implemented in the resource class corresponding to the root node. The logic of this method is to sequentially execute the validation logic for all fields of the resource class corresponding to the root node, thereby checking the business functions corresponding to the business attributes corresponding to the fields. Based on rewriting technology, the Check method is rewritten in each polymorphic class. The validation logic of this Check method sequentially executes the validation logic for all fields of the polymorphic class.

[0140] In some possible implementations, in step S720, since all polymorphic classes are derived based on the resource class corresponding to the root node, executing the Check method of the resource class corresponding to the root node will execute the Check method corresponding to the derived class of the resource class. At the same time, the first line of code of the Check method is super.check(), and super represents the execution of the Check method of the parent class. Therefore, both the Check method and the Check of the derived class will be executed, thereby realizing the inspection of the business functions corresponding to multiple resource packages.

[0141] By implementing the business logic sequential execution function of the fields of the tree-structured resource class through the above method, the business logic corresponding to each field can be maintained in only one place, that is, through unified access to the resource class corresponding to the root node.

[0142] The tree structure is described in detail below using a specific embodiment.

[0143]

[0144]

[0145] As shown in the table above, the resource class corresponding to the root node, or the fields of the Root class, is determined based on the shared business attributes of all resource packages. Fields are categorized into basic types and classes. Basic classes include byte, short int, long int, float, double, and char. Classes can be collection classes in programming languages ​​(such as Java collection classes), classes from predefined libraries (such as JAR libraries), or classes from non-predefined libraries (i.e., custom classes). The data type of a specific field is determined by the business attributes.

[0146] Set the Root class to a polymorphic class. The fields of the polymorphic class are the fields that all subclasses of the polymorphic class should contain, and the fields of the subclasses of the polymorphic class are a series of required fields that only the polymorphic class involves.

[0147] For example, assume resource packages can be divided into time processing-related, region processing-related, billing item processing-related, and peak calculation processing-related areas. The product field is the most common business attribute, and every resource package class involves products. Products are defined directly in the Root polymorphic class. Time processing-related resource packages all have time business attributes, while other resource packages do not. Therefore, only the polymorphic subclasses corresponding to the time processing-related resource packages (such as polymorphic subclass 1 of the Root class) have fields corresponding to time (such as ClassF, while other fields can correspond to other common business attributes of the time processing-related resource packages). Polymorphic subclasses corresponding to other resource packages (such as polymorphic subclass 2 of the Root class) do not have fields corresponding to time.

[0148] All custom classes, including the resource class Root corresponding to the root node (such as ClassB and ClassC), can be either polymorphic or non-polymorphic. Non-polymorphic classes can correspond to business attributes without a hierarchical structure, while polymorphic classes can correspond to business attributes with a hierarchical structure. For example, ClassC can correspond to a billing item, while a polymorphic subclass of ClassC can correspond to a first-level billing item.

[0149] Specifically, the data management method provided by the embodiment of the present disclosure can be implemented based on JAVA technology, wherein the serialization technology is implemented based on JsonTypeInfo annotation technology and JsonSubTypes annotation technology.

[0150] For example, the polymorphic subclass of the Root class can be implemented by the following code:

[0151] @JsonSubTypes({@Type(value=polymorphic subclass 1.class,name="1"),@Type(value=polymorphic subclass 2.class,name="2"),…@Type(value=polymorphic subclass N.class,name="n"),});

[0152] The annotations of the Root class are as follows:

[0153] @JsonTypeInfo(use=Id.NAME,include=As.PROPERTY,property="type")@JsonSubTypes({@Type(value=polymorphic subclass 1.class,name="root_1"),@Type(value=polymorphic subclass 2.class,name="root_2"),…@Type(value=polymorphic subclass N.class,name="root_n"),})

[0154] The definition of the Root class is as follows:

[0155] public class Root{ / / Specific contents are shown in the table above}

[0156] The definition of polymorphic subclass 1 is as follows

[0157] Public class Polymorphic Subclass 1 extends Root { / / / Specific content is shown in the table above}

[0158] Serialization can be achieved with the following code:

[0159] ObjectMapper objectMapper=new ObjectMapper();

[0160] Root root = new Root();

[0161] Deserialization can be achieved with the following code:

[0162] Root root=objectMapper.readValue(jsonValue,Root.class)

[0163] Based on Figure 1 The same principle as shown in the method, Figure 8 A schematic diagram of the structure of a data management device provided by an embodiment of the present disclosure is shown in FIG. Figure 8 As shown, the data management device 80 may include:

[0164] The data acquisition module 810 is used to acquire business attributes corresponding to multiple resource packages; the resource package is used to implement at least one business function, and the business function corresponds to at least one business attribute;

[0165] The data structure module 820 is used to construct a resource data model based on the correspondence between business attributes and resource packages and the hierarchical relationship between business attributes. The resource data model has a tree structure. Each node of the tree structure corresponds to at least one resource class. A resource class includes at least one field, and each field corresponds to at least one business attribute.

[0166] The data management module 830 is used to manage resource data corresponding to multiple resource packages based on the resource data model.

[0167] In the data management device provided in the embodiment of the present disclosure, a massive amount of flexible and personalized resource packages are modeled and integrated through an abstract data model, thereby improving the model abstraction, reducing the management cost of the resource packages, and thereby improving the development efficiency of developers.

[0168] In some possible implementations, the data structure module includes: a first iteration unit, used to divide the business attributes to be processed into common business attributes and non-common business attributes according to the correspondence between the business attributes to be processed corresponding to the K-th layer child node of the tree structure and the resource packages to be processed corresponding to the K-th layer child node of the tree structure; the common business attributes are the business attributes to be processed corresponding to all resource packages to be processed; the non-common business attributes are other business attributes to be processed except the common business attributes; a second iteration unit, used to determine the fields of the resource class corresponding to the K-th layer child node of the tree structure according to the common business attributes; a third iteration unit, used to determine the business attributes to be processed corresponding to the K+1-th layer child node of the tree structure and the resource packages to be processed corresponding to the K+1-th layer child node of the tree structure according to the non-common business attributes; wherein K is an integer greater than or equal to 0.

[0169] In some possible implementations, the second iteration unit is used to: when the common business attributes are business attributes with a hierarchical relationship, set the common attribute fields as polymorphic fields, and generate custom polymorphic classes corresponding to the common attribute fields based on the hierarchical relationship of the common business attributes; the common attribute fields are fields of the resource class corresponding to the K-th level child node of the tree structure corresponding to the common business attributes.

[0170] In some possible implementations, the second iteration unit is used to: when the common business attribute is a business attribute that does not have a hierarchical relationship, determine the data type of the common attribute field according to the business function corresponding to the common business attribute; when the data type of the common attribute field is a data type that is not defined in the predefined database, set the common attribute field to a non-polymorphic field, and generate a non-polymorphic class corresponding to the common attribute field.

[0171] In some possible implementations, the third iterative unit is used to: when the resource packages to be processed corresponding to the K-th layer child nodes of multiple tree structures correspond to the same non-shared business attributes, use the resource packages to be processed corresponding to the K-th layer child nodes of multiple tree structures as the resource packages to be processed corresponding to a K+1-th layer child node of the tree structure, and use the business attributes corresponding to the resource packages to be processed corresponding to the K-th layer child nodes of multiple tree structures in the non-shared business attributes as the business attributes to be processed corresponding to the K+1-th layer child node.

[0172] In some possible implementations, the third iterative unit is used to: when there is an independent resource package to be processed in the resource packages to be processed corresponding to the K-th layer child node of the tree structure, use the independent resource package to be processed as the resource package to be processed corresponding to a K+1-th layer child node of the tree structure, and use the business attributes corresponding to the independent resource package to be processed in the non-shared business attributes as the business attributes to be processed corresponding to the K+1-th layer child node; wherein the independent resource package to be processed is a resource package to be processed that does not have the same non-shared business attributes as the resource packages to be processed corresponding to the K-th layer child nodes of other tree structures.

[0173] In some possible implementations, the data management device further includes: a data entry module for obtaining business attributes corresponding to the resource package to be stored, and determining the resource class of the tree structure corresponding to the resource package to be stored based on the fields corresponding to the business attributes in the tree structure.

[0174] In some possible implementations, the data management module includes a data storage unit, which includes: a data table design subunit, which is used to design a data table based on a resource data model; and a database generation subunit, which is used to generate a database based on the data table and store resource data corresponding to multiple resource packages in the database.

[0175] In some possible implementations, the data table design sub-unit is used to: design a tree-structured data table based on a resource data model, where the fields of the resource data model are consistent with the fields of the data table; the database generation sub-unit is used to: store resource data corresponding to multiple resource packages in the database and obtain resource data corresponding to multiple resource packages from the database based on deserialization technology.

[0176] In some possible implementations, the data management module includes a data inspection unit, which is used to: rewrite the inspection method of the resource class of the resource data model based on the rewriting technology; and implement the inspection of business functions corresponding to multiple resource packages by executing the inspection method of the resource class corresponding to the root node of the resource data model.

[0177] It is understandable that the above modules of the data management device in the embodiment of the present disclosure have the function of realizing Figure 1 The functions of the corresponding steps of the data management method in the embodiment shown in . This function can be implemented by hardware, or by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the above functions. The above modules can be software and / or hardware, and the above modules can be implemented separately or integrated with multiple modules. For the functional description of each module of the above data management device, please refer to Figure 1 The corresponding description of the data management method in the embodiment shown in is not repeated here.

[0178] In the technical solutions disclosed herein, the acquisition, storage, and application of user personal information involved comply with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0179] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium, and a computer program product.

[0180] The electronic device includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the data management method provided in the embodiment of the present disclosure.

[0181] Compared with existing technologies, this electronic device integrates models of massive, flexible and personalized resource packages through abstract data models, thereby improving model abstraction, reducing resource package management costs, and thus improving development efficiency of developers.

[0182] The readable storage medium is a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to enable a computer to execute the data management method provided by the embodiment of the present disclosure.

[0183] Compared with the existing technology, this readable storage medium integrates models of massive, flexible and personalized resource packages through abstract data models, thereby improving the model abstraction, reducing the management cost of resource packages, and thus improving the development efficiency of developers.

[0184] The computer program product includes a computer program, and when the computer program is executed by a processor, it implements the data management method provided in the embodiment of the present disclosure.

[0185] Compared with the existing technology, this computer program product integrates a large number of flexible and personalized resource packages through abstract data models, thereby improving the model abstraction, reducing the management cost of resource packages, and thus improving the development efficiency of developers.

[0186] Figure 9 A schematic block diagram of an example electronic device 800 that can be used to implement embodiments of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are provided as examples only and are not intended to limit the implementation of the present disclosure described and / or claimed herein.

[0187] like Figure 9 As shown, the device 900 includes a computing unit 901, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 902 or a computer program loaded from a storage unit 908 into a random access memory (RAM) 903. Various programs and data required for the operation of the device 900 can also be stored in the RAM 903. The computing unit 901, the ROM 902, and the RAM 903 are connected to each other via a bus 904. An input / output (I / O) interface 905 is also connected to the bus 904.

[0188] Various components in the device 900 are connected to the I / O interface 905, including an input unit 906, such as a keyboard, a mouse, etc.; an output unit 907, such as various types of displays, speakers, etc.; a storage unit 908, such as a magnetic disk, an optical disk, etc.; and a communication unit 909, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 909 allows the device 900 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.

[0189] The computing unit 901 can be a variety of general-purpose and / or specialized processing components with processing and computing capabilities. Some examples of the computing unit 901 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units that run machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The computing unit 901 performs the various methods and processes described above, such as the data management method. For example, in some embodiments, the data management method can be implemented as a computer software program that is tangibly contained in a machine-readable medium, such as the storage unit 908. In some embodiments, part or all of the computer program can be loaded and / or installed on the device 900 via the ROM 902 and / or the communication unit 909. When the computer program is loaded into the RAM 903 and executed by the computing unit 901, one or more steps of the data management method described above can be performed. Alternatively, in other embodiments, the computing unit 901 can be configured to perform the data management method by any other appropriate means (e.g., by means of firmware).

[0190] Various embodiments of the systems and techniques described herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), system-on-chip systems (SOCs), programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include being implemented in one or more computer programs that are executable and / or interpreted on a programmable system comprising at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0191] The program code for implementing the method of the present disclosure can be written in any combination of one or more programming languages. These program codes can be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device so that when the program code is executed by the processor or controller, the functions / operations specified in the flow chart and / or block diagram are implemented. The program code can be executed entirely on the machine, partially on the machine, as a stand-alone software package, partially on the machine and partially on a remote machine, or entirely on a remote machine or server.

[0192] In the context of the present disclosure, a machine-readable medium can be a tangible medium that can contain or store a program for use by or in conjunction with an instruction execution system, device or equipment. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium can include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0193] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0194] The systems and techniques described herein can be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network (LAN), a wide area network (WAN), and the Internet.

[0195] A computer system may include a client and a server. The client and server are generally remote from each other and typically interact through a communication network. The client-server relationship arises through computer programs running on the respective computers and having a client-server relationship with each other. The server may be a cloud server, a server in a distributed system, or a server integrated with a blockchain.

[0196] It should be understood that the various forms of the processes shown above can be used to reorder, add, or delete steps. For example, the steps described in this disclosure can be performed in parallel, sequentially, or in a different order, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved. This is not limited herein.

[0197] The above specific embodiments do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions may be made based on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure shall be included within the scope of protection of this disclosure.

Claims

1. A data management method, comprising: Get the business attributes corresponding to multiple resource packages; The resource package is used to implement at least one business function, and the business function corresponds to at least one business attribute; A resource data model is constructed based on the correspondence between the business attributes and the resource packages and the hierarchical relationship between the business attributes; the resource data model is a tree structure; each node of the tree structure corresponds to at least one resource class; the resource class includes at least one field, and the field corresponds to at least one business attribute; Based on the resource data model, managing resource data corresponding to the plurality of resource packages; The constructing of a resource data model according to the correspondence between the business attributes and the resource packages and the hierarchical relationship between the business attributes includes: According to the correspondence between the to-be-processed service attributes corresponding to the K-th layer child nodes of the tree structure and the to-be-processed resource packages corresponding to the K-th layer child nodes of the tree structure, the to-be-processed service attributes are divided into common service attributes and non-common service attributes; Determine, according to the common business attributes, a field of the resource class corresponding to the K-th layer child node of the tree structure; Determine, according to the non-common service attributes, the service attributes to be processed corresponding to the K+1th layer child node of the tree structure and the resource packages to be processed corresponding to the K+1th layer child node of the tree structure; Wherein, K is an integer greater than or equal to 0.

2. The method according to claim 1, wherein The shared service attributes are service attributes to be processed corresponding to all resource packages to be processed; and the non-shared service attributes are service attributes to be processed other than the shared service attributes.

3. The method according to claim 1, wherein The determining, according to the common service attributes, the field of the resource class corresponding to the K-th layer child node of the tree structure includes: In the case where the common business attributes are business attributes with a hierarchical relationship, the common attribute fields are set as polymorphic fields, and a custom polymorphic class corresponding to the common attribute fields is generated according to the hierarchical relationship of the common business attributes; the common attribute fields are the fields of the resource class corresponding to the K-th layer child node of the tree structure corresponding to the common business attributes.

4. The method according to claim 3, wherein: The determining, according to the common service attributes, the field of the resource class corresponding to the K-th layer child node of the tree structure includes: In a case where the common business attribute is a business attribute having no hierarchical relationship, determining the data type of the common attribute field according to the business function corresponding to the common business attribute; In the case that the data type of the common attribute field is a data type not defined in the predefined database, the common attribute field is set as a non-polymorphic field, and a non-polymorphic class corresponding to the common attribute field is generated.

5. The method according to claim 1, wherein The determining, according to the non-common service attributes, the service attributes to be processed corresponding to the K+1th layer child node of the tree structure and the resource packages to be processed corresponding to the K+1th layer child node of the tree structure includes: In the case that the resource packages to be processed corresponding to multiple K-th layer child nodes of the tree structure correspond to the same non-shared business attributes, the resource packages to be processed corresponding to multiple K-th layer child nodes of the tree structure are used as the resource packages to be processed corresponding to a K+1-th layer child node of the tree structure, and the business attributes corresponding to the resource packages to be processed corresponding to multiple K-th layer child nodes of the tree structure in the non-shared business attributes are used as the business attributes to be processed corresponding to the K+1-th layer child node.

6. The method according to claim 1, wherein The determining, according to the non-common service attributes, the service attributes to be processed corresponding to the K+1th layer child node of the tree structure and the resource packages to be processed corresponding to the K+1th layer child node of the tree structure includes: If there is an independent resource package to be processed in the resource packages to be processed corresponding to the K-th layer child node of the tree structure, the independent resource package to be processed is used as the resource package to be processed corresponding to a K+1-th layer child node of the tree structure, and the service attribute corresponding to the independent resource package to be processed in the non-shared service attributes is used as the service attribute to be processed corresponding to the K+1-th layer child node; The independent resource package to be processed is a resource package to be processed that does not have the same non-shared business attributes as the resource packages to be processed corresponding to the K-th layer child nodes of other tree structures.

7. The method according to claim 1, further comprising: The business attributes corresponding to the resource package to be stored are obtained, and the resource class of the tree structure corresponding to the resource package to be stored is determined according to the fields corresponding to the business attributes in the tree structure.

8. The method according to claim 1, wherein The managing the resource data corresponding to the plurality of resource packages based on the resource data model includes: Designing a data table based on the resource data model; A database is generated based on the data table, and resource data corresponding to the plurality of resource packages are stored in the database.

9. The method according to claim 8, wherein The designing of a data table based on the resource data model includes: Designing a tree-structured data table based on the resource data model, wherein the fields of the resource data model are consistent with the fields of the data table; Storing the resource data corresponding to the plurality of resource packages in the database includes: Based on serialization and deserialization technology, the resource data corresponding to the plurality of resource packages are stored in the database, and the resource data corresponding to the plurality of resource packages are obtained from the database.

10. The method according to claim 1, wherein The managing the resource data corresponding to the plurality of resource packages based on the resource data model includes: Rewrite the checking method of the resource class of the resource data model based on the rewriting technology; The business functions corresponding to the plurality of resource packages are checked by executing the checking method of the resource class corresponding to the root node of the resource data model.

11. A data management device, comprising: The data acquisition module is used to obtain the business attributes corresponding to multiple resource packages; The resource package is used to implement at least one business function, and the business function corresponds to at least one business attribute; A data structure module is configured to construct a resource data model based on the correspondence between the business attributes and the resource packages and the hierarchical relationship between the business attributes; the resource data model is a tree structure; each node of the tree structure corresponds to at least one resource class; the resource class includes at least one field, and the field corresponds to at least one business attribute; A data management module, configured to manage resource data corresponding to the plurality of resource packages based on the resource data model; The data structure module includes: The first iterative unit is configured to divide the to-be-processed business attributes into common business attributes and non-common business attributes according to the correspondence between the to-be-processed business attributes corresponding to the K-th layer child nodes of the tree structure and the to-be-processed resource packages corresponding to the K-th layer child nodes of the tree structure; the common business attributes are to-be-processed business attributes corresponding to all the to-be-processed resource packages; and the non-common business attributes are other to-be-processed business attributes other than the common business attributes. A second iterative unit is configured to determine, according to the common business attributes, a field of a resource class corresponding to a K-th level child node of the tree structure; A third iterative unit is configured to determine, according to the non-common service attributes, a to-be-processed service attribute corresponding to the K+1th layer child node of the tree structure and a to-be-processed resource package corresponding to the K+1th layer child node of the tree structure; Wherein, K is an integer greater than or equal to 0.

12. The device according to claim 11, wherein The common business attributes are business attributes to be processed corresponding to all resource packages to be processed; the non-common business attributes are other business attributes to be processed except the common business attributes.

13. The device according to claim 11, wherein The second iteration unit is used for: In the case where the common business attributes are business attributes with a hierarchical relationship, the common attribute fields are set as polymorphic fields, and a custom polymorphic class corresponding to the common attribute fields is generated according to the hierarchical relationship of the common business attributes; the common attribute fields are the fields of the resource class corresponding to the K-th layer child node of the tree structure corresponding to the common business attributes.

14. The device according to claim 13, wherein The second iteration unit is used for: In a case where the common business attribute is a business attribute having no hierarchical relationship, determining the data type of the common attribute field according to the business function corresponding to the common business attribute; In the case that the data type of the common attribute field is a data type not defined in the predefined database, the common attribute field is set as a non-polymorphic field, and a non-polymorphic class corresponding to the common attribute field is generated.

15. The device according to claim 11, wherein The third iteration unit is used for: In the case that the resource packages to be processed corresponding to multiple K-th layer child nodes of the tree structure correspond to the same non-shared business attributes, the resource packages to be processed corresponding to multiple K-th layer child nodes of the tree structure are used as the resource packages to be processed corresponding to a K+1-th layer child node of the tree structure, and the business attributes corresponding to the resource packages to be processed corresponding to multiple K-th layer child nodes of the tree structure in the non-shared business attributes are used as the business attributes to be processed corresponding to the K+1-th layer child node.

16. The device according to claim 11, wherein The third iteration unit is used for: If there is an independent resource package to be processed in the resource packages to be processed corresponding to the K-th layer child node of the tree structure, the independent resource package to be processed is used as the resource package to be processed corresponding to a K+1-th layer child node of the tree structure, and the service attribute corresponding to the independent resource package to be processed in the non-shared service attributes is used as the service attribute to be processed corresponding to the K+1-th layer child node; The independent resource package to be processed is a resource package to be processed that does not have the same non-shared business attributes as the resource packages to be processed corresponding to the K-th layer child nodes of other tree structures.

17. The apparatus according to claim 11, further comprising: The data entry module is used to obtain the business attributes corresponding to the resource package to be stored, and determine the resource class of the tree structure corresponding to the resource package to be stored according to the fields corresponding to the business attributes in the tree structure.

18. The device according to claim 11, wherein The data management module includes a data storage unit, and the data storage unit includes: A data table design subunit, configured to design a data table based on the resource data model; The database generating subunit is configured to generate a database based on the data table, and store resource data corresponding to the plurality of resource packages in the database.

19. The device according to claim 18, wherein The data table design subunit is used to: design a tree-structured data table based on the resource data model, wherein the fields of the resource data model are consistent with the fields of the data table; The database generation subunit is used to: store resource data corresponding to the plurality of resource packages in the database based on serialization and deserialization technology, and obtain resource data corresponding to the plurality of resource packages from the database.

20. The device according to claim 11, wherein The data management module includes a data checking unit, which is used to: Rewrite the checking method of the resource class of the resource data model based on the rewriting technology; The business functions corresponding to the plurality of resource packages are checked by executing the checking method of the resource class corresponding to the root node of the resource data model.

21. An electronic device comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 10.

22. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1-10.

23. A computer program product comprising a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 10.

Citation Information

Patent Citations

  • Node adjusting method and device for configuration management database

    CN111930718A

  • Universal visual resource directory configuration method and system

    CN114217842A