Method and system for obtaining correlation degree in graph structure
Patent Information
- Application Number
- CN202410151643.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-02-02
- Publication Date
- 2026-11-03
- Estimated Expiration
- 2044-02-02
AI Technical Summary
现有技术中通过人工方式获取数据集合之间的关联度效率低下。
By obtaining the object set and the data body set, the common data body of the first object and the second object in the object set is calculated, and the object association degree is obtained based on the common data body. Finally, the association degrees of all objects are summed to obtain the association degree between the object set and the data body set.
It eliminates the need for manual processing, thus improving the efficiency of obtaining correlations between data sets.
Smart Images

Figure CN118113912B_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of data processing technology, specifically relating to a method and system for obtaining the degree of association in a graph structure. Background Technology
[0002] To determine whether one set of data is related to another set of data, we need to obtain the degree of correlation between the two sets of data. For example, to determine whether one set of users is related to another set of users, we need to obtain the degree of correlation between the two sets of users.
[0003] It should be noted that a data set includes multiple data elements; for example, a user set includes multiple users.
[0004] In the prior art, staff manually analyze the relationship between data elements in one dataset and data elements in another dataset to obtain the degree of correlation between the two datasets.
[0005] In the process of developing this application, the inventors discovered that the prior art has at least the following problems: because the staff manually analyzes the relationship between data elements in one data set and data elements in another data set in order to obtain the degree of correlation between the two data sets, the work efficiency is low. Summary of the Invention
[0006] This application aims to provide a method and system for obtaining the correlation degree in a graph structure, which at least solves the problem of low work efficiency caused by the manual analysis of the correlation between data elements in one dataset and data elements in another dataset in order to obtain the correlation degree between the two datasets in the prior art.
[0007] To solve the above-mentioned technical problems, this application is implemented as follows: In a first aspect, embodiments of this application provide a method for obtaining the degree of association in a graph structure, the method comprising: Obtain an object set and a data body set. The object set includes multiple objects, and the data body set includes multiple data bodies. Each object has a corresponding data body. Obtain the common data bodies of a first object and a second object in the object set, and obtain the object association degree between the first object and the second object based on the common data bodies. The object association degree is used to characterize the number of pairs of common data bodies, and each pair of common data bodies includes two common data bodies. Sum all the object association degrees to obtain the association degree between the object set and the data body set.
[0008] Secondly, embodiments of this application also provide a system for obtaining the correlation degree in a graph structure, including: a control unit, an accumulator, and multiple processing units; the control unit is connected to each of the processing units, and the accumulator is connected to each of the processing units respectively; the control unit is used to obtain an object set and a data body set; wherein, the object set includes multiple objects, the data body set includes multiple data bodies, and each object has a corresponding data body; the control unit is also used to control the processing units to obtain the same data bodies of a first object and a second object in the object set, and to obtain the object correlation degree between the first object and the second object based on the same data bodies; the object correlation degree is used to characterize the number of pairs of identical data bodies, and the pairs of identical data bodies include two identical data bodies; the accumulator is used to sum all the object correlation degrees to obtain the correlation degree between the object set and the data body set.
[0009] Thirdly, embodiments of this application also provide a device for obtaining the correlation degree in a graph structure, the device comprising: The first acquisition module is used to acquire an object set and a data body set. The object set includes multiple objects, and the data body set includes multiple data bodies. Each object has a corresponding data body. The second acquisition module is used to acquire the same data bodies of a first object and a second object in the object set, and to acquire the object association degree between the first object and the second object based on the same data bodies. The object association degree is used to characterize the number of pairs of identical data bodies, and the pairs of identical data bodies include two identical data bodies. The third acquisition module is used to sum all the object association degrees to obtain the association degree between the object set and the data body set.
[0010] Fourthly, embodiments of this application also provide an electronic device, which includes a processor, a memory, and a program or instructions stored in the memory and executable on the processor, wherein the program or instructions, when executed by the processor, implement the steps of the method described in the first aspect.
[0011] Fifthly, embodiments of this application also provide a readable storage medium on which a program or instructions are stored, which, when executed by a processor, implement the steps of the method described in the first aspect.
[0012] In this embodiment, by obtaining an object set and a data body set, wherein the object set includes multiple objects and the data body set includes multiple data bodies, and each object has a corresponding data body, the common data bodies of the first object and the second object in the object set are obtained, and the object association degree between the first object and the second object is obtained based on the common data bodies, wherein the object association degree is used to characterize the number of pairs of common data bodies, and the pairs of common data bodies include two common data bodies, and then all object association degrees are summed to obtain the association degree between the object set and the data body set, so as to realize the association degree between the two data sets without manual processing, thereby improving work efficiency and solving the problem of low work efficiency in the prior art, which is caused by the staff manually analyzing the association relationship between data elements in one data set and data elements in another data set to obtain the association degree between the two data sets. Attached Figure Description
[0013] Figure 1 This is a flowchart illustrating the steps of a method for obtaining the correlation degree in a graph structure according to an embodiment of this application; Figure 2 This is a flowchart illustrating the specific steps of a method for obtaining the correlation degree in a graph structure, as provided in an embodiment of this application. Figure 3 This is a schematic diagram of a system for obtaining the correlation degree in a graph structure provided in an embodiment of this application; Figure 4 This is a schematic diagram of the specific structure of the graph structure correlation acquisition system provided in the embodiments of this application; Figure 5 This is a schematic diagram of the structure of the processing unit provided in the embodiments of this application; Figure 6 This is a schematic diagram of the structure of the selection subunit provided in the embodiments of this application; Figure 7 This is a schematic diagram of the processing flow of the processing unit provided in the embodiments of this application; Figure 8 This is an example diagram of a binary network of object sets and data body sets provided in the embodiments of this application; Figure 9 This is a schematic diagram of the butterfly image provided in the embodiments of this application; Figure 10 This is a block diagram of a device for obtaining the correlation degree in a graph structure according to an embodiment of this application; Figure 11 This is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0014] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0015] The method for obtaining the correlation degree in the graph structure provided in this application will be described in detail below with reference to the accompanying drawings, through specific embodiments and application scenarios.
[0016] Figure 1 This is a flowchart illustrating the steps of a method for obtaining the correlation degree in a graph structure according to an embodiment of this application. Figure 1 As shown, the method may include: Step 101: Obtain the object set and the data body set. The object set includes multiple objects, and the data body set includes multiple data bodies. Each object has a corresponding data body.
[0017] In this embodiment of the application, by obtaining an object set and a data body set, and then based on the objects in the object set and the data bodies in the data body set, the same data bodies of the first object and the second object in the object set are obtained, and based on the same data bodies, the object association degree between the first object and the second object is obtained.
[0018] It should be noted that both the object collection and the data body collection are data collections, where a data collection is a set of multiple data elements. Each object has a corresponding data body, where an object corresponds to (is associated with) at least one data body, and each data body also has a corresponding object, where a data body corresponds to (is associated with) at least one object.
[0019] The object set and the data body set can be data sets of the same type. For example, the object set can be a first user set, which includes multiple first users, and the data body set can be a second user set, which includes multiple second users. First users correspond to second users (e.g., first user h1 corresponds to second user s1, first user h2 corresponds to second user s1, first user h2 corresponds to second user s2, etc.). The object set and the data body set can also be data sets of different types. For example, the object set can be a user set, which includes multiple users, and the data body set can be an item set, which includes multiple items. Users correspond to items (e.g., user r1 corresponds to item t1, user r1 corresponds to item t2, user r2 corresponds to item t1, etc.).
[0020] Specifically, in some embodiments, the object set and the data body set form a bipartite network, which is a graph structure in which all nodes of the bipartite network can be divided into two partitions. There are no direct links between nodes in the same partition, but there are direct links between nodes in different partitions.
[0021] It should be noted that a graph structure includes nodes and edges. Nodes represent elements in a set, and the relationships between elements are represented by edges.
[0022] Step 102: Obtain the same data body between the first object and the second object in the object set, and obtain the object association degree between the first object and the second object based on the same data body.
[0023] The object association degree is used to characterize the number of identical data body pairs, and the identical data body pairs include two identical data bodies.
[0024] In this embodiment of the application, the same data body of the first object and the second object in the object set is obtained based on the objects in the object set and the data body in the data body set. Based on the same data body, the object association degree between the first object and the second object is obtained. Then, all object association degrees are summed to obtain the association degree between the object set and the data body set.
[0025] It should be noted that the data body that is the same as the data body of the second object within the data body of the first object is the same data body within the data body of the second object.
[0026] Specifically, in some embodiments, the object affinity is equal to the number of identical data pairs between the first object and the second object. The more identical data pairs between the first object and the second object, the stronger the affinity between them.
[0027] The same data body pair includes a first same data body and a second same data body, and the first object, the second object, the first same data body, and the second same data body are combined into a unit set.
[0028] For example, refer to Figure 8 The object set includes 6 objects: object u0, object u1, object u2, object u3, object u4, and object u5. The data body set includes 6 data bodies: data body v0, data body v1, data body v2, data body v3, data body v4, and data body v5. Figure 8 In this context, the connection between an object and a data body is used to represent the correspondence (association) between the two. For example, the connection between object u0 and data body v2 is used to represent the association between object u0 and data body v2.
[0029] Reference Figure 9 The lines connecting the units to represent the relationship between objects and data bodies form a butterfly image. One unit set corresponds to one butterfly image, meaning the number of unit sets is equal to the number of butterfly images. Therefore, a unit set can be represented by a butterfly image. For example, objects u0, u2, data bodies v0, and v2 form a unit set. The lines connecting objects u0 and v2, u0 and v0, u2 and v2, and u2 and v0 form a butterfly image, representing the unit set composed of objects u0, u2, v0, and v2.
[0030] The number of unit sets for the first object and the second object is equal to the number of identical data pairs for the first object and the second object. Therefore, the object association degree between the first object and the second object represents the number of unit sets for the first object and the second object, and the value of the object association degree between the first object and the second object is equal to the number of unit sets for the first object and the second object.
[0031] Step 103: Sum all the object association degrees to obtain the association degree between the object set and the data body set.
[0032] In this embodiment, the correlation between the object set and the data body set is obtained by summing all object correlation degrees, thereby realizing the correlation between the two data sets. Specifically, in some embodiments, as can be seen from the foregoing analysis, the value of the object correlation degree between the first object and the second object is equal to the number of unit sets related to the first object and the second object. Therefore, the sum of all object correlation degrees is the total number of all unit sets. Thus, the value of the correlation between the object set and the data body set obtained by summing all object correlation degrees is the total number of all unit sets contained in the union of the object set and the data body set.
[0033] In the unit set, both the first object and the second object are associated with the first identical data body, and both the first object and the second object are associated with the second identical data body. At the same time, both the first identical data body and the second identical data body are associated with the first object, and both the first identical data body and the second identical data body are associated with the second object. That is, the first identical data body is the same data body of the first object and the second object, the second identical data body is the same data body of the first object and the second object, the first object is the same object of the first identical data body and the second identical data body, and the second object is the same object of the first identical data body and the second identical data body. Therefore, the unit set reflects the association relationship between the first object and the second object in the object set and the first identical data body and the second identical data body in the data body set. The larger the total number of unit sets contained in the union of the object set and the data body set, the stronger the association between the object set and the data body set.
[0034] To determine whether a set of objects is related to a set of data (i.e., whether one set of data is related to another set of data), a correlation threshold can be set between the set of objects and the set of data. If the correlation between the set of objects and the set of data is greater than the correlation threshold, the set of objects is determined to be related to the set of data. If the correlation between the set of objects and the set of data is less than or equal to the correlation threshold, the set of objects is determined to be unrelated to the set of data.
[0035] Optionally, in some embodiments, the statistical expression for the number of unit sets (number of butterfly images) contained in the union of the object set and the data volume set, BFC(G), is as follows: , Where G represents a binary network and U represents a set of objects. Representation Object and object The same data body.
[0036] Taking steps 101 to 103 as an example, firstly, obtain the object set and the data body set. The object set is the user set a, which includes user a1, user a2, and user a3. The data body set is the item set b, which includes item b1, item b2, item b3, and item b4. Among them, user a1 is associated with item b1, user a1 is associated with item b2, user a1 is associated with item b3, user a2 is associated with item b1, user a2 is associated with item b2, user a3 is associated with item b1, user a3 is associated with item b3, and user a3 is associated with item b4.
[0037] Then, the common data body of the first object and the second object in the object set is obtained, and based on the common data body, the object association degree between the first object and the second object is obtained, that is, the common data body (item b1, item b2) of user a1 and user a2 is obtained. Since item b1 and item b2 form a common data body pair of user a1 and user a2, the number of common data body pairs of user a1 and user a2 is 1, and the value of the object association degree of user a1 and user a2 is 1. The common data body of user a1 and user a3 is then obtained. (Item b1, Item b3) Since Item b1 and Item b3 form a common data pair between User a1 and User a3, the number of common data pairs between User a1 and User a3 is 1, and the object association value between User a1 and User a3 is 1. Obtain the common data pair (Item b1) between User a2 and User a3. Since User a2 and User a3 have only one common data pair (Item b1), the number of common data pairs between User a2 and User a3 is 0, and the object association value between User a1 and User a3 is 0.
[0038] Then sum all the object association degrees to obtain the association degree between the object set and the data body set. That is, sum the object association degree values of user a1 and user a2, user a1 and user a3, and user a2 and user a3 to obtain the association degree between the object set and the data body set as 2 (obtained by 1+1+0).
[0039] The correlation threshold between the object set and the data body set is set to 3. Since the correlation between the object set and the data body set is less than the correlation threshold, the object set and the data body set are not related.
[0040] In summary, in this embodiment, by obtaining an object set and a data body set, wherein the object set includes multiple objects and the data body set includes multiple data bodies, and each object has a corresponding data body, the common data bodies of the first object and the second object in the object set are obtained, and the object association degree between the first object and the second object is obtained based on the common data bodies, wherein the object association degree is used to characterize the number of pairs of common data bodies, and a pair of common data bodies includes two common data bodies, and then all object association degrees are summed to obtain the association degree between the object set and the data body set, so as to obtain the association degree between the two data sets without manual processing, thereby improving work efficiency and solving the problem of low work efficiency in the prior art, where workers have to manually analyze the association relationship between data elements in one data set and data elements in another data set to obtain the association degree between the two data sets.
[0041] Figure 2This is a flowchart illustrating specific steps of a method for obtaining the correlation degree in a graph structure provided in this application embodiment, such as... Figure 2 As shown, the method may include: Step 201: Obtain an object set and a data body set. The object set includes multiple objects, and the data body set includes multiple data bodies. Each object has a corresponding data body.
[0042] The implementation method of this step is similar to that of sub-step 101 above, and will not be repeated here.
[0043] Step 202: Obtain the same data body of the first object and the second object in the object set, wherein, when each of the same data bodies is obtained, the parameter value of the preset parameter is updated.
[0044] In this embodiment of the application, by obtaining the same data body, wherein, when obtaining the same data body, the parameter value of the preset parameter is updated, and then when it is determined that all the same data bodies have been obtained, the current parameter value of the preset parameter is determined as the object association degree.
[0045] Optionally, in some embodiments, each of the data bodies has a preset value, and obtaining the same data body between the first object and the second object in the object set includes the following sub-step (sub-step 2021): Sub-step 2021: Determine the data body in the data body of the first object that has the same value as the data body of the second object as the same data body.
[0046] In this embodiment of the application, data bodies in the data body of the first object that have the same value as the data body of the second object are identified as identical data bodies, and then the parameter value of the preset parameter is updated each time an identical data body is obtained.
[0047] It should be noted that the values are different for different data volumes.
[0048] For example, the data body of the first object c1 includes data body d1 (the value of data body d1 is 1) and data body d2 (the value of data body d2 is 2), and the data body of the second object c2 includes data body d1 (the value of data body d1 is 1) and data body d3 (the value of data body d3 is 2). Since the value of data body d1 of the first object c1 is equal to the value of data body d1 of the second object c2, data body d1 is determined to be the same data body of the first object c1 and the first object c2.
[0049] Optionally, in some embodiments, updating the parameter value of the preset parameter each time the same data body is acquired includes the following sub-step (sub-step 2022): Sub-step 2022: When each identical data body is obtained, increment the current parameter value of the preset intermediate parameter by 1 to obtain the current new parameter value of the preset intermediate parameter, and add the current parameter value of the preset parameter to the current new parameter value of the preset intermediate parameter to obtain the current new parameter value of the preset parameter.
[0050] The initial value of the preset intermediate parameter is -1, and the initial value of the preset parameter is 0.
[0051] In this embodiment of the application, when the same data body is obtained, the current parameter value of the preset intermediate parameter is incremented by 1 to obtain the current new parameter value of the preset intermediate parameter, and the current parameter value of the preset parameter is added to the current new parameter value of the preset intermediate parameter to obtain the current new parameter value of the preset parameter. Then, when it is determined that all the same data bodies have been obtained, the current parameter value of the preset parameter is determined as the object correlation degree.
[0052] For example, there are a total of 6 identical data bodies between the first object and the second object. The identical data bodies between the first object and the second object are, in order of acquisition, identical data body e1, identical data body e2, identical data body e3, identical data body e4, identical data body e5, and identical data body e6. If the same data body e1 is obtained, the current parameter value f0 of the preset intermediate parameter (i.e., the initial parameter value of the preset intermediate parameter) is incremented by 1 to obtain the current new parameter value f1 of the preset intermediate parameter (adding -1 to 1 results in 0, so f1 is 0). The current parameter value g0 of the preset parameter (i.e., the initial parameter value of the preset parameter) is added to the current new parameter value f1 of the preset intermediate parameter to obtain the current new parameter value g1 of the preset parameter (adding 0 to 0 results in 0, so g1 is 0). If the same data body e2 is obtained, the current parameter value f1 of the preset intermediate parameter is incremented by 1 to obtain the current new parameter value f2 of the preset intermediate parameter (adding 0 to 1 results in 1, so f2 is 1). The current parameter value g1 of the preset parameter is added to the current new parameter value f2 of the preset intermediate parameter to obtain the current new parameter value g2 of the preset parameter (adding 0 to 1 results in 1, so g2 is 1). If the same data body e3 is obtained, increment the current parameter value f2 of the preset intermediate parameter by 1 to obtain the new parameter value f3 of the preset intermediate parameter (adding 1 to 1 gives 2, so f3 is 2). Then add the current parameter value g2 of the preset parameter to the new parameter value f3 of the preset intermediate parameter to obtain the new parameter value g3 of the preset parameter (adding 1 to 2 gives 3, so g3 is 3). If the same data body e4 is obtained, increment the current parameter value f3 of the preset intermediate parameter by 1 to obtain... The current new parameter value f4 of the preset intermediate parameter is obtained (adding 2 and 1 gives 3, so f4 is 3). The current parameter value g3 of the preset parameter is added to the current new parameter value f4 of the preset intermediate parameter to obtain the current new parameter value g4 of the preset parameter (adding 3 and 3 gives 6, so g4 is 6). If the same data body e4 is obtained, the current parameter value f3 of the preset intermediate parameter is incremented by 1 to obtain the current new parameter value f4 of the preset intermediate parameter (adding 2 and 1 gives 3, so f4 is 3). Add the current value g3 of the preset parameter to the current new value f4 of the preset intermediate parameter to obtain the current new value g4 of the preset parameter (adding 3 to 3 gives 6, so g4 is 6); if the same data body e5 is obtained, add 1 to the current value f4 of the preset intermediate parameter to obtain the current new value f5 of the preset intermediate parameter (adding 3 to 1 gives 4, so f5 is 4), and add the current value g4 of the preset parameter to the current new value f5 of the preset intermediate parameter to obtain The current new parameter value of the preset parameter is g5 (6 and 4 are added together to get 10, so g5 is 10); when the same data body e6 is obtained, the current parameter value of the preset intermediate parameter f5 is incremented by 1 to obtain the current new parameter value of the preset intermediate parameter f6 (4 and 1 are added together to get 5, so f6 is 5), and the current parameter value of the preset parameter g5 is added together with the current new parameter value of the preset intermediate parameter f6 to obtain the current new parameter value of the preset parameter g6 (10 and 5 are added together to get 15, so g6 is 15).
[0053] Step 203: If it is determined that all the same data bodies have been obtained, the current parameter value of the preset parameter is determined as the object association degree between the first object and the second object.
[0054] In this embodiment of the application, when it is determined that all identical data bodies have been obtained, the current parameter value of the preset parameter is determined as the object correlation degree, and then all object correlation degrees are summed to obtain the correlation degree between the object set and the data body set.
[0055] It should be noted that step 203 is executed after updating the parameter value of the preset parameter. That is, after obtaining the last identical data body, step 203 is executed after updating the parameter value of the preset parameter.
[0056] For example, there are a total of 6 identical data bodies between the first object and the second object. The identical data bodies between the first object and the second object are, in order of acquisition, identical data body e1, identical data body e2, identical data body e3, identical data body e4, identical data body e5, and identical data body e6.
[0057] When the same data body e1 is obtained, the current parameter value f0 of the preset intermediate parameter (i.e., the initial parameter value of the preset intermediate parameter) is incremented by 1 to obtain the current new parameter value f1 of the preset intermediate parameter (adding -1 to 1 results in 0, so f1 is 0). Then, the current parameter value g0 of the preset parameter (i.e., the initial parameter value of the preset parameter) is added to the current new parameter value f1 of the preset intermediate parameter to obtain the current new parameter value g1 of the preset parameter (adding 0 to 0 results in 0, so g1 is 0). When the same data body e2 is obtained, the current parameter value f1 of the preset intermediate parameter is incremented by 1 to obtain the current new parameter value f2 of the preset intermediate parameter (adding 0 to 1 results in 1, so f2 is 1). Then, the current parameter value g1 of the preset parameter is added to the current new parameter value f2 of the preset intermediate parameter to obtain the current new parameter value g2 of the preset parameter (adding 0 to 1 results in 1, so f2 is 1). (If g2 is 1, then g2 is 1). If the same data body e3 is obtained, the current parameter value f2 of the preset intermediate parameter is incremented by 1 to obtain the current new parameter value f3 of the preset intermediate parameter (if 1 is 2, then f3 is 2), and the current parameter value g2 of the preset parameter is added to the current new parameter value f3 of the preset intermediate parameter to obtain the current new parameter value g3 of the preset parameter (if 1 is 3, then g3 is 3). If the same data body e4 is obtained, the current parameter value f3 of the preset intermediate parameter is incremented by 1 to obtain the current new parameter value f4 of the preset intermediate parameter (if 2 is 3, then f4 is 3), and the current parameter value g3 of the preset parameter is added to the current new parameter value f4 of the preset intermediate parameter to obtain the current new parameter value g4 of the preset parameter (if 3 is 6, then g4 is 6). If the same data body e4 is obtained, the current parameter value f3 of the preset intermediate parameter is incremented by 1 to obtain the new parameter value f4 of the preset intermediate parameter (adding 2 and 1 gives 3, so f4 is 3). Then, the current parameter value g3 of the preset parameter is added to the new parameter value f4 of the preset intermediate parameter to obtain the new parameter value g4 of the preset parameter (adding 3 and 3 gives 6, so g4 is 6). If the same data body e5 is obtained, the current parameter value f4 of the preset intermediate parameter is incremented by 1 to obtain the new parameter value f5 of the preset intermediate parameter (adding 3 and 1 gives 4, so f5 is 4). Add the current parameter value g4 of the preset parameter to the current new parameter value f5 of the preset intermediate parameter to obtain the current new parameter value g5 of the preset parameter (adding 6 and 4 gives 10, so g5 is 10). If the same data body e6 is obtained, add 1 to the current parameter value f5 of the preset intermediate parameter to obtain the current new parameter value f6 of the preset intermediate parameter (adding 4 and 1 gives 5, so f6 is 5). Then add the current parameter value g5 of the preset parameter to the current new parameter value f6 of the preset intermediate parameter to obtain the current new parameter value g6 of the preset parameter (adding 10 and 5 gives 15, so g6 is 15). At this point, it is determined that all the same data bodies have been obtained. Then the current parameter value of the preset parameter (i.e., the new parameter value g6 obtained when the same data body e6 is obtained) is determined as the object correlation degree, and the value of the object correlation degree is 15.
[0058] Step 204: Sum all the object association degrees to obtain the association degree between the object set and the data body set.
[0059] The implementation method of this step is similar to that of sub-step 103 above, and will not be repeated here.
[0060] Optionally, in some embodiments, each data body has a preset value, each object has a corresponding data body sequence, and the data bodies in the data body sequence are arranged in numerical order; the first data body sequence of the first object includes n data bodies, and the second data body sequence of the second object includes m data bodies, where n and m are both positive integers; the method further includes the following steps (steps 205 and 206): Step 205: Compare the i-th data body in the first data body sequence with the j-th data body in the second data body sequence to obtain the first comparison result; where i is a positive integer less than or equal to n, and j is a positive integer less than or equal to m.
[0061] In this embodiment, a first comparison result is obtained by comparing the i-th data body in the first data body sequence with the j-th data body in the second data body sequence. If the first comparison result shows that the value of the i-th data body in the first data body sequence is equal to the value of the j-th data body in the second data body sequence, then an identical data body is determined to be obtained. Specifically, in some embodiments, the data bodies in the data body sequence are arranged in ascending order of value, and the comparison begins with the first data body in the first data body sequence and the first data body in the second data body sequence; in other embodiments, the data bodies in the data body sequence are arranged in descending order of value.
[0062] Step 206: If the first comparison result is that the value of the i-th data body in the first data body sequence is equal to the value of the j-th data body in the second data body sequence, then determine that one identical data body has been obtained.
[0063] In this embodiment of the application, if the value of the i-th data body in the first data body sequence is equal to the value of the j-th data body in the second data body sequence, it is determined that an identical data body is obtained. Then, in each case where an identical data body is obtained, the parameter value of the preset parameter is updated.
[0064] By executing steps 205 to 206, the data bodies in the first data body sequence are compared with the data bodies in the second data body sequence one by one in order to determine whether the same data body is obtained. In order to update the parameter value of the preset parameter when the same data body is obtained.
[0065] Optionally, in some embodiments, the method further includes the following step (step 207): Step 207: If i equals n and the first comparison result is that the value of the i-th data body in the first data body sequence is less than or equal to the value of the j-th data body in the second data body sequence, then determine that all the identical data bodies have been obtained.
[0066] In this embodiment, if i equals n and the first comparison result is that the value of the i-th data body in the first data body sequence is less than or equal to the value of the j-th data body in the second data body sequence, it is determined that all identical data bodies have been obtained. Then, if all identical data bodies have been obtained, the current value of the preset parameter is determined as the object correlation degree. For example, if the first data body sequence includes 3 data bodies and the second data body sequence includes 6 data bodies, when comparing the 3rd data body in the first data body sequence with the 5th data body in the second data body sequence and obtaining the first comparison result, if the value of the 3rd data body in the first data body sequence is less than the value of the 5th data body in the second data body sequence, and since i equals n at this time and the first comparison result is that the value of the i-th data body in the first data body sequence is less than or equal to the value of the j-th data body in the second data body sequence, it is determined that all identical data bodies have been obtained.
[0067] Optionally, in some embodiments, the method further includes the following step (step 208): Step 208: If j equals m and the first comparison result is that the value of the i-th data body in the first data body sequence is greater than or equal to the value of the j-th data body in the second data body sequence, then determine that all the identical data bodies have been obtained.
[0068] In this embodiment, if j equals m and the first comparison result is that the value of the i-th data body in the first data body sequence is greater than or equal to the value of the j-th data body in the second data body sequence, it is determined that all identical data bodies have been obtained. Then, if all identical data bodies have been obtained, the current value of the preset parameter is determined as the object correlation degree. For example, if the first data body sequence includes 8 data bodies and the second data body sequence includes 6 data bodies, when comparing the second data body in the first data body sequence with the sixth data body in the second data body sequence and obtaining the first comparison result, the first comparison result is that the value of the second data body in the first data body sequence is equal to the value of the sixth data body in the second data body sequence. Since j equals m and the first comparison result is that the value of the i-th data body in the first data body sequence is greater than or equal to the value of the j-th data body in the second data body sequence, it is determined that all identical data bodies have been obtained.
[0069] Optionally, in some embodiments, the method further includes the following step (step 209): Step 209: When i equals n and j equals m, determine that all the identical data bodies have been obtained.
[0070] In this embodiment of the application, when i equals n and j equals m, it is determined that all identical data bodies have been obtained. Then, when it is determined that all identical data bodies have been obtained, the current parameter value of the preset parameter is determined as the object association degree.
[0071] For example, the first data body sequence includes 5 data bodies, and the second data body sequence includes 9 data bodies. After comparing the 5th data body in the first data body sequence with the 9th data body in the second data body sequence and obtaining the first comparison result, since i equals n and j equals m, it is determined that all identical data bodies have been obtained.
[0072] Optionally, in some embodiments, after step 205, the method further includes the following steps (steps 210, 211, and 212): Step 210: When i is less than n and the first comparison result is that the value of the i-th data body in the first data body sequence is less than the value of the j-th data body in the second data body sequence, compare the (i+1)-th data body in the first data body sequence with the j-th data body in the second data body sequence to obtain the second comparison result.
[0073] In this embodiment of the application, when i is less than n and the first comparison result is that the value of the i-th data body in the first data body sequence is less than the value of the j-th data body in the second data body sequence, the (i+1)-th data body in the first data body sequence is compared with the j-th data body in the second data body sequence to obtain a second comparison result. Then, when the second comparison result is that the value of the (i+1)-th data body in the first data body sequence is equal to the value of the j-th data body in the second data body sequence, it is determined that an identical data body is obtained.
[0074] For example, the first data body sequence includes 5 data bodies, and the second data body sequence includes 3 data bodies. When comparing the second data body in the first data body sequence with the third data body in the second data body sequence to obtain the first comparison result, the first comparison result is that the value of the second data body in the first data body sequence is less than the value of the third data body in the second data body sequence. Since i is less than n and the first comparison result is that the value of the i-th data body in the first data body sequence is less than the value of the j-th data body in the second data body sequence, the third data body in the first data body sequence is compared with the third data body in the second data body sequence to obtain the second comparison result.
[0075] Step 211: When j is less than m and the first comparison result is that the value of the i-th data body in the first data body sequence is greater than the value of the j-th data body in the second data body sequence, compare the i-th data body in the first data body sequence with the (j+1)-th data body in the second data body sequence to obtain the third comparison result.
[0076] In this embodiment of the application, when j is less than m and the first comparison result is that the value of the i-th data body in the first data body sequence is greater than the value of the j-th data body in the second data body sequence, the i-th data body in the first data body sequence is compared with the (j+1)-th data body in the second data body sequence to obtain a third comparison result. Then, when the third comparison result is that the value of the i-th data body in the first data body sequence is equal to the value of the (j+1)-th data body in the second data body sequence, it is determined that an identical data body is obtained.
[0077] For example, the first data body sequence includes 8 data bodies, and the second data body sequence includes 5 data bodies. When comparing the 5th data body in the first data body sequence with the 3rd data body in the second data body sequence to obtain the first comparison result, the first comparison result is that the value of the 5th data body in the first data body sequence is greater than the value of the 3rd data body in the second data body sequence. Since j is less than m and the first comparison result is that the value of the i-th data body in the first data body sequence is greater than the value of the j-th data body in the second data body sequence, the 5th data body in the first data body sequence is compared with the 4th data body in the second data body sequence to obtain the third comparison result.
[0078] Step 212: When i is less than n and j is less than m, and the value of the i-th data body in the first data body sequence is equal to the value of the j-th data body in the second data body sequence, compare the (i+1)-th data body in the first data body sequence with the (j+1)-th data body in the second data body sequence to obtain the fourth comparison result.
[0079] In this embodiment of the application, when i is less than n and j is less than m, and the value of the i-th data body in the first data body sequence is equal to the value of the j-th data body in the second data body sequence, the (i+1)-th data body in the first data body sequence is compared with the (j+1)-th data body in the second data body sequence to obtain a fourth comparison result. Then, when the fourth comparison result is that the value of the (i+1)-th data body in the first data body sequence is equal to the value of the (j+1)-th data body in the second data body sequence, it is determined that an identical data body is obtained.
[0080] For example, the first data body sequence includes 9 data bodies, and the second data body sequence includes 9 data bodies. When comparing the 5th data body in the first data body sequence with the 3rd data body in the second data body sequence to obtain the first comparison result, the first comparison result is that the value of the 5th data body in the first data body sequence is equal to the value of the 3rd data body in the second data body sequence. Since i is less than n and j is less than m, and the value of the i-th data body in the first data body sequence is equal to the value of the j-th data body in the second data body sequence, the 6th data body in the first data body sequence is compared with the 4th data body in the second data body sequence to obtain the fourth comparison result.
[0081] By executing steps 210 to 212, the data bodies in the first data body sequence can be compared one by one with the data bodies in the second data body sequence in order to determine whether the same data bodies are obtained.
[0082] Optionally, in some embodiments, the method further includes the following step (step 213): Step 213: If the second comparison result is that the value of the (i+1)th data body in the first data body sequence is equal to the value of the jth data body in the second data body sequence, then determine that one identical data body has been obtained.
[0083] In this embodiment of the application, if the value of the (i+1)th data body in the first data body sequence is equal to the value of the jth data body in the second data body sequence, it is determined that an identical data body is obtained. Then, in each case where an identical data body is obtained, the parameter value of the preset parameter is updated.
[0084] Optionally, in some embodiments, the method further includes the following step (step 214): Step 214: If the third comparison result is that the value of the i-th data body in the first data body sequence is equal to the value of the (j+1)-th data body in the second data body sequence, then a single identical data body is determined to be obtained.
[0085] In this embodiment of the application, if the value of the i-th data body in the first data body sequence is equal to the value of the (j+1)-th data body in the second data body sequence in the third comparison result, it is determined that an identical data body is obtained. Then, the parameter value of the preset parameter is updated each time an identical data body is obtained.
[0086] Optionally, in some embodiments, the method further includes the following step (step 215): Step 215: If the fourth comparison result is that the value of the (i+1)th data body in the first data body sequence is equal to the value of the (j+1)th data body in the second data body sequence, then a matching data body is determined to be obtained.
[0087] In this embodiment of the application, if the value of the (i+1)th data body in the first data body sequence is equal to the value of the (j+1)th data body in the second data body sequence in the fourth comparison result, an identical data body is determined, and then the parameter value of the preset parameter is updated each time an identical data body is obtained.
[0088] In summary, in this embodiment, by obtaining an object set and a data body set, wherein the object set includes multiple objects and the data body set includes multiple data bodies, and each object has a corresponding data body, the common data bodies of the first object and the second object in the object set are obtained, and the object association degree between the first object and the second object is obtained based on the common data bodies, wherein the object association degree is used to characterize the number of pairs of common data bodies, and a pair of common data bodies includes two common data bodies, and then all object association degrees are summed to obtain the association degree between the object set and the data body set, so as to obtain the association degree between the two data sets without manual processing, thereby improving work efficiency and solving the problem of low work efficiency in the prior art, where workers have to manually analyze the association relationship between data elements in one data set and data elements in another data set to obtain the association degree between the two data sets.
[0089] Reference Figure 3 This application embodiment also provides a system for obtaining the correlation degree in a graph structure. The system includes a control unit 10, an accumulator 30, and multiple processing units 20. The control unit 10 is connected to each of the processing units 20, and the accumulator 30 is connected to each of the processing units 20. The control unit 10 is used to obtain an object set and a data body set. The object set includes multiple objects, and the data body set includes multiple data bodies. Each object has a corresponding data body. The control unit 10 is also used to control the processing units 20 to obtain the same data bodies of a first object and a second object in the object set, and to obtain the object correlation degree between the first object and the second object based on the same data bodies. The object correlation degree is used to characterize the number of pairs of identical data bodies, and the pairs of identical data bodies include two identical data bodies. The accumulator 30 is used to sum all the object correlation degrees to obtain the correlation degree between the object set and the data body set.
[0090] The specific implementation of the system for obtaining the degree of association in a graph structure is similar to the implementation process of the aforementioned method for obtaining the degree of association in a graph structure, and will not be repeated here.
[0091] In this embodiment, the control unit 10 acquires an object set and a data body set. The object set includes multiple objects, and the data body set includes multiple data bodies. Each object has a corresponding data body. Then, the control unit 10 controls the processing unit 20 to acquire the same data bodies of the first object and the second object in the object set. Based on the same data bodies, the object correlation degree between the first object and the second object is acquired. The object correlation degree is used to characterize the number of pairs of identical data bodies. A pair of identical data bodies includes two identical data bodies. Then, the accumulator 30 sums all the object correlation degrees to obtain the correlation degree between the object set and the data body set. This achieves the acquisition of the correlation degree between the two data sets without manual processing, improving work efficiency and solving the problem of low work efficiency in the prior art where workers manually analyze the correlation between data elements in one data set and data elements in another data set to obtain the correlation degree between the two data sets.
[0092] Optionally, in some embodiments, each data body has a preset value; the processing unit 20 includes a decoder 21, a first register 22, a second register 23, a comparator 24, and a counting subunit; the control unit 10 is connected to the decoder 21, the first register 22, the second register 23, the comparator 24, and the counting subunit, respectively; the decoder 21 is connected to the first register 22 and the second register 23, respectively; the comparator 24 is connected to the first register 22 and the second register 23, respectively; and the comparator 24 is connected to the counting subunit; specifically, the control unit 10 is used to control the decoder 21 to decode the value of the data body of the first object in the object set, to obtain... The first binary code is stored in the first register 22, and the decoder 21 is controlled to decode the value of the data body of the second object in the object set to obtain the second binary code and store it in the second register 23; the control unit 10 is further used to control the comparator 24 to compare the first binary code and the second binary code to obtain the comparison result; the control unit 10 is further used to control the counting subunit to update the parameter value of the preset parameter when the first binary code and the second binary code are the same, and to determine the current parameter value of the preset parameter as the object correlation degree when it is determined that all the comparison results of the first binary code and the second binary code are the same.
[0093] It should be noted that both the first and second binary codes are binary codes. Each storage area of the first register 22 and the second register 23 is set to 32 bits. Since each binary code also needs a flag bit, when the number of bits in the first binary code is greater than 15, the number of bits obtained by adding the flag bit to the number of bits in the first binary code is greater than 16. Therefore, a first binary code is stored in one storage area of the first register 22. When the number of bits in the first binary code is less than or equal to 15, the number of bits obtained by adding the flag bit to the number of bits in the first binary code is less than 16. If the number of bits in the second binary code is greater than or equal to 15, then the number of bits obtained by adding a flag bit to the number of bits in the second binary code is greater than 16. Therefore, one second binary code is stored in a storage area of the second register 23. If the number of bits in the second binary code is less than or equal to 15, then the number of bits obtained by adding a flag bit to the number of bits in the second binary code is less than or equal to 16. Therefore, two second binary codes are stored in a storage area of the second register 23.
[0094] In this embodiment, the control unit 10 controls the decoder 21 to decode the value of the data body of the first object in the object set, obtain the first binary code and store it in the first register 22, and controls the decoder 21 to decode the value of the data body of the second object in the object set, obtain the second binary code and store it in the second register 23. Then, the control unit 10 controls the comparator 24 to compare the first binary code and the second binary code to obtain the comparison result. Then, when the control unit 10 obtains a comparison result in which the first binary code and the second binary code are the same, it controls the counting subunit to update the parameter value of the preset parameter. When it is determined that all the comparison results in which the first binary code and the second binary code are the same are obtained, the current parameter value of the preset parameter is determined as the object correlation degree. Then, the accumulator 30 sums all the object correlation degrees to obtain the correlation degree between the object set and the data body set.
[0095] Reference Figure 4 The correlation acquisition system in the graph structure also includes a memory unit 40 and a data cache unit 50. The control unit 10 includes a control subunit 11 and a selection subunit 12. The memory unit 40 is connected to the data cache unit 50, the data cache unit 50 is connected to the selection subunit 12 and the accumulator 30, and the control subunit 11 is connected to the selection subunit 12.
[0096] Control subunit 11 is also connected to each processing unit 20, specifically, control subunit 11 is connected to comparator 24 and counter subunit; selection subunit 12 is also connected to each processing unit 20, specifically, selection subunit 12 is connected to decoder 21, first register 22 and second register 23. Memory unit 40 is used to store object set and data body set; data cache unit 50 is used to retrieve object set and data body set from memory unit 40 via Advanced eXtensible Interface (AXI) and store them; data cache unit 50 is also used to store the correlation between object set and data body set sent by accumulator 30. Control subunit 11 is used to control selection subunit 12 to retrieve data body value from data cache unit 50 according to the storage address of data body value, and allocate data body value to decoder 21 corresponding to data body value. Selection subunit 12 is used to control decoder 21 to decode the value of the data body of the first object in the object set, obtain the first binary code and store it in the first register 22, and to control decoder 21 to decode the value of the data body of the second object in the object set, obtain the second binary code and store it in the second register 23. Control subunit 11 is also used to control comparator 24 to compare the first binary code and the second binary code, obtain the comparison result, and, when a comparison result of the first binary code and the second binary code being the same is obtained, control counting subunit to update the parameter value of preset parameter, and, when it is determined that all comparison results of the first binary code and the second binary code being the same are obtained, determine the current parameter value of preset parameter as the object correlation degree.
[0097] Reference Figure 5 The processing unit 20 includes a decoder 21, a first register 22, a second register 23, a comparator 24, and a counting subunit. The counting subunit includes a first counter 25 and a second counter 26. The comparator 24 is connected to the first counter 25, and the first counter 25 is connected to the second counter 26. Specifically, the control subunit 11 is used to, upon obtaining a comparison result where the first binary code and the second binary code are identical, control the first counter 25 to increment the current value of the preset intermediate parameter by 1 to obtain the current new value of the preset intermediate parameter, and control the second counter 26 to add the current value of the preset parameter in the second counter 26 to the current new value of the preset intermediate parameter to obtain the current new value of the preset parameter. The initial value of the preset intermediate parameter is -1, and the initial value of the preset parameter is 0.
[0098] Reference Figure 6The selection subunit 12 includes a selector 12a, a priority register group 12b, and a general register group 12c. The selector 12a is connected to the control subunit 11, the priority register group 12b, and the general register group 12c, respectively. The selector 12a is also connected to each processing unit 20. Specifically, the selector 12a is connected to the decoder 21, the first register 22, and the second register 23, respectively. The selector 12a is used to store the value of the object's data body in the priority register group 12b when the number of data bodies is greater than a preset threshold, and to retrieve the value of the unallocated data body from the priority register group 12b and allocate it to the decoder 21 when the number of data bodies is less than or equal to the preset threshold. Conversely, it stores the value of the object's data body in the general register group 12c when the number of data bodies is less than or equal to the preset threshold, and to retrieve the value of the unallocated data body from the general register group 12c and allocate it to the decoder 21 when the priority register group 12b does not contain any unallocated data body values. Selector 12a is also used to control decoder 21 to decode the value of the data body of the first object in the object set, obtain the first binary code and store it in the first register 22, and to control decoder 21 to decode the value of the data body of the second object in the object set, obtain the second binary code and store it in the second register 23.
[0099] Figure 7This is a schematic diagram of the processing flow of processing unit 20. The horizontal axis represents the time series, and the vertical axis represents the comparison sequence. Processing unit 20 processes data in parallel. Specifically, from time 0 to time 1, the first comparison process begins, which involves processing unit 20 performing a decoding X11 step, that is, decoding the value of the first data body of the first object and the value of the first data body of the second object. From time 1 to time 2, while performing the first comparison process, the second comparison process begins. Specifically, processing unit 20 performs a decoding X21 step, that is, decoding the value of the second data body of the first object and the value of the second data body of the second object, and simultaneously performing a code value generation X12 step, that is, generating the first... The binary code of the first data body of the object and the binary code of the first data body of the second object; from the second time to the third time, while performing the first comparison process and the second comparison process, the third comparison process begins, specifically, the processing unit 20 performs the decoding X31 step, that is, decodes the value of the third data body of the first object and the value of the third data body of the second object, and at the same time performs the code value generation X22 step, that is, generates the binary code of the second data body of the first object and the binary code of the second data body of the second object, and at the same time performs the code value comparison X13, that is, compares the binary code of the first data body of the first object and the binary code of the first data body of the second object, and obtains the comparison result 1; From time 3 to time 4, while performing the first comparison process, the second comparison process, and the third comparison process, the fourth comparison process begins. Specifically, the processing unit 20 performs the decoding X41 step, which decodes the value of the fourth data body of the first object and the value of the fourth data body of the second object. At the same time, it performs the code value generation X32 step, which generates the binary code of the third data body of the first object and the binary code of the third data body of the second object. At the same time, it performs the code value comparison X23, which compares the binary code of the second data body of the first object and the binary code of the second data body of the second object to obtain the comparison result 2. At the same time, it performs the first counting X14 step, which increments the current value of the preset intermediate parameter by 1 if the binary code of the first data body of the first object and the binary code of the first data body of the second object are equal in the comparison result 1. Between time 4 and time 5, while performing the first, second, third, and fourth comparison processes, the fifth comparison process begins. The specific process is similar to that described above, and so on, so it will not be repeated here. Specifically, the second technique X15 step is as follows: if the binary code of the first data body of the first object and the binary code of the first data body of the second object are equal in comparison result 1, the current parameter value of the preset parameter is added to the current new parameter value of the preset intermediate parameter to obtain the current new parameter value of the preset parameter.
[0100] In summary, in this embodiment, the control unit 10 acquires an object set and a data body set. The object set includes multiple objects, and the data body set includes multiple data bodies. Each object has a corresponding data body. Then, the control unit 10 controls the processing unit 20 to acquire the same data bodies of the first object and the second object in the object set. Based on the same data bodies, the object correlation degree between the first object and the second object is acquired. The object correlation degree is used to characterize the number of pairs of identical data bodies. A pair of identical data bodies includes two identical data bodies. Then, the accumulator 30 sums all the object correlation degrees to obtain the correlation degree between the object set and the data body set. This achieves the acquisition of the correlation degree between the two data sets without manual processing, improving work efficiency and solving the problem of low work efficiency in the prior art where workers manually analyze the correlation between data elements in one data set and data elements in another data set to obtain the correlation degree between the two data sets.
[0101] Figure 10 This is a block diagram of a device for obtaining the correlation degree in a graph structure provided in an embodiment of this application, such as... Figure 10 As shown, the device 300 includes: The first acquisition module 301 is used to acquire an object set and a data body set, wherein the object set includes multiple objects and the data body set includes multiple data bodies, and each object has a corresponding data body. The second acquisition module 302 is used to acquire the same data body between the first object and the second object in the object set, and to acquire the object association degree between the first object and the second object based on the same data body; the object association degree is used to characterize the number of pairs of the same data body, and the pairs of the same data body include two of the same data bodies; The third acquisition module 303 is used to sum up the correlation degrees of all the objects to obtain the correlation degree between the object set and the data body set.
[0102] Optionally, the second acquisition module 302 specifically includes: a first acquisition submodule, used to acquire the same data body, wherein, when acquiring each of the same data bodies, the parameter value of the preset parameter is updated; and a determination submodule, used to determine the current parameter value of the preset parameter as the object correlation degree when it is determined that all the same data bodies have been acquired.
[0103] Optionally, each data body has a preset value, and each object has a corresponding data body sequence, wherein the data bodies in the data body sequence are arranged in order of numerical value. The first data body sequence of the first object includes n data bodies, and the second data body sequence of the second object includes m data bodies, where n and m are both positive integers; the device 300 further includes: a first comparison module, used to compare the i-th data body in the first data body sequence with the j-th data body in the second data body sequence to obtain a first comparison result; where i is a positive integer less than or equal to n, and j is a positive integer less than or equal to m; and a first determination module, used to determine that an identical data body is obtained when the first comparison result is that the value of the i-th data body in the first data body sequence is equal to the value of the j-th data body in the second data body sequence.
[0104] Optionally, the device 300 further includes: a second determining module, configured to determine that all the identical data bodies have been obtained when i equals n and the first comparison result is that the value of the i-th data body in the first data body sequence is less than or equal to the value of the j-th data body in the second data body sequence; a third determining module, configured to determine that all the identical data bodies have been obtained when j equals m and the first comparison result is that the value of the i-th data body in the first data body sequence is greater than or equal to the value of the j-th data body in the second data body sequence; and a fourth determining module, configured to determine that all the identical data bodies have been obtained when i equals n and j equals m.
[0105] Optionally, the device 300 further includes: a second comparison module, configured to compare the (i+1)th data body in the first data body sequence with the jth data body in the second data body sequence to obtain a second comparison result when i is less than n and the first comparison result is that the value of the i-th data body in the first data body sequence is less than the value of the j-th data body in the second data body sequence; a third comparison module, configured to compare the i-th data body in the first data body sequence with the (j+1)th data body in the second data body sequence to obtain a third comparison result when j is less than m and the first comparison result is that the value of the i-th data body in the first data body sequence is greater than the value of the j-th data body in the second data body sequence; and a fourth comparison module, configured to compare the (i+1)th data body in the first data body sequence with the (j+1)th data body in the second data body sequence to obtain a fourth comparison result when i is less than n and j is less than m, and the value of the i-th data body in the first data body sequence is equal to the value of the j-th data body in the second data body sequence.
[0106] Optionally, the device 300 further includes: a fifth determining module, configured to determine that an identical data body is obtained when the second comparison result is that the value of the (i+1)th data body in the first data body sequence is equal to the value of the jth data body in the second data body sequence; a sixth determining module, configured to determine that an identical data body is obtained when the third comparison result is that the value of the i-th data body in the first data body sequence is equal to the value of the (j+1)th data body in the second data body sequence; and a seventh determining module, configured to determine that an identical data body is obtained when the fourth comparison result is that the value of the (i+1)th data body in the first data body sequence is equal to the value of the (j+1)th data body in the second data body sequence.
[0107] Optionally, the first acquisition submodule specifically includes: an acquisition unit, configured to, upon acquiring the same data body, increment the current parameter value of the preset intermediate parameter by 1 to obtain the current new parameter value of the preset intermediate parameter, and add the current parameter value of the preset parameter to the current new parameter value of the preset intermediate parameter to obtain the current new parameter value of the preset parameter; wherein, the initial parameter value of the preset intermediate parameter is -1, and the initial parameter value of the preset parameter is 0.
[0108] Optionally, each of the data bodies has a preset value. The first acquisition submodule specifically includes: a determination unit, used to determine the data bodies in the data bodies of the first object that have the same value as the data bodies of the second object as the same data bodies.
[0109] The device for obtaining the correlation degree in the graph structure in this application embodiment can be a device, or it can be a component, integrated circuit, or chip in a terminal. The device can be a mobile electronic device or a non-mobile electronic device. For example, mobile electronic devices can be mobile phones, tablets, laptops, PDAs, in-vehicle electronic devices, wearable devices, ultra-mobile personal computers (UMPCs), netbooks, or personal digital assistants (PDAs), etc., while non-mobile electronic devices can be servers, network attached storage (NAS), personal computers (PCs), televisions (TVs), ATMs, or self-service machines, etc. This application embodiment does not make specific limitations.
[0110] The device for obtaining the correlation degree in the graph structure in this application embodiment can be a device with an operating system. The operating system can be Android, iOS, or other possible operating systems; this application embodiment does not specifically limit it.
[0111] The device for obtaining the correlation degree in the graph structure provided in this application embodiment can achieve... Figure 1 The various processes implemented by the device for obtaining the correlation degree in the graph structure in the method embodiment will not be described again here to avoid repetition.
[0112] In this embodiment, by obtaining an object set and a data body set, wherein the object set includes multiple objects and the data body set includes multiple data bodies, and each object has a corresponding data body, the common data bodies of the first object and the second object in the object set are obtained, and the object association degree between the first object and the second object is obtained based on the common data bodies, wherein the object association degree is used to characterize the number of pairs of common data bodies, and the pairs of common data bodies include two common data bodies, and then all object association degrees are summed to obtain the association degree between the object set and the data body set, so as to realize the association degree between the two data sets without manual processing, thereby improving work efficiency and solving the problem of low work efficiency in the prior art, which is caused by the staff manually analyzing the association relationship between data elements in one data set and data elements in another data set to obtain the association degree between the two data sets.
[0113] Optionally, embodiments of this application also provide an electronic device, including a processor, a memory, and a program or instructions stored in the memory and executable on the processor. When the program or instructions are executed by the processor, they implement the various processes of the above-described method embodiments for obtaining the correlation degree in the graph structure and achieve the same technical effect. To avoid repetition, they will not be described again here.
[0114] It should be noted that the electronic devices in the embodiments of this application include the mobile electronic devices and non-mobile electronic devices described above.
[0115] Figure 11 A schematic diagram of the hardware structure of an electronic device to implement an embodiment of this application.
[0116] The electronic device 400 includes, but is not limited to, components such as: radio frequency unit 401, network module 402, audio output unit 403, input unit 404, sensor 405, display unit 406, user input unit 407, interface unit 408, memory 409, and processor 410.
[0117] Those skilled in the art will understand that the electronic device 400 may also include a power supply (such as a battery) for supplying power to various components. The power supply may be logically connected to the processor 410 through a power management system, thereby enabling functions such as managing charging, discharging, and power consumption through the power management system. Figure 11 The electronic device structure shown does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown, or combine certain components, or have different component arrangements, which will not be elaborated here.
[0118] The processor 410 is configured to acquire an object set and a data body set, wherein the object set includes multiple objects and the data body set includes multiple data bodies, and each object has a corresponding data body; acquire the same data bodies of a first object and a second object in the object set, and acquire the object association degree between the first object and the second object based on the same data bodies; the object association degree is used to characterize the number of pairs of the same data bodies, and the pairs of the same data bodies include two of the same data bodies; and sum all the object association degrees to obtain the association degree between the object set and the data body set.
[0119] In this embodiment, by obtaining an object set and a data body set, wherein the object set includes multiple objects and the data body set includes multiple data bodies, and each object has a corresponding data body, the common data bodies of the first object and the second object in the object set are obtained, and the object association degree between the first object and the second object is obtained based on the common data bodies, wherein the object association degree is used to characterize the number of pairs of common data bodies, and the pairs of common data bodies include two common data bodies, and then all object association degrees are summed to obtain the association degree between the object set and the data body set, so as to realize the association degree between the two data sets without manual processing, thereby improving work efficiency and solving the problem of low work efficiency in the prior art, which is caused by the staff manually analyzing the association relationship between data elements in one data set and data elements in another data set to obtain the association degree between the two data sets.
[0120] Optionally, the processor 410 is further configured to acquire the same data body, wherein, upon acquiring each of the same data bodies, the parameter value of the preset parameter is updated; and upon determining that all of the same data bodies have been acquired, the current parameter value of the preset parameter is determined as the object correlation degree.
[0121] Optionally, each data body has a preset value, and each object has a corresponding data body sequence, wherein the data bodies in the data body sequence are arranged in numerical order; the first data body sequence of the first object includes n data bodies, and the second data body sequence of the second object includes m data bodies, where n and m are both positive integers; the processor 410 is further configured to compare the i-th data body in the first data body sequence with the j-th data body in the second data body sequence to obtain a first comparison result; wherein i is a positive integer less than or equal to n, and j is a positive integer less than or equal to m; if the first comparison result is that the value of the i-th data body in the first data body sequence is equal to the value of the j-th data body in the second data body sequence, then it is determined that an identical data body is obtained.
[0122] Optionally, the processor 410 is further configured to determine that all the identical data bodies have been obtained when i equals n and the first comparison result is that the value of the i-th data body in the first data body sequence is less than or equal to the value of the j-th data body in the second data body sequence; to determine that all the identical data bodies have been obtained when j equals m and the first comparison result is that the value of the i-th data body in the first data body sequence is greater than or equal to the value of the j-th data body in the second data body sequence; and to determine that all the identical data bodies have been obtained when i equals n and j equals m.
[0123] Optionally, the processor 410 is further configured to: when i is less than n and the first comparison result is that the value of the i-th data body in the first data body sequence is less than the value of the j-th data body in the second data body sequence, compare the (i+1)-th data body in the first data body sequence with the j-th data body in the second data body sequence to obtain a second comparison result; when j is less than m and the first comparison result is that the value of the i-th data body in the first data body sequence is greater than the value of the j-th data body in the second data body sequence, compare the i-th data body in the first data body sequence with the (j+1)-th data body in the second data body sequence to obtain a third comparison result; and when i is less than n and j is less than m, and the value of the i-th data body in the first data body sequence is equal to the value of the j-th data body in the second data body sequence, compare the (i+1)-th data body in the first data body sequence with the (j+1)-th data body in the second data body sequence to obtain a fourth comparison result.
[0124] Optionally, the processor 410 is further configured to determine that an identical data body is obtained when the second comparison result is that the value of the (i+1)th data body in the first data body sequence is equal to the value of the jth data body in the second data body sequence; to determine that an identical data body is obtained when the third comparison result is that the value of the ith data body in the first data body sequence is equal to the value of the (j+1)th data body in the second data body sequence; and to determine that an identical data body is obtained when the fourth comparison result is that the value of the (i+1)th data body in the first data body sequence is equal to the value of the (j+1)th data body in the second data body sequence.
[0125] Optionally, the processor 410 is further configured to, upon acquiring each of the same data volumes, increment the current parameter value of the preset intermediate parameter by 1 to obtain the current new parameter value of the preset intermediate parameter, and add the current parameter value of the preset parameter to the current new parameter value of the preset intermediate parameter to obtain the current new parameter value of the preset parameter; wherein, the initial parameter value of the preset intermediate parameter is -1, and the initial parameter value of the preset parameter is 0.
[0126] Optionally, each of the data bodies has a preset value, and the processor 410 is further configured to determine the data bodies in the data bodies of the first object that have the same value as the data bodies of the second object as the same data bodies.
[0127] In this embodiment, by obtaining an object set and a data body set, wherein the object set includes multiple objects and the data body set includes multiple data bodies, and each object has a corresponding data body, the common data bodies of the first object and the second object in the object set are obtained, and the object association degree between the first object and the second object is obtained based on the common data bodies, wherein the object association degree is used to characterize the number of pairs of common data bodies, and the pairs of common data bodies include two common data bodies, and then all object association degrees are summed to obtain the association degree between the object set and the data body set, so as to realize the association degree between the two data sets without manual processing, thereby improving work efficiency and solving the problem of low work efficiency in the prior art, which is caused by the staff manually analyzing the association relationship between data elements in one data set and data elements in another data set to obtain the association degree between the two data sets. It should be understood that, in this embodiment, the input unit 404 may include a graphics processing unit (GPU) 4041 and a microphone 4042. The GPU 4041 processes image data of still images or videos obtained by an image capture device (such as a camera) in video capture mode or image capture mode. The display unit 406 may include a display panel 4061, which may be configured in the form of a liquid crystal display, an organic light-emitting diode, or the like. The user input unit 407 includes at least one of a touch panel 4071 and other input devices 4072. The touch panel 4071 is also called a touch screen. The touch panel 4071 may include a touch detection device and a touch controller. Other input devices 4072 may include, but are not limited to, physical keyboards, function keys (such as volume control buttons, power buttons, etc.), trackballs, mice, and joysticks, which will not be described in detail here.
[0128] The memory 409 can be used to store software programs and various data. The memory 409 may primarily include a first storage area for storing programs or instructions and a second storage area for storing data. The first storage area may store the operating system, application programs or instructions required for at least one function (such as sound playback, image playback, etc.). Furthermore, the memory 409 may include volatile memory or non-volatile memory, or both. The non-volatile memory may be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory can be random access memory (RAM), static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct memory bus RAM (DRRAM). The memory 409 in the embodiments of this application includes, but is not limited to, these and any other suitable types of memory.
[0129] Processor 410 may include one or more processing units; optionally, processor 410 integrates an application processor and a modem processor, wherein the application processor mainly handles operations involving the operating system, user interface, and applications, and the modem processor mainly handles wireless communication signals, such as a baseband processor. It is understood that the aforementioned modem processor may also not be integrated into processor 410.
[0130] This application also provides a readable storage medium storing a program or instructions. When executed by a processor, the program or instructions implement the various processes of the above-described method for obtaining the correlation degree in the graph structure, and achieve the same technical effect. To avoid repetition, these will not be described again here. The processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes a computer-readable storage medium, such as a computer read-only memory (ROM), random access memory (RAM), a magnetic disk, or an optical disk.
[0131] This application embodiment also provides a chip, which includes a processor and a communication interface. The communication interface and the processor are coupled. The processor is used to run programs or instructions to implement the various processes of the above-described method embodiment for obtaining the correlation degree in the graph structure, and can achieve the same technical effect. To avoid repetition, it will not be described again here. It should be understood that the chip mentioned in this application embodiment can also be called a system-on-a-chip, system chip, chip system, or system-on-a-chip, etc.
[0132] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element. Furthermore, it should be noted that the scope of the methods and apparatuses in the embodiments of this application is not limited to performing functions in the order shown or discussed, but may also include performing functions substantially simultaneously or in the reverse order, depending on the functions involved. For example, the described methods may be performed in a different order than described, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples. Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, hardware is also possible, but in many cases the former is a preferred implementation. Based on this understanding, the technical solution of this application, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0133] The embodiments of this application have been described above with reference to the accompanying drawings. However, this application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of this application without departing from the spirit and scope of the claims, and all of these forms are within the protection scope of this application.
Claims
1. A method for obtaining the degree of association in a graph structure, characterized in that, The method includes: Obtain an object collection and a data body collection, wherein the object collection includes multiple objects and the data body collection includes multiple data bodies, and each object has a corresponding data body; Obtain the common data body between the first object and the second object in the object set, and obtain the object association degree between the first object and the second object based on the common data body; the object association degree is used to characterize the number of pairs of common data bodies, and the pairs of common data bodies include two of the common data bodies; Sum all the object association degrees to obtain the association degree between the object set and the data volume set; The step of obtaining the common data body between the first object and the second object in the object set, and obtaining the object association degree between the first object and the second object based on the common data body, includes: Obtain the same data body, wherein, in each case of obtaining the same data body, update the parameter value of the preset parameter; If it is determined that all the same data bodies have been obtained, the current parameter value of the preset parameter is determined as the object correlation degree; Each data body has a preset value, and each object has a corresponding data body sequence, wherein the data bodies in the data body sequence are arranged in order of numerical value. The first data body sequence of the first object includes n data bodies, and the second data body sequence of the second object includes m data bodies, where n and m are both positive integers; the method further includes: The i-th data body in the first data body sequence is compared with the j-th data body in the second data body sequence to obtain the first comparison result; where i is a positive integer less than or equal to n, and j is a positive integer less than or equal to m. If the first comparison result is that the value of the i-th data body in the first data body sequence is equal to the value of the j-th data body in the second data body sequence, then it is determined that an identical data body has been obtained.
2. The method according to claim 1, characterized in that, The method further includes: If i equals n and the first comparison result is that the value of the i-th data body in the first data body sequence is less than or equal to the value of the j-th data body in the second data body sequence, it is determined that all the identical data bodies have been obtained; or: If j equals m and the first comparison result is that the value of the i-th data body in the first data body sequence is greater than or equal to the value of the j-th data body in the second data body sequence, it is determined that all the identical data bodies have been obtained; or: Given that i equals n and j equals m, it is determined that all of the same data bodies are obtained.
3. The method according to claim 1, characterized in that, After comparing the i-th data body in the first data body sequence with the j-th data body in the second data body sequence to obtain a first comparison result, the method further includes: If i is less than n and the first comparison result is that the value of the i-th data body in the first data body sequence is less than the value of the j-th data body in the second data body sequence, then the (i+1)-th data body in the first data body sequence is compared with the j-th data body in the second data body sequence to obtain the second comparison result. If j is less than m and the first comparison result is that the value of the i-th data body in the first data body sequence is greater than the value of the j-th data body in the second data body sequence, then the i-th data body in the first data body sequence is compared with the (j+1)-th data body in the second data body sequence to obtain a third comparison result. If i is less than n and j is less than m, and the value of the i-th data body in the first data body sequence is equal to the value of the j-th data body in the second data body sequence, then the (i+1)-th data body in the first data body sequence is compared with the (j+1)-th data body in the second data body sequence to obtain the fourth comparison result.
4. The method according to claim 3, characterized in that, The method further includes: If the second comparison result shows that the value of the (i+1)th data body in the first data body sequence is equal to the value of the jth data body in the second data body sequence, then it is determined that a single identical data body has been obtained; or: If the third comparison result shows that the value of the i-th data body in the first data body sequence is equal to the value of the (j+1)-th data body in the second data body sequence, then it is determined that a single identical data body has been obtained; or: If the fourth comparison result is that the value of the (i+1)th data body in the first data body sequence is equal to the value of the (j+1)th data body in the second data body sequence, then it is determined that an identical data body has been obtained.
5. The method according to claim 1, characterized in that, The step of updating the parameter value of the preset parameter each time the same data body is acquired includes: In each case of obtaining the same data body, the current parameter value of the preset intermediate parameter is incremented by 1 to obtain the current new parameter value of the preset intermediate parameter, and the current parameter value of the preset parameter is added to the current new parameter value of the preset intermediate parameter to obtain the current new parameter value of the preset parameter. The initial value of the preset intermediate parameter is -1, and the initial value of the preset parameter is 0.
6. The method according to claim 1, characterized in that, Each of the data volumes has a preset value, and obtaining the same data volume includes: The data body in the data body of the first object whose value is equal to that in the data body of the second object is identified as the same data body.
7. A system for obtaining the degree of association in a graph structure, characterized in that, include: Control unit, accumulator, and multiple processing units; The control unit is connected to each of the processing units, and the accumulator is connected to each of the processing units respectively; The control unit is used to acquire an object set and a data body set; wherein, the object set includes multiple objects, the data body set includes multiple data bodies, and each object has a corresponding data body; The control unit is further configured to control the processing unit to acquire the same data body between the first object and the second object in the object set, and to acquire the object association degree between the first object and the second object based on the same data body; the object association degree is used to characterize the number of pairs of the same data body, and the pairs of the same data body include two of the same data bodies; The accumulator is used to sum all the object association degrees to obtain the association degree between the object set and the data body set; The step of obtaining the same data body between the first object and the second object in the object set, and obtaining the object association degree between the first object and the second object based on the same data body, includes: obtaining the same data body, wherein, when each of the same data bodies is obtained, the parameter value of a preset parameter is updated; when it is determined that all the same data bodies have been obtained, the current parameter value of the preset parameter is determined as the object association degree; Each data body has a preset value, and each object has a corresponding data body sequence. The data bodies in the data body sequence are arranged in numerical order. The first data body sequence of the first object includes n data bodies, and the second data body sequence of the second object includes m data bodies, where n and m are both positive integers. The control unit is further configured to control the processing unit to compare the i-th data body in the first data body sequence with the j-th data body in the second data body sequence to obtain a first comparison result. Here, i is a positive integer less than or equal to n, and j is a positive integer less than or equal to m. The control unit is further configured to control the processing unit to determine that an identical data body is obtained when the first comparison result is that the value of the i-th data body in the first data body sequence is equal to the value of the j-th data body in the second data body sequence.
8. The system for obtaining the correlation degree in a graph structure according to claim 7, characterized in that, Each data volume has a preset value; the processing unit includes a decoder, a first register, a second register, a comparator, and a counting subunit; The control unit is connected to the decoder, the first register, the second register, the comparator, and the counting subunit, respectively. The decoder is connected to the first register and the second register, respectively. The comparator is connected to the first register and the second register, respectively. The comparator is connected to the counting subunit. The control unit is specifically used to control the decoder to decode the value of the data body of the first object in the object set, obtain the first binary code and store it in the first register, and to control the decoder to decode the value of the data body of the second object in the object set, obtain the second binary code and store it in the second register; The control unit is further configured to control the comparator to compare the first binary code with the second binary code and obtain the comparison result; The control unit is further configured to, when a comparison result is obtained in which the first binary code and the second binary code are the same, control the counting subunit to update the parameter value of the preset parameter, and when it is determined that all comparison results are obtained in which the first binary code and the second binary code are the same, determine the current parameter value of the preset parameter as the object correlation degree.
Citation Information
Patent Citations
Image processing method, device and equipment and storage medium
CN111860226A
Method and apparatus for providing information by using degree of association between reserved word and attribute language
US20190026281A1
