Method, device, system and storage medium for comparing service parameters

By combining local computation with multi-party secure computation in privacy-preserving computation, and using binary strings and tag strings for fragmented computation, the problem of low efficiency in comparing multi-party business parameters is solved, and efficient privacy-preserving comparison is achieved.

CN116595548BActive Publication Date: 2026-05-19CHINA UNIONPAY
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
CHINA UNIONPAY
Filing Date
2023-04-27
Publication Date
2026-05-19

AI Technical Summary

Technical Problem

In the process of privacy computing, when comparing business parameters among multiple parties, a large amount of data transmission and interaction is required, resulting in low efficiency and failing to effectively guarantee the privacy and security of business parameters as well as computing efficiency.

Method used

A method combining local computation and multi-party secure computation is adopted. By performing most of the computation locally on the participating parties, the number of communication interactions is reduced. Fragmented computation is performed using binary strings, tag strings, and initial random strings to obtain the comparison results.

Benefits of technology

It improves the efficiency of comparing business parameters from multiple parties, reduces the number of communication interactions, and ensures the privacy and security of business parameters. It is suitable for scenarios such as federated learning and secure intersection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116595548B_ABST
    Figure CN116595548B_ABST
Patent Text Reader

Abstract

The application discloses a service parameter comparison method, device, system and storage medium, and belongs to the field of big data processing. The method comprises the following steps: obtaining a first interaction string and a first result string based on a first binary string obtained by converting a first service parameter of a first device, a first label string randomly generated, and an initial random string agreed upon; sending the first interaction string to a second device, so that the second device obtains a second result string based on a second binary string obtained by converting a second service parameter of the second device, the initial random string, a part of the second label string randomly generated, and the first interaction string; and interacting with the second device based on the first result string and the second result string, performing fragmentation calculation, and obtaining a first comparison result. According to the embodiment of the application, the efficiency of service parameter comparison of multiple parties can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of big data processing, and in particular relates to a method, device, system and storage medium for comparing business parameters. Background Technology

[0002] With the continuous development of information technology, more and more business scenarios require the joint participation of multiple parties, such as business scoring, machine learning, business data statistics, and ranking. To ensure the security of the information of the multiple parties participating in the same business scenario, privacy computing technology has been introduced.

[0003] During privacy-preserving computation, devices from different parties can encrypt information to obtain ciphertext before transmission, and perform logical calculations in ciphertext to prevent information leakage. In some cases, to achieve business objectives, it is necessary to compare business parameters from different parties. To ensure the privacy and security of these parameters, the actual parameters are not transmitted, requiring extensive data transmission and interaction between multiple parties. This extensive data transmission and interaction takes a considerable amount of time, thus reducing the efficiency of comparing business parameters. Summary of the Invention

[0004] This application provides a method, device, system, and storage medium for comparing business parameters, which can improve the efficiency of comparing business parameters among multiple parties.

[0005] In a first aspect, embodiments of this application provide a method for comparing service parameters, applied to a first device. The method includes: a first binary string obtained by converting first service parameters of the first device, and a randomly generated 2... N The first tag string and the 2 agreed upon by the first device and the second device N Given an initial random string, we obtain a first interactive string and a first result string. The first binary string includes 2... N N is a positive integer; the first interaction string is sent to the second device, so that the second device, based on the second service parameters of the second device, converts the second binary string, the initial random string, the randomly generated part of the second tag string, and the first interaction string to obtain the second result string. The second binary string includes 2 bits. N Each bit; interacts with the second device based on the first result string and the second result string to perform fragmented calculations and obtain a first comparison result, which indicates whether the first service parameter and the second service parameter are equal.

[0006] Secondly, embodiments of this application provide a method for comparing service parameters, applied to a second device. The method includes: receiving a first interaction string sent by a first device, the first interaction string being obtained by the first device based on N randomly generated first tag strings; and obtaining a second result string based on a second binary string obtained by converting second service parameters of the second device, an initial random string, a randomly generated portion of the second tag strings, and the first interaction string. The second binary string includes 2... N N is a positive integer; it interacts with the first device based on the first result string and the second result string, performs fragmented calculations, and obtains the first comparison result. The first result string is obtained by the first device converting the first binary string based on the first service parameter of the first device, the first tag string, and N initial random strings agreed upon by the first device and the second device. The first comparison result indicates whether the first service parameter and the second service parameter are equal. The first binary string includes 2 bits. N 1 bit.

[0007] Thirdly, embodiments of this application provide a first device, including: a local computing module, used for converting a first binary string based on a first service parameter of the first device and a randomly generated 2 N The first tag string and the 2 agreed upon by the first device and the second device N Given an initial random string, we obtain a first interactive string and a first result string. The first binary string includes 2... N N is a positive integer; a communication module is used to send the first interaction string to the second device, so that the second device, based on the second binary string obtained by converting the second binary string obtained by the second device's second service parameters, the initial random string, the randomly generated part of the second tag string, and the first interaction string, obtains a second result string. The second binary string includes 2 bits. N Each bit; the communication module and the local computing module are also used to interact with the second device based on the first result string and the second result string, perform fragmented calculations, and obtain a first comparison result, which indicates whether the first service parameter and the second service parameter are equal.

[0008] Fourthly, embodiments of this application provide a second device, comprising: a communication module, configured to receive a first interaction string sent by a first device, the first interaction string being obtained by the first device based on N randomly generated first tag strings; and a local calculation module, configured to obtain a second result string based on a second binary string obtained by converting second service parameters of the second device, an initial random string, a portion of randomly generated second tag strings, and the first interaction string, the second binary string including 2 NThe communication module and the local computing module are also used to interact with the first device based on the first result string and the second result string, perform fragmented calculations, and obtain a first comparison result. The first result string is obtained by the first device converting the first binary string based on the first service parameters of the first device, the first tag string, and N initial random strings agreed upon by the first device and the second device. The first comparison result indicates whether the first service parameters and the second service parameters are equal. The first binary string includes 2 bits. N 1 bit.

[0009] Fifthly, embodiments of this application provide an electronic device, including: a processor and a memory storing computer program instructions; the processor, when executing the computer program instructions, implements a method for comparing service parameters in the first aspect or a method for comparing service parameters in the second aspect.

[0010] In a sixth aspect, embodiments of this application provide a business parameter comparison system, comprising: a first device for executing a business parameter comparison method of the first aspect; and a second device for executing a business parameter comparison method of the second aspect.

[0011] In a seventh aspect, embodiments of this application provide a computer-readable storage medium storing computer program instructions, which, when executed by a processor, implement a method for comparing business parameters in the first aspect or a method for comparing business parameters in the second aspect.

[0012] This application provides a method, apparatus, device, and storage medium for comparing service parameters. A first device, based on a first binary string, a first tag string, and an initial random string derived from its own first service parameters, calculates a first interaction string and a first result string locally. The first device then sends the first interaction string to a second device. A second device, based on a second binary string, a second tag string, an initial random string, and the first interaction string derived from its own second service parameters, calculates a second result string locally. The first and second devices interact based on the first and second result strings, performing fragmented calculations to obtain a first comparison result indicating whether the first and second service parameters are equal. Most of the calculations in this process are performed locally on both the first and second devices. Communication between the first and second devices is minimal, occurring only during the transmission of the first interaction string and the fragmented calculation process, thus reducing the number of communication interactions between them and improving the efficiency of multi-party service parameter comparison. Attached Figure Description

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

[0014] Figure 1 A schematic diagram of the system architecture of an example of a method for comparing business parameters provided in an embodiment of this application;

[0015] Figure 2 A flowchart illustrating a method for comparing business parameters provided in an embodiment of the first aspect of this application;

[0016] Figure 3 A flowchart illustrating a method for comparing business parameters provided in another embodiment of the first aspect of this application;

[0017] Figure 4 A flowchart illustrating a method for comparing business parameters provided in yet another embodiment of the first solution of this application;

[0018] Figure 5 A flowchart illustrating a method for comparing business parameters provided in an embodiment of the second aspect of this application;

[0019] Figure 6 A flowchart illustrating a method for comparing business parameters provided in another embodiment of the second aspect of this application;

[0020] Figure 7 A flowchart illustrating a method for comparing business parameters provided in yet another embodiment of the second aspect of this application;

[0021] Figure 8 A schematic diagram of an example linear rectification function provided in an embodiment of this application;

[0022] Figure 9 A schematic diagram of the structure of a first device provided in an embodiment of the third aspect of this application;

[0023] Figure 10 This is a schematic diagram of the structure of a second device provided in an embodiment of the fourth aspect of this application;

[0024] Figure 11 This is a schematic diagram of the structure of an electronic device provided according to an embodiment of the fifth aspect of this application. Detailed Implementation

[0025] The features and exemplary embodiments of various aspects of this application will be described in detail below. To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only intended to explain this application and not to limit it. For those skilled in the art, this application can be implemented without some of these specific details. The following description of the embodiments is merely to provide a better understanding of this application by illustrating examples. It should be noted that the acquisition, storage, use, and processing of information and data in the embodiments of this application are all authorized by users or relevant organizations and comply with the relevant provisions of national laws and regulations.

[0026] With the continuous development of information technology, more and more business scenarios require the joint participation of multiple parties, such as business scoring, machine learning, business data statistics, and ranking. To ensure the security of information among the parties involved in the same business scenario, privacy-preserving computation technology has been introduced. During privacy-preserving computation, devices from different parties can encrypt information to obtain ciphertext before transmission, and perform logical calculations in ciphertext to prevent information leakage. In some cases, to achieve business objectives, it is necessary to compare business parameters from different parties. To ensure the privacy and security of these business parameters, the actual business parameters are not transmitted during the comparison process. This necessitates a large amount of data transmission and interaction between the parties, which takes a considerable amount of time, thus reducing the efficiency of business parameter comparison.

[0027] For example, if a method based on obfuscated circuits is used to implement secure multi-party computation, and the relevant data of the service parameters is L bits, then the obfuscated circuit will have L full adders. During the computation process of each full adder, parties A and B, who hold the service parameters, need to perform multiple interactive communications. With L full adders, the number of interactive communications between parties A and B will increase exponentially. The more interactive communications there are, the longer the time spent on interactive communications will be, and the lower the efficiency of comparing service parameters will be.

