Data clustering methods, devices and storage media

By using clustering centers generated by public blockchains to cluster data between consortium blockchains, the problem of direct communication between different consortium blockchains is solved, realizing cross-consortium blockchain data clustering and privacy data protection.

CN115757654BActive Publication Date: 2026-03-06CHINA UNITED NETWORK COMM GRP CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-14
Publication Date
2026-03-06

AI Technical Summary

Technical Problem

The inability of different consortium blockchains to communicate directly prevents data sharing, hinders the discovery of data's potential value, and poses a risk of privacy information being stolen when transmitted through third parties.

Method used

The target consortium blockchain clusters data based on the K first cluster centers sent by the public blockchain, generates K second cluster centers, and returns them to the public blockchain. The public blockchain then generates K third cluster centers. The target consortium blockchain determines the target cluster center based on the convergence of the K third cluster centers and the K second cluster centers, thus achieving cross-consortium blockchain data clustering.

Benefits of technology

It enables cross-consortium blockchain data clustering, avoiding the risk of privacy data theft and ensuring the accuracy and security of data clustering.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115757654B_ABST
    Figure CN115757654B_ABST
Patent Text Reader

Abstract

This application discloses a data clustering method, apparatus, and storage medium, relating to the field of communication technology, which enables data clustering of data samples without exchanging information between consortium blockchains. The method includes: receiving K first clustering centers sent by a public blockchain; clustering sample data in a target consortium blockchain using a clustering algorithm based on the K first clustering centers to determine K second clustering centers; sending the K second clustering centers to the public blockchain; receiving K third clustering centers sent by the public blockchain, wherein the K third clustering centers are clustering centers determined by the public blockchain based on the K second clustering centers sent by each of the multiple consortium blockchains; determining whether the K second clustering centers and the K third clustering centers satisfy a preset convergence condition; if satisfied, determining the K third clustering centers as the K target clustering centers of the target consortium blockchain. The embodiments of this application are applied to the data clustering process.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of communications, and more particularly to a data clustering method, apparatus, and storage medium. Background Technology

[0002] Due to limitations in the underlying protocols and technologies of blockchain, different consortium blockchains are independent and closed to each other, making direct communication between them impossible. This prevents data sharing between different consortium blockchains, severely hindering the extraction of potential value from the data on these blockchains.

[0003] In related technologies, data sharing between different consortium blockchains is achieved through notary mechanisms, sidechains / relays, hash locking, and distributed private key control. This allows a target consortium blockchain to obtain information from other consortium blockchains, enabling more accurate analysis of sample data within the target consortium blockchain. However, these methods carry the risk of privacy data being stolen during the exchange process. Therefore, how to perform data clustering on received data samples without exchanging information between consortium blockchains remains an unresolved issue. Summary of the Invention

[0004] This application provides a data clustering method, apparatus, and storage medium for performing data clustering on received data samples without exchanging information between consortium blockchains.

[0005] To achieve the above objectives, this application adopts the following technical solution:

[0006] Firstly, this application provides a clustering analysis method applied to a target consortium blockchain, which is any one of multiple consortium blockchains connected to a public blockchain. The method includes: Step 1, the target consortium blockchain receives K first clustering centers sent by the public blockchain, where K is a positive integer greater than or equal to 1; Step 2, the target consortium blockchain uses a clustering algorithm based on the K first clustering centers to cluster sample data in the target consortium blockchain, determining K second clustering centers; Step 3, the target consortium blockchain sends the K second clustering centers to the public blockchain; Step 4, the target consortium blockchain receives K third clustering centers sent by the public blockchain, where the K third clustering centers are clustering centers determined by the public blockchain based on the K second clustering centers sent by each of the multiple consortium blockchains; Step 5, the target consortium blockchain determines whether a preset convergence condition is met between the K second clustering centers and the K third clustering centers; Step 6, if the condition is met, the target consortium blockchain determines the K third clustering centers as the K target clustering centers of the target consortium blockchain.

[0007] In conjunction with the first aspect above, in one possible implementation, the method further includes: if the condition is not met, the target consortium chain takes the K third cluster centers as the first cluster centers and repeats steps 2 to 5 above until the preset convergence condition is met; and takes the currently determined K third cluster centers as the K target cluster centers of the target consortium chain.

[0008] In conjunction with the first aspect mentioned above, in one possible implementation, the method further includes: the target consortium blockchain determining the number of sample data corresponding to each of the K second cluster centers; and sending the number of sample data corresponding to each cluster center to the public blockchain.

[0009] Secondly, embodiments of this application provide a data clustering method applied in a public blockchain, which connects to multiple consortium blockchains. The method includes: the public blockchain sending K first clustering centers to each of the multiple consortium blockchains; the public blockchain receiving K second clustering centers sent by each consortium blockchain, wherein the K second clustering centers are determined by each consortium blockchain using a clustering algorithm based on the K first clustering centers; the public blockchain determining K third clustering centers based on the K second clustering centers sent by each consortium blockchain; and the public blockchain sending the K third clustering centers to each consortium blockchain.

[0010] In conjunction with the second aspect above, in one possible implementation, the multiple consortium blockchains include m consortium blockchains, where m is a positive integer greater than or equal to 2. The method further includes: determining K third cluster centers based on K second cluster centers sent by each of the multiple consortium blockchains, including: determining a target operation, the target operation including: obtaining m target second cluster centers, where each of the m target second cluster centers corresponds one-to-one with one of the m consortium blockchains; the target second cluster center is the second cluster center obtained after the consortium blockchains cluster the target first cluster centers; the target first cluster center is one of the K first cluster centers. Determine the number of m cluster samples corresponding to the m target second cluster centers; where one target second cluster center corresponds to one cluster sample quantity; determine m products based on the product of each target second cluster center and the number of cluster samples corresponding to each target cluster center; determine the ratio of the sum of the m products to the sum of the m cluster sample quantities; determine the target third cluster center; the target third cluster center is one of the K third cluster centers; for each second cluster center determined by the K first cluster centers, perform the above target operations to determine the K third cluster centers.

