A relationship processing method, apparatus and electronic device

By using graph databases and relational constraint configuration files in the CRM system, the problem of low efficiency in querying and validating object relational data in traditional CRM systems is solved, achieving efficient data storage and validation and improving application service performance.

CN117312462BActive Publication Date: 2026-02-03CHINA TELECOM CORP LTD TECHNOLOGY INNOVATION CENTER +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311267686.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-09-27
Publication Date
2026-02-03
Estimated Expiration
2043-09-27

AI Technical Summary

Technical Problem

Traditional CRM systems are inefficient when querying relationships between objects based on relational databases, resulting in low validation efficiency and reduced application service processing performance.

Method used

A graph database is used to store object data and its relationships. The rules in the relationship constraint configuration file determine whether the target relationship is valid, and the relationship is stored or deleted in the graph database to avoid conflicts and simplify code processing.

Benefits of technology

It improves the efficiency of querying and validating object relationship data, ensures the validity and accuracy of the data, reduces the processing burden of application services, and reflects the intuitiveness of object relationships.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117312462B_ABST
    Figure CN117312462B_ABST
Patent Text Reader

Abstract

The application discloses a relationship processing method and device and electronic equipment. The method comprises the following steps: obtaining a relationship constraint configuration file and a target relationship corresponding to a target object; determining whether the target relationship is established based on a relationship rule in the relationship constraint configuration file; if yes, storing the target relationship to a graph database; and if no, deleting the target relationship. Through the technical scheme provided by the embodiment of the application, the query efficiency and the verification efficiency of the relationship data are improved, and the processing performance of the application service is avoided from being reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of big data technology, and in particular to a method, apparatus and electronic device for processing relationships. Background Technology

[0002] Currently, traditional Customer Relationship Management (CRM) systems typically use relational databases to store object data and the relationships between objects. A system architecture diagram of this CRM system is shown below. Figure 1 As shown, it can be divided into the physical layer, component layer, application layer, and portal layer. Among them, the relational database used to store object data and the relationship data between objects in the CRM system is located in the component layer.

[0003] When recording data about relationships between objects, the relational databases described above, such as Figure 2 As shown, at least three tables are required: an A object table, a Z object table, and a relationship table. When querying the relationship data between A objects and Z objects, the process begins by first retrieving the A-identity document (ID) corresponding to the A object from the A object table. Then, based on the A-ID, the relationship table containing the A-ID is determined. Next, the relationship table containing the A-ID is retrieved, along with the Z-ID contained within that relationship. Then, based on the Z-ID, the data corresponding to the Z-ID is determined from the Z object table. Finally, the data corresponding to the A-ID in the A object table, the data corresponding to the Z-ID in the Z object table, and the relationship data between the A-ID and Z-ID in the relationship table are combined to obtain the relationship data between A objects and Z objects.

[0004] Therefore, query efficiency is low when querying data about relationships between objects in a relational database.

[0005] Furthermore, when new relational data between objects is added to a relational database, the validation logic and rules for that relational data need to be updated to verify its correctness, i.e., to verify whether the relations contained in the relational data are valid, which makes the validation efficiency of relational data between objects low.

[0006] Furthermore, relational databases, when querying and validating object data and the relationships between objects, are... Figure 1 The query and validation operations performed in the application services of the application layer shown in the figure are tightly coupled with the application services in the application layer, resulting in low processing performance of the application services in the application layer.

[0007] Therefore, when storing object data and the relationship data between objects based on relational data, the query efficiency and validation efficiency of the relational data are low, which also leads to a decrease in the processing performance of application services. Summary of the Invention

[0008] This application provides a solution to address the low query and validation efficiency of relational data when storing object data and relationships between objects in a relational database. The specific implementation scheme is as follows:

[0009] Firstly, this application provides a method for processing relationships, the method comprising:

[0010] Obtain the relation constraint configuration file and the target relations corresponding to the target object;

[0011] Based on the relationship rules in the relationship constraint configuration file, determine whether the target relationship is valid;

[0012] If so, store the target relationship in the graph database;

[0013] If not, delete the target relationship.