[0028] For example, using secret sharing to achieve secure multi-party computation requires executing the A2B protocol. The A2B protocol needs to convert an arithmetic share to a Boolean share. The computational performance of the A2B protocol mainly depends on the chosen adder circuit, such as a Kogge-Stone or Sklansky structure adder circuit. However, the adder circuit executes many times, and processing each bit of the data related to the service parameters requires extensive communication between party A and party B, who hold the service parameters. Each carry involved in the adder circuit also requires extensive communication between party A and party B. This large number of communication operations reduces the efficiency of comparing service parameters.

[0029] This application provides a method, device, system, and storage medium for comparing business parameters. It combines local computing with Secure Multi-Party Computation (MPC). Most of the operations related to the comparison of business parameters are executed locally on the respective local machines of the two parties involved in the comparison, without the need for homomorphic encryption or decryption or additional auxiliary parties. This reduces the number of communication interactions between the two parties involved in the comparison and minimizes the communication time of secure multi-party computation, thereby improving the efficiency of business parameter comparison.

[0030] The business parameter comparison method provided in this application can be used for comparing business parameters between two parties, or for comparing business parameters between more parties. In scenarios involving comparisons of business parameters between more parties, any two of the parties can use the business parameter comparison method provided in this application. For ease of explanation, in this application, the device on which one party performs the business parameter comparison method is referred to as the first device, and the device on which the other party performs the business parameter comparison method is referred to as the second device. Figure 1 A schematic diagram of a system architecture for an example of a method for comparing business parameters provided in an embodiment of this application, as shown below. Figure 1 As shown, the system architecture includes a first device 11 and a second device 12. The first device 11 belongs to the first party, and the second device 12 belongs to the second party. The first party and the second party are different. The first device 11 and the second device 12 can communicate with each other. However, in this embodiment, most of the calculations related to the service parameters of the first device 11 during the service parameter comparison process are performed locally on the first device 11. Similarly, most of the calculations related to the service parameters of the second device 12 during the service parameter comparison process are performed locally on the second device 12. The first device 11 and the second device 12 can be user terminals, servers, or other devices. The types of the first device 11 and the second device 12 are not limited here.

[0031] The following describes the comparison methods, equipment, systems, and storage media for the business parameters provided in this application.

[0032] The first aspect of this application provides a method for comparing service parameters, which can be applied to a first device, that is, the method for comparing service parameters can be executed by the first device. Figure 2 A flowchart of a method for comparing business parameters provided in an embodiment of the first aspect of this application is shown below. Figure 2 As shown, the comparison method for the business parameters may include steps S201 to S203.

[0033] In step S201, the first binary string obtained by converting the first service parameters of the first device and the randomly generated 2 NThe first tag string and the 2 agreed upon by the first device and the second device N Given an initial random string, we obtain the first interactive string and the first result string.

[0034] The first business parameters include the business parameters of the first party to which the first device belongs. These business parameters can be used in various business implementation scenarios, such as business scoring, machine learning, business model training, business data statistics, and sorting. The specific types of business parameters are not limited here.

[0035] The first binary string is the binary string obtained by converting the first business parameter. The first binary string includes 2 N N is a positive integer. For example, the first binary string can include 4 bits, 8 bits, 16 bits, 32 bits, 64 bits, or even more bits, depending on the application scenario and requirements. In some examples, to improve the accuracy of business parameter comparison, N ≥ 4 can be set.

[0036] The first tag string is randomly generated by the first device. The number of first tag strings is the same as the number of bits in the first binary string. For example, if the first binary string consists of 4 bits, the first device randomly generates 4 first tag strings, with each bit in the first binary string corresponding to one first tag string. The first tag strings can be used to identify the value of the corresponding bit in the first binary string. In some examples, the number of bits in each first tag string is the same as the number of bits in the first binary string, but this is not a limitation.

[0037] The initial random string is a pre-defined randomly generated string between the first and second devices, and the initial random string in the first device is the same as that in the second device. In some examples, the DH algorithm (i.e., the Diffie-Hellman algorithm) can be used to complete the key exchange between the first and second devices without directly transmitting the original keys, thereby obtaining a shared random number seed. This random number seed can be used to generate the initial random string in both the first and second devices. That is, the first device uses the random number seed to generate the initial random string, and the second device also uses the random number seed to generate the initial random string. The number of initial random strings is the same as the number of bits in the first binary string and the number of bits in the second binary string. For example, the first device can choose a prime number p, a base g, and a random number a, and then calculate A = g. a (mod p), the first device sends the prime number p, the base g, and the calculated A to the second device, which can choose a random number b and calculate B = g. b(mod p) and s1 = A b (mod p), the second device can send the calculated B to the first device, and the first device calculates s2 = B. a (mod p) If s2 calculated by the first device is equal to s1 calculated by the second device, s1 can be used as the random number seed. For example, if p = 509, g = 5, a = 123, b = 456, then A = 215, B = 181, and s1 = s2 = 121. 121 can be used as the random number seed. It should be noted that the random number seed s1 is not transmitted between the first and second devices. A and B, calculated using the prime number p and base g transmitted between the first and second devices, cannot be used to deduce s1, ensuring the security of the random number seed. Since the first and second devices obtain a shared random number seed using the DH algorithm, there is no need to distribute an initial random string, further reducing the number of communication interactions between the first and second devices and improving the efficiency of comparing service parameters.

[0038] By calculating the first binary string, the first tag string, and the initial random string, the first interaction string and the first result string can be obtained. Specifically, the first interaction string and the first result string can be obtained using an XOR algorithm based on the first binary string, the first tag string, and the initial random string. The calculation of obtaining the first interaction string and the first result string is performed locally on the first device and does not generate interaction with the second device, significantly saving the time spent on communication interaction on the first device.

[0039] The first interaction string can be obtained from the first tag string. This first interaction string can be provided to the second device, enabling the second device to obtain a second result string based on the first interaction string and its own generated information. The first device can establish a connection with itself using the first interaction string. It is important to note that the first business parameters cannot be derived from the first interaction string, thus ensuring the privacy and security of the first business parameters.

[0040] The first result string can be obtained based on the first label string, the initial random string, and the first binary string. The first result string can represent the first binary string, but the first binary string cannot be derived from the first result string. The first result string can be used to perform fragmented calculations with the second result string generated by the second device to determine whether the first service parameter is equal to the second service parameter in the second device.

[0041] It should be noted that the first label string, the initial random string, the first interaction string, and the first result string mentioned above are all binary strings.

[0042] In step S202, the first interaction string is sent to the second device so that the second device can obtain the second result string based on the second binary string obtained by converting the second service parameters of the second device, the initial random string, the randomly generated part of the second tag string, and the first interaction string.

[0043] In step S202, the first device performs a communication interaction with the second device, sending a first interaction string to the second device. After receiving the first interaction string, the second device can obtain a second result string based on the second binary string, the initial random string, the randomly generated part of the second tag string, and the received first interaction string.

[0044] The second service parameters include the service parameters of the second party to which the second device belongs. For details of the service parameters, please refer to the relevant descriptions in the above embodiments, which will not be repeated here.

[0045] The second binary string is the binary string obtained by converting the second business parameter. The second binary string includes 2 N The second binary string has the same number of bits as the first binary string.

[0046] The initial random string in the second device is the same as the initial random string in the first device. For details, please refer to the relevant descriptions in the above embodiments, which will not be repeated here.

[0047] The second tag string in the second device consists of a portion randomly generated by the second device and a portion derived from this randomly generated portion of the second tag string and the received first interaction string. The number of tags in the second tag string is the same as the number of bits in the second binary string. In some examples, the second device randomly generates 2... N -1 second tag string, the randomly generated second tag string can include the first second tag string to the second tag string. N -1 second tag string, the 2nd N The second tag string can be based on the first second tag string to the second... NThe second binary string is obtained by generating one second tag string and the first interaction string. For example, if the second binary string consists of 4 bits, the second device randomly generates 3 second tag strings. The fourth second tag string can be obtained based on the first 3 randomly generated second tag strings and the first interaction string. Each bit in the second binary string corresponds to one second tag string. The second tag strings can be used to identify the value of the corresponding bit in the second binary string. In some examples, the number of bits in each second tag string is the same as the number of bits in the second binary string, but this is not a limitation.

[0048] The second result string can be obtained based on the second binary string, the initial random string, the randomly generated second tag string, and the first interaction string. The second result string can represent the second binary string, but it cannot be derived by reversing the second binary string from the second result string. The second result string can be used to perform fragmented calculations with the first result string generated by the first device to determine whether the second service parameter is equal to the first service parameter in the first device.

[0049] It should be noted that both the second tag string and the second result string mentioned above are binary strings.

[0050] In step S203, the device interacts with the second device based on the first result string and the second result string to perform fragmented calculations and obtain the first comparison result.

[0051] Fragmented computation may include fragmented subtraction. A first device can fragment a first result string, and a second device can fragment a second result string. The first device and the second device perform a multi-party secure computation of fragmented subtraction to obtain a first comparison result. The first comparison result can indicate whether the first result string and the second result string are equal, thereby indicating whether the first service parameter and the second service parameter are equal. Fragmented computation involves only a few communication interactions between the first device and the second device, resulting in a very small number of communication interactions. For example: The first device can fragment the first result string to obtain a first fragment and a second fragment, and the sum of the first fragment and the second fragment is the first result string; the second device can fragment the second result string to obtain a third fragment and a fourth fragment, and the sum of the third fragment and the fourth fragment is the second result string; the first device and the second device exchange the first fragment and the third fragment; the first device calculates a first difference between the first fragment and the third fragment; the second device calculates a second difference between the fourth fragment and the second fragment; the first device sends the first difference to the second device, or the second device sends the second difference to the first device; the first device or the second device calculates the difference between the first difference and the second difference; if the difference is zero, the first comparison result indicates that the first service parameter and the second service parameter are equal; if the difference is not zero, the first comparison result indicates that the first service parameter and the second service parameter are not equal.