[0011] Thirdly, embodiments of this application provide a data clustering device, comprising: a communication unit for performing step 1, receiving K first clustering centers sent by a public blockchain, wherein K is a positive integer greater than or equal to 1; a processing unit for performing step 2, clustering sample data in a target consortium blockchain using a clustering algorithm based on the K first clustering centers to determine K second clustering centers; the communication unit is further configured to perform step 3, sending the K second clustering centers to the public blockchain; and performing step 4, receiving K third clustering centers sent by the public blockchain, wherein the K third clustering centers are clustering centers determined by the public blockchain based on the K second clustering centers sent by each of the multiple consortium blockchains; the processing unit is further configured to perform step 5, determining whether a preset convergence condition is met between the K second clustering centers and the K third clustering centers; and performing step 6, if the condition is met, determining the K third clustering centers as the K target clustering centers of the target consortium blockchain.

[0012] In conjunction with the third aspect above, in one possible implementation, the processing unit is further configured to, if not satisfied, use the K third cluster centers as the first cluster centers and instruct the device to repeat steps 2 to 5 above until the preset convergence condition is met; and use the currently determined K third cluster centers as the K target cluster centers of the target consortium chain.

[0013] In conjunction with the third aspect mentioned above, in one possible implementation, the processing unit is further configured to determine the number of sample data corresponding to each of the K second cluster centers; the communication unit is further configured to send the number of sample data corresponding to each cluster center to the public blockchain.

[0014] Fourthly, embodiments of this application provide another data clustering apparatus, comprising: a communication unit, configured to send K first clustering centers to each of a plurality of consortium blockchains; receive K second clustering centers sent by each consortium blockchain, wherein the K second clustering centers are determined by each consortium blockchain using a clustering algorithm based on the K first clustering centers; a processing unit, configured to determine K third clustering centers based on the K second clustering centers sent by each consortium blockchain; and the communication unit is further configured to send the K third clustering centers to each consortium blockchain.

[0015] In conjunction with the fourth aspect above, in one possible implementation, the processing unit is further configured to: determine a target operation, the target operation including: obtaining m target second cluster centers, each of the m target second cluster centers corresponding one-to-one with m consortium chains; the target second cluster center is the second cluster center obtained after the consortium chain clusters the target first cluster center; the target first cluster center is one of the K first cluster centers; determining the number of m cluster samples corresponding to the m target second cluster centers; wherein, one target second cluster center corresponds to one number of cluster samples; determining m products based on the product of each target second cluster center and the number of cluster samples corresponding to each target cluster center; determining the ratio of the sum of the m products to the sum of the m cluster sample numbers; determining the ratio as the target third cluster center; the target third cluster center is one of the K third cluster centers; and performing the above target operation on each second cluster center determined by each of the K first cluster centers to determine the K third cluster centers.

[0016] Fifthly, embodiments of this application provide a data clustering apparatus, which includes a processor and a memory; wherein the memory is used to store computer execution instructions, and when the data clustering apparatus is running, the processor executes the computer execution instructions stored in the memory to cause the data clustering apparatus to perform the data clustering method as described in any possible implementation of the first aspect.

[0017] In a sixth aspect, embodiments of this application provide a data clustering apparatus, which includes a processor and a memory; wherein the memory is used to store computer execution instructions, and when the data clustering apparatus is running, the processor executes the computer execution instructions stored in the memory to cause the data clustering apparatus to perform the data clustering method as described in any possible implementation of the second aspect.

[0018] In a seventh aspect, embodiments of this application provide a computer-readable storage medium storing instructions that, when executed by a processor of an intelligent data clustering device, enable the intelligent data clustering device to perform a data clustering method as described in any possible implementation of the first aspect.

[0019] Eighthly, embodiments of this application provide a computer-readable storage medium storing instructions that, when executed by a processor of an intelligent data clustering device, enable the intelligent data clustering device to perform a data clustering method as described in any possible implementation of the second aspect.

[0020] In this disclosure, the name of the aforementioned data clustering device does not limit the device or functional module itself. In actual implementation, these devices or functional modules may appear under other names. As long as the function of each device or functional module is similar to that of this disclosure, it falls within the scope of the claims of this disclosure and its equivalents.

[0021] These or other aspects of this application will become more readily apparent in the following description.

[0022] The above scheme brings at least the following beneficial effects: In this embodiment, firstly, the target consortium blockchain clusters its own data based on the K first clustering centers sent by the public blockchain, and returns the resulting K second clustering centers to the public blockchain. This allows the public blockchain to obtain the clustering results of the target consortium blockchain, and since this application only sends the clustering centers and not the actual data, it effectively avoids the problem of privacy data theft caused by sending data. After the public blockchain obtains the clustering results of multiple consortium blockchains, it generates K third clustering centers based on the clustering results of multiple consortium blockchains. The target consortium blockchain determines its K target clustering centers based on the convergence between the K third clustering centers and the K second clustering centers. In this way, the target consortium blockchain can determine the convergence between its own clustering centers and the clustering centers of other consortium blockchains by comparing the convergence degree of its own K second clustering centers with the K third clustering centers, and when convergence occurs, it uses the current K third clustering centers as target clustering centers. This achieves cross-consortium blockchain data clustering. Attached Figure Description

[0023] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0024] Figure 1 This is a schematic diagram of the structure of a data clustering device provided in an embodiment of this application;

[0025] Figure 2 A flowchart illustrating a data clustering method provided in an embodiment of this application;

[0026] Figure 3 A schematic diagram illustrating the communication process between a public blockchain and a consortium blockchain, provided as an embodiment of this application;

[0027] Figure 4 A flowchart illustrating yet another data clustering method provided in this application embodiment;

[0028] Figure 5A flowchart illustrating yet another data clustering method provided in this application embodiment;

[0029] Figure 6 This is a schematic diagram of the structure of a data clustering device provided in an embodiment of this application;