[0014] Through the above-described embodiments, based on the relationship rules in the obtained relationship constraint configuration file, the validity of the target relationship is determined. If the relationship is valid, it is stored in the graph database; otherwise, it is deleted. This avoids conflicts between the target relationship and the relationship data stored in the graph database, ensuring the validity and accuracy of the relationship data stored in the graph database. Furthermore, processing relationship data based on a graph database, compared to processing relationship data based on a relational database, avoids complex and cumbersome code processing, thereby improving the processing performance of relationship data and increasing the efficiency of verifying relationship data between objects. Simultaneously, storing data based on a graph database, compared to storing data based on relational databases, more intuitively reflects the relationships between objects, making it more convenient to query relationship data between objects, thus improving the query efficiency of relationship data between objects.

[0015] In one possible implementation, before determining whether the target relationship is valid based on the relationship rules in the relationship constraint configuration file, the method further includes:

[0016] The relationship constraint configuration file contains preset relationship rules; wherein the relationship rules include a first relationship type, a second relationship type, and relationship constraints between the first relationship type and the second relationship type.

[0017] In one possible implementation, determining whether the target relationship is valid based on the relationship rules in the relationship constraint configuration file includes:

[0018] In the graph database, query the associated objects corresponding to the target object, and determine the association type corresponding to the associated objects;

[0019] In the relationship constraint configuration file, query multiple relationship rules that contain the association relationship type, and obtain the multiple relationship rules;

[0020] Based on the aforementioned relationship rules, it is determined whether the target relationship is valid.

[0021] In one possible implementation, determining whether the target relationship is valid based on the relationship rules in the relationship constraint configuration file includes:

[0022] Determine the object relationship between the target object and its corresponding associated objects;

[0023] Based on the object relationship, the relationship type corresponding to the associated object, and the target relationship type corresponding to the target object, the target relationship rule is determined from multiple relationship rules in the relationship constraint configuration file;

[0024] Read the relation constraints in the target relation rule;

[0025] Based on the aforementioned relational constraints, determine whether the target relation holds true.

[0026] Secondly, this application also provides a relation processing apparatus, the apparatus comprising:

[0027] The acquisition module is used to acquire the relation constraint configuration file and the target relations corresponding to the target object;

[0028] The processing module is used to determine whether the target relationship is valid based on the relationship rules in the relationship constraint configuration file;

[0029] If so, store the target relationship in the graph database;

[0030] If not, delete the target relationship.

[0031] In one possible implementation, the processing module is specifically used to preset the relationship rules in the relationship constraint configuration file; wherein the relationship rules include a first relationship type, a second relationship type, and relationship constraints between the first relationship type and the second relationship type.

[0032] In one possible implementation, the processing module is specifically configured to: query the graph database for associated objects corresponding to the target object and determine the association type corresponding to the associated objects; query the relation rules containing the association type in the relation constraint configuration file and obtain the multiple relation rules; and determine whether the target relation is valid based on the multiple relation rules.

[0033] In one possible implementation, the processing module is specifically configured to: determine the object relationship between the target object and the associated object corresponding to the target object; determine the target relationship rule from multiple relationship rules in the relationship constraint configuration file based on the object relationship, the association relationship type corresponding to the associated object, and the target relationship type corresponding to the target object; read the relationship constraints in the target relationship rule; and determine whether the target relationship is valid based on the relationship constraints.

[0034] Thirdly, this application provides an electronic device, comprising:

[0035] Memory, used to store computer programs;

[0036] When a processor executes a computer program stored in the memory, it implements the above-described method steps for processing a relationship.

[0037] Fourthly, this application provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the above-described method steps for processing a relationship. Attached Figure Description

[0038] Figure 1 This is a schematic diagram of the CRM system architecture provided in the embodiments of this application;

[0039] Figure 2 This application provides a schematic diagram of object data and the relationship data between objects based on a relational database in an embodiment of the present application.

[0040] Figure 3 A flowchart illustrating a relationship processing method provided in an embodiment of this application;

[0041] Figure 4a This application provides an illustration of object data and relationship data between objects based on a graph database in its embodiments. Figure 1 ;

[0042] Figure 4b This application provides an illustration of object data and relationship data between objects based on a graph database in its embodiments. Figure 2 ;

[0043] Figure 5 A schematic diagram illustrating the processing procedure of the relationship processing method provided in the embodiments of this application;

[0044] Figure 6 A schematic diagram of a relationship processing apparatus provided in an embodiment of this application;

[0045] Figure 7 A schematic diagram of an electronic device provided in this application. Detailed Implementation