[0052] In this embodiment, the first device calculates a first interaction string and a first result string locally based on a first binary string, a first tag string, and an initial random string obtained from its own first service parameters, and sends the first interaction string to the second device. The second device calculates a second result string locally based on a second binary string, a second tag string, an initial random string, and the first interaction string obtained from its own second service parameters. The first and second devices interact based on the first and second result strings, performing fragmented calculations to obtain a first comparison result indicating whether the first and second service parameters are equal. Most of the calculations in this process are performed locally on both the first and second devices. The communication interaction between the first and second devices is minimal, occurring only during the transmission of the first interaction string and the fragmented calculation process, reducing the number of communication interactions between them and thus improving the efficiency of multi-party service parameter comparison. Furthermore, the plaintext of the first service parameters in the first device and the second service parameters in the second device terminal is not leaked, ensuring privacy and security, making it highly suitable for scenarios such as federated learning and secure intersection.

[0053] In some embodiments, the first interaction string and the first result string can be calculated using an XOR algorithm. Figure 3A flowchart illustrating a method for comparing business parameters provided in another embodiment of the first aspect of this application. Figure 3 and Figure 2 The difference is that, Figure 2 Step S201 can be further refined as follows: Figure 3 Steps S2011 to S2013 in the process.

[0054] In step S2011, the first interaction string is obtained by using the XOR algorithm based on the first tag string.

[0055] The number of tags in the first tag string is the same as the number of bits in the first binary string, which allows for 2... N The first interaction string is obtained by XORing the first tag strings. For example, if N=2, and the first device randomly generates four first tag strings, namely a0_0, a1_0, a2_0, and a3_0, then the first interaction string is... in, This is the XOR operator.

[0056] In step S2012, based on the first tag string and the initial random string, the XOR algorithm is used to obtain 2. N A third tag string.

[0057] The first tag string represents a bit in the first binary string with a value of 0. The third tag string represents a bit in the first binary string with a value of 1. The number of initial random strings is the same as the number of bits in the first binary string. The third tag string corresponding to each bit of the first binary string is obtained by XORing the first tag string and the initial random string. For example, if N=2, the first device randomly generates four first tag strings: a0_0, a1_0, a2_0, and a3_0; and four initial random strings: r0, r1, r2, and r3; then the four generated third tag strings are a0_1, a1_1, a2_1, and a3_1.

[0058] in, In this first binary string, the bits from left to right are the first to the fourth bits respectively. a0_0, a0_1 and r0 correspond to the first bit of the first binary string, a1_0, a1_1 and r1 correspond to the second bit of the first binary string, a2_0, a2_1 and r2 correspond to the third bit of the first binary string, and a3_0, a3_1 and r3 correspond to the fourth bit of the first binary string.

[0059] In step S2013, a first result string is obtained based on the first tag string, the third tag string, and the first binary string.

[0060] Each bit of the first binary string has a value of 0 or 1. Based on the value of the bits in the first binary string, a first tag string and / or a third tag string for XOR calculation can be determined. Specifically, the first device can select the first tag string and / or the third tag string corresponding to the bit values ​​in the first binary string; based on the selected first tag string and / or third tag string, the first result string is obtained using the XOR algorithm.

[0061] If a bit in the first binary string has a value of 0, the first tag string corresponding to that bit is selected; if a bit in the first binary string has a value of 1, the third tag string corresponding to that bit is selected. An XOR operation is performed on the selected first tag string and / or the third tag string to obtain the first result string. For example, if N = 2, corresponding to the four bits of the first binary string, the first tag strings are a0_0, a1_0, a2_0, and a3_0, and the third tag strings are a0_1, a1_1, a2_1, and a3_1. If the first binary string is 0001, the first bit has a value of 0, so the first tag string a0_0 is selected; the second bit has a value of 0, so the first tag string a1_0 is selected; the third bit has a value of 0, so the first tag string a2_0 is selected; and the fourth bit has a value of 1, so the third tag string a3_1 is selected. The first result string is...

[0062] In some embodiments, the second result string is obtained by the second device based on the second tag string, the fourth tag string, and the second binary string. The second tag string indicates that the corresponding bit in the second binary string has a value of 0. A portion of the second tag string is obtained by XORing a randomly generated portion of the second tag string and the first interaction string. The fourth tag string indicates that the corresponding bit in the second binary string has a value of 1. The fourth tag string is obtained by the second device by XORing the second tag string and the initial random string.

[0063] The number of the second tag string is the same as the number of bits in the second binary string. The second device randomly generates the first to the second tag string. N -1 second tag string, from the first second tag string to the second... N XORing the second tag string (-1) with the first interaction string yields the second tag string. NThere is a second tag string. For example, if N=2, the first interaction string is a_0, and the second device randomly generates 3 second tag strings, namely b0_0, b1_0, and b2_0, then the fourth second tag string...

[0064] The second tag string corresponding to each bit of the second binary string can be XORed with the initial random string to obtain the fourth tag string corresponding to each bit of the second binary string. For example, if N=2, the initial random strings are r0, r1, r2, and r3, and the second tag strings are b0_0, b1_0, b2_0, and b3_0, then the four generated fourth tag strings are b0_1, b1_1, b2_1, and b3_1, where... In this second binary string, the bits from left to right are the first to the fourth bits, respectively. b0_0, b0_1 and r0 correspond to the first bit of the second binary string, b1_0, b1_1 and r1 correspond to the second bit of the second binary string, b2_0, b2_1 and r2 correspond to the third bit of the second binary string, and b3_0, b3_1 and r3 correspond to the fourth bit of the second binary string.

[0065] Each bit of the second binary string has a value of 0 or 1. The second device can determine the second tag string and / or the fourth tag string for XOR calculation based on the bit values ​​of the second binary string. Specifically, the second device can select the second tag string and / or the fourth tag string corresponding to the bit values ​​in the second binary string; and use the XOR algorithm to obtain the second result string based on the selected second tag string and / or the fourth tag string.

[0066] If a bit in the second binary string has a value of 0, the second tag string corresponding to that bit is selected; if a bit in the second binary string has a value of 1, the fourth tag string corresponding to that bit is selected. An XOR operation is performed on the selected second tag string and / or the fourth tag string to obtain the second result string. For example, if N = 2, the second tag strings corresponding to the four bits of the second binary string are b0_0, b1_0, b2_0, and b3_0, and the fourth tag strings are b0_1, b1_1, b2_1, and b3_1. If the second binary string is 1001, the first bit has a value of 1, so the fourth tag string b0_1 is selected; the second bit has a value of 0, so the second tag string b1_0 is selected; the third bit has a value of 0, so the second tag string b2_0 is selected; and the fourth bit has a value of 1, so the fourth tag string b3_1 is selected. The second result string is...

[0067] In some embodiments, if the first service parameter and the second service parameter are not equal, it is also necessary to determine the size relationship between the first service parameter and the second service parameter. The first device and the second device can each perform a halving comparison of the first binary string and the second binary string. This halving comparison refers to dividing the first binary string and the second binary string into high-order strings and low-order strings with equal numbers of bits, respectively. The high-order strings of the first binary string and the high-order strings of the second binary string are compared, and the low-order strings of the first binary string and the low-order strings of the second binary string are compared. The comparison between high-order strings and the comparison between low-order strings can also be performed in the manner described in the above embodiments, comparing whether the first service parameter and the second service parameter are equal. If at least one of the high-order strings and the low-order strings is not equal, the halving comparison can be performed again on the unequal high-order strings and / or low-order strings until the number of bits in the newly obtained high-order strings and low-order strings is 1. The size relationship between the first service parameter and the second service parameter can be determined by the value of this single bit.

[0068] Figure 4 A flowchart illustrating a method for comparing business parameters provided in another embodiment of the first solution of this application. Figure 4 and Figure 2 The difference is that the comparison method for business parameters may also include steps S204 to S211.

[0069] In step S204, if the first comparison result indicates that the first service parameter and the second service parameter are not equal, the first binary string is split in the middle to obtain two first target strings.

[0070] The first target string consists of a high-order string and a low-order string; that is, one of the two first target strings is the high-order string, and the other is the low-order string. The high-order string is located at the relatively high position of the string being segmented, and the low-order string is located at the relatively low position of the string being segmented. For example, if the first target string is 01101010, and this first target string has 8 bits, from left to right (high-order to low-order), these are the first to eighth bits. The first four bits, corresponding to 0110, are the high-order string, and the fifth to eighth bits, corresponding to 1010, are the low-order string.

[0071] In step S205, based on the first target string, the first tag string corresponding to the first target string, and the initial random string, the target interaction string and the first target result string corresponding to the first target string are obtained.

[0072] The first device can execute step S205 on the high-order string and the low-order string respectively. The first device can obtain the target interaction string and the first target result string corresponding to the high-order string based on the high-order string, the first tag string corresponding to the high-order string, and the initial random string corresponding to the high-order string. The first device can obtain the target interaction string and the first target result string corresponding to the low-order string based on the low-order string, the first tag string corresponding to the low-order string, and the initial random string corresponding to the low-order string.

[0073] The target interaction string can be obtained from the first tag string corresponding to the first target string. This target interaction string can be provided to the second device so that the second device can obtain the second target result string based on the target interaction string and its own generated information. The first device can establish a connection with itself using the target interaction string. It is important to note that the first target string cannot be derived from the target interaction string.

[0074] The first target result string can be obtained based on the first target string, the first tag string corresponding to the first target string, and the initial random string corresponding to the first target string. The first target result string can represent the first target result string, but the first target string cannot be derived from it. The first target result string can be used to perform fragmented calculations with the second result string generated by the second device to determine whether the first target string is equal to the second target string in the second device.

[0075] The calculation in step S205 is similar to that in steps S201 and S2011 to S2013 in the above embodiments, and can be found in the relevant content in the above embodiments. The target interaction string can be obtained by using an XOR algorithm based on the first tag string corresponding to the first target string; the third tag string corresponding to the first target string can be obtained by using an XOR algorithm based on the first tag string corresponding to the first target string and the initial random string corresponding to the first target string; and the first target result string is obtained based on the first tag string corresponding to the first target string, the third tag string corresponding to the first target string, and the first target string. Here, the third target string corresponding to the first target string can also be directly obtained from the third tag string calculated in step S2012.