[0030] Figure 7 This is a schematic diagram of another data clustering device provided in an embodiment of this application. Detailed Implementation

[0031] In this article, the term "and / or" is merely a description of the relationship between related objects, indicating that there can be three relationships. For example, A and / or B can represent three situations: A exists alone, A and B exist simultaneously, and B exists alone.

[0032] The terms "first" and "second," etc., used in the specification and drawings of this application are used to distinguish different objects or to distinguish different treatments of the same object, rather than to describe a specific order of objects.

[0033] Furthermore, the terms "comprising" and "having," and any variations thereof, used in the description of this application are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not limited to the steps or units listed, but may optionally include other steps or units not listed, or may optionally include other steps or units inherent to such process, method, product, or apparatus.

[0034] It should be noted that in the embodiments of this application, the words "exemplary" or "for example" are used to indicate examples, illustrations, or explanations. Any embodiment or design scheme described as "exemplary" or "for example" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or design schemes. Specifically, the use of the words "exemplary" or "for example" is intended to present the relevant concepts in a specific manner.

[0035] In the description of this application, unless otherwise stated, "a plurality of" means two or more.

[0036] The technical solutions of this application embodiment can be used in various communication systems, including third-generation partnership project (3GPP) communication systems, such as long-term evolution (LTE) systems, 5G mobile communication systems, NR systems, vehicle-to-everything (NR V2X) systems, LTE and 5G hybrid networking systems, device-to-device (D2D) communication systems, machine-to-machine (M2M) communication systems, Internet of Things (IoT) systems, and other next-generation communication systems. They can also be non-3GPP communication systems, without limitation.

[0037] The technical solutions of this application embodiment can be applied to various communication scenarios, such as one or more of the following communication scenarios: enhanced mobile broadband (eMBB), ultra-reliable low latency communication (URLLC), machine type communication (MTC), massive machine type communications (mMTC), SA, D2D, V2X, and IoT communication scenarios.

[0038] The communication systems and scenarios applicable to this application mentioned above are merely illustrative examples, and are not limited to these examples. This will be explained uniformly here and will not be repeated below.

[0039] In some embodiments, the terminal device involved in this application can be a device for implementing communication functions. The terminal device can also be referred to as user equipment (UE), terminal, access terminal, user unit, user station, mobile station (MS), remote station, remote terminal, mobile terminal (MT), user terminal, wireless communication device, user agent, or user device, etc. The terminal device can be, for example, a wireless terminal or wired terminal in IoT, V2X, D2D, M2M, 5G networks, or future evolved public land mobile networks (PLMNs). A wireless terminal can refer to a device with wireless transceiver capabilities, which can be deployed on land, including indoors or outdoors, handheld or vehicle-mounted; it can also be deployed on water (such as on ships); and it can also be deployed in the air (such as on airplanes, balloons, and satellites).

[0040] For example, terminal devices can be drones, IoT devices (e.g., sensors, electricity meters, water meters, etc.), V2X devices, stations (STs) in wireless local area networks (WLANs), cellular phones, cordless phones, session initiation protocol (SIP) phones, wireless local loop (WLL) stations, personal digital assistant (PDA) devices, handheld devices with wireless communication capabilities, computing devices or other processing devices connected to a wireless modem, in-vehicle devices, wearable devices (also known as wearable smart devices), tablets or computers with wireless transceiver capabilities, virtual reality (VR) terminals, wireless terminals in industrial control, wireless terminals in self-driving, wireless terminals in remote medical care, wireless terminals in smart grids, wireless terminals in transportation safety, wireless terminals in smart cities, and wireless terminals in smart homes. The terminal can be a wireless terminal in the home, an in-vehicle terminal, a vehicle with vehicle-to-vehicle (V2V) communication capability, an intelligent connected vehicle, or a drone with drone-to-UAV (U2U) communication capability, etc. The terminal can be mobile or fixed; this application does not specifically limit its location.

[0041] To implement the data clustering method provided in this application, this application provides a data clustering apparatus for executing the data clustering method provided in this application. Figure 1 This is a schematic diagram of a data clustering device provided in an embodiment of this application. Figure 1 As shown, the data clustering device 100 includes at least one processor 101, a communication line 102, and at least one communication interface 104, and may also include a memory 103. The processor 101, memory 103, and communication interface 104 can be connected via the communication line 102.

[0042] The processor 101 may be a central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of this application, such as one or more digital signal processors (DSPs), or one or more field-programmable gate arrays (FPGAs).

[0043] Communication line 102 may include a path for transmitting information between the aforementioned components.

[0044] The communication interface 104 is used to communicate with other devices or communication networks. It can use any transceiver-like device, such as Ethernet, radio access network (RAN), WLAN, etc.

[0045] The memory 103 may be a read-only memory (ROM) or other type of static storage device capable of storing static information and instructions, random access memory (RAM) or other type of dynamic storage device capable of storing information and instructions, or electrically erasable programmable read-only memory (EEPROM), compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical discs, laser discs, optical discs, digital universal optical discs, Blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium capable of including or storing desired program code having the form of instructions or data structures and accessible by a computer, but not limited thereto.

[0046] In one possible design, the memory 103 can exist independently of the processor 101, meaning the memory 103 can be an external memory of the processor 101. In this case, the memory 103 can be connected to the processor 101 via a communication line 102 to store execution instructions or application code, and its execution is controlled by the processor 101 to implement the data clustering method provided in the following embodiments of this application. In another possible design, the memory 103 can also be integrated with the processor 101, meaning the memory 103 can be an internal memory of the processor 101. For example, the memory 103 can be a cache, which can be used to temporarily store some data and instruction information.

[0047] As one possible implementation, processor 101 may include one or more CPUs, for example Figure 1 CPU0 and CPU1 in the example. Alternatively, the data clustering device 100 may include multiple processors, such as CPU0 and CPU1. Figure 1 The processors 101 and 107 are included. Alternatively, the data clustering apparatus 100 may also include an output device 105 and an input device 106.

