Information sharing method and device, electronic equipment and storage medium
Through the combination of fully homomorphic encryption technology and deterministic finite state automata, the problem of data confidentiality and availability in inventory research in the supply chain is solved, fast and secure information comparison is achieved, and the risk of privacy data leakage is reduced.
Patent Information
- Application Number
- CN202410701288.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-31
- Publication Date
- 2024-09-24
AI Technical Summary
In supply chain scenarios, it is difficult for consumers and suppliers to simultaneously achieve data availability and confidentiality during the inventory survey process, leading to risks of privacy data leakage and commercial disputes.
Through fully homomorphic encryption technology, ciphertext and deterministic finite state automata are used for information comparison to ensure that sensitive information is invisible during the calculation process, achieving the confidentiality of product demand data and inventory data, and constructing deterministic finite automata Accelerate calculation speed.
It effectively solves the problem of privacy data leakage in inventory research, breaks through the technical bottleneck of having both privacy protection and usability, improves the calculation speed of fully homomorphic encryption, and ensures the confidentiality and availability of data.
Smart Images

Figure CN118694565A
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of supply chain management, and in particular to an information sharing method, device, electronic device and storage medium. Background Art
[0002] The massive growth of data has made data the most important resource and wealth in today's society, and has also become an indispensable basis for all decision-making and management. In the supply chain scenario, consumers need to conduct inventory data research on suppliers to understand their supply capabilities to ensure that their production efficiency is not affected by the supply of raw materials, parts, etc. In the inventory research process, consumers obtain supplier product inventory data, and suppliers obtain consumer product demand data. Both parties give up the protection of privacy data in order to establish a cooperative relationship. It is difficult to achieve data availability and confidentiality at the same time. While sharing and transmitting privacy data, various commercial disputes caused by data infringement and illegal leakage may arise. Summary of the invention
[0003] In order to solve the problems of the prior art, the embodiments of the present application provide an information sharing method, device, electronic device and storage medium. The technical solution is as follows:
[0004] In one aspect, a method for sharing information is provided, the method comprising:
[0005] Receive a ciphertext and a bootstrap key sent by a first terminal, and a deterministic finite state automaton sent by a second terminal; the ciphertext is obtained by the first terminal performing fully homomorphic encryption on product demand data based on a private key, the bootstrap key is a public key corresponding to the private key; the deterministic finite state automaton indicates state nodes of product inventory data and flow paths between the state nodes;
[0006] Encrypting the deterministic finite state automaton based on the bootstrap key to obtain a secret state deterministic finite state automaton;
[0007] The ciphertext is used as an input of the secret state determining finite state automaton, so that the secret state determining finite state automaton performs state transition, and obtains a state transition result corresponding to the ciphertext; the state transition result indicates whether the ciphertext causes the secret state determining finite state automaton to transition from an initial state back to the initial state;
[0008] The state transfer result corresponding to the ciphertext is sent to the first terminal, so that the first terminal decrypts the state transfer result based on the private key to obtain an information comparison result; the information comparison result indicates whether the product inventory meets the product demand.
[0009] In another aspect, an information sharing device is provided, the device comprising:
[0010] An information receiving module, configured to receive a ciphertext and a bootstrap key sent by a first terminal, and a deterministic finite state automaton sent by a second terminal; the ciphertext is obtained by performing fully homomorphic encryption on product demand data based on a private key, the bootstrap key is a public key corresponding to the private key; the deterministic finite state automaton indicates state nodes of product inventory data and flow paths between the state nodes;
[0011] An encryption processing module, used for encrypting the deterministic finite state automaton based on the bootstrap key to obtain a secret state deterministic finite state automaton;
[0012] a state transfer module, configured to use the ciphertext as an input of the secret state determination finite state automaton, so as to make the secret state determination finite state automaton perform state transfer, and obtain a state transfer result corresponding to the ciphertext; the state transfer result indicates whether the ciphertext makes the secret state determination finite state automaton transfer from an initial state back to the initial state;
[0013] The result returning module is used to send the state transfer result corresponding to the ciphertext to the first terminal, so that the first terminal decrypts the state transfer result based on the private key to obtain the information comparison result; the information comparison result indicates whether the product inventory meets the product demand.
[0014] In an exemplary embodiment, the information receiving module includes:
[0015] a first information acquisition module, configured to send a first information acquisition request to the first terminal in response to the information sharing request sent by the first terminal, so that the first terminal returns the bootstrap key and returns the ciphertext based on the product requirement data;
[0016] and sending a second information acquisition request to the second terminal, so that the second terminal returns the deterministic finite state automaton based on the product inventory data.
[0017] In an exemplary embodiment, the first information acquisition module includes:
[0018] A data generating module, used to generate first data based on a preset data generating method;
[0019] A first serialization module, used for serializing the first data into a binary form to obtain the private key;
[0020] A data processing module, used for processing the first data based on a preset data processing method to obtain second data;
[0021] A second serialization module, used for serializing the second data into a binary form to obtain the bootstrap key;
[0022] The key returning module is used to return the bootstrap key.
[0023] In an exemplary embodiment, the first information acquisition module further includes:
[0024] A third serialization module is used to serialize the product demand data into a binary form to obtain a target sequence;
[0025] A sequence encryption module, used for performing torus fully homomorphic encryption on the target sequence based on the private key to obtain the ciphertext;
[0026] The ciphertext returning module is used to return the ciphertext.
[0027] In an exemplary embodiment, the first information acquisition module further includes:
[0028] A first data conversion module, used to convert the product inventory data into a target paradigm;
[0029] A second data conversion module, used for converting the target paradigm into a non-deterministic finite state automaton;
[0030] A subset construction module, used for performing subset construction on the non-deterministic finite state automaton to obtain the deterministic finite state automaton;
[0031] The data return module is used to return the determined finite state automaton.
[0032] In an exemplary embodiment, the device further includes a second information acquisition module for real-time information sharing, and the second information acquisition module includes:
[0033] a second information acquisition module, configured to send a third information acquisition request to the first terminal in response to the information sharing request sent by the first terminal, so that the first terminal updates the product demand data, and returns the ciphertext based on the updated product demand data;
[0034] and sending a fourth information acquisition request to the second terminal so that the second terminal updates the product inventory data, and returns the deterministic finite state automaton based on the updated product inventory data.
[0035] On the other hand, an electronic device is provided, comprising a processor and a memory, wherein the memory stores at least one instruction or at least one program, and the at least one instruction or the at least one program is loaded and executed by the processor to implement any of the above-mentioned information sharing methods.
[0036] On the other hand, a computer-readable storage medium is provided, in which at least one instruction or at least one program is stored, and the at least one instruction or the at least one program is loaded and executed by a processor to implement the information sharing method as described in any of the above aspects.
[0037] On the other hand, a computer program product or a computer program is provided, the computer program product or the computer program includes computer instructions, the computer instructions are stored in a computer-readable storage medium. A processor of an electronic device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the electronic device performs any of the above-mentioned information sharing methods.
[0038] In the embodiment of the present application, a determinate finite state automaton provided by a second terminal is encrypted by a bootstrap key provided by a first terminal to obtain a secret state determinate finite state automaton; the determinate finite state automaton indicates the state nodes of product inventory data and the flow path between the state nodes; the ciphertext provided by the first terminal is used as the input of the secret state determinate finite state automaton, so that the secret state determinate finite state automaton performs state flow, and a state flow result corresponding to the ciphertext is obtained; the state flow result indicates whether the ciphertext causes the secret state determinate finite state automaton to flow back from an initial state to an initial state; the state flow result corresponding to the ciphertext is sent to the first terminal, so that the first terminal decrypts the state flow result based on a private key to obtain an information comparison result; the information comparison result indicates whether the product inventory meets the product demand. The ciphertext of the present application is obtained based on the fully homomorphic encryption of the product demand data, so that the server can directly operate on the ciphertext, ensuring that sensitive information is invisible during the entire operation process, and completing the comparison of the two on the premise of ensuring the confidentiality of the product demand data of the first terminal and the inventory data of the second terminal, thereby effectively solving the problem of privacy data leakage during the inventory survey process and breaking through the technical bottleneck of the difficulty in achieving both privacy protection and availability; at the same time, compared with directly calculating the ciphertext through the paradigm, the speed of constructing a deterministic finite automaton for calculation will be faster, thereby improving the calculation speed of fully homomorphic encryption in the inventory survey scenario. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0040] Figure 1 is an interactive schematic diagram of an information sharing method provided in an embodiment of the present application;
[0041] Figure 2 It is a flowchart of an information sharing method provided in an embodiment of the present application;
[0042] Figure 3 This is an example diagram of a product inventory data corresponding range provided in an embodiment of the present application;
[0043] Figure 4 is an example diagram of a deterministic finite state automaton provided in an embodiment of the present application;
[0044] Figure 5 It is a structural block diagram of an information sharing device provided in an embodiment of the present application;
[0045] Figure 6 It is a hardware structure block diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0046] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.
[0047] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or server that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0048] It is understandable that in the specific implementation of this application, related data such as user information is involved. When the above embodiments of this application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of relevant data need to comply with relevant laws, regulations and standards of relevant countries and regions.
[0049] In traditional supply chain scenarios, consumers need to conduct inventory data research on suppliers to understand their supply capabilities, so as to ensure that their production efficiency is not affected by the supply of raw materials, parts, etc. During the inventory research process, consumers obtain supplier product inventory data, while suppliers obtain consumer product demand data. Both parties give up the protection of privacy data to establish a cooperative relationship, and it is difficult to achieve data availability and confidentiality at the same time.
[0050] In view of this, this application proposes an information sharing method, please refer to Figure 1 , which shows an interactive schematic diagram of an information sharing method provided by an embodiment of the present application. The consumer uses a private key to encrypt its product demand data σ into a ciphertext sequence d and sends it to the server. The supplier provides the server with a DFA (deterministic finite automaton) M indicating the product inventory data m. After receiving the ciphertext sequence d sent by the consumer and the DFA sent by the supplier, the server performs calculations to obtain a ciphertext calculation result c and sends it to the consumer. The consumer decrypts the received ciphertext c to obtain a plaintext calculation result result, and the result indicates whether the product inventory meets the product demand.
[0051] See also Figure 2 , which shows a flow chart of an information sharing method provided by an embodiment of the present application. It should be noted that this specification provides method operation steps such as the embodiments or flow charts, but may include more or fewer operation steps based on conventional or non-creative labor. The order of steps listed in the embodiments is only one way of executing the steps among many orders, and does not represent the only order of execution. When the system or product is executed in practice, it can be executed in the order shown in the embodiments or the drawings or in parallel (for example, in a parallel processor or multi-threaded processing environment). Specifically, Figure 2 As shown, the method may include:
[0052] S201, receiving a ciphertext and a bootstrap key sent by a first terminal, and a deterministic finite state automaton sent by a second terminal.
[0053] Among them, the first terminal corresponds to consumers in the supply chain scenario.
[0054] The ciphertext is obtained by the first terminal performing fully homomorphic encryption on the product demand data based on the private key. Specifically, the result obtained by performing a certain operation on the ciphertext is exactly equal to the result obtained by performing the operation on the product demand data and then encrypting it, which is a prerequisite for subsequent operations to be performed directly based on the ciphertext.
[0055] The bootstrap key is the public key corresponding to the private key.
[0056] Among them, the second terminal corresponds to the supplier in the supply chain scenario.
[0057] The state nodes of the finite state automaton indicating the product inventory data and the flow paths between the state nodes are determined. Specifically, the products corresponding to the product inventory data match the products corresponding to the product demand data.
[0058] In an exemplary embodiment, the above step S201 may include the following steps:
[0059] In response to the information sharing request sent by the first terminal, sending a first information acquisition request to the first terminal, so that the first terminal returns a bootstrap key and returns a ciphertext based on the product requirement data;
[0060] And sending a second information acquisition request to the second terminal, so that the second terminal returns a determined finite state automaton based on the product inventory data.
[0061] Among them, the first terminal corresponds to consumers in the supply chain scenario.
[0062] The information sharing request is issued by the consumer based on the first terminal, and is intended to request product inventory data.
[0063] The first information acquisition request is intended to obtain the public key and product demand data of the first terminal.
[0064] The ciphertext is obtained by the first terminal performing fully homomorphic encryption on the product demand data based on the private key. Specifically, the result obtained by performing a certain operation on the ciphertext is exactly equal to the result obtained by performing the operation on the product demand data and then encrypting it, which is a prerequisite for subsequent operations to be performed directly based on the ciphertext.
[0065] The bootstrap key is the public key corresponding to the private key.
[0066] Among them, the second terminal corresponds to the supplier in the supply chain scenario.
[0067] The second information acquisition request is intended to acquire product inventory data of the second terminal.
[0068] The state nodes of the finite state automaton indicating the product inventory data and the flow paths between the state nodes are determined. Specifically, the products corresponding to the product inventory data match the products corresponding to the product demand data.
[0069] Specifically, the bootstrap key, the ciphertext corresponding to the product demand data, and the deterministic finite state automaton corresponding to the product inventory data are obtained, and then the ciphertext and the deterministic finite state automaton are further operated based on the bootstrap key to compare the product demand data with the product inventory data.
[0070] It can be seen from the above technical solutions of the embodiment of the present application that the embodiment of the present application obtains the bootstrap key, the ciphertext corresponding to the product demand data, and the deterministic finite state automaton corresponding to the product inventory data, so as to compare the product demand data with the product inventory data based on the bootstrap key, thereby ensuring the confidentiality of the product demand data and the product inventory data.
[0071] In an exemplary embodiment, the step of returning the bootstrap key may include the following steps:
[0072] Generate first data based on a preset data generation method;
[0073] Serializing the first data into a binary form to obtain a private key;
[0074] Based on a preset data processing method, the first data is processed to obtain second data;
[0075] Serializing the second data into a binary form to obtain a bootstrap key;
[0076] Returns the bootstrap key.
[0077] The preset data generation method is used to directly generate a new element in the container instead of creating a temporary object first. Specifically, a random string is generated based on the preset data generation method.
[0078] The first data is a random character string.
[0079] The private key is held by the first terminal and is used to encrypt product demand data and decrypt status transfer results.
[0080] The preset data processing method is a method of generating a random character string, and the first data needs to be used as input.
[0081] The second data is a random character string.
[0082] Among them, the bootstrap key is the public key corresponding to the private key, which is used for subsequent calculation of the ciphertext.
[0083] In a specific implementation, the emplace function can be selected as the preset data generation method, and the first data is generated based on the emplace function, and the first data is serialized into binary form to obtain a private key; accordingly, the preset data processing method is to use the first data as the input of the emplace function to generate the second data, and the second data is serialized into binary form to obtain a bootstrap key, and it is only necessary to return the bootstrap key to the server.
[0084] It can be seen from the above technical solutions of the embodiment of the present application that the embodiment of the present application first generates a private key, and then generates a bootstrap key through the private key, which is used for subsequent fully homomorphic calculations based on ciphertext and a deterministic finite state automaton.
[0085] In an exemplary embodiment, the step of returning the ciphertext based on the product demand data may include the following steps:
[0086] Serialize the product demand data into binary form to obtain the target sequence;
[0087] Perform torus fully homomorphic encryption on the target sequence based on the private key to obtain the ciphertext;
[0088] Returns the ciphertext.
[0089] The product demand data indicates the demand of the first terminal for a certain product.
[0090] In the specific implementation, the consumer encodes the product demand data σ into a binary target sequence σ = (σ 0 ,σ 1 …,,σ |AP| ); The target sequence σ can be encrypted based on the encrupt function. Specifically, the private key sk is used as the input of the encrupt function, and the target sequence σ is encrypted bit by bit to obtain a ciphertext sequence d, satisfying d=(Enc(σ 0 ),Enc(σ 0 )…,,Enc(σ |AP| )); returns d to the server.
[0091] It can be seen from the above technical scheme of the embodiment of the present application that the first terminal in the embodiment of the present application encodes the product demand data into a binary sequence, encrypts the encoded binary sequence bit by bit through the torus fully homomorphic encryption technology in the fully homomorphic encryption technology, and sends the encrypted ciphertext sequence to the server for subsequent calculation process, thereby realizing inventory survey without leaking the privacy data of the first terminal, thereby realizing the privacy protection of the product demand data of the first terminal.
[0092] In an exemplary embodiment, the step of returning the product inventory data to determine the finite state automaton may include the following steps:
[0093] Convert product inventory data into target format;
[0094] Convert the target paradigm into a non-deterministic finite state automaton;
[0095] Subset the non-deterministic finite state automaton to obtain a deterministic finite state automaton;
[0096] Returns a deterministic finite state automaton.
[0097] The product inventory data indicates the inventory quantity of the product corresponding to the product demand data.
[0098] Among them, the target paradigm is LTL (Linear Temporal Logic) paradigm.
[0099] In a specific implementation, the second terminal can convert the product inventory data into the LTL paradigm Φ based on the Quine-McCluskey algorithm m Specifically, the upper and lower thresholds of product inventory data are used as input to obtain the LTL paradigm Φ representing the product inventory range. m ; Use SPOT (Small Programmable Object Technology) to convert LTL paradigm to m Convert to NFA (non-deterministic finite automaton) m , through the subset construction algorithm, NFA N m Convert to DFA M m , get the DFA file represented by the state transition list, and convert DFA M m Send to the server.
[0100] It can be seen from the above technical solutions of the embodiment of the present application that the embodiment of the present application converts the product inventory data of the second terminal into the linear temporal logic LTL paradigm through the Quine-McCluskey algorithm, converts the LTL paradigm into a non-deterministic finite state automaton through the SPOT library, and then converts it into a deterministic finite state automaton through a subset construction algorithm. The initial product inventory data cannot be deduced from the deterministic finite state automaton, thereby realizing the privacy protection of the product inventory data of the second terminal.
[0101] S203, encrypting the deterministic finite state automaton based on the bootstrap key to obtain a secret state deterministic finite state automaton.
[0102] Among them, the state nodes of the product inventory data in the dense state deterministic finite state automaton and the flow paths between the state nodes are in an invisible state.
[0103] Specifically, the finite state automaton is calculated based on the ciphertext and the secret state, and the product demand data of the first terminal and the product inventory data of the second terminal are invisible during the whole process.
[0104] In a specific implementation, a cipher state deterministic finite state automaton may be constructed through a homomorphic data selection gate, and is used to perform state transfer after receiving the ciphertext data from the first terminal.
[0105] In a specific implementation, the deterministic finite state automaton can be encrypted based on the cloud function. Specifically, the file spec_filename storing the deterministic finite state automaton DFA and the file bk_filename storing the bootstrap key are input, and the output result is a encrypted deterministic finite state automaton.
[0106] S205, using the ciphertext as an input of a cipher state determining finite state automaton, so that the cipher state determining finite state automaton performs state transfer, and obtains a state transfer result corresponding to the ciphertext.
[0107] The state transition result indicates whether the ciphertext causes the cipher state deterministic finite state automaton to transition from the initial state back to the initial state.
[0108] Specifically, if the ciphertext causes the secret state deterministic finite state automaton to flow from the initial state back to the initial state, it indicates that the product inventory can meet the product demand; if the ciphertext causes the secret state deterministic finite state automaton to flow from the initial state but not back to the initial state, it indicates that the product inventory cannot meet the product demand.
[0109] In the specific implementation, the state flow of the secret state deterministic finite state automaton can be carried out based on the fully homomorphic OFFLINE algorithm, with DFA M, ciphertext d1, d2, ..., d n , the bootstrap key BK is used as input, and the output state flow result c satisfies Dec(c)=M(Dec(d1)Dec(d2),…,Dec(d n )). For example, Figure 3 As shown, it is an example diagram of a corresponding range of product inventory data provided in an embodiment of the present application, representing that the range of product inventory data is (70,180); Figure 4 As shown, it is an example diagram of a finite state automaton provided in an embodiment of the present application, and Figure 3 The product inventory data shown in FIG. 1 corresponds to the product inventory data shown in FIG. 1 . Based on this, the following two examples are proposed, which correspond to the two situations of the state flow results.
[0110] If the product demand data is 133, the first terminal converts it into 010000101=(p9p8,…,p1), encrypts p1, p2,…,p9 into ciphertext d1, d2,…,d9 in sequence and sends them to the server. The server starts to circulate the directed graph from the initial state 0: Because the state returns to the initial state, the state flow result indicates that the product demand data is within the range of the product inventory data, 133∈(70,180), that is, 70<133<180.
[0111] Similarly, if the product demand data is 69, the first terminal converts it into 001000101=(p9p8,…,p1), encrypts p1, p2,…,p9 into ciphertext d1, d2,…,d9 in sequence and sends them to the server. The server starts to circulate the directed graph from the initial state 0: Because it does not return to the initial state, the state flow result indicates that the product demand data exceeds the range of the product inventory data. That is, 69<70.
[0112] S207, sending the state transfer result corresponding to the ciphertext to the first terminal, so that the first terminal decrypts the state transfer result based on the private key to obtain the information comparison result.
[0113] Among them, the information comparison result indicates whether the product inventory meets the product demand.
[0114] In a specific implementation, the first terminal can decrypt the state transfer result bit by bit based on the decrypt function. Specifically, the state transfer result corresponding to the ciphertext and the private key are used as input parameters of the function, and the output result is the plaintext information comparison result.
[0115] For example, if the information comparison result is 1, it indicates that the product demand data is less than or equal to the product inventory data, and the product inventory can meet the product demand; if the information comparison result is 0, it indicates that the product demand data is greater than the product inventory data, and the product inventory cannot meet the product demand.
[0116] It can be seen from the above technical scheme of the embodiment of the present application that the embodiment of the present application compares the product demand data with the product inventory data through the deterministic finite state automaton corresponding to the ciphertext of the product demand data and the product inventory data, so as to determine whether the product inventory meets the product demand; wherein, the ciphertext is obtained based on the fully homomorphic encryption of the product demand data, so that the server can directly operate on the ciphertext, ensuring that sensitive information is invisible during the entire operation process, and completing the comparison of the two on the premise of achieving the confidentiality of the product demand data of the first terminal and the inventory data of the second terminal, effectively solving the problem of privacy data leakage during the inventory survey process, and breaking through the technical bottleneck of privacy protection and availability; at the same time, compared with directly calculating the ciphertext through the paradigm, the speed of constructing a deterministic finite automaton for calculation will be faster, thereby improving the calculation speed of fully homomorphic encryption in the inventory survey scenario.
[0117] In an exemplary embodiment, the following steps may also be included:
[0118] In response to the information sharing request sent by the first terminal, sending a third information acquisition request to the first terminal so that the first terminal updates the product requirement data, and returns a ciphertext based on the updated product requirement data;
[0119] and sending a fourth information acquisition request to the second terminal so that the second terminal updates the product inventory data, and returns a finite state automaton based on the updated product inventory data.
[0120] Among them, the first terminal corresponds to consumers in the supply chain scenario.
[0121] The information sharing request is issued by the consumer based on the first terminal, and is intended to request product inventory data.
[0122] The first information acquisition request is intended to obtain the public key and product demand data of the first terminal.
[0123] The ciphertext is obtained by the first terminal performing fully homomorphic encryption on the product demand data based on the private key. Specifically, the result obtained by performing a certain operation on the ciphertext is exactly equal to the result obtained by performing the operation on the product demand data and then encrypting it, which is a prerequisite for subsequent operations to be performed directly based on the ciphertext.
[0124] The bootstrap key is the public key corresponding to the private key.
[0125] Among them, the second terminal corresponds to the supplier in the supply chain scenario.
[0126] The second information acquisition request is intended to acquire product inventory data of the second terminal.
[0127] The state nodes of the finite state automaton indicating the product inventory data and the flow paths between the state nodes are determined. Specifically, the products corresponding to the product inventory data match the products corresponding to the product demand data.
[0128] Specifically, the first terminal provides product demand data in rounds, and the server obtains the bootstrap key, the corresponding ciphertext of the updated product demand data, and the determined finite state automaton corresponding to the updated product inventory data of the second terminal, thereby further operating the ciphertext and the determined finite state automaton based on the bootstrap key to compare the product demand data with the product inventory data, and returning the state flow result of this time to the first terminal.
[0129] It can be seen from the above technical solutions of the embodiment of the present application that the embodiment of the present application performs real-time data processing by responding to the information sharing request of the first terminal in real time. The ciphertext corresponding to the product demand data of the first terminal can be provided to the server in rounds without providing all the data at one time. The server returns the status flow results multiple times during the processing, thereby realizing online inventory research.
[0130] Corresponding to the information sharing methods provided in the above-mentioned embodiments, the embodiment of the present application also provides an information sharing device. Since the information sharing device provided in the embodiment of the present application corresponds to the information sharing methods provided in the above-mentioned embodiments, the implementation methods of the aforementioned information sharing methods are also applicable to the information sharing device provided in this embodiment and will not be described in detail in this embodiment.
[0131] See also Figure 5 , which is a schematic diagram of the structure of an information sharing device provided in an embodiment of the present application, the device has the function of implementing the information sharing method in the above method embodiment, and the function can be implemented by hardware or by hardware executing corresponding software. Figure 5 As shown, the device may include:
[0132] The information receiving module 510 is used to receive the ciphertext and the bootstrap key sent by the first terminal, and the determined finite state automaton sent by the second terminal; the ciphertext is obtained by fully homomorphically encrypting the product demand data based on the private key, and the bootstrap key is the public key corresponding to the private key; the determined finite state automaton indicates the state nodes of the product inventory data and the flow path between the state nodes;
[0133] An encryption processing module 520 is used to encrypt the deterministic finite state automaton based on the bootstrap key to obtain a secret state deterministic finite state automaton;
[0134] The state transfer module 530 is used to use the ciphertext as an input of the ciphertext-determined finite state automaton to make the ciphertext-determined finite state automaton perform state transfer and obtain a state transfer result corresponding to the ciphertext; the state transfer result indicates whether the ciphertext makes the ciphertext-determined finite state automaton transfer from the initial state back to the initial state;
[0135] The result return module 540 is used to send the state flow result corresponding to the ciphertext to the first terminal, so that the first terminal decrypts the state flow result based on the private key to obtain the information comparison result; the information comparison result indicates whether the product inventory meets the product demand.
[0136] In an exemplary embodiment, the information receiving module includes:
[0137] A first information acquisition module, configured to send a first information acquisition request to the first terminal in response to an information sharing request sent by the first terminal, so that the first terminal returns a bootstrap key and returns a ciphertext based on the product requirement data;
[0138] And sending a second information acquisition request to the second terminal, so that the second terminal returns a determined finite state automaton based on the product inventory data.
[0139] In an exemplary embodiment, the first information acquisition module includes:
[0140] A data generating module, used to generate first data based on a preset data generating method;
[0141] A first serialization module, used to serialize the first data into a binary form to obtain a private key;
[0142] A data processing module, used to process the first data based on a preset data processing method to obtain second data;
[0143] A second serialization module, used for serializing the second data into a binary form to obtain a bootstrap key;
[0144] Key return module, used to return the bootstrap key.
[0145] In an exemplary embodiment, the first information acquisition module further includes:
[0146] The third serialization module is used to serialize the product demand data into binary form to obtain a target sequence;
[0147] The sequence encryption module is used to perform torus fully homomorphic encryption on the target sequence based on the private key to obtain the ciphertext;
[0148] The ciphertext return module is used to return the ciphertext.
[0149] In an exemplary embodiment, the first information acquisition module further includes:
[0150] A first data conversion module, for converting product inventory data into a target paradigm;
[0151] A second data conversion module, used for converting the target paradigm into a non-deterministic finite state automaton;
[0152] A subset construction module is used to perform subset construction on a non-deterministic finite state automaton to obtain a deterministic finite state automaton;
[0153] The data return module is used to return the deterministic finite state automaton.
[0154] In an exemplary embodiment, the device further includes a second information acquisition module for performing real-time information sharing, and the second information acquisition module includes:
[0155] a second information acquisition module, configured to send a third information acquisition request to the first terminal in response to the information sharing request sent by the first terminal, so that the first terminal updates the product demand data, and returns a ciphertext based on the updated product demand data;
[0156] and sending a fourth information acquisition request to the second terminal so that the second terminal updates the product inventory data, and returns a finite state automaton based on the updated product inventory data.
[0157] It should be noted that the device provided in the above embodiment, when implementing its functions, is only illustrated by the division of the above functional modules. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the device and method embodiments provided in the above embodiment belong to the same concept, and the specific implementation process is detailed in the method embodiment, which will not be repeated here.
[0158] An embodiment of the present application provides an electronic device, which includes a processor and a memory, wherein the memory stores at least one instruction or at least one program, and the at least one instruction or the at least one program is loaded and executed by the processor to implement any one of the information sharing methods provided in the above method embodiments.
[0159] The memory can be used to store software programs and modules. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory. The memory can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, application programs required for functions, etc.; the data storage area can store data created according to the use of the device, etc. In addition, the memory can include a high-speed random access memory and can also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices. Accordingly, the memory can also include a memory controller to provide the processor with access to the memory.
[0160] The method embodiments provided in the embodiments of the present application may be executed in a computer terminal, a server or a similar computing device, that is, the above-mentioned electronic device may include a computer terminal, a server or a similar computing device. Figure 6 is a hardware structure block diagram of a computer device running an information sharing method provided by an embodiment of the present invention, such as Figure 6 As shown, the internal structure of the computer device may include but is not limited to: a processor, a network interface and a memory. The processor, network interface and memory in the computer device may be connected via a bus or other means. Figure 6 The example of connecting through bus is taken in the following.
[0161] Among them, the processor (or CPU (Central Processing Unit)) is the computing core and control core of the computer device. The network interface may optionally include a standard wired interface, a wireless interface (such as WI-FI, a mobile communication interface, etc.). Memory is a memory device in a computer device for storing programs and data. It is understandable that the memory here can be a high-speed RAM storage device or a non-volatile memory device (non-volatile memory), such as at least one disk storage device; optionally, it can also be at least one storage device located away from the aforementioned processor. The memory provides a storage space, which stores the operating system of the electronic device, which may include but is not limited to: Windows system (an operating system), Linux (an operating system), Android (Android, a mobile operating system) system, IOS (a mobile operating system) system, etc., and the present invention is not limited to this; and, in the storage space, one or more instructions suitable for being loaded and executed by the processor are also stored, and these instructions may be one or more computer programs (including program codes). In the embodiment of this specification, the processor loads and executes one or more instructions stored in the memory to implement the information sharing method provided in the above method embodiment.
[0162] An embodiment of the present application also provides a computer-readable storage medium, which can be set in an electronic device to store at least one instruction or at least one program related to implementing an information sharing method. The at least one instruction or the at least one program is loaded and executed by the processor to implement any one of the information sharing methods provided in the above method embodiments.
[0163] Optionally, in this embodiment, the above-mentioned storage medium may include but is not limited to: a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and other media that can store program codes.
[0164] It should be noted that the above-mentioned sequence of the embodiments of the present application is for description only and does not represent the advantages and disadvantages of the embodiments. The above-mentioned specific embodiments of this specification are described. Other embodiments are within the scope of the attached claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0165] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0166] A person skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware or by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.
[0167] The above are only preferred embodiments of the present application and are not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application should be included in the protection scope of the present application.
Claims
1. An information sharing method, characterized in that: The method comprises: Receive a ciphertext and a bootstrap key sent by a first terminal, and a deterministic finite state automaton sent by a second terminal; the ciphertext is obtained by the first terminal performing fully homomorphic encryption on product demand data based on a private key, the bootstrap key is a public key corresponding to the private key; the deterministic finite state automaton indicates state nodes of product inventory data and flow paths between the state nodes; Encrypting the deterministic finite state automaton based on the bootstrap key to obtain a secret state deterministic finite state automaton; The ciphertext is used as an input of the secret state determining finite state automaton, so that the secret state determining finite state automaton performs state transition, and obtains a state transition result corresponding to the ciphertext; the state transition result indicates whether the ciphertext causes the secret state determining finite state automaton to transition from an initial state back to the initial state; The state transfer result corresponding to the ciphertext is sent to the first terminal, so that the first terminal decrypts the state transfer result based on the private key to obtain an information comparison result; the information comparison result indicates whether the product inventory meets the product demand.
2. The information sharing method according to claim 1, characterized in that: The receiving of the ciphertext and the bootstrap key sent by the first terminal and the deterministic finite state automaton sent by the second terminal includes: In response to the information sharing request sent by the first terminal, sending a first information acquisition request to the first terminal, so that the first terminal returns the bootstrap key and returns the ciphertext based on the product requirement data; and sending a second information acquisition request to the second terminal, so that the second terminal returns the deterministic finite state automaton based on the product inventory data.
3. The information sharing method according to claim 2, characterized in that: The returning the bootstrap key comprises: Generate first data based on a preset data generation method; Serializing the first data into binary form to obtain the private key; Based on a preset data processing method, the first data is processed to obtain second data; Serializing the second data into a binary form to obtain the bootstrap key; Returns the bootstrap key.
4. The information sharing method according to claim 3, characterized in that: The returning the ciphertext based on the product requirement data comprises: Serializing the product demand data into a binary form to obtain a target sequence; Perform torus fully homomorphic encryption on the target sequence based on the private key to obtain the ciphertext; Returns the ciphertext.
5. The information sharing method according to claim 2, characterized in that: The returning the determining finite state automaton based on the product inventory data comprises: converting the product inventory data into a target format; converting the target paradigm into a non-deterministic finite state automaton; Subsetting the non-deterministic finite state automaton to obtain the deterministic finite state automaton; Returns the deterministic finite state automaton.
6. The information sharing method according to any one of claims 2 to 5, characterized in that: The method further comprises: In response to the information sharing request sent by the first terminal, sending a third information acquisition request to the first terminal so that the first terminal updates the product demand data, and returns the ciphertext based on the updated product demand data; and sending a fourth information acquisition request to the second terminal so that the second terminal updates the product inventory data, and returns the deterministic finite state automaton based on the updated product inventory data.
7. An information sharing device, characterized in that: The device comprises: An information receiving module, configured to receive a ciphertext and a bootstrap key sent by a first terminal, and a deterministic finite state automaton sent by a second terminal; the ciphertext is obtained by performing fully homomorphic encryption on product demand data based on a private key, the bootstrap key is a public key corresponding to the private key; the deterministic finite state automaton indicates state nodes of product inventory data and flow paths between the state nodes; An encryption processing module, used for encrypting the deterministic finite state automaton based on the bootstrap key to obtain a secret state deterministic finite state automaton; a state transfer module, configured to use the ciphertext as an input of the secret state determination finite state automaton, so as to make the secret state determination finite state automaton perform state transfer, and obtain a state transfer result corresponding to the ciphertext; the state transfer result indicates whether the ciphertext makes the secret state determination finite state automaton transfer from an initial state back to the initial state; The result returning module is used to send the state transfer result corresponding to the ciphertext to the first terminal, so that the first terminal decrypts the state transfer result based on the private key to obtain the information comparison result; the information comparison result indicates whether the product inventory meets the product demand.
8. An electronic device, characterized in that: The method comprises a processor and a memory, wherein the memory stores at least one instruction or at least one program, and the at least one instruction or at least one program is loaded and executed by the processor to implement the information sharing method according to any one of claims 1 to 6.
9. A computer-readable storage medium, wherein at least one instruction or at least one program is stored in the storage medium, and the at least one instruction or the at least one program is loaded and executed by a processor to implement the information sharing method according to any one of claims 1 to 6.
10. A computer program, characterized in that When the computer program is executed by a processor, the information sharing method according to any one of claims 1 to 6 is implemented.