[0076] For example, if N=2, then the number of bits in the first target string is 2. If the four first tag strings in the first device are a0_0, a1_0, a2_0, and a3_0, and the initial random strings are r0, r1, r2, and r3, then the first tag strings corresponding to the high-order bits include a0_0 and a1_0, and the target interaction string corresponding to the high-order bits... The initial random strings corresponding to the high-order strings are r0 and r1, and the third tag strings corresponding to the high-order strings are a0_1 and a1_1, respectively. The first tag strings corresponding to the low-order strings include a2_0 and a3_0, and the target interaction strings corresponding to the low-order strings are... The initial random strings corresponding to the lower-order strings are r2 and r3, and the third tag strings corresponding to the lower-order strings are a2_1 and a3_1, respectively. If the value of a bit in the first target string is 0, then the first tag string corresponding to that bit is selected; if the value of a bit in the first target string is 1, then the third tag string corresponding to that bit is selected; an XOR algorithm is performed on the selected first tag string and / or third tag string to obtain the first target result string. If the high-order string is 0 or 1, the first target result string corresponding to the high-order string is... If the lower-order string is 10, the first target result string corresponding to the lower-order string.

[0077] In step S206, the target interaction string is sent to the second device so that the second device can obtain the second target result string corresponding to the second target string based on the second target string, the target interaction string, the part of the second tag string corresponding to the second target string, and the initial random string.

[0078] The second target string includes the high-order string and the low-order string obtained by splitting the second binary string from the middle; that is, one second target string is the high-order string, and the other is the low-order string. The specific contents of the high-order and low-order strings can be found in the relevant descriptions in the above embodiments, and will not be repeated here.

[0079] The second device can obtain a second target result string corresponding to the second target string based on the second target string, the target interaction string, a portion of the second tag string corresponding to the second target string, and an initial random string. The second device can also obtain the second target result string corresponding to the high-order string based on the high-order string obtained from segmenting the second binary string, the target interaction string, the second tag string corresponding to the high-order string, and the initial random string corresponding to the high-order string. Finally, the second device can obtain the second target result string corresponding to the low-order string based on the low-order string obtained from segmenting the second binary string, the target interaction string, the second tag string corresponding to the low-order string, and the initial random string corresponding to the low-order string.

[0080] The second target result string can be obtained based on the second target string, the target interaction string, the second tag string corresponding to the second target string, and the initial random string corresponding to the second target string. The second target result string can characterize the second target result string, but it cannot be derived by working backward from it. The second target result string can be used to perform fragmented calculations with the first result string generated by the first device to determine whether the second target string is equal to the first target string in the first device.

[0081] In step S207, the second device interacts with the first target result string and the second target string to perform fragmented calculations and obtain comparison sub-results.

[0082] The specific details of fragmented computation can be found in the relevant content of the above embodiments, and will not be repeated here. The comparison sub-result can characterize whether the first target string and the second target string are equal.

[0083] In step S208, if the comparison sub-result indicates that the first target string and the second target string are not equal, the first target string is split in the middle to obtain a new first target string, and a new comparison sub-result is obtained based on the new first target string.

[0084] The new first target string may include the high-order and low-order strings obtained by splitting the original first target string in the middle. The step of obtaining a new comparison sub-result based on the new first target string may include: obtaining a new target interaction string and a new first target result string corresponding to the new first target string based on the new first target string, the first tag string corresponding to the new first target string, and the initial random string; sending the new target interaction string to the second device, so that the second device, based on the new second target string, the new target interaction string, a portion of the second tag string corresponding to the new second target string, and the initial random string, obtains a new second target result string corresponding to the new second target string; and interacting with the second device based on the new first target result string and the new second target result string to perform fragmented computation and obtain a new comparison sub-result.

[0085] The above steps can be repeated until a new comparison result indicates that the new first target string and the new second target string are equal, or until the new first target string is a single binary digit, and a second comparison result is obtained. The second comparison result can represent the size relationship between the first business parameter and the second business parameter. Specifically, the second comparison result indicates that the first business parameter is greater than the second business parameter or the first business parameter is less than the second business parameter.

[0086] That is, if the new comparison result indicates that the new first target string and the new second target string are equal, proceed to step S209; if the new comparison result indicates that the new first target string and the new second target string are not equal, proceed to step S210.

[0087] In step S209, the new first target string is not processed. Correspondingly, the second device also does not process the new second target string.

[0088] If the new first target string is equal to the new second target string, there is no point in continuing the comparison. Therefore, no further processing of the new first target string and the new second target string is required.

[0089] In step S210, it is determined whether the number of bits in the new first target string is 1.

[0090] The number of bits in the new first target string is equal to the number of bits in the new second target string. If the number of bits in the new first target string is not equal to the number of bits in the new second target string, further comparison is needed to determine the size relationship between the new first target string and the new second target string, and thus the size relationship between the first business parameter and the second business parameter. If the number of bits in both the new first target string and the new second target string is 1, the second comparison result can be obtained directly. If the number of bits in both the new first target string and the new second target string is not 1, a binary comparison is needed, repeating the steps above to obtain the new first target result string and the new second target result string.

[0091] That is, if the number of bits in the new first target string and the new second target string is 1, proceed to step S211; if the number of bits in the new first target string and the new second target string is not 1, return to step S208, and proceed to step S208 to split the first target string in the middle to obtain a new first target string. Based on the new first target string, obtain the content of the new comparison sub-result.

[0092] In step S211, a second comparison result is obtained based on the new first target result string and the new second target result string.

[0093] If the number of bits in the new first target string and the new second target string is 1, and the new first target string and the new second target string are not equal, then one of the new first target string and the other is 1, and 1 > 0, so the second comparison result can be obtained.

[0094] In some examples, when the new second target string is a single binary number, the second tag string corresponding to the new second target string is obtained by the second device based on the original second tag string corresponding to the new second target string and the new target interaction string, and the fourth tag string corresponding to the new second target string is obtained by the second device based on the updated second tag string corresponding to the new second target string and the initial random string.

[0095] For example, if N=2, and the third bit of the second binary string is the new second target string, then the updated second tag string corresponding to the new second target string... The b2_0 on the left side of the equals sign represents the updated second tag string corresponding to the new second target string, while the b2_0 on the right side represents the original second tag string corresponding to the new second target string. The a_0 on the right side of the equals sign represents the new target interaction string; correspondingly, the fourth tag string corresponds to the new second target string. b2_0 on the right side of the equals sign is the updated second label string corresponding to the new second target string, and r2 on the right side of the equals sign is the initial random string corresponding to the new second target string.

[0096] In the above embodiments, when it is necessary to obtain the size relationship between the first business parameter and the second business parameter, a binary comparison method can be used to determine the relationship step by step. The calculation associated with the first target string and the second target string obtained by each halving can be executed in parallel, shortening the calculation time and thus further improving the efficiency of business parameter comparison.

[0097] A second aspect of this application provides a method for comparing service parameters, which can be applied to a second device, i.e., the method for comparing service parameters can be executed by the second device. Figure 5 A flowchart of a method for comparing business parameters provided in an embodiment of the second aspect of this application is shown below. Figure 5 As shown, the comparison method for the business parameters may include steps S301 to S303.

[0098] In step S301, the first interaction string sent by the first device is received.

[0099] The first interaction string is obtained by the first device based on N randomly generated first tag strings.

[0100] In step S302, the second result string is obtained by converting the second binary string obtained from the second service parameters of the second device, the initial random string, the randomly generated part of the second tag string, and the first interaction string.

[0101] The second binary string includes 2 NThere are 10 bits, where N is a positive integer.

[0102] In step S303, the device interacts with the first device based on the first result string and the second result string to perform fragmented calculations and obtain the first comparison result.

[0103] The first result string is obtained from the first binary string converted by the first device based on the first service parameters, the first tag string, and N initial random strings agreed upon by the first device and the second device. The first comparison result indicates whether the first service parameters and the second service parameters are equal. The first binary string includes 2 N 1 bit.

[0104] In some examples, N ≥ 4.

[0105] The specific details of steps S301 to S303 can be found in the relevant descriptions in the above embodiments, and will not be repeated here.

[0106] In this embodiment, the first device calculates a first interaction string and a first result string locally based on a first binary string, a first tag string, and an initial random string obtained from its own first service parameters, and sends the first interaction string to the second device. The second device calculates a second result string locally based on a second binary string, a second tag string, an initial random string, and the first interaction string obtained from its own second service parameters. The first and second devices interact based on the first and second result strings, performing fragmented calculations to obtain a first comparison result indicating whether the first and second service parameters are equal. Most of the calculations in this process are performed locally on both the first and second devices. The communication interaction between the first and second devices is minimal, occurring only during the transmission of the first interaction string and the fragmented calculation process, reducing the number of communication interactions between them and thus improving the efficiency of multi-party service parameter comparison. Furthermore, the plaintext of the first service parameters in the first device and the second service parameters in the second device terminal is not leaked, ensuring privacy and security, making it highly suitable for scenarios such as federated learning and secure intersection.

[0107] Figure 6 A flowchart illustrating a method for comparing business parameters provided in another embodiment of the second aspect of this application. Figure 6 and Figure 5 The difference is that, Figure 5 Step S302 can be further refined as follows: Figure 6 Steps S3021 to S3023 in the process.

[0108] In step S3021, based on a randomly generated portion of the second tag string and the first interaction string, an XOR algorithm is used to obtain another portion of the second tag string.

[0109] In step S3022, the fourth tag string is obtained based on the second tag string and the initial random string.

[0110] The second tag string indicates that the corresponding bit in the second binary string has a value of 0. The fourth tag string indicates that the corresponding bit in the second binary string has a value of 1.

[0111] In step S3023, a second result string is obtained based on the second tag string, the fourth tag string, and the second binary string.

[0112] In some examples, the second device may select a second tag string and / or a fourth tag string corresponding to the bit values ​​in the second binary string; and based on the selected second tag string and / or fourth tag string, use an XOR algorithm to obtain a second result string.

[0113] The specific details of steps S3021 to S3023 can be found in the relevant descriptions in the above embodiments, and will not be repeated here.

[0114] In some embodiments, the first result string is obtained by the first device based on the first tag string, the third tag string, and the first binary string. The first tag string indicates that the value of the corresponding bit in the first binary string is 0. The third tag string indicates that the value of the corresponding bit in the first binary string is 1, and the third tag string is obtained by the first device using an XOR algorithm based on the first tag string and the initial random string.

[0115] Figure 7 A flowchart illustrating a method for comparing business parameters provided in yet another embodiment of the second aspect of this application. Figure 7 and Figure 5 The difference is that, Figure 7 The comparison method for the business parameters shown may also include steps S304 to S311.

[0116] In step S304, if the first comparison result indicates that the first business parameter and the second business parameter are not equal, the second binary string is split in the middle to obtain two second target strings.