[0048] Through the above description of the implementation methods, those skilled in the art will clearly understand that, for the sake of convenience and brevity, only the division of the above functional modules is used as an example. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the network node can be divided into different functional modules to complete all or part of the functions described above. The specific working process of the system, modules, and network nodes described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0049] The following is an explanation of the terms used in this application.

[0050] 1. Blockchain

[0051] Blockchain technology is the core supporting technology of digital cryptocurrency systems, represented by Bitcoin. Blockchain is characterized by decentralization, flexibility, and security.

[0052] A blockchain typically consists of multiple blockchain nodes, all of which collectively maintain the data written to the blockchain ledger. Because writing, deleting, or modifying data in a blockchain node requires consensus from all nodes, a blockchain is a distributed database that is very difficult to tamper with.

[0053] The distributed nature of blockchain is reflected not only in the distributed storage of data but also in the distributed recording of data. Distributed recording of data refers to the collaborative maintenance and recording of data within the blockchain by the participants in the blockchain system. The data stored in the blockchain is also called a block, and blockchain nodes connect these blocks into a data chain based on the chronological order in which they were created.

[0054] From a technical perspective, blockchain is not a single technology, but rather the result of the integration of multiple technologies. These technologies are combined in a new structure to form a new way of recording, storing, and expressing data—that is, blockchain.

[0055] Generally speaking, blockchain has at least the following three characteristics: immutability, decentralization, and smart contracts.

[0056] Immutability refers to the fact that blockchain technology can be applied to trace the entire process of data being uploaded to the chain. Every transfer on the chain is recorded by the blockchain nodes and permanently stored. Since the data is shared by all blockchain nodes, modifications to the database on a single blockchain node are invalid. Therefore, blockchain can guarantee the stability and reliability of data and reduce the risk of data tampering.

[0057] Decentralization refers to the fact that blockchain collectively maintains and shares a platform in a decentralized manner. Each node can directly obtain information within its authorized scope according to its own needs, without the need for an intermediary platform to transmit information. This reduces dependence on third parties and can also avoid events such as third-party platforms absconding with donations in centralized models.

[0058] Smart contracts can be used to partially mitigate default events, especially in data-driven areas.

[0059] Blockchain can be divided into three types according to its application: public blockchain, private blockchain, and consortium blockchain, which will be explained below.

[0060] A public blockchain refers to a blockchain without an official organization or management body, and without a central server. In a public blockchain, nodes freely connect to the network according to system rules, operating without control, and work together based on a consensus mechanism. All nodes in the blockchain can read and send transactions for valid confirmation, and any node can participate in the consensus process. In a public blockchain, nodes jointly maintain the security, transparency, and immutability of the entire blockchain through cryptographic techniques and consensus mechanisms such as Proof of Work (PoW2) and Proof of Work (PoS3). Typical applications of public blockchains include Bitcoin and Ethereum.

[0061] A private blockchain refers to a blockchain built on an internal network (such as a corporate intranet). The operating rules of the blockchain system need to be set according to requirements, and only a few nodes have modification / read permissions. Private blockchains retain the authenticity and some decentralized characteristics of traditional blockchains. Typical applications of private blockchains include Eris Industries and Overstock.

[0062] A consortium blockchain is a blockchain jointly initiated by several institutions, falling between public and private blockchains. Consortium blockchains possess some decentralized characteristics. Each institution runs one or more nodes, and data within them can only be read, written, and sent by different institutions within the blockchain, who collectively record transaction data. Typical applications of consortium blockchains include Hyperledger and the R3 blockchain consortium (R3CEV).

[0063] The terms used in this application have been explained above. The data clustering method provided in this application will be described below.

[0064] Due to limitations in the underlying protocols and technologies of blockchain, different consortium blockchains are independent and closed to each other, making direct communication between them impossible. This exacerbates the "island" problem between different consortium blockchains, preventing data sharing and severely hindering the extraction of potential value from the data on these blockchains.

[0065] In related technologies, data sharing between different consortium blockchains is achieved through notary mechanisms, sidechains / relays, hash locking, and distributed private key control. This allows a consortium blockchain to obtain privacy information from other consortium blockchains through third parties, and then combine this information with the received data samples to perform data clustering, achieving accurate data clustering. However, during the transmission of privacy information through third parties, there is a risk that this privacy information may be illegally stolen.

[0066] To address the technical problems existing in related technologies, this application provides a data clustering method. In this embodiment, firstly, the target consortium blockchain clusters its own data based on K first clustering centers sent by the public blockchain, and returns the resulting K second clustering centers to the public blockchain. This allows the public blockchain to obtain the clustering results of the target consortium blockchain. Furthermore, since this application only sends the clustering centers and not the actual data, it effectively avoids the problem of privacy data theft caused by sending data. After the public blockchain obtains the clustering results of multiple consortium blockchains, it generates K third clustering centers based on the K second clustering centers of each consortium blockchain. Thus, the K third clustering centers can reflect the characteristics of the clustering centers of multiple consortium blockchains. Finally, the target consortium blockchain determines its K target clustering centers based on the convergence between the K third clustering centers and the K second clustering centers. In this way, the target consortium blockchain can determine the convergence of its own cluster centers with those of other consortium blockchains by comparing the convergence of its K second cluster centers with its K third cluster centers. Upon convergence, the current K third cluster centers are used as the target cluster centers. This achieves cross-consortium blockchain data clustering.

[0067] The following, in conjunction with the appendix Figure 2 The data clustering method provided in the embodiments of this application will be described in detail, such as... Figure 2 As shown, this data clustering method includes:

[0068] S201. The public blockchain sends K first cluster centers to each of the multiple consortium blockchains. Correspondingly, the target consortium blockchain receives the K first cluster centers sent by the public blockchain.

[0069] The target consortium chain is any one of the multiple consortium chains connected to the public chain; the multiple consortium chains include m consortium chains, where m is a positive integer greater than or equal to 2 and K is a positive integer greater than or equal to 1.