[0046] To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings. The specific operational methods in the method embodiments can also be applied to the device embodiments or system embodiments. It should be noted that in the description of this application, "multiple" is understood as "at least two". "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, and B existing alone. A connected to B can represent: A and B directly connected, and A and B connected through C. Furthermore, in the description of this application, terms such as "first" and "second" are used only for distinguishing the purpose of description and should not be construed as indicating or implying relative importance or order.

[0047] The embodiments of this application will now be described in detail with reference to the accompanying drawings.

[0048] Data on relationships between objects is the foundation for all value creation in big data analytics. However, querying and validating object data and the relationships between objects using traditional relational databases requires complex and cumbersome code processing, resulting in low query and validation efficiency.

[0049] Therefore, this application proposes a method for processing relationships. Based on the relationship rules in the relationship constraint configuration file, the method verifies the target relationship corresponding to the target object. When the verification is successful, the target object and the target relationship are stored in a graph database. This approach ensures the validity and accuracy of object data and the relationship data between objects, while also improving the efficiency of querying and verifying the object data and relationship data.

[0050] Reference Figure 3 The diagram shown is a flowchart of a relationship processing method provided in an embodiment of this application. The method includes:

[0051] S1, obtain the relation constraint configuration file and the target relation corresponding to the target object.

[0052] Since graph databases use vertices and edges to represent relationships between data, the focus is on these relationships. Furthermore, graph databases support transactions, ensuring normal operation under concurrent conditions. Therefore, this application proposes a method for querying and validating object data and the relationships between objects based on a graph database.

[0053] Specifically, when querying and validating relationship data between objects, the relationship rules are first preset in the relationship constraint configuration file. These relationship rules include a first relationship type, a second relationship type, and the relationship constraints between the first and second relationship types. The first relationship type can be an object relationship type, and the second relationship type can be a child object relationship type; alternatively, the first relationship type can be a child object relationship type, and the second relationship type can be an object relationship type.

[0054] For example, the relation constraint configuration file is shown in Table 1 below:

[0055] Table 1. Schematic diagram of relation constraint configuration file.

[0056] Relationship rule number Object Relational Type Sub-object relation type Relationship Constraints 1 Mutual exclusion Dependency Mutual exclusion

[0057] In Table 1, when the object relationship type (i.e., the first relationship type) is mutually exclusive, and the child object relationship type (i.e., the second relationship type) of the corresponding child object is dependent, the relationship between the object and the child object is mutually exclusive, indicating a conflict between them. In other words, based on relationship constraints, it can be determined whether a conflict exists between the relationship between objects and the relationship between their child objects. Therefore, the relationship rules in the relationship constraint configuration file shown in Table 1 can be: if the object relationship type is mutually exclusive and the child object relationship type is dependent, then the relationship constraint between the object relationship type and the child object relationship type is mutually exclusive.

[0058] In this embodiment, the pre-defined relationship rules in the relationship constraint configuration file can be multiple relationship rules. However, it should be noted that these multiple relationship rules do not conflict with each other. In this embodiment, corresponding relationship rules can be added, deleted, or modified in the relationship constraint configuration file according to specific application scenarios.

[0059] Therefore, when adding new objects or relationships between objects during business development, it is only necessary to maintain the pre-defined relationship rules in the relationship constraint configuration file, avoiding the need to update the validation logic of the relationship data between objects and the code corresponding to the validation rules, thereby further improving the validation efficiency of the relationship data between objects.

[0060] In the relationship constraint configuration file, when setting relationship rules, relevant personnel or devices can perform logical reasoning based on the first relationship type (such as object relationship type) and the second relationship type (such as child object relationship type) to obtain relationship constraints, thereby setting relationship rules; or they can directly receive the first relationship type, the second relationship type, and the relationship constraints between the first relationship type and the second relationship type to set relationship rules.

[0061] Furthermore, after presetting the relationship rules in the relationship constraint configuration file, the relationship constraint configuration file and the target relationship corresponding to the target object are obtained.

[0062] When obtaining the target relationship corresponding to the target object, the target object is first determined, and then the target relationship corresponding to the target object is obtained.

[0063] In this embodiment, the target object can be an object defined on the business side, and the target object can also be a multi-layered complex object. The target relationship can be any one or more types of relationships between target objects. The establishment of this target relationship can be achieved through the relationship configuration function built into the CRM system.