[0117] The second target string consists of a high-order string and a low-order string.

[0118] In step S305, the target interaction string sent by the first device is received.

[0119] The target interaction string is obtained by the first device based on the first target string, the first tag string corresponding to the first target string, and an initial random string. The first target string includes the high-order and low-order strings obtained by splitting the first binary string in the middle.

[0120] In step S306, based on the second target string, the target interaction string, the second tag string corresponding to the second target string, and the initial random string, the second target result string corresponding to the second target string is obtained.

[0121] In step S307, the device interacts with the first device based on the first target result string and the second target result string to perform fragmented calculations and obtain comparison sub-results.

[0122] The comparison result indicates whether the first target string and the second target string are equal.

[0123] In step S308, if the comparison sub-result indicates that the first target string and the second target string are not equal, the second target string is split in the middle to obtain a new second target string, and a new comparison sub-result is obtained based on the new second target string.

[0124] The new second target string may include the high-order and low-order strings obtained by splitting the original second target string in the middle. The step of obtaining a new comparison sub-result based on the new second target string may include: obtaining a new second target result string corresponding to the new second target string based on the new second target string, the new target interaction string, the second label string corresponding to the new second target string, and the initial random string; and interacting with the first device based on the new first target result string and the new second target result string to perform fragmented calculations and obtain a new comparison sub-result.

[0125] The above steps can be repeated until a new comparison result indicates that the new first target string is equal to the new second target string, or until the new second target string is a single binary digit, and a second comparison result is obtained. The second comparison result indicates that the first business parameter is greater than the second business parameter or the first business parameter is less than the second business parameter.

[0126] That is, if the new comparison result indicates that the new first target string and the new second target string are equal, proceed to step S309; ​​if the new comparison result indicates that the new first target string and the new second target string are not equal, proceed to step S310.

[0127] In step S309, the new second target string is not processed. Correspondingly, the first device also does not process the new first target string.

[0128] In step S310, it is determined whether the number of bits in the new second target string is 1.

[0129] The number of bits in the new second target string is equal to the number of bits in the new first target string. If the number of bits in the new first target string is not equal to the number of bits in the new second target string, further comparison is needed to determine the size relationship between the new first target string and the new second target string, and thus the size relationship between the first business parameter and the second business parameter. If the number of bits in both the new first target string and the new second target string is 1, the second comparison result can be obtained directly. If the number of bits in both the new first target string and the new second target string is not 1, a binary comparison is needed, repeating the steps above to obtain the new first target result string and the new second target result string.

[0130] That is, if the number of bits in the new first target string and the new second target string is 1, execute step S311; if the number of bits in the new first target string and the new second target string is not 1, return to step S308, execute step S308 to split the second target string in the middle to obtain a new second target string, and obtain the content of the new comparison sub-result based on the new second target string.

[0131] In step S311, a second comparison result is obtained based on the new first target result string and the new second target result string.

[0132] In some examples, when the new second target string is a single binary number, the second device can obtain the updated second tag string corresponding to the new second target string based on the original second tag string corresponding to the new second target string and the new target interaction string; and obtain the fourth tag string corresponding to the new second target string based on the updated second tag string corresponding to the new second target string and the initial random string. For details, please refer to the relevant descriptions in the above embodiments, which will not be repeated here.

[0133] The specific details of steps S304 to S311 can be found in the relevant descriptions in the above embodiments, and will not be repeated here.

[0134] To facilitate understanding, the following two specific examples illustrate the comparison process of business parameters.

[0135] The comparison process of business parameters will be explained using an example where the first business parameter and the second business parameter are equal. Assume the first business parameter is 9, the second business parameter is 9, and the first binary string and the second binary string, converted from the first and second business parameters, both have 4 bits each. Both the first and second binary strings are 1001. This comparison process can include steps c1 to c11.

[0136] In step c1, the first device and the second device obtain random number seeds using the DH algorithm. Each device then uses its seed to randomly generate initial random strings r0, r1, r2, and r3. r0 corresponds to the first bit of the first binary string, r1 to the second bit, r2 to the third bit, and r3 to the fourth bit. Specifically, r0 = 1111, r1 = 1101, r2 = 1100, and r3 = 1010.

[0137] In step c2, the first device randomly generates four first tag strings: a0_0, a1_0, a2_0, and a3_0. a0_0 corresponds to the first bit of the first binary string, a1_0 corresponds to the second bit, a2_0 corresponds to the third bit, and a3_0 corresponds to the fourth bit. Specifically, a0_0 = 0001, a1_0 = 1001, a2_0 = 1110, and a3_0 = 1001.

[0138] In step c3, the first device performs an XOR operation on the first tag string and the initial random string corresponding to the same bit position, obtaining four third tag strings: a0_1, a1_1, a2_1, and a3_1. a0_1 corresponds to the first bit of the first binary string, a1_1 corresponds to the second bit, a2_1 corresponds to the third bit, and a3_1 corresponds to the fourth bit.

[0139] In step c4, the first device performs an XOR operation on the four first tag strings a0_0, a1_0, a2_0, and a3_0 to obtain the first interaction string a_0. Wherein,

[0140] In step c5, the first device sends the first interaction string a_0 to the second device.

[0141] In step c6, the second device randomly generates three second tag strings: b0_0, b1_0, and b2_0. b0_0 corresponds to the first bit of the second binary string, b1_0 corresponds to the second bit of the second binary string, and b2_0 corresponds to the third bit of the second binary string. Specifically, b0_0 = 1011, b1_0 = 0011, and b2_0 = 1010.

[0142] In step c7, the second device performs an XOR operation on the second tag strings b0_0, b1_0, b2_0 and the first interaction string a_0 to obtain the fourth second tag string b3_0.

[0143]

[0144] In step c8, the second device performs an XOR operation on the second tag string and the initial random string corresponding to the same bit position, obtaining four fourth tag strings: b0_1, b1_1, b2_1, and b3_1. b0_1 corresponds to the first bit of the second binary string, b1_1 corresponds to the second bit of the second binary string, b2_1 corresponds to the third bit of the second binary string, and b3_1 corresponds to the fourth bit of the second binary string.

[0145] In step c9, the first device selects the third tag string a0_1, the first tag string a1_0, the first tag string a2_0, and the third tag string a3_1 based on the first binary string 1001, and performs an XOR operation on the selected first tag string and the third tag string to obtain the first result string z_a.

[0146] In step c10, the second device selects the fourth tag string b0_1, the second tag string b1_0, the second tag string b2_0, and the fourth tag string b3_1 based on the second binary string 1001, and performs an XOR operation on the selected second tag string and the fourth tag string to obtain the second result string z_b.

[0147] In step c11, the first device and the second device interact based on the first result string and the second result string to perform fragmented calculations and obtain a first comparison result. The first comparison result indicates that the first service parameter and the second service parameter are equal.

[0148] The comparison process for business parameters will be further illustrated using an example where the first and second business parameters are not equal. Assume the first and second business parameters are both 9, and the first and second binary strings obtained from the conversion of the first and second business parameters each have 4 bits. The first binary string is 1000, and the second binary string is 1001. The comparison process for these business parameters may include steps d1 to d34.

[0149] In step d1, the first device and the second device obtain random number seeds using the DH algorithm. Each device then uses its seed to randomly generate initial random strings r0, r1, r2, and r3. r0 corresponds to the first bit of the first binary string, r1 to the second bit, r2 to the third bit, and r3 to the fourth bit. Specifically, r0 = 1111, r1 = 1101, r2 = 1100, and r3 = 1010.

[0150] In step d2, the first device randomly generates four first tag strings: a0_0, a1_0, a2_0, and a3_0. a0_0 corresponds to the first bit of the first binary string, a1_0 corresponds to the second bit, a2_0 corresponds to the third bit, and a3_0 corresponds to the fourth bit. Specifically, a0_0 = 0001, a1_0 = 1001, a2_0 = 1110, and a3_0 = 1001.

[0151] In step d3, the first device performs an XOR operation on the first tag string and the initial random string corresponding to the same bit position, obtaining four third tag strings a0_1, a1_1, a2_1, and a3_1. a0_1 corresponds to the first bit of the first binary string, a1_1 corresponds to the second bit, a2_1 corresponds to the third bit, and a3_1 corresponds to the fourth bit.

[0152] In step d4, the first device performs an XOR operation on the four first tag strings a0_0, a1_0, a2_0, and a3_0 to obtain the first interaction string a_0. Wherein,

[0153] In step d5, the first device sends the first interaction string a_0 to the second device.

[0154] In step d6, the second device randomly generates three second tag strings: b0_0, b1_0, and b2_0. b0_0 corresponds to the first bit of the second binary string, b1_0 corresponds to the second bit of the second binary string, and b2_0 corresponds to the third bit of the second binary string. Specifically, b0_0 = 1011, b1_0 = 0011, and b2_0 = 1010.

[0155] In step d7, the second device performs an XOR operation on the second tag strings b0_0, b1_0, b2_0 and the first interaction string a_0 to obtain the fourth second tag string b3_0.

[0156]

[0157] In step d8, the second device performs an XOR operation on the second tag string and the initial random string corresponding to the same bit position, obtaining four fourth tag strings: b0_1, b1_1, b2_1, and b3_1. b0_1 corresponds to the first bit of the second binary string, b1_1 corresponds to the second bit, b2_1 corresponds to the third bit, and b3_1 corresponds to the fourth bit.

[0158] In step d9, the first device selects the third tag string a0_1, the first tag string a1_0, the first tag string a2_0, and the first tag string a3_0 based on the first binary string 1000, and performs an XOR operation on the selected first tag string and the third tag string to obtain the first result string z_a.

[0159] In step d10, the second device selects the fourth tag string b0_1, the second tag string b1_0, the second tag string b2_0, and the fourth tag string b3_1 based on the second binary string 1001, and performs an XOR operation on the selected second tag string and the fourth tag string to obtain the second result string z_b.

[0160] In step d11, the first device and the second device interact based on the first result string and the second result string to perform fragmented calculations and obtain a first comparison result. The first comparison result indicates that the first service parameter and the second service parameter are not equal.

[0161] In step d12, the first device splits the first binary string 1000 into a high-order string 10 and a low-order string 00.

