Transfederal processing method, system, and computer device
Patent Information
- Application Number
- CN202211644029.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-15
- Publication Date
- 2026-09-08
- Estimated Expiration
- 2042-12-15
AI Technical Summary
因此,在统计诸如均值、标准差等描述性统计值时,纵向各方可以直接统计出每一列数据的各项统计指标,但横向需要结合多方数据才能统计出该列的各项统计指标,各方无法单独获得统计结果,此外,在其他类似的横向联邦的场景中,也存在着相同的问题
[0020] The present invention provides a method, system, and computer device for horizontal federation processing. First, the initiator of the horizontal federation sends a request to obtain intermediate calculation results to the participating parties. The participating parties calculate the intermediate results based on their original data and send them back to the initiator. The initiator then performs horizontal federation calculations based on its original data and the intermediate calculation results. The intermediate calculation results do not expose the original data of the participating parties, and the initiator cannot deduce the original data of the participating parties from the intermediate calculation results. Simultaneously, the initiator can utilize the intermediate calculation results to implement the horizontal federation calculations. Through this invention, when implementing horizontal federation calculations, no third-party coordinating party is required for data integration processing, and the exposure of original data between the parties is avoided.
Smart Images

Figure CN116167453B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of federated learning processing technology, and more particularly to a horizontal federation processing method, system, and computer device. Background Technology
[0002] Federated learning is a distributed machine learning technique. Its core idea is to train a model in a distributed manner across multiple data sources that have local data. Without exchanging local individual or sample data, it constructs a global model based on virtual fused data by exchanging model parameters or intermediate computation results. This achieves a balance between data privacy protection and data sharing computation, namely, a new application paradigm of "data is available but not visible" and "the model moves while the data does not move".
[0003] In the context of federated learning, horizontal and vertical federation differ significantly in their processing logic due to the different data concatenation methods. In vertical federation, the connections between structured data are based on the ID of each row, with each party possessing all its own rows of data. In horizontal federation, however, the connections between structured data are based on the header of each column, with each party possessing only a portion of the data in that column. Therefore, when calculating descriptive statistics such as mean and standard deviation, vertical federation parties can directly calculate the statistical indicators for each column, but horizontal federation requires combining data from multiple parties to calculate the statistical indicators for that column; each party cannot obtain statistical results independently. Furthermore, similar problems exist in other similar horizontal federation scenarios.
[0004] Existing technologies propose a horizontal federation processing method that adds a third coordinator, enabling horizontal federation to send all data from each party to the coordinator for data integration processing, thereby avoiding the problem that each party cannot obtain the calculation results independently during the horizontal federation process.
[0005] However, in the above process, the coordinating party has access to all the data, and its authority is too great. In actual federated scenarios, it is impossible to determine a suitable third coordinating party, making this processing solution difficult to implement in practice.
[0006] Therefore, how to better solve the problem that each party cannot obtain the federated computing results independently in the horizontal federation process has become a technical problem that urgently needs to be solved in this field. Summary of the Invention
[0007] The purpose of this invention is to provide a horizontal federation processing method, system, and computer device to solve the aforementioned technical problems in the prior art.
[0008] On the one hand, in order to achieve the above objectives, the present invention provides a horizontal federation processing method.
[0009] The horizontal federation processing method is applied to the initiator of the horizontal federation. The processing method includes: sending a request to obtain intermediate calculation results to the participants of the horizontal federation, wherein the intermediate calculation results are the results calculated by the participants based on the participants' original data, and the intermediate calculation results do not expose the participants' original data; receiving the intermediate calculation results sent by the participants; and performing horizontal federation calculations based on the initiator's original data and the intermediate calculation results.
[0010] On the other hand, in order to achieve the above objectives, the present invention provides a horizontally federated processing apparatus.
[0011] The horizontal federation processing device is applied to the initiator of the horizontal federation. The processing device includes: a first sending module, used to send a request to obtain intermediate calculation results to the participants of the horizontal federation, wherein the intermediate calculation results are the results calculated by the participants based on the participants' original data, and the intermediate calculation results do not expose the participants' original data; a first receiving module, used to receive the intermediate calculation results sent by the participants; and a first processing module, used to perform horizontal federation calculations based on the initiator's original data and the intermediate calculation results.
[0012] On the other hand, in order to achieve the above objectives, the present invention provides a horizontal federation processing method.
[0013] The horizontal federation processing method is applied to the participants in a horizontal federation. The processing method includes: receiving a request to obtain intermediate calculation results sent by the initiator of the horizontal federation; calculating the intermediate calculation results based on the original data of the participants, wherein the intermediate calculation results do not expose the original data of the participants; and sending the intermediate calculation results to the initiator of the horizontal federation, wherein the initiator is used to perform horizontal federation calculations based on the initiator's original data and the intermediate calculation results.
[0014] On the other hand, in order to achieve the above objectives, the present invention provides a horizontally federated processing apparatus.
[0015] The processing device for this horizontal federation is applied to the participants in the horizontal federation. The processing device includes: a second receiving module for receiving a request to obtain intermediate calculation results sent by the initiator of the horizontal federation; a second processing module for calculating the intermediate calculation results based on the original data of the participants, wherein the intermediate calculation results do not expose the original data of the participants; and a second sending module for sending the intermediate calculation results to the initiator of the horizontal federation, wherein the initiator performs horizontal federation calculations based on the initiator's original data and the intermediate calculation results.
[0016] On the other hand, in order to achieve the above objectives, the present invention provides a horizontal federation processing system.
[0017] The horizontal federation processing system includes a horizontal federation initiator and several participating parties, wherein: the initiator is used to send a request to obtain intermediate calculation results to the participating parties; the participating parties are used to receive the request, calculate the intermediate calculation results based on the original data of the participating parties, and return the intermediate calculation results to the initiator, wherein the intermediate calculation results do not expose the original data of the participating parties; the initiator is also used to receive the intermediate calculation results and perform horizontal federation calculations based on the original data of the initiator and the intermediate calculation results.
[0018] In another aspect, to achieve the above objectives, the present invention also provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the above method.
[0019] In another aspect, to achieve the above objectives, the present invention also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the above method.
[0020] The present invention provides a method, system, and computer device for horizontal federation processing. First, the initiator of the horizontal federation sends a request to obtain intermediate calculation results to the participating parties. The participating parties calculate the intermediate results based on their original data and send them back to the initiator. The initiator then performs horizontal federation calculations based on its original data and the intermediate calculation results. The intermediate calculation results do not expose the original data of the participating parties, and the initiator cannot deduce the original data of the participating parties from the intermediate calculation results. Simultaneously, the initiator can utilize the intermediate calculation results to implement the horizontal federation calculations. Through this invention, when implementing horizontal federation calculations, no third-party coordinating party is required for data integration processing, and the exposure of original data between the parties is avoided. Attached Figure Description
[0021] Various other advantages and benefits will become apparent to those skilled in the art upon reading the following detailed description of preferred embodiments. The accompanying drawings are for illustrative purposes only and are not intended to limit the invention. Furthermore, the same reference numerals denote the same parts throughout the drawings. In the drawings:
[0022] Figure 1 A flowchart of a horizontal federation processing method provided in Embodiment 1 of the present invention;
[0023] Figure 2 This is a schematic diagram of the interaction logic between the initiator and the participants in the horizontal federation processing method provided in Embodiment 1 of the present invention;
[0024] Figure 3 This is a schematic diagram of the interaction logic between the initiator and the participants in the horizontal federation processing method provided in Embodiment 1 of the present invention;
[0025] Figure 4 This is a schematic diagram of the interaction logic between the initiator and the participants in the horizontal federation processing method provided in Embodiment 1 of the present invention;
[0026] Figure 5 This is a data diagram of the initiator and participants in the horizontal federation processing method provided in Embodiment 1 of the present invention;
[0027] Figure 6 This is a schematic diagram of pointer markers for the initiator and participants in the horizontal federation processing method provided in Embodiment 1 of the present invention;
[0028] Figures 7 to 9 This is a schematic diagram of pointer movement between the initiator and participants in the horizontal federation processing method provided in Embodiment 1 of the present invention.
[0029] Figure 10 This is a schematic diagram of the interaction logic between the initiator and the participants in the horizontal federation processing method provided in Embodiment 1 of the present invention;
[0030] Figure 11 This is a block diagram of a horizontal federation processing device provided in Embodiment 2 of the present invention;
[0031] Figure 12 A flowchart of the horizontal federation processing method provided in Embodiment 3 of the present invention;
[0032] Figure 13 This is a block diagram of a horizontal federation processing apparatus provided in Embodiment 4 of the present invention;
[0033] Figure 14 This is a block diagram of a horizontal federation system provided in Embodiment 5 of the present invention;
[0034] Figure 15 This is a hardware structure diagram of a computer device provided in Embodiment Six of the present invention. Detailed Implementation
[0035] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without inventive effort are within the scope of protection of this invention.
[0036] The inventors discovered that in horizontal federation, when it is necessary to combine the data of the initiator and several participants to achieve federated computation on the same data column, that is, when each party cannot obtain the federated computation result independently, the existing technical idea is to avoid data transfer between the initiator and the participants. The conventional technical approach is to send all the data of each party to a third coordinator for data integration and processing, thereby solving the problem of data exposure between the parties.
[0037] The horizontal federation processing method, system, and computer equipment provided in this application overcome the aforementioned technical biases and propose a technical solution for achieving horizontal federated computation by transferring data between the initiator and participants without the need for a third party. Specifically, the initiator first sends a request to obtain intermediate computation results to the participants. After receiving the request, the participants calculate the intermediate computation results based on their original data and return the intermediate computation results to the initiator. The intermediate computation results do not expose the participants' original data; that is, after receiving the intermediate computation results, the initiator cannot deduce the participants' original data from them, but can perform horizontal federated computation based on the initiator's original data and the intermediate computation results. This demonstrates that in this horizontal federated computation process, no third party was used to integrate the data from all parties. Horizontal federated computation was achieved solely through data transfer between the initiator and the participants. The data transferred from the participants to the initiator is not the original data, but rather intermediate computation results calculated from the original data without exposing the original data. These intermediate computation results can be obtained by calculating several original data points using the algorithm required for horizontal federated computation, i.e., y1 = f1(x1, x2… xn), where f1 is the algorithm required for horizontal federated computation (specifically, depending on the algorithm used). (This varies depending on the actual computing purpose of the federation). y1 is the intermediate calculation result, and x1, x2…xn are n original data. x1, x2…xn cannot be derived from y1. The intermediate calculation result can also be obtained by encrypting several original data using a homomorphic encryption algorithm, i.e., y2 = f2(x1, x2…xn), where f2 is a homomorphic encryption algorithm (specifically, it can be a fully homomorphic encryption algorithm or a semi-homomorphic encryption algorithm), y2 is the intermediate calculation result, and x1, x2…xn are n original data. x1, x2…xn cannot be derived from y2.
[0038] The horizontal federation processing method, system, and computer equipment provided in this application overcome technical biases in scenarios where parties cannot obtain computation results independently during the horizontal federation process. They enable direct data transfer between the initiating and participating parties, avoiding the exposure of raw data and achieving horizontal federation computation without the need for a third coordinating party. The various embodiments provided in this application will be detailed below.
[0039] Example 1
[0040] This invention provides a method for processing horizontal federation. This method is applied to the initiator of a horizontal federation and solves the problem that each party cannot individually obtain the federation calculation results during the horizontal federation process without the need for a third coordinator. It achieves federation calculation while avoiding the exposure of raw data between parties. Specifically, Figure 1 A flowchart of the horizontal federation processing method provided in Embodiment 1 of the present invention is shown below. Figure 1 As shown, the horizontal federation processing method provided in this embodiment includes the following steps S101 to S103.
[0041] Step S101: Send a request to obtain intermediate calculation results to the participants in the horizontal federation.
[0042] The horizontal federated computing process involves multiple data sources. The data source initiating the federated computing task is called the initiator, and the other data sources are called the participants. In this step, the initiator can send a request to the participants to retrieve intermediate computing results based on an RPC communication framework. Upon receiving this request, the participants perform calculations based on their own raw data to obtain intermediate computing results, which do not expose the participants' original data.
[0043] For example, when federated computing can be broken down into each party performing step-by-step computing based on the original data, and then using the step-by-step results of each party to perform unified federated computing, and the original data of each party cannot be derived from the step-by-step results of each party, the step-by-step results of each party are sent to the initiating party as intermediate computing results.
[0044] For example, when federated computing requires the original data of all parties to be directly involved in the calculation, homomorphic encryption is used to encrypt the original data. The encrypted result is then used as the intermediate calculation result and sent to the initiator.
[0045] Step S102: Receive the intermediate calculation results sent by the participants.
[0046] After the initiator sends a request to the participants to obtain the intermediate calculation results, it can receive the intermediate calculation results returned by the participants.
[0047] Step S103: Perform horizontal federation calculations based on the initiator's original data and intermediate calculation results.
[0048] When the intermediate calculation result is the above-mentioned step-by-step result, after receiving the intermediate calculation result, the initiator can first perform step-by-step calculation based on the initiator's original data to obtain the initiator's step-by-step result, and then perform horizontal federated calculation based on the step-by-step results of the initiator and the participants to obtain the final result of the federated calculation.
[0049] When the intermediate calculation result is the above-mentioned encrypted result, after receiving the intermediate calculation result, the initiator can first use the homomorphic encryption algorithm to encrypt the original data of the initiator to obtain the encrypted result of the initiator, and then perform horizontal federated calculation based on the encrypted results of the initiator and the participants to obtain the final result of the federated calculation.
[0050] In the horizontal federation processing method provided in this embodiment, the initiator of the horizontal federation first sends a request to obtain intermediate calculation results to the participating parties. The participating parties calculate the intermediate calculation results based on their original data and send them to the initiator. The initiator then performs horizontal federation calculations based on its original data and the intermediate calculation results. The intermediate calculation results do not expose the participating parties' original data, and the initiator cannot deduce the original data from the intermediate calculation results. Simultaneously, the initiator can utilize the intermediate calculation results to achieve horizontal federation calculations. Using the horizontal federation processing method provided in this embodiment, no third-party coordinating party is required for data integration processing when implementing horizontal federation calculations, and the exposure of original data between the parties is avoided.
[0051] Optionally, in one embodiment, the federated columns of the horizontal federation include the participating columns of the participants and the initiating columns of the initiator. The step of performing horizontal federation calculation based on the initiator's original data and intermediate calculation results includes: performing horizontal federation calculation based on the initiating columns, the number of elements in the initiating columns, the first statistical value of the participating columns, and the number of elements in the participating columns to obtain the second statistical value of the federated columns.
[0052] Specifically, in horizontal federation, the connection of structured data is based on the header of each column. Data belonging to the same header in the data of the parties in the horizontal federation form a federated column. In this application, data belonging to the participating party in the same header is defined as a participating column, and data belonging to the initiating party is defined as an initiating column. For example, the structured data in horizontal federation includes three columns, with the headers of age, height, and weight, respectively. The federated column corresponding to the age header in the horizontal federation includes participating columns that have the age header and belong to the participating party, and the included initiating column that has the age header and belongs to the initiating party. Similarly, the federated column corresponding to the height header in the horizontal federation includes participating columns that have the height header and belong to the participating party, and the included initiating column that has the height header and belongs to the initiating party.
[0053] In this embodiment, the horizontal federated calculation based on the initiator's original data and intermediate calculation results uses the statistical values of the federated columns. First, the second statistical value of the federated columns is decomposed into the first statistical values of the participating columns and the initiator's columns, respectively. Then, the second statistical value of the federated columns is obtained based on the first statistical values of the participating and initiator columns. It should be noted that the first and second statistical values have no order; they can represent the same statistical value or different statistical values. On the participating side, the first statistical value of the participating columns can be calculated based on the participating columns, and this first statistical value, along with the number of elements in the participating columns, is sent to the initiator as an intermediate calculation result. On the initiator side, the first statistical value of the initiator can be calculated based on the initiator columns and the number of elements in the initiator columns. Finally, horizontal federated calculation is performed based on the first statistical value of the participating columns, the number of elements in the participating columns, and the initiator's first statistical value to obtain the second statistical value of the federated columns. Furthermore, after receiving the first statistical value of the participating columns, the initiator cannot deduce the original data of the participating columns from the first statistical value.
[0054] The horizontal federation processing method provided in this embodiment can realize the calculation of horizontal federation statistics without a coordinating party, obtain the horizontal federation statistics without relying on a third party, and avoid data exposure.
[0055] Optionally, in one embodiment, the step of performing a horizontal federation calculation based on the initiating column, the number of elements in the initiating column, a first statistical value of the participating column, and the number of elements in the participating column to obtain a second statistical value of the federated column includes: performing a horizontal federation calculation based on the initiating column, the number of elements in the initiating column, the mean of the participating column, and the number of elements in the participating column to obtain the mean of the federated column.
[0056] Specifically, in this embodiment, both the first and second statistical values are means. The mean calculation in a horizontal federation can be viewed as each party seeking a common mean. Therefore, during the calculation process, the mean can be uniformly calculated by obtaining each party's individual mean and the number of values. However, when transmitting individual mean values and the number of elements, it is impossible to deduce the original data values. The specific calculation formula is as follows:
[0057]
[0058] Where mean is the overall mean of a single column in the horizontal federation (i.e., the mean of the federation column), mean_ is the mean of the i-th party in the horizontal federation (i.e., the mean of the participating column or the mean of the initiating column), and n_i is the number of elements corresponding to the i-th party in the horizontal federation.
[0059] Figure 2 This is a schematic diagram of the interaction logic between the initiator and the participants in the horizontal federation processing method provided in Embodiment 1 of the present invention, as shown below. Figure 2As shown, in this embodiment, the interaction logic between the initiator and the participants is that the participants send their own average and number of elements to the initiator, and the initiator calculates the overall average.
[0060] The horizontal federation processing method provided in this embodiment prevents the initiator from directly deducing the participants' original data based on the number of elements and the average value transmitted by the participants. This achieves the calculation of the overall average value of a single column in the horizontal federation without exposing the original data, and eliminates the need for third-party data coordination. Furthermore, after calculating their own average value, participants only need to transmit the average value and the number of elements to the initiator. The data transmission volume during horizontal federation communication is small, which helps improve communication efficiency.
[0061] Optionally, in one embodiment, the step of performing a horizontal federated calculation based on the initiating column, the number of elements in the initiating column, a first statistical value of the participating column, and the number of elements in the participating column to obtain a second statistical value of the federated column includes: performing a horizontal federated calculation based on the initiating column, the number of elements in the initiating column, the mean of the participating column, the standard deviation of the participating column, and the number of elements in the participating column to obtain the standard deviation of the federated column.
[0062] Specifically, in this embodiment, the first statistical value includes the mean and standard deviation, and the second statistical value includes the standard deviation. The calculation of the standard deviation of the horizontal federation can be decomposed into first calculating the mean, standard deviation, and number of elements of each party, and then obtaining the overall standard deviation. Therefore, in the calculation process, the calculation can be unified by obtaining the mean, standard deviation, and number of elements of each party.
[0063] For either the participant or the initiator, firstly, according to the formula Substituting the mean μ, the number of elements n, and the standard deviation S of one side, the sum of squares of the side can be calculated. Secondly, according to the formula
[0064]
[0065] The population variance can then be obtained, and the population standard deviation can be obtained by further utilizing the population variance. Among these, Let n be the population variance. c n is the number of elements in the federated column. c The value μ can be obtained by considering the number of elements in the participating column and the number of elements in the initiating column. c The mean of the federated column can be obtained from the mean of the participating column and the mean of the originating column. Therefore, given the mean and the number of elements, only the standard deviation needs to be transferred to obtain the sum of squares of the individual data to calculate the final population variance.
[0066] Figure 3This is a schematic diagram of the interaction logic between the initiator and the participants in the horizontal federation processing method provided in Embodiment 1 of the present invention, as shown below. Figure 3 As shown, the interaction logic between the initiator and the participant in this embodiment is as follows: the participant sends its own mean, number of elements and standard deviation to the initiator, and the initiator calculates the overall standard deviation.
[0067] The horizontal federation processing method provided in this embodiment allows the initiator to directly deduce the participants' original data based on the number of elements, mean, and standard deviation transmitted by the participants. This achieves the calculation of the overall standard deviation of a single column in the horizontal federation without exposing the original data, and eliminates the need for third-party data coordination. Furthermore, after calculating their own mean and standard deviation, participants only need to transmit the mean, number of elements, and standard deviation to the initiator. This results in a small data transmission volume during horizontal federation communication, improving communication efficiency.
[0068] Optionally, in one embodiment, the first federated column of the horizontal federation includes a first participating column of the participants and a first initiating column of the initiator, and the second federated column includes a second participating column of the participants and a second initiating column of the initiator; the intermediate calculation result includes a first statistical value of the first participating column, the number of elements in the first participating column, a third statistical value of the second participating column, and a first relational feature of the first and second participating columns, wherein the number of elements in each column of the participants is equal; the step of performing horizontal federation calculation based on the original data of the initiator and the intermediate calculation result includes: performing horizontal federation calculation based on the first initiating column, the number of elements in the first initiating column, the second initiating column, the number of elements in the second initiating column, the first statistical value of the first participating column, the number of elements in the first participating column, the third statistical value of the second participating column, and the first relational feature to obtain the second relational feature of the first and second federated columns.
[0069] Specifically, in some application scenarios, horizontal federated computation requires calculating the relationship characteristics between two federated columns, such as calculating the relationship characteristics between a federated column for corresponding age and a federated column for corresponding weight. When calculating the second relationship characteristics between two federated columns, namely the first federated column and the second federated column, it is decomposed into calculating the first statistical value of the first participating column, the third statistical value of the second participating column, and the first relationship characteristics between the first participating column and the second participating column, and the first statistical value of the first initiating column, the third statistical value of the second initiating column, and the first relationship characteristics between the first initiating column and the second initiating column.
[0070] For the participating party, a first statistical value for the first participating column is calculated based on the first participating column and the number of elements in the first participating column. A third statistical value for the second participating column is calculated based on the number of elements in the second participating column. A first relational characteristic between the two participating columns can also be calculated based on the first and second participating columns. This first statistical value, third statistical characteristic, first relational characteristic, and number of elements in the participating columns are sent as intermediate calculation results to the initiating party. For the initiating party, the first statistical value for the first initiating column can be calculated first based on the first initiating column and the number of elements in the first initiating column. Then, a third statistical value for the second initiating column is calculated based on the number of elements in the second initiating column. A first relational characteristic between the two initiating columns can also be calculated based on the first and second initiating columns. Finally, a horizontal federated calculation is performed based on the data from both the participating party and the initiating party to obtain the second relational characteristics of the first and second federated columns. However, after receiving the first and third statistical values of the participating columns and the first relational characteristics of the two participating columns, the initiating party cannot deduce the original data for each participating column.
[0071] The horizontal federation processing method provided in this embodiment can realize the calculation of horizontal federation statistics without a coordinator, obtain the relationship characteristics of two federation columns in the horizontal federation without relying on a third party, and avoid data exposure.
[0072] Optionally, in one embodiment, the step of performing horizontal federated calculation based on the initiator's original data and intermediate calculation results includes: performing horizontal federated calculation based on the first initiator column, the number of elements in the first initiator column, the second initiator column, the number of elements in the second initiator column, the mean of the first participating column, the sum of squares of the first participating column, the number of elements in the first participating column, the mean of the second participating column, the sum of squares of the second participating column, and the covariance of the first participating column and the second participating column to obtain the correlation coefficient of the first federated column and the second federated column.
[0073] Specifically, in this embodiment, the first and third statistical values are both means, the first relational feature is the covariance, and the second relational feature is the correlation coefficient. The correlation coefficient between the two federated columns in the horizontal federation can be decomposed into first calculating the mean, covariance, sum of squares, and number of elements of each party, and then obtaining the overall correlation coefficient of the two federated columns. Therefore, in the calculation process, the mean, covariance, sum of squares, and number of elements of each party can be obtained for unified calculation.
[0074] The correlation coefficient, also known as the Pearson correlation coefficient, calculates the degree of correlation between two data sets. In horizontal federation, since each party only holds a portion of the data, it is necessary to calculate the correlation separately before summing them up.
[0075] Suppose we need to calculate the correlation coefficient between the first federated column a and the second federated column b. From the formula for the correlation coefficient, we know that:
[0076]
[0077] Where, ρ a,b Let σ be the correlation coefficient between the first federated column a and the second federated column b, and let cov(a,b) be the covariance between the first federated column a and the second federated column b. a Let σ be the standard deviation of the first federal column a. b Let be the standard deviation of the second federated column b. The standard deviation of a federated column can be calculated using the sum of squares of the federated columns, which will not be elaborated upon here.
[0078] From the formula for covariance, we know that:
[0079]
[0080] Among them, a i Let b be the element of the first federated column a, and E(a) be the mean of the first federated column a. i Let E(b) be the element of the second federated column b, and let E(b) be the mean of the second federated column b.
[0081] Further breaking it down into initiators and participants, we get:
[0082]
[0083] Where n1 is the number of elements in the initiating column and n2 is the number of elements in the participating column.
[0084] Therefore, given the overall mean, the overall covariance can be calculated by combining the values of the initiator and participants with the overall mean to obtain the correlation coefficient of the two columns.
[0085] Figure 4 This is a schematic diagram of the interaction logic between the initiator and the participants in the horizontal federation processing method provided in Embodiment 1 of the present invention, as shown below. Figure 4 As shown, the interaction logic between the initiator and the participant in this embodiment is as follows: the participant sends its mean, number of elements, sum of squares, and covariance to the initiator, and the initiator calculates the overall correlation coefficient.
[0086] The horizontal federation processing method provided in this embodiment allows the initiator to directly deduce the participants' original data based on the number of elements, mean, sum of squares, and covariance of the two columns transmitted by the participants. This achieves the calculation of the correlation coefficient between the two columns in the horizontal federation without exposing the original data and without requiring third-party data coordination. Furthermore, after calculating their own mean, sum of squares, and covariance, the participants only need to transmit the mean, number of elements, sum of squares, and covariance to the initiator. This results in a small data transmission volume during the horizontal federation communication process, which is beneficial for improving communication efficiency.
[0087] Optionally, in one embodiment, the intermediate calculation result includes encrypted data obtained by the participants encrypting the participants' original data using a homomorphic encryption algorithm; the step of performing horizontal federated computation based on the initiator's original data and the intermediate calculation result includes: encrypting the initiator's original data using a homomorphic encryption algorithm, and performing horizontal federated computation based on the initiator's encrypted data and the participants' encrypted data.
[0088] Specifically, in some horizontal federated computing scenarios, the initiator needs to obtain the raw data from the participants for computation. That is, when federated computation cannot be performed using the results of step-by-step processing, the participants encrypt their raw data using a homomorphic encryption algorithm, and then send the encrypted data to the initiator. The initiator can first encrypt its own raw data using the homomorphic encryption algorithm to obtain its own encrypted data. Finally, horizontal federated computation is achieved based on the encrypted data from both the initiator and the participants.
[0089] In the horizontal federation processing method provided in this embodiment, the participants transmit encrypted data to the initiator, and the initiator cannot deduce the participants' original data from this encrypted data. Furthermore, a homomorphic encryption algorithm is used for encryption. Based on the characteristics of homomorphic encryption, horizontal federation computation can be performed based on the encrypted data of each party, enabling the calculation of horizontal federation statistics without a coordinating party. This allows for the acquisition of horizontal federation statistics without relying on a third party, while also avoiding data exposure.
[0090] Optionally, in one embodiment, the federation column of the horizontal federation includes the participation column of the participants and the initiator column of the initiator. The step of performing horizontal federation calculation based on the encrypted data of the initiator and the encrypted data of the participants includes: determining the median of the federation column based on the size relationship between the encrypted data of the participation column and the encrypted data of the initiator column.
[0091] Specifically, the calculation logic for the median in a horizontal federation is similar to extracting the corresponding quartile value from two or more elements. In existing technologies, when each quartile vector is not visible, a precise median cannot be obtained in a horizontal federation. In this embodiment, after receiving the encrypted data from the participants, the initiator can determine the median in the federated columns based on the size relationship between the encrypted data in the participant columns and the encrypted data in the initiator column.
[0092] The horizontal federation processing method provided in this embodiment can realize the calculation of the median of a horizontal federation without a coordinating party, obtain the median of the federated column in the horizontal federation without relying on a third party, and avoid data exposure.
[0093] Optionally, in one embodiment, after the participating column and the initiating column are sorted according to element size, a left pointer and a right pointer are set, wherein the left pointer initially points to the first element less than the median of the column, and the right pointer initially points to the first element greater than the median of the column; the step of sending a request to obtain intermediate calculation results to the participating parties of the horizontal federation includes: obtaining the encrypted data of the element pointed to by the left pointer and the encrypted data of the element pointed to by the right pointer in the participating column; the step of encrypting the original data of the initiating party using a homomorphic encryption algorithm includes: encrypting the elements pointed to by the left and right pointers in the initiating column using a homomorphic encryption algorithm; the step of determining the median of the federation column based on the size relationship between the encrypted data of the participating column and the encrypted data of the initiating column includes: step S1, determining the maximum value among the right pointer values of each column, wherein the column containing the maximum value is the maximum value column, the right pointer value is the encrypted data of the element pointed to by the right pointer, and the left pointer value is the encrypted data of the element pointed to by the left pointer; step S2, determining whether the left pointer value of the maximum value column is less than the right pointer value of all columns, wherein when the left pointer value of the maximum value column is greater than the right pointer value of any column, that is, the left pointer value of the maximum value column is not satisfied. When the pointer value is less than the right pointer values of all columns, execute step S3 (move pointer). When the left pointer value of the maximum value column is less than the right pointer values of all columns, or when the left pointer of the maximum value column exceeds the maximum value column, execute step S7. Step S3: Initiate a pointer adjustment request to the maximum value column so that the left and right pointers of the maximum value column move in the direction of element decrease, respectively. Step S4: Determine the minimum value among the left pointer values of each column, where the column containing the minimum value is the minimum value column. Step S5: Determine whether the right pointer value of the minimum value column is greater than the left pointer values of all columns, where the minimum value... When the right pointer value of a column is less than the left pointer value of any column, that is, when the right pointer value of the minimum value column is not greater than the left pointer values of all columns, step S6 (move pointer) is executed. When the right pointer value of the minimum value column is greater than the left pointer values of all columns, or when the right pointer of the minimum value column exceeds the minimum value column, step S7 is executed. In step S6, a pointer adjustment request is initiated to the column where the minimum value is located, so that the left and right pointers of the minimum value column move in the direction of increasing elements, and after moving, the process returns to step S1. In step S7, the median of the federated columns is obtained by calculating the mean of the right pointer values of each column.
[0094] To illustrate the steps described above in detail, let's take a two-party federation as an example. Assume both parties in the federation have the same federation columns. Figure 5 This is a data diagram illustrating the initiator and participants in the horizontal federation processing method provided in Embodiment 1 of the present invention. The actual values of the initiator and participants are as follows: Figure 5 As shown.
[0095] In horizontal federation, the lengths of the data columns for each party are not necessarily equal. The above diagram only simulates the simplest two-party federation case. This method can be generalized to multi-party horizontal federations and can satisfy all data conditions. Taking the calculation of the median as an example... Figure 5 The overall median of the two columns of data is 4. However, in actual horizontal federation, it is impossible to integrate all the data to obtain the median. In this embodiment, a pointer is used to mark the data situation, and the pointer is moved step by step according to the data size to obtain the final median.
[0096] First, when obtaining the median, two pointers, left and right, are used to mark the corresponding median values in the initiating and participating columns, respectively. Initially, the left pointer marks the first value less than the median, and the right pointer marks the first value greater than the median. Figure 6 This is a schematic diagram of the pointer markers for the initiator and participants in the horizontal federation processing method provided in Embodiment 1 of the present invention, as shown below. Figure 6 As shown, the median for the initiator is 2.5. The left pointer marks the first value less than 2.5 as 2, and the right pointer marks the first value greater than 2.5 as 3. The median for the participants is 4. Since the corresponding position of the left pointer cannot be directly obtained, a round-up approach is used, marking the left pointer at the median position and the right pointer marking the first value greater than 4 as 5. After marking, the pointers actually obtain the numerical positions closest to the quantiles of each party. Then, the horizontal federation initiator sends intermediate calculation result requests to each participant and adjusts the pointers of each party according to the range. If the horizontal federation parties cannot satisfy the condition that the left pointer value is less than or equal to all right pointers, the pointers are moved. Since only the magnitude of the value is needed, not the specific value, the parties can compare encrypted data, thus eliminating the need to obtain the original data from each party.
[0097] The specific action logic is as follows:
[0098] Step S1: Find the maximum value among the right pointer values in each column (initiating column and participating column), and find the square with the largest right pointer value, such as... Figure 6 As shown, the right pointer value of the participating column is the maximum value, which corresponds to 5.
[0099] Step S2: Check the left pointer of the participating column to determine if the left pointer value of the participating column is less than or equal to the right pointer values of all columns. Figure 6 In the process, it is found that the left pointer of the participating column does not meet the condition of being less than or equal to all right pointer values, so the pointer is moved.
[0100] Step S3, Move pointer: Initiate a pointer adjustment request for the column with the maximum value in the direction, that is, the participating column, so that the left and right pointers of the participating column move the pointers in the direction of decreasing value. Figure 7 This is a schematic diagram illustrating the pointer movement of the initiator and participants in the horizontal federation processing method provided in Embodiment 1 of the present invention, as shown below. Figure 7 As shown, the left and right pointers of the participants move upwards respectively.
[0101] Step S4, find the minimum value of the left pointer: the initiator finds the left pointer with the smallest value, which is the initiator. At this time, the left pointer value of the initiator is the smallest.
[0102] In step S5, the initiator compares whether the right pointers of all parties are greater than the left pointers. It can be seen that the left pointer of the participating party is 4 at this time, which does not satisfy the condition that the right pointer of the initiator is 3 and is greater than the left pointer of the participating party. Therefore, it moves further.
[0103] Step S6: The initiator moves its own pointer in the direction of increasing value. Figure 8 This is a schematic diagram illustrating the pointer movement of the initiator and participants in the horizontal federation processing method provided in Embodiment 1 of the present invention, as shown below. Figure 8 As shown, the left and right pointers of the initiator move downwards respectively.
[0104] Repeat the above loop. Since the condition is still not met after the moves, further moves are needed based on the maximum value of the right pointer and the minimum value of the left pointer, until all left pointers are less than or equal to the value of the right pointer. The situation after multiple moves is as follows: Figure 9 As shown.
[0105] The movement stops when the left pointer value of the maximum value column is less than the right pointer values of all columns, or when the left pointer of the maximum value column exceeds the maximum value column. Specifically, for pointers exceeding a value column, the right pointer is marked as positive infinity, and the left pointer is marked as negative infinity. For example... Figure 9 As shown, the initiator's right pointer is equal to positive infinity. Furthermore, the left pointers of all parties (initiator 3, participant 4) are all less than or equal to the right pointers of all parties (initiator positive infinity, participant 4). Once the stopping condition is met, the pointer movement stops, and the values of the right pointers of each party are obtained.
[0106] At this point, the initiator's right pointer value is positive infinity, and the participant's right pointer value is 4. If both sides have values, then: Horizontal Federation Median = Sum of Right Pointers of Each Side / Number of Participants. If infinity exists, remove infinity and subtract the corresponding number of participants from the denominator. In the current case, the final result is 4 / (2-1) = 4, so the horizontal federation median is 4.
[0107] Figure 10 This is a schematic diagram of the interaction logic between the initiator and the participants in the horizontal federation processing method provided in Embodiment 1 of the present invention, as shown below. Figure 10 As shown, in this embodiment, the initiator and participants move pointers based on the comparison results of the encrypted data to obtain the median of the federated column.
[0108] Example 2
[0109] Corresponding to Embodiment 1 above, Embodiment 2 of the present invention provides a horizontal federation processing device. The technical features and corresponding technical effects can be referred to Embodiment 1 above, and will not be repeated in this embodiment. Figure 11 This is a block diagram of the horizontal federation processing apparatus provided in Embodiment 2 of the present invention, as shown below. Figure 11 As shown, the device includes: a first transmitting module 201, a first receiving module 202, and a first processing module 203.
[0110] The first sending module 201 is used to send a request to obtain intermediate calculation results to the participants in the horizontal federation, wherein the intermediate calculation results are the results calculated by the participants based on the participants' original data, and the intermediate calculation results do not expose the participants' original data; the first receiving module 202 is used to receive the intermediate calculation results sent by the participants; and the first processing module 203 is used to perform horizontal federation calculations based on the initiator's original data and the intermediate calculation results.
[0111] Example 3
[0112] This invention provides a method for processing horizontal federation. This method is applied to the participants in horizontal federation. Through this method, the problem that each party cannot obtain the federation calculation results independently during the horizontal federation process can be solved without the need for a third coordinating party. While realizing federation calculation, it avoids the exposure of the original data between the parties. At the same time, the technical feature details and corresponding technical effects corresponding to the above embodiment one can be referred to the above embodiment one, and will not be repeated here. Figure 12 The flowchart of the horizontal federation processing method provided in Embodiment 3 of the present invention is as follows: Figure 12 As shown, the horizontal federation processing method provided in this embodiment includes the following steps S301 to S303.
[0113] Step S301: Receive a request from the initiator of the horizontal federation to obtain intermediate calculation results.
[0114] Step S302: Calculate the intermediate calculation result based on the original data of the participating parties.
[0115] The intermediate calculation results do not expose the original data of the participating parties.
[0116] Step S303: Send the initiator of the horizontal federation in the intermediate calculation results.
[0117] The initiator is used to perform horizontal federated computation based on the initiator's original data and the intermediate computation results.
[0118] Example 4
[0119] Corresponding to Embodiment 1 above, Embodiment 4 of the present invention provides a horizontal federation processing device. The technical features and corresponding technical effects can be referred to Embodiment 1 above, and will not be repeated in this embodiment. Figure 13 This is a block diagram of the horizontal federation processing apparatus provided in Embodiment 4 of the present invention, as follows: Figure 13 As shown, the device includes a second receiving module 401, a second processing module 402, and a second transmitting module 403.
[0120] The second receiving module 401 is used to receive a request for obtaining intermediate calculation results sent by the initiator of the horizontal federation; the second processing module 402 is used to calculate the intermediate calculation results based on the original data of the participants, wherein the intermediate calculation results do not expose the original data of the participants; the second sending module 403 is used to send the intermediate calculation results to the initiator of the horizontal federation, wherein the initiator is used to perform horizontal federation calculations based on the initiator's original data and the intermediate calculation results.
[0121] Example 5
[0122] Figure 14 The horizontal federation processing system provided in Embodiment 4 of the present invention, such as Figure 13 As shown, the processing system includes a horizontal federation initiator 501 and several participants 502.
[0123] Wherein, the initiator 501 is used to send a request to obtain intermediate calculation results to the participant 502; the participant 502 is used to receive the request, calculate the intermediate calculation results based on the participant's original data, and return the intermediate calculation results to the initiator 501, wherein the intermediate calculation results do not expose the participant's original data;
[0124] The initiator 501 is also used to receive the intermediate calculation results and perform horizontal federated calculations based on the initiator's original data and the intermediate calculation results.
[0125] Example 6
[0126] This embodiment also provides a computer device, such as a smartphone, tablet computer, laptop computer, desktop computer, rack server, blade server, tower server, or cabinet server (including a standalone server or a server cluster composed of multiple servers), etc., capable of executing programs. Figure 15 As shown, the computer device 01 in this embodiment includes, but is not limited to, a memory 012 and a processor 011 that can be interconnected via a system bus, such as... Figure 15 As shown. It should be noted that, Figure 15Only a computer device 01 with component memory 012 and processor 011 is shown; however, it should be understood that it is not required to implement all of the components shown, and more or fewer components may be implemented instead.
[0127] In this embodiment, the memory 012 (i.e., the readable storage medium) includes flash memory, hard disk, multimedia card, card-type memory (e.g., SD or DX memory), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, disk, optical disk, etc. In some embodiments, the memory 012 may be an internal storage unit of the computer device 01, such as the hard disk or memory of the computer device 01. In other embodiments, the memory 012 may also be an external storage device of the computer device 01, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc., equipped on the computer device 01. Of course, the memory 012 may include both the internal storage unit and its external storage device of the computer device 01. In this embodiment, the memory 012 is typically used to store the operating system and various application software installed on the computer device 01, such as the program code of the horizontal federation processing device in the above embodiment. In addition, memory 012 can also be used to temporarily store various types of data that have been output or will be output.
[0128] In some embodiments, processor 011 may be a central processing unit (CPU), controller, microcontroller, microprocessor, or other data processing chip. This processor 011 is typically used to control the overall operation of computer device 01. In this embodiment, processor 011 is used to run program code stored in memory 012 or process data, such as the horizontal federation processing device provided in the above embodiments, to implement the horizontal federation processing method provided in the above embodiments.
[0129] Example 7
[0130] This seventh embodiment also provides a computer-readable storage medium, such as flash memory, hard disk, multimedia card, card-type memory (e.g., SD or DX memory), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, disk, optical disk, server, app store, etc., which stores a computer program. When the program is executed by a processor, it implements the corresponding function. The computer-readable storage medium of this embodiment is used to store a horizontally federated processing device, which, when executed by a processor, implements the horizontally federated processing method provided in the above embodiments.
[0131] 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. Unless otherwise specified, 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.
[0132] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0133] 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. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method.
[0134] The above are merely preferred embodiments of the present invention and do not limit the scope of the patent. Any equivalent structural or procedural transformations made based on the description and drawings of the present invention, or direct or indirect applications in other related technical fields, are similarly included within the scope of patent protection of the present invention.
Claims
1. A processing method of cross-federation, characterized by, The application is applied to an initiator of a horizontal federation, a federation column of the horizontal federation includes a participation column of a participant and an initiation column of the initiator, the participation column and the initiation column are provided with left pointers and right pointers after being sorted according to element sizes, the left pointer initially points to the first element smaller than the median of the column, and the right pointer initially points to the first element larger than the median of the column, and the processing method comprises the following steps: sending an acquisition request of an intermediate calculation result to the participant of the horizontal federation, wherein the intermediate calculation result includes encrypted data of an element pointed to by the left pointer and encrypted data of an element pointed to by the right pointer in the participation column, and the participant encrypts original data of the participant by using a homomorphic encryption algorithm to obtain the encrypted data; receiving the intermediate calculation result sent by the participant; performing horizontal federation calculation according to the original data of the initiator and the intermediate calculation result, including encrypting elements pointed to by the left pointer and the right pointer in the initiation column by using a homomorphic encryption algorithm, and determining the median of the federation column according to the size relationship between the encrypted data of the participation column and the encrypted data of the initiation column, including: step S1, determining the maximum value in the right pointer values of the columns, wherein the column where the maximum value is located is a maximum value column, the right pointer value is the encrypted data of the element pointed to by the right pointer, and the left pointer value is the encrypted data of the element pointed to by the left pointer; step S2, judging whether the left pointer value of the maximum value column is smaller than the right pointer values of all columns, wherein when the left pointer value of the maximum value column is greater than the right pointer value of any column, step S3 is performed, when the left pointer value of the maximum value column is smaller than the right pointer values of all columns, or the left pointer of the maximum value column exceeds the maximum value column, step S7 is performed; step S3, initiating a pointer adjustment request to the maximum value column, so that the left pointer and the right pointer of the maximum value column move in the direction of decreasing elements respectively; step S4, determining the minimum value in the left pointer values of the columns, wherein the column where the minimum value is located is a minimum value column; step S5, judging whether the right pointer value of the minimum value column is greater than the left pointer values of all columns, wherein when the right pointer value of the minimum value column is smaller than the left pointer value of any column, step S6 is performed, when the right pointer value of the minimum value column is greater than the left pointer values of all columns, or the right pointer of the minimum value column exceeds the minimum value column, step S7 is performed; step S6, initiating a pointer adjustment request to the column where the minimum value is located, so that the left pointer and the right pointer of the minimum value column move in the direction of increasing elements respectively, and returning to step S1 after moving; step S7, calculating the average of the right pointer values of the columns to obtain the median of the federation column.
2. The processing method of transverse federal according to claim 1, characterized in that, The step of performing horizontal federation calculation according to the original data of the initiator and the intermediate calculation result comprises the following steps: performing horizontal federation calculation according to the initiation column, the number of elements of the initiation column, the first statistical value of the participation column and the number of elements of the participation column to obtain the second statistical value of the federation column.
3. The method of claim 2, wherein, The step of performing a horizontal federated calculation according to the initiating column, the number of elements of the initiating column, the first statistical value of the participating column, and the number of elements of the participating column to obtain a second statistical value of the federated column comprises at least one of: performing a horizontal federated calculation according to the initiating column, the number of elements of the initiating column, the mean of the participating column, and the number of elements of the participating column to obtain a mean of the federated column; performing a horizontal federated calculation according to the initiating column, the number of elements of the initiating column, the mean of the participating column, the standard deviation of the participating column, and the number of elements of the participating column to obtain a standard deviation of the federated column.
4. The horizontal federated processing method according to claim 1, wherein the first federated column of the horizontal federation comprises a first participating column of the participant and a first initiating column of the initiator, and the second federated column comprises a second participating column of the participant and a second initiating column of the initiator; the intermediate calculation result comprises a first statistical value of the first participating column, a number of elements of the first participating column, a third statistical value of the second participating column, and a first relationship feature of the first participating column and the second participating column, and the number of elements of each column of the participant is equal; the step of performing a horizontal federated calculation according to the initiator original data and the intermediate calculation result comprises: performing a horizontal federated calculation according to the first initiating column, the number of elements of the first initiating column, the second initiating column, the number of elements of the second initiating column, the first statistical value of the first participating column, the number of elements of the first participating column, the third statistical value of the second participating column, and the first relationship feature to obtain a second relationship feature of the first federated column and the second federated column.
5. The method of claim 4, wherein, The step of performing a horizontal federated calculation according to the initiator original data and the intermediate calculation result comprises: performing a horizontal federated calculation according to the first initiating column, the number of elements of the first initiating column, the second initiating column, the number of elements of the second initiating column, the mean of the first participating column, the sum of squares of the first participating column, the number of elements of the first participating column, the mean of the second participating column, the sum of squares of the second participating column, and the covariance of the first participating column and the second participating column to obtain a correlation coefficient of the first federated column and the second federated column.
6. A cross-federal handling system characterized by, The horizontal federation comprises an initiator and a plurality of participants, and a federated column of the horizontal federation comprises a participating column of the participant and an initiating column of the initiator. After the participating column and the initiating column are sorted according to the size of elements, left pointers and right pointers are arranged, wherein the left pointer initially points to the first element smaller than the median of the column, and the right pointer initially points to the first element larger than the median of the column, and wherein: the initiator is configured to send an acquisition request of an intermediate calculation result to the participant; The participant is configured to receive the acquisition request, calculate the intermediate calculation result by encrypting the participant original data by using a homomorphic encryption algorithm, and return the intermediate calculation result to the initiator, wherein the intermediate calculation result comprises encrypted data of an element pointed to by a left pointer and encrypted data of an element pointed to by a right pointer in the participant column; The initiator is further configured to receive the intermediate calculation result, and perform horizontal federated calculation according to the initiator original data and the intermediate calculation result, comprising: encrypting elements pointed to by the left pointer and the right pointer in the initiator column by using a homomorphic encryption algorithm, and determining the median of the federated column according to a size relationship between the encrypted data of the participant column and the encrypted data of the initiator column, comprising: Step S1, determining a maximum value in the right pointer values of the columns, wherein a column where the maximum value is located is a maximum value column, and the right pointer value is encrypted data of an element pointed to by a right pointer, and the left pointer value is encrypted data of an element pointed to by a left pointer; Step S2, judging whether the left pointer value of the maximum value column is less than the right pointer values of all the columns, wherein when the left pointer value of the maximum value column is greater than the right pointer value of any column, step S3 is performed, and when the left pointer value of the maximum value column is less than the right pointer values of all the columns, or the left pointer of the maximum value column exceeds the maximum value column, step S7 is performed; Step S3, initiating a pointer adjustment request to the maximum value column, so that the left pointer and the right pointer of the maximum value column are moved in the direction in which the elements decrease, respectively; Step S4, determining a minimum value in the left pointer values of the columns, wherein a column where the minimum value is located is a minimum value column; Step S5, judging whether the right pointer value of the minimum value column is greater than the left pointer values of all the columns, wherein when the right pointer value of the minimum value column is less than the left pointer value of any column, step S6 is performed, and when the right pointer value of the minimum value column is greater than the left pointer values of all the columns, or the right pointer of the minimum value column exceeds the minimum value column, step S7 is performed; Step S6, initiating a pointer adjustment request to the column where the minimum value is located, so that the left pointer and the right pointer of the minimum value column are moved in the direction in which the elements increase, respectively, and returning to the step S1 after the moving; Step S7, calculating a mean value of the right pointer values of the columns to obtain the median of the federated column.
7. A computer device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, The processor implements the steps of the method in any one of claims 1 to 5 when executing the computer program.
Citation Information
Patent Citations
Feature correlation analysis method and device in federation learning and readable storage medium
CN110443378A
Data management method and device and electronic equipment
CN114065238A
Data median determination method and device
CN114595479A