[0064] For example, the flexible platform is a specification management platform under the new sales system, including processes for configuring and managing standard product units (SPUs), stock keeping units (SKUs), products, and their relationships. During the front-end application configuration process, SPUs, SKUs, and products have been added, and these SPUs, SKUs, products, and their corresponding relationships have been stored in a graph database. The graph database stores the SPUs, SKUs, products, and their relationships as follows: Figure 4a As shown.

[0065] exist Figure 4a In this context, the government and enterprise broadband SPU constitutes the government and enterprise broadband product, which in turn includes government and enterprise broadband SKUs; the home broadband SPU constitutes the home broadband product, which also includes home broadband SKUs. Furthermore, the government and enterprise broadband SPUs and the home broadband SPUs are mutually exclusive.

[0066] At this point, the application layer adds a new "Enterprise VIP Broadband SKU" based on the enterprise broadband product and a new "Home VIP Broadband SKU" based on the home broadband product. Simultaneously, it establishes a dependency relationship between the enterprise VIP Broadband SKU and the home VIP Broadband SKU using the built-in relationship configuration function in the CRM system. These two VIP Broadband SKUs are the target objects, and the dependency relationship between them is the target relationship.

[0067] S2 determines whether the target relationship is valid based on the relationship rules in the relationship constraint configuration file.

[0068] After obtaining the relation constraint configuration file and the target relation in step S1, the relationship rules in the target relation constraint configuration file are used to determine whether the target relation is valid, thereby determining whether to execute step S3 or step S4.

[0069] Specifically, if the target relationship is valid, then step S3 is executed.

[0070] If the target relationship is not established, proceed to step S4.

[0071] In one possible implementation, when determining whether a target relationship is valid based on the relationship rules in the relationship constraint configuration file, the process first involves querying the graph database for the associated objects corresponding to the target object and determining the relationship type corresponding to those associated objects. Next, the relationship constraint configuration file is used to query and retrieve multiple relationship rules containing that relationship type, thereby determining whether the target relationship is valid based on these multiple relationship rules.

[0072] For example, the relation constraint configuration file contains four relation rules, as shown in Table 2 below:

[0073] Table 2. Schematic diagram of relation constraint configuration file.

[0074] Relationship rule number Object Relational Type Sub-object relation type Relationship Constraints 1 Mutual exclusion Dependency Mutual exclusion 2 Constituent Relationship Mutual exclusion synchronous 3 Dependency Mutual exclusion synchronous 4 Inclusion relationship Relationship synchronous

[0075] In Table 2, a "synchronous" relation constraint indicates that the relationship between objects does not conflict with the relationship between their child objects. Assuming a graph database is used, and the relationship type of the associated objects corresponding to the target object is determined to be mutually exclusive, then in the relation constraint configuration file shown in Table 2, we can query the relation rules that include mutually exclusive relationships. It is evident that only the relation rules with serial numbers 1, 2, and 3 in Table 2 contain mutually exclusive relationships. Therefore, we retrieve the three relation rules with serial numbers 1, 2, and 3 from the relation constraint configuration file shown in Table 2. Based on these three relation rules, we can then determine whether the target relationship is valid.

[0076] It should be noted that, in this embodiment, the associated objects corresponding to the target object, and the related data of the associated relationships corresponding to those associated objects, have been pre-stored in the graph database. That is, before determining whether a target relationship is valid based on the relationship rules in the relationship constraint configuration file, the associated objects corresponding to the target object, and the related data of the associated relationships, must be stored in the graph database.

[0077] Therefore, based on graph databases, it is possible to directly determine the associated objects corresponding to the target object, as well as the types of relationships between these associated objects. For example, ... Figure 4b As shown, assuming that sub-object A and sub-object Z are target objects, and the dependency relationship between sub-object A and sub-object Z is a target relationship, then based on Figure 4b The graph database shown illustrates the relationship data between objects, directly identifying the associated objects A and Z. The relationship between these objects is a dependency. Therefore, storing object data and the relationships between them in a graph database provides a clear and intuitive representation of these relationships.

[0078] By using the above method, it is avoided that when determining the relationship rule corresponding to the target relationship, it is necessary to query the relationship rule corresponding to the target relationship from a large number of relationship rules. This reduces the time required to determine the relationship rule corresponding to the target relationship and improves the efficiency of determining the relationship rule corresponding to the target relationship.

[0079] In another possible implementation, when determining whether a target relationship is valid based on the relationship rules in the relationship constraint configuration file, it is also possible to directly obtain each preset relationship rule in the relationship constraint configuration file, and then determine whether the target relationship is valid based on each relationship rule.