[0162] In step d13, the first device obtains the first target result string corresponding to the high-order string 10 based on the third tag string a0_1 corresponding to the high-order string 10 and the first tag string a1_0.

[0163] In step d14, the first device obtains the target interaction item a_01 corresponding to the high-order string 10 based on the first tag strings a0_0 and a1_0 corresponding to the high-order string 10.

[0164] In step d15, the first device sends the target interaction string a_01 corresponding to the high-order string to the second device.

[0165] In step d16, the second device splits the second binary string 1001 into a high-order string 10 and a low-order string 01.

[0166] In step d17, the second device obtains the second tag string b1_0 corresponding to the second bit of the second binary string based on the second tag string b0_0 corresponding to the first bit of the second binary string and the received target interaction string a_01.

[0167] In step d18, the second device obtains the corresponding fourth tag strings b0_1 and b1_1 based on the second tag strings b0_0 and b1_0, and the initial random strings r0 and r1.

[0168]

[0169] In step d19, the second device obtains the second target result string corresponding to the high-order string 10 based on the fourth tag string b0_1 and the second tag string b1_0 corresponding to the high-order string 10.

[0170] In step d20, the first device and the second device interact based on the first target result string z_a1 and the second target result string z_b1 to perform fragmented calculations and obtain comparison sub-results. The comparison sub-results indicate that the high-order string 10 of the first binary string is equal to the high-order string 10 of the second binary string.

[0171] In step d21, the first device can repeat the calculations similar to steps d13 to d15 above for the low-order string 00 to obtain the first target result string z_a2; the second device can repeat the calculations similar to steps d17 to d19 above for the low-order string 01 to obtain the second target result string z_b2.

[0172] In step d22, the first device and the second device interact based on the first target result string z_a1 and the second target result string z_b1 to perform fragmented calculations and obtain comparison sub-results. The comparison sub-results indicate that the low-order string 00 of the first binary string is not equal to the low-order string 01 of the second binary string.

[0173] In step d23, the first device splits the unequal low-order string 00 into a new high-order string 0 and a new low-order string 0. The new high-order string 0 is the third bit of the first binary string, and the new low-order string 0 is the fourth bit of the first binary string.

[0174] In step d24, the first device obtains a new target interaction string a_021 based on the first tag string a2_0 corresponding to the third bit of the first binary number. Where a_021 = a2_0 = 1110.

[0175] In step d25, the first device obtains the third tag string a2_1 based on the first tag string a2_0 and the initial random string r2.

[0176] In step d26, the first device obtains a new first target result string z_a21 based on the first tag string a2_0 corresponding to the new high-order string 0. Here, z_a21 = a2_0 = 1110.

[0177] In step d27, the first device sends the new target interaction string a_021 to the second device.

[0178] In step d28, the second device splits the unequal low-order string 01 into a new high-order string 0 and a new low-order string 1. The new high-order string 0 is the third bit of the second binary string, and the new low-order string 1 is the fourth bit of the second binary string.

[0179] In step d29, the second device updates the second tag string b2_0 based on the new target interaction string a_021 and the original second tag string b2_0. The original second tag string b2_0 = 1010, and the updated second tag string...

[0180] In step d30, the second device obtains the fourth tag string based on the updated second tag string b2_0 and the initial random string r2.

[0181] In step d31, the second device obtains the new first target result string z_b21 based on the second tag string b2_0 corresponding to the new high-order string 0. Where z_b21 =

[0182] b2_0 = 1110.

[0183] In step d32, the first device and the second device interact based on the first target result string z_a21 and the second target result string z_b21 to perform fragmented calculations and obtain comparison sub-results. The comparison sub-results indicate that the value 0 of the third bit in the first binary string is equal to the value 0 of the third bit in the second binary string.

[0184] In step d33, the first device can repeat the calculations similar to steps d24 to d27 above for the new low-order string 0 (i.e., the value of the fourth bit of the first binary string) to obtain the first target result string z_a22; the second device can repeat the calculations similar to steps d29 to d32 above for the new low-order string 1 (i.e., the value of the fourth bit of the second binary string) to obtain the second target result string z_b22.

[0185] In step d34, the first device and the second device interact based on the first target result string z_a21 and the second target result string z_b21 to perform fragmented calculations and obtain a second comparison result. The second comparison result indicates that the first service parameter is less than the second service parameter.

[0186] The method for comparing business parameters in this application can be applied to various scenarios that require comparison of business parameters, which will not be described in detail here.

[0187] In some examples, in scenarios where neural networks are used to train business models, the rectified linear unit (ReLU) f(x) = max(0, wx + b) can be used as the activation function of neurons in the neural network to define the non-linear output of the neuron after the linear transformation wx + b. For the input vector from the previous layer of the neural network entering the neuron, the neuron using this activation function will output max(0, wx + b). The rectified linear unit has sparsity, which allows the sparsed model to better mine relevant features and fit the training data. Figure 8 A schematic diagram of an example linear rectification function provided in an embodiment of this application, in Figure 8In the x>0 region of a neural network, gradient saturation and vanishing gradients do not occur, and the computational complexity is low, requiring no exponential operations; a threshold is sufficient to obtain the activation value. The hidden layers in a neural network choose a linear rectified function as the activation function, ensuring that the gradient is always 1 when z is greater than zero, thus improving the computational speed of the gradient descent algorithm. Variants derived from this linear rectified function, such as PRelu (Parametric Rectified Linear Unit) and LRelu (Leaky ReLU), can also be used as activation functions for neurons. The activation function formula requires comparing 0 and wx+b to determine their relationship; during this comparison, it is necessary to prevent wx+b from leaking.

[0188] In some examples, business processes require the use of functions like the sigmoid function, which necessitates comparing business parameters. Alternatively, business processes may require comparisons to distinguish the boundaries of piecewise functions. Furthermore, in the Private Set Intersection (PSI) stage of deep learning scenarios, the dense state determination of the intersection is necessary, which also requires comparing certain business parameters.

[0189] A third aspect of this application provides a first device. Figure 9 A schematic diagram of the structure of the first device provided in an embodiment of the third aspect of this application is shown below. Figure 9 As shown, the first device 400 includes a local computing module 401 and a communication module 402.

[0190] The local computing module 401 can be used to convert the first binary string obtained from the first service parameters of the first device and the randomly generated 2 N The first tag string and the 2 agreed upon by the first device and the second device N Given an initial random string, we obtain a first interactive string and a first result string. The first binary string includes 2... N There are 10 bits, where N is a positive integer.

[0191] Communication module 402 is used to send the first interaction string to the second device, so that the second device, based on the second binary string obtained by converting the second service parameters of the second device, the initial random string, the randomly generated part of the second tag string, and the first interaction string, obtains a second result string. The second binary string includes 2 N 1 bit.

[0192] The communication module 402 and the local computing module 401 are also used to interact with the second device based on the first result string and the second result string to perform fragmented calculations and obtain the first comparison result.

[0193] The first comparison result indicates whether the first business parameter is equal to the second business parameter.

[0194] In some examples, N ≥ 4.

[0195] In this embodiment, the first device calculates a first interaction string and a first result string locally based on a first binary string, a first tag string, and an initial random string obtained from its own first service parameters, and sends the first interaction string to the second device. The second device calculates a second result string locally based on a second binary string, a second tag string, an initial random string, and the first interaction string obtained from its own second service parameters. The first and second devices interact based on the first and second result strings, performing fragmented calculations to obtain a first comparison result indicating whether the first and second service parameters are equal. Most of the calculations in this process are performed locally on both the first and second devices. The communication interaction between the first and second devices is minimal, occurring only during the transmission of the first interaction string and the fragmented calculation process, reducing the number of communication interactions between them and thus improving the efficiency of multi-party service parameter comparison. Furthermore, the plaintext of the first service parameters in the first device and the second service parameters in the second device terminal is not leaked, ensuring privacy and security, making it highly suitable for scenarios such as federated learning and secure intersection.

[0196] In some embodiments, the local computing module 401 is configured to: obtain a first interaction string based on a first tag string using an XOR algorithm; and obtain 2 based on the first tag string and an initial random string using an XOR algorithm. N A third tag string is given, the first tag string indicates that the corresponding bit value in the first binary string is 0, and the third tag string indicates that the corresponding bit value in the first binary string is 1; based on the first tag string, the third tag string, and the first binary string, the first result string is obtained.

[0197] In some examples, the local calculation module 401 is used to: select a first tag string and / or a third tag string corresponding to the bit values ​​in the first binary string; and obtain a first result string based on the selected first tag string and / or third tag string using an XOR algorithm.

[0198] In some embodiments, the second result string is obtained by the second device based on the second tag string, the fourth tag string, and the second binary string. The second tag string indicates that the corresponding bit value in the second binary string is 0. A portion of the second tag string is obtained by XORing another randomly generated portion of the second tag string and the first interaction string. The fourth tag string indicates that the corresponding bit value in the second binary string is 1. The fourth tag string is obtained by the second device by XORing the second tag string and the initial random string.

[0199] In some embodiments, the local computing module 401 can also be used to: when the first comparison result indicates that the first service parameter and the second service parameter are not equal, split the first binary string in the middle to obtain two first target strings, the first target strings including high-order strings and low-order strings; and obtain the target interaction string and the first target result string corresponding to the first target string based on the first target string, the first tag string corresponding to the first target string and the initial random string.

[0200] Communication module 402 can also be used to: send the target interaction string to the second device, so that the second device can obtain a second target result string corresponding to the second target string based on the second target string, the target interaction string, the second tag string corresponding to the second target string, and the initial random string. The second target string includes the high-order string and low-order string obtained by splitting the second binary string in the middle.

[0201] The local computing module 401 and the communication module 402 can also be used to: interact with the second device based on the first target result string and the second target string, perform fragmented calculations, and obtain comparison sub-results, which represent whether the first target string and the second target string are equal.

[0202] The local computing module 401 and the communication module 402 can also be used to: when the comparison sub-result indicates that the first target string and the second target string are not equal, split the first target string in the middle to obtain a new first target string, obtain a new comparison sub-result based on the new first target string, until the new comparison sub-result indicates that the new first target string and the new second target string are equal, or until the new first target string is a single binary number, and obtain a second comparison result, the second comparison result indicating that the first service parameter is greater than the second service parameter or the first service parameter is less than the second service parameter.