[0070] Optionally, the K first cluster centers are randomly generated by the public blockchain. Afterward, the public blockchain can further define these K first cluster centers as the first clustering parameters.

[0071] For example, the first clustering parameter is (C1, C2, ..., Ck), where C1, C2, and Ck are the K first clustering centers described in the embodiments of this application.

[0072] For example, in combination Figure 3 It can be seen that the public chain sends K first clustering centers to the first consortium chain, the second consortium chain, and the m-th consortium chain, respectively, where m is a positive integer greater than or equal to 2. The first consortium chain is the target consortium chain described in the embodiments of this application.

[0073] It should be noted that before receiving the K first cluster centers, each of the multiple consortium blockchains needs to preprocess, align, and normalize the raw data on the chain to achieve unified management of the various consortium blockchains by the public blockchain.

[0074] S202. The target consortium chain uses a clustering algorithm to cluster the sample data in the first consortium chain based on the K first cluster centers to determine the K second cluster centers.

[0075] In one possible implementation, the target consortium blockchain uses the Kmeans clustering algorithm to cluster the sample data in the target consortium blockchain based on K first cluster centers to determine K second cluster centers. Afterward, the target consortium blockchain can further determine these K second cluster centers as second clustering parameters.

[0076] For example, the second clustering parameters determined by the target consortium chain are: (C111, C112, ..., C11K), where C111 is the first second cluster center, C112 is the second second cluster center, and C11K is the Kth second cluster center.

[0077] As an example, the clustering algorithm involved in the embodiments of this application can be the K-means clustering algorithm, or other clustering algorithms, and this application does not limit it.

[0078] In one possible implementation, the target consortium blockchain calculates the distances from all its own sample data to the K first cluster centers, and designates the first cluster center closest to the target sample data as the cluster of the target sample data. The target consortium blockchain then treats the sample data corresponding to each of the K first cluster centers as sample data of the same class, and designates the center of the sample data of the same class as the second cluster center.

[0079] S203. The target consortium blockchain sends K second cluster centers to the public blockchain. Correspondingly, the public blockchain receives K second cluster centers sent by each consortium blockchain.

[0080] In one possible implementation, the target consortium blockchain encrypts the K second cluster centers using cryptographic methods to obtain first encrypted data. The target consortium blockchain sends the first encrypted data to the public blockchain, which then receives it. This prevents other devices from illegally obtaining the K second cluster centers. Similarly, multiple consortium blockchains can each encrypt their own first encrypted data and send it to the public blockchain, with the public blockchain receiving the first encrypted data from each consortium blockchain.

[0081] Optionally, the public chain receives the first encrypted data sent by each of the multiple consortium chains and saves the first encrypted data on the public chain. In this way, the contribution of each of the multiple consortium chains can be stored.

[0082] S204. The public chain determines K third cluster centers based on the K second cluster centers sent by each consortium chain.

[0083] In one possible implementation, the public blockchain determines K third cluster centers based on the K second cluster centers sent by each consortium blockchain. Subsequently, the consortium blockchain can also use these K third cluster centers as third clustering parameters.

[0084] For example, the third clustering parameter is (C21, C22, ..., C2K), where C21, C22, and C2K are the K first clustering centers described in the embodiments of this application.

[0085] In one possible implementation, the public blockchain decrypts the first encrypted data using cryptographic techniques before determining the K third cluster centers.

[0086] S205. The public blockchain sends K third cluster centers to each consortium blockchain. Correspondingly, the target consortium blockchain receives the K third cluster centers sent by the public blockchain.

[0087] Optionally, the public blockchain encrypts the K third cluster centers in an encrypted manner to obtain second encrypted data, and then sends the second encrypted data to each consortium blockchain.

[0088] S206. The target alliance chain determines whether the K second cluster centers and K third cluster centers meet the preset convergence conditions.

[0089] S207. If satisfied, the target consortium chain determines K third cluster centers as the K target cluster centers of the target consortium chain.

[0090] Among them, the K target clustering centers of the target consortium chain are used to cluster the received data.

[0091] The above solution will bring at least the following beneficial effects:

[0092] This application provides a data clustering method. First, the target consortium blockchain clusters its own data based on K first clustering centers sent by the public blockchain, and returns the resulting K second clustering centers to the public blockchain. This allows the public blockchain to obtain the clustering results from the target consortium blockchain. Furthermore, since this application only sends the clustering centers and not the actual data, it effectively avoids the problem of privacy data theft caused by sending data. After the public blockchain obtains the clustering results from multiple consortium blockchains, it generates K third clustering centers based on the K second clustering centers of each consortium blockchain. Thus, the K third clustering centers can reflect the characteristics of the clustering centers of multiple consortium blockchains. Finally, the target consortium blockchain determines its K target clustering centers based on the convergence between the K third clustering centers and the K second clustering centers. In this way, the target consortium blockchain can determine the convergence of its own cluster centers with those of other consortium blockchains by comparing the convergence of its K second cluster centers with its K third cluster centers. Upon convergence, the current K third cluster centers are used as the target cluster centers. This achieves cross-consortium blockchain data clustering.

[0093] In one possible implementation, in S206 above, if the K second cluster centers and the K third cluster centers do not meet the preset convergence condition, then the target consortium chain redetermines the new K third cluster centers. The process of redetermining the new K third cluster centers by the target consortium chain is described below.

[0094] In one possible implementation, combining Figure 2 ,like Figure 4 As shown, the process of determining whether the K second cluster centers and K third cluster centers meet the preset convergence conditions in S206 above can be specifically implemented through the following S401-S402.

[0095] S401. If not satisfied, the target consortium chain will use K third cluster centers as first cluster centers and repeat steps 2 to 5 above until the preset convergence condition is met.

[0096] In one possible implementation, the preset convergence condition includes any one of the following conditions: the difference between the K second cluster centers and the K third cluster centers is less than or equal to a first preset threshold, and the number of convergence comparisons is greater than or equal to a second preset threshold.