[0080] In another possible implementation, when determining whether a target relationship is valid based on the relationship rules in the relationship constraint configuration file, it is also possible to query multiple relationship rules in the relationship constraint configuration file that contain the target relationship type corresponding to the target relationship, and obtain multiple relationship rules, thereby determining whether the target relationship is valid based on the multiple relationship rules.

[0081] In this embodiment of the application, the method of obtaining relationship rules can be adjusted according to the specific application scenario.

[0082] Furthermore, after obtaining multiple relationship rules from the relationship constraint configuration file, in one possible implementation, when determining whether a target relationship is valid based on multiple relationship rules, the object relationship between the target object and the associated object is first determined. For example, the target object is a child object of the associated object.

[0083] Then, based on the object relationships, the relationship types corresponding to the associated objects, and the target relationship type corresponding to the target object, the target relationship rule is determined from multiple relationship rules. After determining the target relationship rule, the relationship constraints within that rule are read. Based on these relationship constraints, it is then determined whether the target relationship is valid.

[0084] For example, the target object, the target relationship, the associated objects corresponding to the target object, and the associated relationships corresponding to the associated objects, such as... Figure 4a As shown. In Figure 4a In this context, the target objects are: enterprise VIP broadband SKUs and residential VIP broadband SKUs. The target relationship is the dependency between enterprise VIP broadband SKUs and residential VIP broadband SKUs. The associated objects are: enterprise broadband SPUs, enterprise broadband products, enterprise broadband SKUs, residential broadband SPUs, residential broadband products, and residential broadband SKUs. Because... Figure 4a The only relationship between the associated objects is a mutual exclusion relationship between government / enterprise broadband SPUs and home broadband SPUs. Therefore, the relationship between the associated objects is a mutual exclusion relationship between government / enterprise broadband SPUs and home broadband SPUs. In other words, the target object's relationship type is dependency, and the associated object's relationship type is mutual exclusion. Multiple relationship rules are those numbered 1, 2, and 3 in Table 2 above.

[0085] Since SPU is the parent class of Product, and Product is the parent class of SKU, we can determine that SPU is an object and SKU is a child object. Therefore, in the above-mentioned associated object types and target object types, the target relationship type (i.e., dependency relationship) is the child object relationship type in the relationship constraint configuration file, and the association relationship type (i.e., mutual exclusion relationship) is the object relationship type in the relationship constraint configuration file. Then, among the multiple relationship rules, the relationship rule corresponding to the child object relationship type being dependency and the object relationship type being mutual exclusion is the relationship rule with sequence number 1. Therefore, this relationship rule with sequence number 1 is determined as the target relationship rule.

[0086] Next, the relation constraints in the target relation rule are read; these constraints are mutually exclusive. Based on these constraints, it can be determined whether to execute step S3 or step S4. Since the relation constraints are mutually exclusive, it indicates that there is a conflict between the relationship between objects and the relationship between their sub-objects, i.e., a conflict between the association relationship and the target relationship. Therefore, the target relationship is not valid, and step S4 is executed.

[0087] By using the above method, after determining the object relationship between the target object and its corresponding associated objects, the target relationship rule is determined from multiple relationship rules in the relationship constraint configuration file based on the object relationship, the association relationship type of the associated objects, and the target relationship type of the target object. Based on the relationship constraints in the target relationship rule, it can be determined whether the target relationship conflicts with the associated relationship, thereby determining whether the target relationship is valid, so as to determine whether to store the target relationship in the graph database or delete the target relationship.

[0088] Furthermore, when there are multiple relationships between the target object and its associated objects, the relationship between the target object and its associated objects is used to verify whether there is a conflict between the relationship and the target relationship for each relationship, thereby determining whether the target relationship is valid.

[0089] If any of the multiple relationships between the associated objects conflict with the target relationship, then the target relationship is determined to be invalid, and step S4 is executed.

[0090] If multiple relationships between the associated objects do not conflict with the target relationship, then the target relationship is determined to be valid, and step S3 is executed.

[0091] In determining whether there is a conflict between the association relationship and the target relationship, the determination is also based on the relationship rules in the relationship constraint configuration file.

[0092] S3 stores the target relationship in the graph database.

[0093] In step S2, based on the relation rules in the relation constraint configuration file, if the target relation obtained in step S1 is valid, the target relation is stored in the graph database. If the target object corresponding to the target relation is an object added or modified in this operation, the target object is also stored in the database.