[0203] In some embodiments, when the new second target string is a single binary digit, the second tag string corresponding to the new second target string is updated by the second device based on the original second tag string corresponding to the new second target string and the new target interaction string. The fourth tag string corresponding to the new second target string is obtained by the second device based on the updated second tag string corresponding to the new second target string and the initial random string.

[0204] A third aspect of this application provides a second device. Figure 10 This is a schematic diagram of the structure of the second device provided in an embodiment of the fourth aspect of this application, as shown below. Figure 10 As shown, the second device 500 includes a communication module 501 and a local computing module 502.

[0205] The communication module 501 can be used to receive a first interaction string sent by the first device. The first interaction string is obtained by the first device based on N randomly generated first tag strings.

[0206] The local computing module 502 can be used to obtain a second result string based on the second binary string obtained from the second service parameters of the second device, the initial random string, the randomly generated part of the second tag string, and the first interaction string. The second binary string includes 2 N There are 10 bits, where N is a positive integer.

[0207] The communication module 501 and the local computing module 502 can also be used to interact with the first device based on the first result string and the second result string to perform fragmented calculations and obtain a first comparison result. The first result string is obtained from a first binary string converted by the first device based on the first service parameters of the first device, a first tag string, and N initial random strings agreed upon by the first device and the second device. The first comparison result indicates whether the first service parameters and the second service parameters are equal. The first binary string includes 2... N 1 bit.

[0208] In some examples, N ≥ 4.

[0209] In this embodiment, the first device calculates a first interaction string and a first result string locally based on a first binary string, a first tag string, and an initial random string obtained from its own first service parameters, and sends the first interaction string to the second device. The second device calculates a second result string locally based on a second binary string, a second tag string, an initial random string, and the first interaction string obtained from its own second service parameters. The first and second devices interact based on the first and second result strings, performing fragmented calculations to obtain a first comparison result indicating whether the first and second service parameters are equal. Most of the calculations in this process are performed locally on both the first and second devices. The communication interaction between the first and second devices is minimal, occurring only during the transmission of the first interaction string and the fragmented calculation process, reducing the number of communication interactions between them and thus improving the efficiency of multi-party service parameter comparison. Furthermore, the plaintext of the first service parameters in the first device and the second service parameters in the second device terminal is not leaked, ensuring privacy and security, making it highly suitable for scenarios such as federated learning and secure intersection.

[0210] In some embodiments, the local computing module 502 may be used to: obtain another part of the second tag string based on a randomly generated portion of the second tag string and the first interaction string using an XOR algorithm; obtain a fourth tag string based on the second tag string and the initial random string, wherein the second tag string represents that the corresponding bit in the second binary string has a value of 0, and the fourth tag string represents that the corresponding bit in the second binary string has a value of 1; and obtain a second result string based on the second tag string, the fourth tag string, and the second binary string.

[0211] In some examples, the local computation module 502 can be used to: select a second tag string and / or a fourth tag string corresponding to the bit values ​​in the second binary string; and obtain a second result string based on the selected second tag string and / or fourth tag string using an XOR algorithm.

[0212] In some embodiments, the first result string is obtained by the first device based on the first tag string, the third tag string, and the first binary string. The first tag string indicates that the corresponding bit in the first binary string has a value of 0. The third tag string indicates that the corresponding bit in the first binary string has a value of 1, and the third tag string is obtained by the first device using an XOR algorithm based on the first tag string and the initial random string.

[0213] In some embodiments, the local computing module 502 can also be used to: when the first comparison result indicates that the first service parameter and the second service parameter are not equal, split the second binary string in the middle to obtain two second target strings, the second target strings including a high-order string and a low-order string.

[0214] The communication module 501 can also be used to: receive a target interaction string sent by the first device. The target interaction string is obtained by the first device based on a first target string, a first tag string corresponding to the first target string, and an initial random string. The first target string includes the high-order and low-order strings obtained by splitting the first binary string in the middle.

[0215] The local computing module 502 can also be used to: obtain the second target result string corresponding to the second target string based on the second target string, the target interaction string, the part of the second label string corresponding to the second target string, and the initial random string.

[0216] The communication module 501 and the local computing module 502 can also be used to: interact with the first device based on the first target result string and the second target result string, perform fragmented calculations, and obtain comparison sub-results, which represent whether the first target string and the second target string are equal.

[0217] The communication module 501 and the local computing module 502 can also be used to: when the comparison sub-result indicates that the first target string and the second target string are not equal, split the second target string in the middle to obtain a new second target string, obtain a new comparison sub-result based on the new second target string, until the new comparison sub-result indicates that the new first target string and the new second target string are equal, or until the new second target string is a single binary number, and obtain a second comparison result. The second comparison result indicates that the first service parameter is greater than the second service parameter or the first service parameter is less than the second service parameter.

[0218] In some examples, the local computing module 502 can also be used to: obtain the updated second label string corresponding to the new second target string based on the original second label string corresponding to the new second target string and the new target interaction string when the new second target string is a single binary number; and obtain the fourth label string corresponding to the new second target string based on the updated second label string corresponding to the new second target string and the initial random string.

[0219] The fifth aspect of this application also provides an electronic device. Figure 11 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the fifth aspect of this application, as shown below. Figure 11As shown, the electronic device 600 includes a memory 601, a processor 602, and a computer program stored in the memory 601 and executable on the processor 602.

[0220] In some examples, the processor 602 described above may include a central processing unit (CPU), or an application-specific integrated circuit (ASIC), or one or more integrated circuits that may be configured to implement the embodiments of this application.

[0221] Memory 601 may include read-only memory (ROM), random access memory (RAM), disk storage media device, optical storage media device, flash memory device, electrical, optical, or other physical / tangible memory storage device. Therefore, typically, memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., memory devices) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform operations described with reference to the comparison method of service parameters according to the first aspect embodiment of this application or the comparison method of service parameters according to the second aspect embodiment of this application.

[0222] The processor 602 runs a computer program corresponding to the executable program code by reading the executable program code stored in the memory 601, so as to implement the comparison method of business parameters in the first aspect embodiment or the comparison method of business parameters in the second aspect embodiment.

[0223] In some examples, electronic device 600 may also include communication interface 603 and bus 604. For example, Figure 11 As shown, the memory 601, processor 602, and communication interface 603 are connected through bus 604 and complete communication with each other.

[0224] The communication interface 603 is mainly used to enable communication between various modules, devices, units, and / or equipment in the embodiments of this application. Input devices and / or output devices can also be connected through the communication interface 603.

[0225] Bus 604 includes hardware, software, or both, that couples components of electronic device 600 together. For example, and not limitingly, bus 604 may include an Accelerated Graphics Port (AGP) or other graphics bus, an Enhanced Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), a Hyper Transport (HT) interconnect, an Industry Standard Architecture (ISA) bus, an Infinite Bandwidth Interconnect, a Low Pin Count (LPC) bus, a memory bus, a Micro Channel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-E) bus, a Serial Advanced Technology Attachment (SATA) bus, a Video Electronics Standards Association Local Bus (VLB) bus, or other suitable buses, or combinations of two or more of these. Where appropriate, bus 604 may include one or more buses. Although specific buses are described and illustrated in the embodiments of this application, this application considers any suitable bus or interconnection.

[0226] A sixth aspect of this application provides a service parameter comparison system, which may include a first device and a second device. The first device can execute the service parameter comparison method of the first aspect embodiment described above, and the second device can execute the service parameter comparison method of the second aspect embodiment described above, and can achieve the same technical effect. To avoid repetition, it will not be described again here.

[0227] A seventh aspect of this application provides a computer-readable storage medium storing computer program instructions. When executed by a processor, these instructions can implement the comparison method for business parameters in the first aspect embodiment or the comparison method for business parameters in the second aspect embodiment, achieving the same technical effect. To avoid repetition, further details are omitted here. The aforementioned computer-readable storage medium may include non-transitory computer-readable storage media, such as read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks, etc., and is not limited thereto.

[0228] This application provides a computer program product. When the instructions in the computer program product are executed by the processor of an electronic device, the electronic device performs the comparison method of business parameters in the first aspect embodiment or the comparison method of business parameters in the second aspect embodiment, and achieves the same technical effect. To avoid repetition, it will not be described again here.

[0229] It should be clarified that the various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. For the first device embodiment, second device embodiment, electronic device embodiment, system embodiment, computer-readable storage medium embodiment, and computer program product, the relevant parts can be referred to the description section of the method embodiment. This application is not limited to the specific steps and structures described above and shown in the figures. Those skilled in the art can make various changes, modifications, and additions, or change the order of steps, after understanding the spirit of this application. Furthermore, for the sake of brevity, detailed descriptions of known methods and techniques are omitted here.

[0230] The aspects of this application have been described above with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It should be understood that each block in the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus to produce a machine such that these instructions, executable via the processor of the computer or other programmable data processing apparatus, enable the implementation of the functions / actions specified in one or more blocks of the flowchart illustrations and / or block diagrams. Such a processor can be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor, or a field-programmable logic circuit. It is also understood that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can also be implemented by dedicated hardware performing the specified functions or actions, or can be implemented by a combination of dedicated hardware and computer instructions.

[0231] Those skilled in the art will understand that the above embodiments are exemplary and not restrictive. Different technical features appearing in different embodiments can be combined to achieve beneficial effects. Based on a study of the drawings, specification, and claims, those skilled in the art should be able to understand and implement other variations of the disclosed embodiments. In the claims, the term "comprising" does not exclude other means or steps; the quantifier "a" does not exclude a plurality; the terms "first" and "second" are used to identify names and not to indicate any particular order. No reference numerals in the claims should be construed as limiting the scope of protection. The functionality of multiple parts appearing in the claims can be implemented by a single hardware or software module. The appearance of certain technical features in different dependent claims does not mean that these technical features cannot be combined to achieve beneficial effects.

Claims