[0097] Optionally, the preset convergence condition includes: the average difference between the K second cluster centers and the K third cluster centers is less than or equal to a first preset threshold. For example, |(C21-C111+C22-C121+C31-C131+……+C2K-C11K)| / K is less than or equal to the first preset threshold.

[0098] In other words, when the convergence condition is not met among the K second cluster centers and K third cluster centers, the target consortium chain uses the currently obtained K third cluster centers as the first cluster centers and iterates cyclically to determine new second and third cluster centers, and then determines whether the convergence condition is met between the new second and third cluster centers. If it is met, the cyclic iteration process stops; otherwise, it continues until the convergence condition is met.

[0099] S402. The target consortium chain will use the currently determined K third cluster centers as the K target cluster centers of the target consortium chain.

[0100] The above scheme brings at least the following beneficial effects: In this embodiment, depending on whether the K second cluster centers and K third cluster centers meet the preset convergence condition, the target consortium blockchain uses the K third cluster centers as the first cluster centers and recalculates the K second and K third cluster centers. When the recalculated K second and K third cluster centers meet the preset convergence condition, the target consortium blockchain uses the currently determined K third cluster centers as the K target cluster centers of the target consortium blockchain. In this way, it can be guaranteed that the target cluster centers can perform accurate clustering analysis on the sample data in the target consortium blockchain.

[0101] In one possible implementation, combining Figure 2 ,like Figure 5 As shown, the process of determining the K third cluster centers in S204 above can be specifically implemented through the following S501-S506:

[0102] S501, The target consortium chain determines the number of sample data corresponding to each of the K second cluster centers.

[0103] In one possible implementation, during the process of clustering sample data in the target consortium blockchain using the K-means clustering algorithm based on K first cluster centers, the number of sample data corresponding to each of the K first cluster centers is counted. The number of sample data corresponding to each of the K first cluster centers is the same as the number of sample data corresponding to each of the K second cluster centers.

[0104] Optionally, the number of sample data corresponding to each of the K second cluster centers in the target consortium chain is: (N111, N112, ..., N11K). Wherein, N111 is the number of sample data corresponding to the second cluster center C111, and N11K is the number of sample data corresponding to the second cluster center C11K.

[0105] S502, the public blockchain obtains m target second cluster centers.

[0106] Among them, the m target second cluster centers correspond one-to-one with the m consortium chains; the target second cluster center is the second cluster center obtained by the consortium chain after clustering the target first cluster center; the target first cluster center is one of the K first cluster centers.

[0107] For example, the first target second cluster center is the K second cluster centers (C111, C112, ..., C11K) determined by the target consortium chain as described in the embodiments of this application; the m-th target second cluster center is (Cm11, Cm12, ..., Cm1K).

[0108] S503. The public blockchain determines the number of m cluster samples corresponding to the second cluster centers of m targets.

[0109] In this context, one target second cluster center corresponds to one cluster sample size.

[0110] For example, the number of cluster samples corresponding to the first target second cluster center is the number of sample data corresponding to each of the K second cluster centers in the target consortium chain described in this application embodiment, (N111, N112, ..., N11K); the number of cluster samples corresponding to the m-th target second cluster center is (Nm11, Nm12, ..., Nm1K).

[0111] S504. The public blockchain determines m products based on the product of the number of cluster samples corresponding to each target second cluster center and each target cluster center.

[0112] S505. The ratio of the sum of m products to the sum of the number of m cluster samples is determined by the public chain.

[0113] S506, the public chain determines the ratio as the target third cluster center.

[0114] The target third cluster center is one of the K third cluster centers.

[0115] For example, the target third cluster center satisfies the following formula: (C21, C22, ..., C2K) = ((C111*N111+C211*N211+C311*N311+……+Cm11*Nm11) / (N111+N211+……+Nm11), (C112*N112+C212*N212+C312*N312+……+Cm12*Nm12) / (N 112+N212+……+Nm12), (C113*N113+C213*N213+C313*N313+……+Cm13*Nm13) / (N313+N213+… …+Nm13)…(Cm11*Nm11+Cm12*Nm12+Cm13*Nm13+…+Cm1K*Nm1K) / (Nm11+Nm12+…+Nm1K)).

[0116] Wherein, C111 is the first second cluster center reported by the target consortium blockchain, N111 is the number of sample data corresponding to the first second cluster center reported by the target consortium blockchain, C11K is the Kth second cluster center reported by the target consortium blockchain, and N11K is the number of sample data corresponding to the Kth second cluster center reported by the target consortium blockchain; Cm11 is the first second cluster center reported by the m-th consortium blockchain, Nm11 is the number of sample data corresponding to the first second cluster center reported by the m-th consortium blockchain, Cm1K is the Kth second cluster center reported by the m-th consortium blockchain, and Nm1K is the number of sample data corresponding to the Kth second cluster center reported by the m-th consortium blockchain; the m-th consortium blockchain and the target consortium blockchain are connected by a common public blockchain.

[0117] It should be noted that while the target consortium blockchain uses the K third cluster centers as the first cluster centers and repeats steps 2 to 5 above, the public blockchain stores the current K second cluster centers. Thus, the public blockchain determines the K third cluster centers using the K second cluster centers most recently reported by each consortium blockchain and the number of sample data corresponding to each of the K second cluster centers. Since the data most recently reported by each consortium blockchain is converged data, a more accurate set of K third cluster centers can be obtained.

[0118] The above scheme offers at least the following advantages: In this embodiment, the public blockchain determines K third cluster centers using a weighted summation algorithm based on the K second cluster centers sent by each of the multiple consortium blockchains and the number of sample data corresponding to each of the K second cluster centers. This allows the K third cluster centers to possess the clustering characteristics of all the multiple consortium blockchains connected to the public blockchain, enabling clustering of data from each of the multiple consortium blockchains. Consequently, when using the K third cluster centers as target cluster centers to cluster received data samples, cluster analysis of the data samples can be performed more accurately.