[0094] In this embodiment, the graph database can exist in the form of a storage module. This storage module (i.e., the graph database) can store not only target objects and target relationships, but also any object data and data relating to objects. Therefore, storing object data and data relating to objects based on this storage module (i.e., the graph database) can intuitively represent the relationships between objects, and its query performance is superior to that of relational databases.

[0095] S4, Delete the target relationship.

[0096] In step S2, based on the relationship rules in the relationship constraint configuration file, if the target relationship obtained in step S1 is not valid, the target relationship is deleted. Furthermore, the result is returned to the front-end application in the portal layer, and the data from this operation is deleted. If the target object is a newly added or modified object in this operation data, the target object is also deleted, or the object is restored.

[0097] In summary, the relationship processing method proposed in this application determines whether the target relationship corresponding to the target object is valid based on the relationship rules in the obtained relationship constraint configuration file. If the target relationship is valid, it is stored in the graph database; otherwise, it is deleted. This method validates the target relationship, storing it only in the graph database after the validation is successful (i.e., the target relationship is valid), thus improving the validity and accuracy of the relationship data between objects. Furthermore, determining the validity of the target relationship based on the relationship rules in the relationship constraint configuration file avoids conflicts between the target relationship and the relationship data stored in the graph database, further ensuring the validity and accuracy of the data.

[0098] Furthermore, using a graph database to store, query, and validate object data and the relationships between objects avoids complex and cumbersome code processing for these functions, thus improving the efficiency of these processes. Additionally, using a graph database to store the relationships between objects makes this data intuitive, directly reflecting the relationships between objects.

[0099] Furthermore, the relationship verification method provided in this application supports flexible deployment and can be used to verify the relationships between complex multi-layered objects in various business systems.

[0100] The technical solution of this application will be further explained below with reference to a specific application process.

[0101] like Figure 5 The diagram illustrates the relationship processing method. In the improved CRM system architecture, a new relationship storage and validation unit has been added to the component layer. This unit comprises two sub-units: an object and relationship storage sub-unit and an object relationship validation sub-unit. The object and relationship storage sub-unit stores data for each object and the relationships between them, and it is a graph database. The object relationship validation sub-unit validates the relationships between objects to determine if the relationship is valid.

[0102] Specifically, the portal layer first transmits the newly added target object and its corresponding target relationships to the application layer. This target object is a multi-layered, complex object. Then, the application layer continues to transmit the target object and its target relationships to the relationship storage and validation unit in the component layer.

[0103] In the relational storage and verification unit, the target relation corresponding to the target object is first analyzed and verified in the object relation verification subunit to determine whether the target relation is valid. This object relation verification subunit is further divided into a configuration unit and an execution unit.

[0104] First, the configuration unit pre-defines various relationship rules. These relationship rules include object relationship types, sub-object relationship types, and the relationship constraints between object relationship types and sub-object relationship types.

[0105] Then, in the execution unit, the associated object corresponding to the target relationship and the associated relationship corresponding to the associated object are first determined from the object and relation storage sub-unit. Then, based on the association type corresponding to the association, the target relationship type corresponding to the target relationship, and the object relationship between the target object and the associated object, the target relationship rule is obtained from the configuration unit. This target relationship rule includes the association type and the target relationship type. Next, the relationship constraints in the target relationship rule are read. If the relationship constraints are mutually exclusive, it is determined that the association and the target relationship conflict, thus determining that the target relationship is invalid, indicating that the verification result for the target relationship is a verification failure. The verification result containing the verification failure is then transmitted to the portal layer so that the front-end application in the portal layer can delete the newly added target object and target relationship. If the relationship constraints are not mutually exclusive, it is determined that the association and the target relationship do not conflict, thus determining that the target relationship is valid, indicating that the verification result for the target relationship is a verification success. The verification result containing the verification success, along with the target object and the target relationship, is then transmitted to the object and relation storage sub-unit so that the target object and the target relationship can be stored in the object and relation storage sub-unit.

[0106] By using the above method, based on the newly added relationship storage and verification unit in the component layer, the verification and storage of the target relationship corresponding to the target object is realized, ensuring the validity and accuracy of the object data and the relationship data between objects. At the same time, it avoids the use of complex and cumbersome code processing to query and verify the object data and the relationship data between objects, thereby improving the query efficiency and verification efficiency of the object data and the relationship data between objects.