1. A method for comparing business parameters, characterized in that, Applied to a first device, the method includes: Based on the first binary string obtained by converting the first service parameters of the first device, and the randomly generated 2 N The first tag string and the 2 agreed upon by the first device and the second device N An initial random string is used to obtain a first interactive string and a first result string. The first binary string includes 2... N There are 10 bits, where N is a positive integer; The first interaction string is sent to the second device, so that the second device, based on the second binary string obtained by converting the second service parameters of the second device, the initial random string, the randomly generated part of the second tag string, and the first interaction string, obtains a second result string. The second binary string includes 2 N One bit; The second device interacts with the first result string and the second result string to perform fragmented calculations and obtain a first comparison result. The first comparison result indicates whether the first service parameter and the second service parameter are equal. The first binary string obtained by converting the first service parameters based on the first device, and the randomly generated 2 N The first tag string and the 2 agreed upon by the first device and the second device N Given an initial random string, we obtain the first interactive string and the first result string, including: Based on the first tag string, the first interaction string is obtained using an XOR algorithm; Based on the first tag string and the initial random string, using the XOR algorithm, we obtain 2. N A third tag string, wherein the first tag string represents that the value of the corresponding bit in the first binary string is 0, and the third tag string represents that the value of the corresponding bit in the first binary string is 1; Based on the first tag string, the third tag string, and the first binary string, the first result string is obtained; The second result string is obtained by the second device based on the second tag string, the fourth tag string, and the second binary string. The second tag string indicates that the corresponding bit in the second binary string has a value of 0. A portion of the second tag string is obtained by XORing the randomly generated portion of the second tag string and the first interaction string. The fourth tag string indicates that the corresponding bit in the second binary string has a value of 1. The fourth tag string is obtained by the second device by XORing the second tag string and the initial random string.

2. The method according to claim 1, characterized in that, The process of obtaining the first result string based on the first tag string, the third tag string, and the first binary string includes: Select the first tag string and / or the third tag string that correspond to the bit values ​​in the first binary string; Based on the selected first tag string and / or the third tag string, the first result string is obtained using an XOR algorithm.

3. The method according to claim 1, characterized in that, Also includes: If the first comparison result indicates that the first business parameter and the second business parameter are not equal, the first binary string is split in the middle to obtain two first target strings, the first target strings including high-order strings and low-order strings; Based on the first target string, the first tag string corresponding to the first target string, and the initial random string, the target interaction string and the first target result string corresponding to the first target string are obtained; The target interaction string is sent to the second device so that the second device obtains a second target result string corresponding to the second target string based on the second target string, the target interaction string, the second tag string corresponding to the second target string, and the initial random string. The second target string includes the high-order string and low-order string obtained by splitting the second binary string from the middle. The second device interacts with the first target result string and the second target string to perform fragmented calculations and obtain comparison sub-results, wherein the comparison sub-results characterize whether the first target string and the second target string are equal; If the comparison sub-result indicates that the first target string and the second target string are not equal, the first target string is split in the middle to obtain a new first target string. Based on the new first target string, a new comparison sub-result is obtained until the new comparison sub-result indicates that the new first target string and the new second target string are equal, or until the new first target string is a single binary number, and a second comparison result is obtained. The second comparison result indicates that the first service parameter is greater than the second service parameter or the first service parameter is less than the second service parameter.

4. The method according to claim 3, characterized in that, When the new second target string is a single binary number, the second tag string corresponding to the new second target string is obtained by the second device by updating the original second tag string corresponding to the new second target string and the new target interaction string. The fourth tag string corresponding to the new second target string is obtained by the second device based on the updated second tag string corresponding to the new second target string and the initial random string.

5. The method according to any one of claims 1 to 4, characterized in that, N≥4。 6. A method for comparing business parameters, characterized in that, Applied to a second device, the method includes: Receive a first interaction string sent by a first device, wherein the first interaction string is obtained by the first device based on N randomly generated first tag strings; Based on the second binary string obtained by converting the second service parameters of the second device, the initial random string, the randomly generated part of the second tag string, and the first interaction string, a second result string is obtained. The second binary string includes 2 N There are 10 bits, where N is a positive integer; The system interacts with the first device based on the first result string and the second result string, performing fragmented calculations to obtain a first comparison result. The first result string is obtained from the first binary string converted by the first device based on the first service parameters, the first tag string, and N initial random strings agreed upon by the first and second devices. The first comparison result indicates whether the first service parameters and the second service parameters are equal. The first binary string includes 2... N One bit; The second binary string obtained by converting the second service parameters based on the second device, the initial random string, the randomly generated part of the second tag string, and the first interaction string are combined to obtain the second result string, which includes: Based on the randomly generated portion of the second tag string and the first interaction string, another portion of the second tag string is obtained using an XOR algorithm; A fourth tag string is obtained based on the second tag string and the initial random string. The second tag string represents that the value of the corresponding bit in the second binary string is 0, and the fourth tag string represents that the value of the corresponding bit in the second binary string is 1. Based on the second tag string, the fourth tag string, and the second binary string, the second result string is obtained; The first result string is obtained by the first device based on the first tag string, the third tag string, and the first binary string. The first tag string indicates that the value of the corresponding bit in the first binary string is 0, and the third tag string indicates that the value of the corresponding bit in the first binary string is 1. The third tag string is obtained by the first device using an XOR algorithm based on the first tag string and the initial random string.

7. The method according to claim 6, characterized in that, The process of obtaining the second result string based on the second tag string, the fourth tag string, and the second binary string includes: Select the second tag string and / or the fourth tag string that correspond to the bit values ​​in the second binary string; The second result string is obtained by using an XOR algorithm based on the selected second tag string and / or the fourth tag string.

8. The method according to claim 6, characterized in that, Also includes: If the first comparison result indicates that the first business parameter and the second business parameter are not equal, the second binary string is split in the middle to obtain two second target strings, the second target strings including high-order strings and low-order strings; The first device receives a target interaction string sent by the first device. The target interaction string is obtained by the first device based on a first target string, the first tag string corresponding to the first target string, and the initial random string. The first target string includes the high-order string and low-order string obtained by splitting the first binary string from the middle. Based on the second target string, the target interaction string, the partial second tag string corresponding to the second target string, and the initial random string, the second target result string corresponding to the second target string is obtained; The device interacts with the first target result string and the second target result string to perform fragmented calculations and obtain comparison sub-results, wherein the comparison sub-results characterize whether the first target string and the second target string are equal; If the comparison sub-result indicates that the first target string and the second target string are not equal, the second target string is split in the middle to obtain a new second target string. Based on the new second target string, a new comparison sub-result is obtained until the new comparison sub-result indicates that the new first target string and the new second target string are equal, or until the new second target string is a single binary number, and a second comparison result is obtained. The second comparison result indicates that the first service parameter is greater than the second service parameter or the first service parameter is less than the second service parameter.

9. The method according to claim 8, characterized in that, When the new second target string is a single binary number, the updated second tag string corresponding to the new second target string is obtained based on the original second tag string corresponding to the new second target string and the new target interaction string; Based on the updated second tag string corresponding to the new second target string and the initial random string, the fourth tag string corresponding to the new second target string is obtained.

10. The method according to any one of claims 6 to 9, characterized in that, N≥4。 11. A first device, characterized in that, include: The local computing module is used to convert the first binary string obtained from the first service parameters of the first device and the randomly generated 2 N The first tag string and the 2 agreed upon by the first device and the second device N An initial random string is used to obtain a first interactive string and a first result string. The first binary string includes 2... N There are 10 bits, where N is a positive integer; The communication module is used to send the first interaction string to the second device, so that the second device, based on the second binary string obtained by converting the second binary string according to the second service parameters of the second device, the initial random string, the randomly generated part of the second tag string, and the first interaction string, obtains a second result string, wherein the second binary string includes 2 N One bit; The communication module and the local computing module are also used to interact with the second device based on the first result string and the second result string to perform fragmented calculations and obtain a first comparison result. The first comparison result indicates whether the first service parameter and the second service parameter are equal. The local computing module is used to: obtain the first interaction string based on the first tag string using an XOR algorithm; Based on the first tag string and the initial random string, using the XOR algorithm, we obtain 2. N A third tag string, wherein the first tag string represents that the value of the corresponding bit in the first binary string is 0, and the third tag string represents that the value of the corresponding bit in the first binary string is 1; Based on the first tag string, the third tag string, and the first binary string, the first result string is obtained; The second result string is obtained by the second device based on the second tag string, the fourth tag string, and the second binary string. The second tag string indicates that the corresponding bit in the second binary string has a value of 0. A portion of the second tag string is obtained by XORing the randomly generated portion of the second tag string and the first interaction string. The fourth tag string indicates that the corresponding bit in the second binary string has a value of 1. The fourth tag string is obtained by the second device by XORing the second tag string and the initial random string.

12. A second device, characterized in that, include: The communication module is used to receive a first interaction string sent by the first device, wherein the first interaction string is obtained by the first device based on N randomly generated first tag strings; The local computing module is used to obtain a second result string based on the second binary string obtained by converting the second service parameters of the second device, the initial random string, the randomly generated part of the second tag string, and the first interaction string. The second binary string includes 2 N There are 10 bits, where N is a positive integer; The communication module and the local computing module are further configured to interact with the first device based on the first result string and the second result string, perform fragmented computation, and obtain a first comparison result. The first result string is obtained by the first device converting a first binary string based on the first service parameter of the first device, the first tag string, and N initial random strings agreed upon by the first device and the second device. The first comparison result indicates whether the first service parameter and the second service parameter are equal. The first binary string includes 2 N bits The local computing module is used to: obtain another part of the second tag string based on the randomly generated part of the second tag string and the first interaction string using an XOR algorithm; and obtain a fourth tag string based on the second tag string and the initial random string, wherein the second tag string represents that the value of the corresponding bit in the second binary string is 0, and the fourth tag string represents that the value of the corresponding bit in the second binary string is 1. Based on the second tag string, the fourth tag string, and the second binary string, the second result string is obtained; The first result string is obtained by the first device based on the first tag string, the third tag string, and the first binary string. The first tag string indicates that the value of the corresponding bit in the first binary string is 0, and the third tag string indicates that the value of the corresponding bit in the first binary string is 1. The third tag string is obtained by the first device using an XOR algorithm based on the first tag string and the initial random string.

13. An electronic device, characterized in that, include: Processor and memory storing computer program instructions; When the processor executes the computer program instructions, it implements the comparison method for business parameters as described in any one of claims 1 to 10.

14. A system for comparing business parameters, characterized in that, include: The first device is used to perform the comparison method of business parameters as described in any one of claims 1 to 5; The second device is used to perform the comparison method of business parameters as described in any one of claims 6 to 10.

15. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer program instructions that, when executed by a processor, implement the comparison method for business parameters as described in any one of claims 1 to 10.