[0119] As can be seen, the above mainly describes the technical solutions provided by the embodiments of this application from a methodological perspective. To achieve the above functions, it includes hardware structures and / or software modules corresponding to the execution of each function. Those skilled in the art should readily recognize that, in conjunction with the modules and algorithm steps of the various examples described in the embodiments disclosed herein, the embodiments of this application can be implemented in hardware or a combination of hardware and computer software. Whether a function is executed in hardware or by computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this invention.

[0120] This application embodiment can divide the data clustering device into functional modules according to the above method example. For example, each function can be divided into a separate functional module, or two or more functions can be integrated into one processing module. The integrated module can be implemented in hardware or as a software functional module. Optionally, the module division in this application embodiment is illustrative and only represents one logical functional division; other division methods may be used in actual implementation.

[0121] like Figure 6 The diagram shown is a structural schematic of a data clustering device 60 provided in an embodiment of this application. The data clustering device 60 includes a communication unit 601 and a processing unit 602.

[0122] Communication unit 601 is used to execute step 1, receiving K first cluster centers sent by the public chain, where K is a positive integer greater than or equal to 1; processing unit 602 is used to execute step 2, using a clustering algorithm to cluster sample data in the target consortium chain based on the K first cluster centers, to determine K second cluster centers; communication unit 601 is also used to execute step 3, sending K second cluster centers to the public chain; and execute step 4, receiving K third cluster centers sent by the public chain, where the K third cluster centers are cluster centers determined by the public chain based on the K second cluster centers sent by each of the multiple consortium chains; processing unit 602 is also used to execute step 5, determining whether the K second cluster centers and the K third cluster centers meet a preset convergence condition; and execute step 6, if they meet the condition, determining the K third cluster centers as the K target cluster centers of the target consortium chain.

[0123] Optionally, the processing unit 602 is further configured to, if not satisfied, use the K third cluster centers as the first cluster centers and instruct the device to repeat steps 2 to 5 above until the preset convergence condition is met; and use the currently determined K third cluster centers as the K target cluster centers of the target consortium chain.

[0124] Optionally, the processing unit 602 is further configured to determine the number of sample data corresponding to each of the K second cluster centers; the communication unit 601 is further configured to send the number of sample data corresponding to each cluster center to the public blockchain.

[0125] like Figure 7 The diagram shown is a structural schematic of another data clustering device 70 provided in an embodiment of this application. The data clustering device 70 includes a communication unit 701 and a processing unit 702.

[0126] The communication unit 701 is used to send K first clustering centers to each of the multiple consortium chains; receive K second clustering centers sent by each consortium chain, wherein the K second clustering centers are determined by each consortium chain based on the K first clustering centers and using a clustering algorithm to cluster the sample data of that consortium chain; the processing unit 702 is used to determine K third clustering centers based on the K second clustering centers sent by each consortium chain; the communication unit 701 is also used to send K third clustering centers to each consortium chain.

[0127] Optionally, the processing unit 702 is further configured to determine a target operation, which includes: obtaining m target second cluster centers, each of which corresponds one-to-one with one of the m consortium chains; the target second cluster center is the second cluster center obtained by the consortium chain after clustering the target first cluster center; the target first cluster center is one of the K first cluster centers; determining the number of m cluster samples corresponding to the m target second cluster centers; wherein, one target second cluster center corresponds to one number of cluster samples; determining m products based on the product of each target second cluster center and the number of cluster samples corresponding to each target cluster center; determining the ratio of the sum of the m products to the sum of the m cluster sample numbers; determining the ratio as the target third cluster center; the target third cluster center is one of the K third cluster centers; and performing the above target operation on each second cluster center determined by the K first cluster centers to determine the K third cluster centers.

[0128] The processing units 602 and 702 can be processors or controllers. They can implement or execute various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this application. The processor can also be a combination of functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, etc. The communication units 601 and 701 can be transceiver circuits or communication interfaces, etc. The storage module can be a memory. When the processing unit is a processor, the communication unit is a communication interface, and the storage module is a memory, the data clustering device involved in the embodiments of this application can be... Figure 1 The data clustering device shown.

[0129] Through the above description of the implementation methods, those skilled in the art will clearly understand that, for the sake of convenience and brevity, only the division of the above functional modules is used as an example. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the network node can be divided into different functional modules to complete all or part of the functions described above. The specific working process of the system, modules, and network nodes described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0130] This application also provides a computer-readable storage medium storing instructions. When a computer executes these instructions, the computer performs each step of the method flow shown in the above-described method embodiments.

[0131] This application 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 computer programs or instructions to implement the data clustering method in the above method embodiments.

[0132] Embodiments of this application provide a computer program product containing instructions that, when executed on a computer, cause the computer to perform the data clustering method described in the above method embodiments.

[0133] The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of computer-readable storage media (a non-exhaustive list) include: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), registers, hard disks, optical fibers, compact disc read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing, or any other form of computer-readable storage medium in the art. An exemplary storage medium is coupled to a processor, enabling the processor to read information from and write information to the storage medium. Of course, the storage medium may also be a component of the processor. The processor and the storage medium may reside in an application-specific integrated circuit (ASIC). In embodiments of the present invention, a computer-readable storage medium may be any tangible medium that contains or stores a program that may be used by or in conjunction with an instruction execution system, apparatus, or device.

[0134] Since the apparatus, device, computer-readable storage medium, and computer program product in the embodiments of the present invention can be applied to the above methods, the technical effects that can be obtained can also be referred to the above method embodiments. The embodiments of this application will not be repeated here.

[0135] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A data clustering method, characterized by, The method is applied to a target consortium chain, the target consortium chain being any one of a plurality of consortium chains connected by a public chain; the method comprises: Step 1, receiving K first clustering centers sent by the public chain, wherein K is a positive integer greater than or equal to 1; Step 2, clustering sample data in the target consortium chain according to the K first clustering centers by using a clustering algorithm to determine K second clustering centers; Step 3, sending the K second clustering centers to the public chain; Step 4, receiving K third clustering centers sent by the public chain, the K third clustering centers being clustering centers determined by the public chain according to the K second clustering centers sent by each of the plurality of consortium chains; Step 5, determining whether a preset convergence condition is met between the K second clustering centers and the K third clustering centers; Step 6, if the preset convergence condition is met, determining that the K third clustering centers are K target clustering centers of the target consortium chain.