[0107] Furthermore, by placing the relation storage and verification unit in the component layer, the relation storage and verification unit is isolated from the application business in the application layer, thus avoiding any impact on the application business and ensuring the processing performance of the application business.

[0108] Furthermore, the objects and relational storage sub-units in the relational storage and verification unit store object data and the data on the relationships between objects in the form of a graph database, which intuitively reflects the relationships between objects, and its query performance is better than that of relational databases.

[0109] Meanwhile, the object relationship verification subunit within the relational storage and verification unit analyzes and verifies the target relationship, ensuring that the target relationship does not conflict with the data in the object and relational storage subunit, and guaranteeing the accuracy of application-side constraints and verifications. Furthermore, the configuration unit within the object relationship verification subunit pre-defines various relationship rules. When new objects and relationships are added during business development, only the relationship rules in this configuration unit need to be maintained, further improving the efficiency of relational data verification.

[0110] Based on the same inventive concept, this application also provides a relation processing device, such as... Figure 6 The diagram shown is a schematic representation of a relationship processing apparatus provided in this application. The apparatus includes:

[0111] The acquisition module 601 is used to acquire the relation constraint configuration file and the target relation corresponding to the target object;

[0112] Processing module 602 is used to determine whether the target relationship is valid based on the relationship rules in the relationship constraint configuration file;

[0113] If so, store the target relationship in the graph database;

[0114] If not, delete the target relationship.

[0115] In one possible implementation, the processing module 602 is specifically used to pre-set relationship rules in the relationship constraint configuration file; wherein the relationship rules include a first relationship type, a second relationship type, and relationship constraints between the first relationship type and the second relationship type.

[0116] In one possible implementation, the processing module 602 is further configured to query the associated objects corresponding to the target object in the graph database and determine the association relationship type corresponding to the associated objects; query multiple relationship rules containing the association relationship type in the relationship constraint configuration file and obtain multiple relationship rules; and determine whether the target relationship is valid based on the multiple relationship rules.

[0117] In one possible implementation, the processing module 602 is further configured to determine the object relationship between the target object and the associated object corresponding to the target object; determine the target relationship rule from multiple relationship rules in the relationship constraint configuration file based on the object relationship, the association relationship type corresponding to the associated object and the target relationship type corresponding to the target object; read the relationship constraints in the target relationship rule; and determine whether the target relationship is valid based on the relationship constraints.

[0118] Based on the same inventive concept, this application also provides an electronic device that can realize the function of the aforementioned relationship processing device, see reference. Figure 7 The aforementioned electronic devices include:

[0119] At least one processor 701 and a memory 702 connected to at least one processor 701. In this embodiment, the specific connection medium between the processor 701 and the memory 702 is not limited. Figure 7 The example shown is the connection between processor 701 and memory 702 via bus 700. Bus 700 is... Figure 7 The connections between other components are indicated by thick lines and are for illustrative purposes only, not as limiting information. The 700 bus can be divided into address bus, data bus, control bus, etc., for ease of representation. Figure 7 The term is represented by a single thick line, but this does not imply that there is only one bus or one type of bus. Alternatively, the processor 701 can also be called a controller; there is no restriction on the name.

[0120] In this embodiment, memory 702 stores instructions executable by at least one processor 701. By executing the instructions stored in memory 702, at least one processor 701 can perform the relationship processing method described above. Processor 701 can implement... Figure 6 The functions of each module in the device shown.

[0121] The processor 701 is the control center of the device. It can connect to various parts of the control device through various interfaces and lines. By running or executing instructions stored in memory 702 and calling data stored in memory 702, the processor can perform various functions and process data, thereby monitoring the device as a whole.

[0122] In one possible design, processor 701 may include one or more processing units. Processor 701 may integrate an application processor and a modem processor, wherein the application processor mainly handles the operating system, user interface, and applications, and the modem processor mainly handles wireless communication. It is understood that the modem processor may also not be integrated into processor 701. In some embodiments, processor 701 and memory 702 may be implemented on the same chip; in some embodiments, they may also be implemented on separate chips.

[0123] The processor 701 can be a general-purpose processor, such as a central processing unit (CPU), digital signal processor, application-specific integrated circuit, field-programmable gate array or other programmable logic device, discrete gate or transistor logic device, or discrete hardware component, capable of implementing or executing the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the processing methods related to the relationships disclosed in the embodiments of this application can be directly manifested as being executed by a hardware processor, or executed by a combination of hardware and software modules within the processor.