2. The method of claim 1, wherein, After the step 5, determining whether a preset convergence condition is met between the K second clustering centers and the K third clustering centers, the method further comprises: If the preset convergence condition is not met, taking the K third clustering centers as the first clustering centers, and repeatedly performing the above steps 2 to 5 until the preset convergence condition is met; Taking the currently determined K third clustering centers as the K target clustering centers of the target consortium chain.

3. The method of claim 1, wherein, After the step 2, clustering sample data in the target consortium chain according to the K first clustering centers by using a clustering algorithm to determine K second clustering centers, the method further comprises: Determining the number of sample data corresponding to each clustering center in the K second clustering centers; Sending the number of sample data corresponding to each clustering center to the public chain.

4. A data clustering method characterized by, The method is applied to a public chain, the public chain being connected with a plurality of consortium chains; the method comprises: Sending K first clustering centers to each of the plurality of consortium chains; Receiving K second clustering centers sent by each of the plurality of consortium chains, the K second clustering centers being determined by each of the plurality of consortium chains according to the K first clustering centers by using a clustering algorithm to cluster sample data of the consortium chain; Determining K third clustering centers according to the K second clustering centers sent by each of the plurality of consortium chains; Sending the K third clustering centers to each of the plurality of consortium chains.

5. The method of claim 4, wherein, The plurality of consortium chains comprises m consortium chains, m being a positive integer greater than or equal to 2; the determining of the K third clustering centers according to the K second clustering centers sent by each of the plurality of consortium chains comprises: Determining a target operation, the target operation comprising: Obtaining m target second clustering centers, the m target second clustering centers corresponding to the m consortium chains one by one; the target second clustering center being a second clustering center obtained by clustering a target first clustering center by a consortium chain; the target first clustering center being one of the K first clustering centers; determining m cluster sample quantities corresponding to the m target second cluster centers; wherein one target second cluster center corresponds to one cluster sample quantity; determining m products according to a product of each target second cluster center and a cluster sample quantity corresponding to each target cluster center; determining a ratio of a sum of the m products to a sum of the m cluster sample quantities; determining the ratio as a target third cluster center; the target third cluster center is one third cluster center in the K third cluster centers; performing the above target operation on the second cluster center determined for each first cluster center in the K first cluster centers to determine the K third cluster centers.

6. A data clustering apparatus characterized by comprising: The device comprises a communication unit and a processing unit: The communication unit is configured to perform step 1, receive K first cluster centers sent by a public chain, wherein K is a positive integer greater than or equal to 1; The processing unit is configured to perform step 2, cluster sample data in a target consortium chain by using a clustering algorithm according to the K first cluster centers to determine K second cluster centers; The communication unit is further configured to perform step 3, send the K second cluster centers to the public chain; and perform step 4, receive K third cluster centers sent by the public chain, wherein the K third cluster centers are cluster centers determined by the public chain according to K second cluster centers sent by each consortium chain in a plurality of consortium chains; The processing unit is further configured to perform step 5, determine whether a preset convergence condition is met between the K second cluster centers and the K third cluster centers; and perform step 6, if the preset convergence condition is met, determine the K third cluster centers as K target cluster centers of the target consortium chain.

7. The apparatus of claim 6, wherein, The processing unit is further configured to, if the preset convergence condition is not met, take the K third cluster centers as the first cluster centers, and instruct the device to repeatedly perform the above steps 2 to 5 until the preset convergence condition is met; and take the currently determined K third cluster centers as the K target cluster centers of the target consortium chain.

8. The apparatus of claim 6, wherein, The processing unit is further configured to determine a quantity of sample data corresponding to each cluster center in the K second cluster centers; The communication unit is further configured to send the quantity of sample data corresponding to each cluster center to the public chain.

9. A data clustering apparatus, characterized by comprising: The device comprises a communication unit and a processing unit: The communication unit is configured to send K first cluster centers to each consortium chain in a plurality of consortium chains; and receive K second cluster centers sent by each consortium chain, wherein the K second cluster centers are determined by each consortium chain according to the K first cluster centers by using a clustering algorithm to cluster sample data of the consortium chain; The processing unit is configured to determine K third cluster centers according to the K second cluster centers sent by each consortium chain; The communication unit is further configured to send the K third cluster centers to each consortium chain.

10. The apparatus of claim 9, wherein, The processing unit is further configured to determine a target operation, The target operation includes: obtaining m target second clustering centers, the m target second clustering centers correspond to the m alliance chains one by one; the target second clustering center is a second clustering center obtained by clustering the target first clustering center of the alliance chain; the target first clustering center is one of the K first clustering centers; determining the m clustering sample quantities corresponding to the m target second clustering centers; wherein one target second clustering center corresponds to one clustering sample quantity; determining m products according to the product of each target second clustering center and the clustering sample quantity corresponding to each target clustering center; determining the ratio of the sum of the m products to the sum of the m clustering sample quantities; determining the ratio as a target third clustering center; the target third clustering center is one of the K third clustering centers; The target operation is performed for the second clustering center determined for each of the K first clustering centers to determine the K third clustering centers.

11. A data clustering apparatus, characterized by comprising: Comprise: A processor and a memory; wherein the memory is used to store computer execution instructions, when the data clustering device runs, the processor executes the computer execution instructions stored in the memory, so that the data clustering device executes the data clustering method in any one of claims 1-3 or 4-5.

12. A computer-readable storage medium, characterized in that, The computer readable storage medium comprises instructions which, when executed by a data clustering device, cause the computer to perform the data clustering method as claimed in any one of claims 1-3 or 4-5.

Citation Information

Patent Citations

  • Cross-feature federated clustering method based on KMeans and related equipment

    CN113657525A

  • Clustering analysis method and device, computer equipment and storage medium

    CN113792760A