[0124] Memory 702, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer-executable programs, and modules. Memory 702 may include at least one type of storage medium, such as flash memory, hard disk, multimedia card, card-type memory, random access memory (RAM), static random access memory (SRAM), programmable read-only memory (PROM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), magnetic storage, magnetic disk, optical disk, etc. Memory 702 can be any other medium capable of carrying or storing desired program code in the form of instructions or data structures that can be accessed by a computer, but is not limited thereto. In the embodiments of this application, memory 702 can also be a circuit or any other device capable of implementing storage functions for storing program instructions and / or data.

[0125] By designing and programming the processor 701, the code corresponding to the relationship processing methods described in the foregoing embodiments can be embedded into the chip, enabling the chip to execute these methods during operation. Figure 3 The steps of the relationship processing method in the illustrated embodiment are as follows. How to design and program the processor 701 is a technique well-known to those skilled in the art and will not be described further here.

[0126] Based on the same inventive concept, embodiments of this application also provide a storage medium storing computer instructions that, when executed on a computer, cause the computer to perform the processing method of the relationship described above.

[0127] In some possible implementations, various aspects of the relationship processing method provided in this application may also be implemented in the form of a program product, which includes program code that, when the program product is run on a device, causes the control device to perform the steps in the relationship processing method according to the various exemplary embodiments of this application described above.

[0128] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0129] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0130] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0131] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

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

Claims

1. A method for processing relationships, characterized in that, include: Obtain the relation constraint configuration file and the target relations corresponding to the target object; Determine the object relationship between the target object and its corresponding associated objects; Based on the object relationship, the relationship type corresponding to the associated object, and the target relationship type corresponding to the target object, the target relationship rule is determined from multiple relationship rules in the relationship constraint configuration file; Read the relation constraints in the target relation rule; Based on the relationship constraints, determine whether there is a conflict between the target relationship and the association relationship corresponding to the associated object; If not, then the target relationship is determined to be true, and the target relationship is stored in the graph database; If so, then the target relationship is determined to be invalid, and the target relationship is deleted.

2. The method as described in claim 1, characterized in that, Before determining whether the target relationship is valid based on the relationship rules in the relationship constraint configuration file, the method further includes: The relationship constraint configuration file contains preset relationship rules; wherein the relationship rules include a first relationship type, a second relationship type, and relationship constraints between the first relationship type and the second relationship type.

3. The method as described in claim 1, characterized in that, Before determining the object relationship between the target object and its corresponding associated object, the method further includes: In the graph database, query the associated objects corresponding to the target object, and determine the association relationship type corresponding to the associated objects; In the relationship constraint configuration file, query the multiple relationship rules that contain the associated relationship type, and obtain the multiple relationship rules.

4. A relation processing device, characterized in that, include: The acquisition module is used to acquire the relation constraint configuration file and the target relations corresponding to the target object; The processing module is used to determine the object relationship between the target object and the associated object corresponding to the target object; based on the object relationship, the association relationship type corresponding to the associated object, and the target relationship type corresponding to the target object, determine the target relationship rule from multiple relationship rules in the relationship constraint configuration file; and read the relationship constraints in the target relationship rule. Based on the relationship constraints, determine whether there is a conflict between the target relationship and the association relationship corresponding to the associated object; If not, then the target relationship is determined to be true, and the target relationship is stored in the graph database; If so, then the target relationship is determined to be invalid, and the target relationship is deleted.

5. The apparatus as described in claim 4, characterized in that, The processing module is used to preset the relationship rules in the relationship constraint configuration file; wherein the relationship rules include a first relationship type, a second relationship type, and relationship constraints between the first relationship type and the second relationship type.

6. The apparatus as claimed in claim 4, characterized in that, The processing module is used to query the graph database for the associated object corresponding to the target object, and determine the association relationship type corresponding to the associated object; In the relationship constraint configuration file, query the multiple relationship rules that contain the associated relationship type, and obtain the multiple relationship rules.

7. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor, when executing a computer program stored in the memory, implements the method steps of any one of claims 1-3.

8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the method described in any one of claims 1-3.

Citation Information

Patent Citations

  • Ontology-based data verification method and device

    CN113934855A

  • Centralized management of data nodes

    US20070233925A1