A spatial crowdsourcing task allocation method based on blockchain and privacy computing
Through blockchain and privacy computing technology, combined with smart contracts and privacy collection interception algorithm, the problem of insufficient location privacy protection in the existing space crowdsourcing architecture is solved, efficient and secure task allocation is achieved, and workers and task requests are ensured. The privacy of the person is safe.
Patent Information
- Application Number
- CN202410260549.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-07
- Publication Date
- 2024-11-12
- Estimated Expiration
- 2044-03-07
AI Technical Summary
The existing space crowdsourcing architecture has shortcomings in protecting the location privacy of workers and task requesters, especially inadequate protection of task requesters' location privacy. The traditional centralized platform has low trust, which can easily lead to workers' sensitive information leakage. Moreover, the existing blockchain solutions are inefficient and cannot prevent malicious attacks on the platform.
Using a spatial crowdsourcing task allocation method based on blockchain and privacy computing, the privacy location records of workers and task requesters are obtained through smart contracts, privacy collection interception and cloud service provider design, and using Blond filtering and geographic differential privacy algorithms Perform location matching, reduce computing complexity, and encrypt the key generation by a trusted authentication agency to ensure the security and privacy of location information.
It realizes location privacy protection for workers and task requesters, improves the security and efficiency of task allocation, reduces the computational complexity, avoids malicious platform attacks, and saves workers' computing resources.
Smart Images

Figure CN118114935B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of information security technology, and specifically relates to a spatial crowdsourcing task allocation method based on blockchain and privacy computing. Background Art
[0002] Crowdsourcing refers to the behavior of companies or organizations outsourcing some tasks to an unknown group of people in the form of open recruitment. Workers participating in crowdsourcing tasks answer questions based on their own information. The increasing popularity of mobile devices has made a new type of spatial crowdsourcing possible, which assigns tasks with spatial constraints to workers who meet the spatial constraints and requires workers to complete tasks at a specific location. The existing spatial crowdsourcing architecture generally has two modes: 1) server-assigned task mode and 2) worker-selected task mode. Compared with the worker-selected task mode, the server-assigned task mode does not require workers to be online and consumes less resources, so it has a wider application potential. In the server-assigned task mode, there are generally three entities: requesters, workers, and spatial crowdsourcing platforms. Requesters have some location-based questions and then publish tasks based on the location to the spatial crowdsourcing platform. Workers register their information on the spatial crowdsourcing platform and submit their locations to the platform. The platform assigns workers of appropriate distance to perform tasks based on the results of location matching.
[0003] At present, the existing architecture model requires the spatial crowdsourcing platform to collect tasks and workers' location information, while the traditional centralized crowdsourcing platform services belong to companies or other organizations with low trust, and the direct upload of location information may lead to the leakage of workers' sensitive information and cause serious privacy concerns. In order to solve the above problems, there are already a few developers who use blockchain to build decentralized spatial crowdsourcing task allocation solutions, but the location privacy of workers and task publishers cannot be fully protected.
[0004] For example, the existing patent CN110620772A is a spatial crowdsourcing multi-level location privacy protection method based on blockchain, and its implementation steps are: initialization parameters; the requester submits a task request to the blockchain; the worker regularly uploads the location record to the blockchain; the worker divides the area according to the selected privacy level, and submits the combination of the location coordinate ciphertext and the boundary record as the location information to the blockchain; the requester verifies the location information submitted by the worker based on the location record on the blockchain and the location information submitted by the worker; There are several problems in this technical solution: 1. Only the location privacy of the workers is protected, and the location privacy protection of the task requester is not considered; 2. Each task release requires each worker to be counted online in real time; 3. The requester needs to verify the location of the worker one by one, which is inefficient.
[0005] For example, the existing public patent CN115587716A discloses a privacy-preserving spatial crowdsourcing task allocation method and system, whose implementation steps are as follows: two allocation terminals are used to respectively hold secret sharing shares of the task location and the task processing terminal location. In the task allocation process, all tasks are completed based on the secret sharing domain, and the allocation terminal performs crowdsourcing task allocation without knowing the plaintext task location and the task processing terminal location. This technical solution has the following problems: 1. Using two terminals (i.e., crowdsourcing platforms) to protect the location cannot prevent malicious attacks on the crowdsourcing platform; 2. Secret sharing is generally based on polynomials, and the time complexity is too high. It takes a long time to complete task allocation in spatial crowdsourcing, which is inefficient. Summary of the invention
[0006] In view of this, the purpose of the present invention is to provide a spatial crowdsourcing task allocation method based on blockchain and privacy computing. A spatial crowdsourcing allocation scheme is designed by combining blockchain smart contracts, privacy set intersection and cloud service providers to prevent the spatial crowdsourcing platform from doing evil and protect the privacy of workers and task requesters. The privacy set intersection algorithm reduces the complexity of the calculation, and the outsourced computing scheme used is more friendly to workers and does not require workers to perform large-scale calculations.
[0007] To achieve the above objectives, the present invention provides a spatial crowdsourcing task allocation method based on blockchain and privacy computing, comprising:
[0008] Obtain the location records uploaded by the workers, perform privacy calculation and encryption to obtain the private location records, and upload the private location records to the blockchain based on the smart contract call;
[0009] Obtain the task request uploaded by the task requester and send it to the blockchain. When the blockchain receives the task request, it calls the private location record through the smart contract interface and sends it to the cloud service provider;
[0010] Based on the Bloom filtering and privacy set intersection method, the task privacy location set held by the task requester and the privacy location record set held by the cloud service provider are matched, and the location matching result is uploaded to the blockchain;
[0011] According to the location matching results, task requests and workers' idle status, crowdsourcing tasks in task requests are dynamically allocated through blockchain.
[0012] Furthermore, a spatial crowdsourcing task allocation method based on blockchain and privacy computing also includes:
[0013] Select a trusted certification body;
[0014] According to the trusted certification authority, trusted certificates are created for the workers, task requesters and cloud service providers who have just joined the space crowdsourcing task allocation method, and the RSA algorithm is called to generate key pairs corresponding to the workers, task requesters and cloud service providers respectively;
[0015] The generated key pairs are sent to the corresponding workers, task requesters, and cloud service providers through a trusted certification authority.
[0016] Furthermore, a spatial crowdsourcing task allocation method based on blockchain and privacy computing also includes:
[0017] By means of a trusted authentication agency, a location-based service map is divided into a plurality of non-overlapping grids with a side length of μ; wherein each non-overlapping grid is assigned a grid number according to a preset order;
[0018] Obtaining the grid information public parameters and preset privacy budget contained in the non-overlapping grids and sending them to the workers and task requesters who create trusted certificates;
[0019] Obtain a trusted certificate and upload it to the blockchain.
[0020] Furthermore, the location records uploaded by the workers are obtained and encrypted by privacy calculation to obtain the privacy location records, which are then uploaded to the blockchain based on the smart contract, including:
[0021] Get the location record (row, col) uploaded by the worker and the selected random value σ W ∈[0,1);
[0022] Based on geographic indistinguishability, the geo-differential privacy value is calculated based on the random value chosen by the worker:
[0023]
[0024] Among them, r W is the geographical differential privacy value of worker W, ε is the preset privacy budget, σ W is a random value selected by the worker, e is a natural constant, and w -1 is the Lambert W function, -1 branch;
[0025] Calculate the worker's private location based on the geo-differential privacy value and the worker's location record:
[0026] xrow W =row W +r W cosθ,θ∈[0,2π)
[0027] ycol W =col W +r Wsinθ,θ∈[0,2π)
[0028] Among them, (row W ,col W ) is the position record of worker W, (xrow W ,ycol W ) is the privacy position of worker W, θ is the angle between the position record of worker W and the privacy position;
[0029] Obtain a set of worker grid numbers after the worker's private position is mapped to the activity range grid; wherein the activity range grid includes a plurality of non-overlapping grids with a side length of μ, and the set of worker grid numbers includes the grid number of the worker's current activity range grid;
[0030] Obtain the private key sent to the worker by the trusted certification authority, and determine the worker's signature information based on the private key and the worker's grid number set;
[0031] The private location is encrypted based on the worker’s signature information and the public key sent by the trusted certification authority to the cloud service provider to generate a private location record:
[0032]
[0033] Among them, record W For worker W’s private location record, X‖Cert W ‖T W is the signature information of worker W, T W The valid timestamp of the location record uploaded by the worker is preset. W is the worker’s private key, pk cs is the public key of the cloud service provider, X is the set of worker grid numbers of worker W, Sign the public key of the cloud service provider. Indicates encryption with the worker's private key, Cert W Credible certificates for workers;
[0034] Get the blockchain address of worker W, call the worker location contract LC according to the blockchain address, and upload the private location record to the blockchain.
[0035] Furthermore, the task request uploaded by the task requester is sent to the blockchain. When the blockchain receives the task request, it calls the privacy location record through the smart contract interface and sends it to the cloud service provider, including:
[0036] Obtaining the task request uploaded by the task requester; wherein the task request includes the requester's unique identity, the task release unique identity, the task reward, the required number of people and the time limit;
[0037] Get the blockchain address of the task requester, call the task contract TC according to the blockchain address, and upload the task request to the blockchain;
[0038] The blockchain verifies the authenticity of the task request by performing trusted verification on the trusted certificate of the task requester. After the verification is passed, the cloud service provider calls the private location records of idle workers on the blockchain through the smart contract interface to generate a collection of private location records.
[0039] When the cloud service provider receives the private location record of the idle worker, the private location record is decrypted by the private key sent to the cloud service provider by the trusted certification authority and the private key of the corresponding idle worker;
[0040] If the decryption fails, the cloud service provider abandons the private location record of the idle worker;
[0041] The private location records of all successfully decrypted idle workers are obtained to generate a private location record set; wherein the private location record set includes a set of worker grid numbers corresponding to each idle worker.
[0042] Furthermore, based on the Bloom filtering and privacy set intersection method, the task privacy location set held by the task requester and the privacy location record set held by the cloud service provider are matched, and the location matching result is obtained and uploaded to the blockchain, including:
[0043] Obtain a collection of private location records held by the cloud service provider;
[0044] Get the task private location set held by the task requester;
[0045] Calculate the similarity between the task private location set and the private location record set according to the Bloom filter, obtain the private location records in the private location record set that meet the preset similarity, and generate a matching location set;
[0046] According to the privacy location set matching scheme based on the PSI protocol, the privacy set intersection of the matching location set and the task privacy location set is performed, and the location matching result is uploaded to the blockchain.
[0047] Furthermore, the task privacy location set held by the task requester is obtained, including:
[0048] Get the location record (row, col) of the spatial crowdsourcing task uploaded by the task requester and the selected random value σ R ∈[0,1);
[0049] Based on geographic indistinguishability, the geo-differential privacy value is calculated based on the random value chosen by the task requester:
[0050]
[0051] Among them, r R is the geographic differential privacy value of the spatial crowdsourcing task uploaded by the task requester R, ε is the preset privacy budget, σ R is a random value selected by the task requester R, e is a natural constant, and w -1 is the Lambert W function, -1 branch;
[0052] The private location of the spatial crowdsourcing task is calculated based on the geographic differential privacy value and the location record of the spatial crowdsourcing task uploaded by the task requester:
[0053] xrow R =row R +r R cosα,α∈[0,2π)
[0054] ycol R =col R +r R sinα,α∈[0,2π)
[0055] Among them, (row R ,col R ) is the location record of the spatial crowdsourcing task uploaded by the task requester R, (xrow R ,ycol R ) is the private position of the spatial crowdsourcing task uploaded by the task requester R, α is the angle between the position record of the spatial crowdsourcing task uploaded by the task requester R and the private position;
[0056] Obtain a set of task grid numbers after the private location of the spatial crowdsourcing task uploaded by the task requester is mapped to the activity range grid; wherein the activity range grid includes a plurality of non-overlapping grids with a side length of μ, and the set of task grid numbers includes the grid numbers of the activity range grids involved in the spatial crowdsourcing task uploaded by the task requester R;
[0057] A task privacy location set is generated according to a task grid number set and a secret key sent by a trusted certification authority to a task requester; wherein the task privacy location set includes a task grid number set of a spatial crowdsourcing task.
[0058] Further, similarity calculation is performed on the task private location set and the private location record set according to the Bloom filter to obtain private location records in the private location record set that meet the preset similarity. Generating the matching location set includes the following steps:
[0059] Step 1: Initialize the Bloom filter BF through the task requester Y(b, l, k, H); where Y is the set of task privacy locations, b is the length of the Bloom filter, l is the number of encoded elements, k is the number of hash functions, H is the set of hash functions, and The hash function in takes the value [0, b-1];
[0060] Get the jth hash function to participate in the initialization process, denoted as BF Y [j], where 0≤j≤b-1;
[0061] The task requester inputs the task private location set to the Bloom filter BF Y , calculate h i (y m ), BF Y [j] is set to 1 to complete the Bloom filter BF Y Initialization operation; where y m ∈Y, 1≤i≤l, y m is the grid number of the activity range grid where the privacy position of the spatial crowdsourcing task is mapped, m represents the number of elements in the Y set, and h represents the hash function;
[0062] Step 2: The cloud service provider obtains the initialized Bloom filter BF Y , perform a hash mapping h for each private location record in the private location record set i (x n ), judge BF Y Is it 1? n ∈X, X is the private location record in the private location record set, x n is the grid number where the worker’s privacy position is mapped to the activity range grid, and n represents the number of elements in the X set;
[0063] If x in each private location record n ∈X cannot be mapped to BF Y In the process, the similarity between the current private location record and the task private location is determined to be 0, and the current private location record is discarded;
[0064] Step 3: According to step 2, the private location records whose similarity with the task private location is 0 are filtered out in the private location record set to obtain a matching location set.
[0065] Furthermore, according to the privacy location set matching scheme based on the PSI protocol, the matching location set and the task privacy location set are intersected, and the location matching result is obtained and uploaded to the blockchain, including:
[0066] Step 11: Get three hash functions h1,h2,h3∈[0,1] k →[0,1]* , cuckoo hashing is performed on the grid number of the task privacy location in the task privacy location set held by the task requester, and the generated hash value is placed in 1.2m buckets and a storage bucket; where the size of the storage bucket is a constant s, and m is the number of elements in the task privacy location set;
[0067] Step 12: Obtain the hash data randomly constructed by the task requester, and fill the bucket and storage bucket in step 11; each bucket has one element, and there are exactly s elements in the storage bucket;
[0068] Step 13: Obtain a l×k random bit matrix T initialized by the task requester:
[0069]
[0070] Wherein, each element in the matrix T is 0 or 1, l = 1.2m + s;
[0071] Step 14. Generate matrix U based on matrix T:
[0072]
[0073] in, u i With t i Represents the i-th row of matrix U and matrix T, Bin_y i The element stored in bucket i corresponding to the cuckoo hash;
[0074] Step 15: Get k selection bits b=(b1, b2, ... b initialized by the cloud service provider k );
[0075] Set the task requester as the sender and the cloud service provider as the receiver, and perform k oblivious transfers of length l Among them, the input of the task requester is (t j ,u j )(1≤j≤k),t j and u j denotes the jth (1≤j≤k) column of the matrix T and U respectively, and the input of the cloud service provider is b j , when b j = 0, the task requester R gets t j , when b j = 1, the task requester R gets u j ;
[0076] Get all the column combinations received by the task requester to get the matrix Q:
[0077]
[0078] Among them, the size of matrix Q is l×k;
[0079] Step 16: When there is a task privacy position that matches the privacy positions of multiple workers, obtain the l = 1.2m + s buckets generated by the cloud service provider for each matching position set, and use the hash functions h1, h2, h3 to calculate the binary bit string of the grid number in the matching position set, and for each x∈X', obtain h1(y), h3(y), h3(y), and put them into the corresponding first 1.2n buckets, where X' is the matching position set;
[0080] Put each x into the last s buckets and generate two sets:
[0081] S X,1 ={h i (x),bin j │x∈X',i∈{1,2,3},j∈{1,…,1.2n}}
[0082] S X,2 ={x,bin 1.2n+j │x∈X',j∈{1,…,s}}
[0083] Among them, bin j represents the jth hash bucket;
[0084] The task requester traverses the elements in all buckets and the matrix Q. For bucket j (1≤j≤1.2m+s), the encoding function is used to generate C(r′) for each element r′ in the bucket, and then the calculation is performed with the j-th row of the matrix Q to generate two sets:
[0085]
[0086]
[0087] x∈bin_{1.2n+j}
[0088] Step 17: Get the set S' generated by the task requester X,1 and the set S' X,2 Send it to the cloud service provider and calculate the hash value of each row of matrix T:
[0089] Hash j =h4(j,t)(1≤j≤1.2n+s)
[0090] For the cuckoo hash, the elements in each bucket correspond to each row j in the matrix T. If 1≤j≤1.2n, the matrix hash value corresponding to the bucket can be found in the set S' X,1Or the matrix hash value corresponding to the bucket 1.2n<j≤1.2n+s can be found in the set S' X,2 If it is found in , it means that the privacy location coordinates of the current idle worker K match the privacy location coordinates of the task. The cloud service provider CS saves all matching results, generates a location matching result and sends it to the task requester R. The task requester R sends the location matching result to the blockchain through the blockchain node.
[0091] Furthermore, according to the location matching results, task requests and workers’ idle status, the crowdsourcing tasks in the task requests are dynamically allocated through the blockchain, including:
[0092] When the task requester sends the location matching result to the blockchain through the blockchain node, an association relationship between the location matching result and the corresponding task request is established based on the unique identifier of the space crowdsourcing task and the unique identity identifier of the task requester;
[0093] After receiving the location matching result, the blockchain verifies whether the set in the location matching result is empty. If it is empty, the task allocation fails and a failure prompt is returned to the task requester.
[0094] If it is not empty, the blockchain selects the corresponding number of idle workers based on the association between the location matching result and the corresponding task request, according to the number of people required in the corresponding task request, changes the status of the selected idle workers to a busy state, and returns the spatial crowdsourcing task to the selected idle workers.
[0095] The beneficial effects of the present invention are:
[0096] 1. A spatial crowdsourcing task allocation scheme based on blockchain and privacy set intersection is proposed, which uses cloud service resources for outsourcing computing and achieves safe, reliable and efficient task allocation;
[0097] 2. During the entire process of task assignment, the location of the worker and the task requester are encrypted private locations, ensuring the location privacy of both.
[0098] 3. In the position matching stage, the privacy set intersection algorithm used can achieve one-to-many position matching, that is, matching a task position with all idle worker positions, reducing the complexity of the calculation;
[0099] 4. The cloud service provider outsources workers to perform location matching. Workers only need to upload their private location and do not need to worry about subsequent location matching calculations, saving workers' computing resources.
[0100] Other advantages, objectives and features of the present invention will be described in the following description and will be apparent to those skilled in the art to some extent, or they may be taught from the practice of the present invention. The purposes and other advantages of the present invention may be realized and obtained by the structures particularly pointed out in the written description and the accompanying drawings.
[0101] The technical solution of the present invention is further described in detail below through the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0102] The accompanying drawings are used to provide a further understanding of the present invention and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the present invention and do not constitute a limitation of the present invention. In the accompanying drawings:
[0103] Figure 1 This is a method flow chart of a spatial crowdsourcing task allocation method based on blockchain and privacy computing in an embodiment of the present invention;
[0104] Figure 2 This is a schematic diagram of a specific execution process of a spatial crowdsourcing task allocation method based on blockchain and privacy computing in an embodiment of the present invention;
[0105] Figure 3 A schematic diagram of the workflow of a trusted certification authority in a spatial crowdsourcing task allocation method based on blockchain and privacy computing in an embodiment of the present invention;
[0106] Figure 4 This is another workflow diagram of a trusted certification agency in a spatial crowdsourcing task allocation method based on blockchain and privacy computing in an embodiment of the present invention. DETAILED DESCRIPTION
[0107] The preferred embodiments of the present invention are described below in conjunction with the accompanying drawings. It should be understood that the preferred embodiments described herein are only used to illustrate and explain the present invention, and are not used to limit the present invention.
[0108] like Figure 1 As shown, the present invention proposes a spatial crowdsourcing task allocation method based on blockchain and privacy computing, comprising:
[0109] S101. Obtain the location records uploaded by the workers, perform privacy calculation and encryption to obtain the privacy location records, and upload the privacy location records to the blockchain based on the smart contract;
[0110] S102, obtaining the task request uploaded by the task requester and sending it to the blockchain. When the blockchain receives the task request, it calls the private location record through the smart contract interface and sends it to the cloud service provider;
[0111] S103, based on the Bloom filtering and privacy set intersection method, matching the task privacy location set held by the task requester and the privacy location record set held by the cloud service provider, obtaining the location matching result and uploading it to the blockchain;
[0112] S104, dynamically allocating crowdsourcing tasks in the task request through blockchain according to the location matching result, the task request and the worker's idle state;
[0113] The working principle of the above technical solution is: please refer to Figure 2The present invention proposes a spatial crowdsourcing task allocation method based on blockchain and privacy computing. First, in the initialization phase, the system is initialized and the necessary initial parameters are set; in the location recording phase, the worker generates his own location record and sends it to the blockchain through a contract call; the requester sends a task request in the task submission phase, which is saved by the blockchain; and the requester calculates the privacy position of the task position, while the blockchain calculates the ciphertext set of the idle worker privacy position, and the cloud service provider receives the ciphertext set through a contract interface call; in the location matching phase, the worker privacy position ciphertext set held by the cloud service provider and the task location set held by the requester are subjected to Bloom filtering and privacy set intersection to generate a worker set. The result of the combination; in the task allocation stage, the requester uploads the location matching result to the blockchain, and the blockchain adjusts and allocates the worker status; the system model corresponding to this method consists of five entities, including the requester, the worker, the blockchain, the trusted certification authority and the cloud service provider; among them, the task requester: the task requester is responsible for initiating the task request and submitting the task description to the blockchain. The requester can calculate the privacy location of the real location of the task through location-based differential privacy, and then match the location with the privacy location set of the workers owned by the cloud service provider to obtain the qualified worker set result and submit the result to the blockchain; workers: workers regularly calculate their real location through location-based differential privacy The private location is obtained and encrypted, and then the encrypted ciphertext of the private location is uploaded to the blockchain through communication; blockchain network: first, the block nodes are reasonably deployed in various corners of the city, and each participating entity can communicate with the blockchain through these nodes. The blockchain is mainly responsible for saving the workers' private location ciphertext and changing the workers' working status, and calculating the idle worker set when the requester publishes the task. At the same time, when receiving the location matching result of the requester, the appropriate worker is selected to assign the task according to the number of workers described in the task; cloud service provider: considering the computing limitations of workers' mobile devices, the solution uses cloud service providers to replace workers to perform outsourced computing of location matching. The cloud service provider is responsible for collecting data from the district The blockchain obtains the ciphertext of the private location information of the idle workers, then decrypts and verifies it, and performs location matching privacy calculations with the requester. Since the cloud service provider obtains the private location of the workers, it cannot infer the real location of the workers, ensuring the privacy of the workers' location when outsourcing calculations; Trusted certification authority: Trusted certification authorities are generally institutions with a certain trust foundation, such as governments or large guarantee companies. They are responsible for the identity authentication of all entities in the entire system. Whenever an entity joins the system, it needs to communicate with the trusted certification authority to obtain an identity certificate and synchronize it to the blockchain. At the same time, the trusted certification authority also needs to initialize the location grid parameters and differential privacy calculation parameters during the system initialization phase;
[0114] The beneficial effects of the above technical solution are: a spatial crowdsourcing task allocation scheme based on blockchain and privacy set intersection is proposed, and cloud service resources are used for outsourced computing to achieve safe, reliable and efficient task allocation; in the entire process of task allocation, the worker location and the task requester's location are both encrypted private locations, while ensuring the location privacy of both; in the location matching stage, the privacy set intersection algorithm used can achieve one-to-many location matching, that is, a task location is matched with all idle worker locations at one time, reducing the complexity of the calculation; the cloud service provider outsources the workers to perform location matching, and the workers only need to upload their own private locations and do not need to worry about subsequent location matching calculations, saving the workers' computing resources.
[0115] See also Figure 3 , Figure 4 In one embodiment, a spatial crowdsourcing task allocation method based on blockchain and privacy computing further includes:
[0116] S201, select a trusted certification body;
[0117] S202, creating trusted certificates for the workers, task requesters, and cloud service providers that are newly added to the allocation system corresponding to the spatial crowdsourcing task allocation method according to the trusted certification authority, and calling the RSA algorithm to generate key pairs corresponding to the workers, task requesters, and cloud service providers respectively;
[0118] S203, sending the generated key pair to the corresponding worker, task requester and cloud service provider through a trusted certification authority;
[0119] S301, dividing a location-based service map into a plurality of non-overlapping grids with a side length of μ through a trusted certification authority; wherein each non-overlapping grid is assigned a grid number according to a preset order;
[0120] S302, obtaining grid information public parameters and preset privacy budgets contained in non-overlapping grids and sending them to workers and task requesters who create trusted certificates;
[0121] S303, obtain a trusted certificate and upload it to the blockchain;
[0122] The working principle and beneficial effects of the above technical solution are as follows: for worker W in the system, TA creates a certificate Cert for W W , and call the RSA algorithm to generate a key pair (pk W ,sk W ) ; Perform the same operation for the requester R of the SC task and the cloud service provider CS to generate the certificate Cert R ,Cert CS and key pair (pk R ,sk R), (pk CS ,sk CS ); Then, TA divides the location-based service map into multiple non-overlapping grids with a side length of μ, and assigns a grid number to each grid in sequence. In this application, the grid number is preset as a binary non-repeating string; Finally, TA sends the grid information public parameters and privacy budget ε to each worker and task requester, and sends the corresponding key (pk W ,sk W ), (pk R ,sk R ) and (pk CS ,sk CS ) are sent to W, R and CS respectively; the blockchain administrator BLM is responsible for initializing the blockchain and smart contracts LocationContract(), TaskContract(), ResultContract(); W, R and CS generate their own blockchain addresses addr W ,addr R and addr CS .
[0123] In one embodiment, the location records uploaded by the workers are obtained and encrypted by privacy calculation to obtain the privacy location records, and the privacy location records are uploaded to the blockchain based on the smart contract, including:
[0124] Get the location record (row, col) uploaded by the worker, i.e. the Cartesian coordinates, and the selected random value σ W ∈[0,1);
[0125] Based on geographic indistinguishability, the geo-differential privacy value is calculated based on the random value chosen by the worker:
[0126]
[0127] Among them, r W is the geographical differential privacy value of worker W, ε is the preset privacy budget, σ W is a random value selected by the worker, e is a natural constant, and w -1 is the Lambert W function, -1 branch;
[0128] Geographically indistinguishable attributes are used to hide the real location to achieve privacy protection when outsourcing computing to cloud service providers;
[0129] Calculate the worker's private location based on the geo-differential privacy value and the worker's location record:
[0130] xrow W =row W +r W cosθ,θ∈[0,2π)
[0131] ycol W =col W +r W sinθ,θ∈[0,2π)
[0132] Among them, (row W ,col W ) is the position record of worker W, (xrow W ,ycol W ) is the private position of worker W, θ is the angle between the position record of worker W and the private position, specifically: connect the coordinates of the position record and the private position into a line, and obtain the angle formed by this line relative to the horizontal axis of the Cartesian coordinate system as θ;
[0133] Get the worker grid number set X = {x1, x2, ..., x n}; wherein the activity range grid includes a plurality of non-overlapping grids with a side length of μ, and the worker grid number set includes the grid number of the worker's current activity range grid;
[0134] Obtain the private key sent to the worker by the trusted certification authority, and determine the worker's signature information based on the private key and the worker's grid number set;
[0135] The private location is encrypted based on the worker’s signature information and the public key sent by the trusted certification authority to the cloud service provider to generate a private location record:
[0136]
[0137] Among them, recorded W For worker W’s private location record, X‖Cert W ‖T W is the signature information of worker W, T W The valid timestamp of the location record uploaded by the worker is preset. W is the worker’s private key, pk cs is the public key of the cloud service provider, X is the set of worker grid numbers of worker W, Sign the public key of the cloud service provider. Indicates encryption with the worker's private key, Cert W Credible certificates for workers;
[0138] Get the blockchain address addr of worker W W , call the AddLocation() method of the worker location contract LC according to the blockchain address and upload the private location record to the blockchain.
[0139] In one embodiment, a task request uploaded by a task requester is obtained and sent to the blockchain. When the blockchain receives the task request, the private location record is called through the smart contract interface and sent to the cloud service provider, including:
[0140] Get the task request uploaded by the task requester TD = {Rid, Tid, reward, number, [t beg ,t end ]}; Among them, the task request includes the requester's unique identity Rid, the task release unique identity Tid, the task reward reward, the required number of people number and the time limit [t beg ,t end ];
[0141] Get the blockchain address addr of the task requester R , according to the blockchain address addr R Call the task release contract TC and upload the task request to the blockchain;
[0142] The blockchain verifies the authenticity of the task request by performing trusted verification on the trusted certificate of the task requester. After the verification is passed, the cloud service provider calls the private location records of idle workers on the blockchain through the smart contract interface to generate a collection of private location records.
[0143] The blockchain contract TC queries the currently recorded idle workers W and generates a set of private location records of idle workers within the validity period;
[0144] When the cloud service provider receives the private location record of the idle worker, the private location record is decrypted by the private key sent to the cloud service provider by the trusted certification authority and the private key of the corresponding idle worker;
[0145] If the decryption fails, the cloud service provider abandons the private location record of the idle worker;
[0146] The private location records of all successfully decrypted idle workers are obtained to generate a private location record set; wherein the private location record set includes a worker grid number set X corresponding to each idle worker.
[0147] In one embodiment, based on the Bloom filtering and privacy set intersection method, the task privacy location set held by the task requester and the privacy location record set held by the cloud service provider are matched, and the location matching result is obtained and uploaded to the blockchain, including:
[0148] Obtain a collection of private location records held by the cloud service provider;
[0149] Get the task private location set held by the task requester;
[0150] Calculate the similarity between the task private location set and the private location record set according to the Bloom filter, obtain the private location records in the private location record set that meet the preset similarity, and generate a matching location set;
[0151] According to the privacy location set matching scheme based on the PSI protocol, the privacy set intersection of the matching location set and the task privacy location set is performed, and the location matching result is uploaded to the blockchain.
[0152] In one embodiment, obtaining a task privacy location set held by a task requester includes:
[0153] Get the location record (row, col) of the spatial crowdsourcing task uploaded by the task requester and the selected random value σ R ∈[0,1);
[0154] Based on geographic indistinguishability, the geo-differential privacy value is calculated based on the random value chosen by the task requester:
[0155]
[0156] Among them, r R is the geographic differential privacy value of the spatial crowdsourcing task uploaded by the task requester R, ε is the preset privacy budget, σ R is a random value selected by the task requester R, e is a natural constant, and w -1 is the Lambert W function, -1 branch;
[0157] The private location of the spatial crowdsourcing task is calculated based on the geographic differential privacy value and the location record of the spatial crowdsourcing task uploaded by the task requester:
[0158] xrow R =row R +r R cosα,α∈[0,2π)
[0159] ycol R =col R +r R sinα,α∈[0,2π)
[0160] Among them, (row R ,col R ) is the location record of the spatial crowdsourcing task uploaded by the task requester R, (xrow R ,ycol R) is the private position of the spatial crowdsourcing task uploaded by the task requester R, α is the angle between the position record of the spatial crowdsourcing task uploaded by the task requester R and the private position, specifically: connect the coordinates of the position record and the private position into a line, and obtain the angle formed by this line relative to the horizontal axis of the Cartesian coordinate system as α;
[0161] Get the task grid number set Y = {y1, y2, ..., y m}; wherein the activity range grid includes a plurality of non-overlapping grids with a side length of μ, and the task grid number set includes the grid numbers of the activity range grids involved in the spatial crowdsourcing task uploaded by the task requester R;
[0162] A task privacy position set is generated according to the task grid number set and the secret key sent by the trusted certification authority to the task requester; wherein the task privacy position set includes the task grid number set Y of the spatial crowdsourcing task.
[0163] In one embodiment, similarity calculation is performed on the task private location set and the private location record set according to the Bloom filter to obtain private location records in the private location record set that meet a preset similarity, and generating a matching location set includes the following steps:
[0164] Step 1: Initialize the Bloom filter BF through the task requester Y (b, l, k, H); where Y is the set of task privacy locations, b is the length of the Bloom filter, l is the number of encoded elements, k is the number of hash functions, H is the set of hash functions, and The hash function in takes the value [0, b-1];
[0165] Get the jth hash function to participate in the initialization process, denoted as BF Y [j], where 0≤j≤b-1;
[0166] The task requester inputs the task private location set to the Bloom filter BF Y , calculate h i (y m ), BF Y [j] is set to 1 to complete the Bloom filter BF Y Initialization operation; where y m ∈Y, 1≤i≤l, y m is the grid number of the activity range grid where the privacy position of the spatial crowdsourcing task is mapped, m represents the number of elements in the Y set, and h represents the hash function;
[0167] Step 2: The cloud service provider obtains the initialized Bloom filter BF Y, perform a hash mapping h for each private location record in the private location record set i (x n ), judge BF Y Is it 1? n ∈X, X is the private location record in the private location record set, x n is the grid number where the worker’s privacy position is mapped to the activity range grid, and n represents the number of elements in the X set;
[0168] If x in each private location record n ∈X cannot be mapped to BF Y In the process, the similarity between the current private location record and the task private location is determined to be 0, and the current private location record is discarded;
[0169] Step 3: According to step 2, filter out the private location records whose similarity with the task private location is 0 in the private location record set, and obtain the matching location set X′={x1,x2,...,x n};
[0170] The working principle and beneficial effects of the above technical solution are as follows: The filtering design is mainly divided into three steps: 1) The task requester and the cloud service provider initialize the Bloom filter (b, l, k, H), where the parameter b represents the length of the Bloom filter, l represents the number of encoded elements, k represents the number of hash functions, and H represents the set of hash functions; the set of hash functions The hash function in takes the value [0, b-1]; the requester R initializes and generates the Bloom filter BF Y , where the i-th (0≤i≤b-1) bit is denoted as BF Y [i]; Requester R inputs Y, for each y m ∈Y, calculate h i (y m )(1≤i≤l), BF Y [i] is set to 1; 2) The cloud service provider receives the Bloom filter BF of the requester R for the input Y Y , for X={x1,x2,...,x n}, for each x n ∈X hash map h i (x n )(1≤i≤l)Find BF Y Is it equal to 1? If each x n ∈X cannot be mapped to BF Y , it indicates that the similarity between the worker's location and the task location is 0; 3) The cloud service provider follows the above steps for each idle worker w iMapping the privacy positions of workers, filtering out most of the workers with similarity of 0, and taking the remaining workers as position matching objects, we get X′=set{p(X,BF Y )! =0}.
[0171] In one embodiment, according to the privacy location set matching scheme based on the PSI protocol, the matching location set and the task privacy location set are intersected by privacy sets, and the location matching result is obtained and uploaded to the blockchain, including:
[0172] Step 11: Get three hash functions h1,h2,h3∈[0,1] k →[0,1] * , cuckoo hashing is performed on the grid number of the task privacy location in the task privacy location set held by the task requester, and the generated hash value is placed in 1.2m buckets and a storage bucket; where the size of the storage bucket is a constant s, and m is the number of elements in the task privacy location set;
[0173] Step 12: Obtain the hash data randomly constructed by the task requester, and fill the bucket and storage bucket in step 11; each bucket has one element, and there are exactly s elements in the storage bucket;
[0174] Step 13: Obtain a l×k random bit matrix T initialized by the task requester:
[0175]
[0176] Wherein, each element in the matrix T is 0 or 1, l = 1.2m + s;
[0177] Step 14. Generate matrix U based on matrix T:
[0178]
[0179] in, u i With t i Represents the i-th row of matrix U and matrix T, Bin_y i The element stored in bucket i corresponding to the cuckoo hash;
[0180] Step 15: Get k selection bits b=(b1, b2, ... b initialized by the cloud service provider k );
[0181] Set the task requester as the sender and the cloud service provider as the receiver, and perform k oblivious transfers of length l Among them, the input of the task requester is (t j ,u j)(1≤j≤k),t j and u j denotes the jth (1≤j≤k) column of the matrix T and U respectively, and the input of the cloud service provider is b j , when b j = 0, the task requester R gets t j , when b j = 1, the task requester R gets u j ;
[0182] Get all the column combinations received by the task requester to get the matrix Q:
[0183]
[0184] Among them, the size of matrix Q is l×k;
[0185] Step 16: When there is a task privacy position that matches the privacy positions of multiple workers, obtain the l = 1.2m + s buckets generated by the cloud service provider for each matching position set, and use the hash functions h1, h2, h3 to calculate the binary bit string of the grid number in the matching position set, and for each x∈X', obtain h1(y), h3(y), h3(y), and put them into the corresponding first 1.2n buckets, where X' is the matching position set;
[0186] Put each x into the last s buckets and generate two sets:
[0187] S X,1 ={h i (x),bin j │x∈X',i∈{1,2,3},j∈{1,…,1.2n}}
[0188] S X,2 ={x,bin 1.2n+j │x∈X',j∈{1,…,s}}
[0189] Among them, bin j represents the jth hash bucket;
[0190] The task requester traverses the elements in all buckets and the matrix Q. For bucket j (1≤j≤1.2m+s), the encoding function is used to generate C(r′) for each element r′ in the bucket, and then the calculation is performed with the j-th row of the matrix Q to generate two sets:
[0191]
[0192]
[0193] x∈bin_{1.2n+j}
[0194] Step 17: Get the set S' generated by the task requester X,1 and the set S' X,2 Send it to the cloud service provider and calculate the hash value of each row of matrix T:
[0195] Hash j =h4(j,t)(1≤j≤1.2n+s)
[0196] For the cuckoo hash, the elements in each bucket correspond to each row j in the matrix T. If 1≤j≤1.2n, the matrix hash value corresponding to the bucket can be found in the set S' X,1 Or the matrix hash value corresponding to the bucket 1.2n<j≤1.2n+s can be found in the set S' X,2 If it is found in , it means that the privacy position coordinates of the current idle worker K match the privacy position coordinates of the task. The cloud service provider CS saves all matching results, generates a position matching result and sends it to the task requester R. The task requester R sends the position matching result to the blockchain through the blockchain node;
[0197] The working principle and beneficial effects of the above technical solution are as follows: for the private location set X′1, X′2, …, X′ owned by the cloud service provider n To find the intersection between the private location set Y owned by the requester R, we design a private location set matching scheme based on the PSI protocol. The algorithm is as follows:
[0198]
[0199]
[0200] In the preprocessing phase of the PSI protocol based on oblivious transfer, first, the requester R and the cloud service provider CS initialize the calculation parameters and negotiate a common random encoding function C:{0,1} * →[0,1] k It is used to pre-process the set data in a unified manner. In our scheme, 128-bit AES is used for encoding. The specific structure is to perform 4 AES operations and then concatenate them, as shown in the formula:
[0201] C(·)=AES(1||·)||AES(2||·)||AES(3||·)||AES(4||·)
[0202] Among them, r is the privacy coordinate, the length of C(r) is k, 3K≤k≤4K is the security parameter, generally 128; then, R and CS are preprocessed to respectively <y>and workers privacy location <x>, encoded as a k-bit binary string.<C(y)><C(x)> Next, R numbers each grid in Y it holds;
[0203] Use three hash functions h1,h2,h3∈[0,1] k →[0,1] * Perform cuckoo hashing and put the generated hash values into 1.2m buckets and a storage bucket. The size of the storage bucket is a constant s, and m is the size of the set Y. Then, R constructs random hash data to fill these buckets and the storage bucket so that each bucket has one element and there are exactly s elements in the storage bucket.
[0204] Next, R initializes an l×k random bit matrix T, where each element is either 0 or 1, and the size of l is 1.2m+s;
[0205]
[0206] Then, generate the matrix U
[0207]
[0208] make where u i With t i They represent the i-th row of U and T respectively, and Bin_y_I is the element stored in the corresponding bucket i of cuckoohash;
[0209] CS randomly initializes k selected bits b=(b1,b2,...b k ); R acts as the sender and CS acts as the receiver, performing k oblivious transmissions of length l For the i-th oblivious transmission of length l, the input of R is (t j ,u j )(1≤j≤k),t j and u j denotes the jth (1≤j≤k) column of the matrices T and U respectively; the input of CS is b j ;
[0210] When b j = 0, R gets t j , when b j =1, R gets u j , combine all the columns received by R into an l×k matrix Q:
[0211]
[0212] in,
[0213] In the one-to-many case, the location of a task needs to match the locations of multiple workers. We optimize the algorithm and use one communication of the Q matrix to complete the bucket operation of the private locations of all CS workers. Specifically, CS generates l=1.2n+s buckets for each X, and uses the hash functions h1, h2, and h3 to operate the encoded binary bit strings in X it holds. For each x∈X, h1(y), h3(y), and h3(y) are obtained and placed in the corresponding first 1.2n buckets. At the same time, each x is placed in the last s buckets to generate two sets:
[0214] S X,1 ={h i (x),bin j │x∈X',i∈{1,2,3},j∈{1,…,1.2n}}
[0215] S X,2 ={x,bin 1.2n+j │x∈X',j∈{1,…,s}}
[0216] Next, R traverses the elements in all buckets and the matrix Q. For bucket j (1≤j≤1.2m+s), the encoding function is applied to each element r′ in the bucket to generate C(r′). Then, it is calculated with the j-th row of the matrix Q to generate two sets:
[0217]
[0218]
[0219] R sends two sets S′1, S′2 to CS, and CS calculates the hash value of each row of matrix T:
[0220] Hash j =h4(j,t)(1≤j≤1.2n+s)
[0221] For each element in each bucket of the cuckoo hash, corresponding to each row j in the matrix T, if the matrix hash value corresponding to bucket 1≤j≤1.2n can be found in set S′1, or the matrix hash value corresponding to bucket 1.2n<j≤1.2n+s can be found in set S′2, then the privacy position coordinates of the current worker match the privacy position coordinates of the task; CS saves the number of matching coordinates of the current computing worker and repeats for each idle worker w i Perform position matching calculations; after completing the position matching calculations for all workers, sort the number of matching coordinates for each worker, generate a result set result and send it to R.
[0222] In one embodiment, crowdsourcing tasks in task requests are dynamically allocated through blockchain based on location matching results, task requests, and worker idleness, including:
[0223] When the task requester sends the location matching result to the blockchain through the blockchain node, an association relationship between the location matching result and the corresponding task request is established based on the unique identifier of the space crowdsourcing task and the unique identity identifier of the task requester;
[0224] After receiving the location matching result, the blockchain verifies whether the set in the location matching result is empty. If it is empty, the task allocation fails and a failure prompt is returned to the task requester.
[0225] If it is not empty, the blockchain selects a corresponding number of idle workers based on the correlation between the location matching result and the corresponding task request according to the number of people required in the corresponding task request, changes the status of the selected idle workers to the busy status, and returns the spatial crowdsourcing task to the selected idle workers;
[0226] The working principle and beneficial effects of the above technical solution are as follows: after the spatial crowdsourcing task requester R completes the location matching with the cloud service provider CS, the requester R publishes the result set result; the requester R sends the result to the blockchain through the blockchain node, and links it to the corresponding task request TD through the spatial crowdsourcing task identifier Tid and the requester identifier Rid; then, the blockchain verifies whether the set is empty; if it is empty, it means that the current spatial crowdsourcing task cannot find suitable workers and the task allocation fails; if it is not empty, the blockchain selects the corresponding number of workers w according to the task number i , change its idle state to free, mark it in busy state busy, and notify the matching worker w i Perform spatial crowdsourcing tasks.
[0227] Furthermore, this solution also designs smart contracts, including worker location contracts, task submission contracts, and allocation result contracts. To address the problem of malicious platform attacks in the traditional spatial crowdsourcing model, a decentralized task submission-location calculation-task allocation model is designed, and three smart contracts are designed to interact with entities in spatial crowdsourcing;
[0228] The worker location contract provides a method for managing worker location record information. By calling addLocation(), the worker's current location information is added to the blockchain. We use 4 key, value pairs to store worker information. The keys are the worker ID Wid, the encrypted location information Location record valid time t i , worker status state (set to free and busy); at the same time, maintain a key, value of all currently registered workers, the key is workerList, and the collection is updated when a new worker is added; the contract algorithm is:
[0229]
[0230] UpdateLocation(): If the worker w i The position has changed and the current record needs to be modified i ;
[0231] UpdateLocation() implements the update of LC. It calls the put interface provided by chainmaker to overwrite the old value, but UpdateLocation() does not update the value of workerList.
[0232] DeleteLocation(): When you want to delete a worker's record, call the DeleteLocation() method in LC. When deleting, verify whether the caller's identity is correct, as shown in the following algorithm:
[0233]
[0234] QueryLocation(): It implements the LC query method. The entity or contract uses Wid to call the Get interface provided by chainmaker to obtain the worker location information;
[0235] The task submission contract is responsible for managing the tasks submitted by the task requester and generating the corresponding worker location set for the cloud service provider. It first verifies the legitimacy of the requester's identity, then checks the validity of the time attribute of the submitted task description, and then checks the workers in the current workerList who are idle and whose time is within the valid range, and generates a freeworkerList. The specific algorithm is:
[0236]
[0237]
[0238] QueryfreeworkerList(): By calling the TC's QueryfreeworkerList() method, the cloud service provider can obtain the set of free worker location records at the time the task is published. Specifically, it queries the value string corresponding to the key keyword freeworkerList, and then obtains the record through the get() method. i ;
[0239] The assignment result contract is responsible for managing the final results of the task, checking the correctness of the result set, then assigning workers, and updating the worker status. The specific algorithm includes:
[0240]
[0241] Finally, it should be noted that the above preferred embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail through the above preferred embodiments, those skilled in the art should understand that various changes can be made in form and details without departing from the scope defined by the claims of the present invention.< / x> < / y>
Claims
1. A spatial crowdsourcing task allocation method based on blockchain and privacy computing, characterized in that: include: Obtain the location records uploaded by the workers, perform privacy calculation and encryption to obtain the private location records, and upload the private location records to the blockchain based on the smart contract call; Obtain the task request uploaded by the task requester and send it to the blockchain. When the blockchain receives the task request, it calls the private location record through the smart contract interface and sends it to the cloud service provider; Based on the Bloom filtering and privacy set intersection method, the task privacy location set held by the task requester and the privacy location record set held by the cloud service provider are matched, and the location matching result is uploaded to the blockchain; Based on the location matching results, task requests and workers’ idle status, crowdsourcing tasks in task requests are dynamically allocated through blockchain; Based on the Bloom filtering and privacy set intersection method, the task privacy location set held by the task requester and the privacy location record set held by the cloud service provider are matched, and the location matching results are uploaded to the blockchain, including: Obtain a collection of private location records held by the cloud service provider; Get the task private location set held by the task requester; Calculate the similarity between the task private location set and the private location record set according to the Bloom filter, obtain the private location records in the private location record set that meet the preset similarity, and generate a matching location set; According to the privacy location set matching scheme based on the PSI protocol, the matching location set and the task privacy location set are intersected, and the location matching result is uploaded to the blockchain; The similarity between the task private location set and the private location record set is calculated according to the Bloom filter to obtain the private location records in the private location record set that meet the preset similarity. The generation of the matching location set includes the following steps: Step 1: Initialize Bloom filter through task requester ;in, is the task privacy location set, is the length of the Bloom filter, is the number of elements encoded, is the number of hash functions, is a set of hash functions, a set of hash functions The hash function in is ; Get the jth hash function to participate in the initialization process, denoted as ,in, ; The task requester inputs the task private location set to the Bloom filter In the calculation ,Will Set to 1 to complete the Bloom filter Initialization operation; among them, , , The privacy location of the spatial crowdsourcing task is mapped to the grid number of the activity range grid, m represents the number of elements in the collection, represents a hash function; Step 2: The cloud service provider obtains the initialized Bloom filter , perform hash mapping for each private location record in the private location record set ,judge Is it 1? , X is the private location record in the private location record set, is the grid number where the worker’s privacy position is mapped to the activity range grid, and n represents the number of elements in the X set; If each private location record Cannot be mapped to In the process, the similarity between the current private location record and the task private location is determined to be 0, and the current private location record is discarded; Step 3: According to step 2, the private location records whose similarity with the task private location is 0 are filtered out in the private location record set to obtain a matching location set; According to the privacy location set matching scheme based on the PSI protocol, the matching location set and the task privacy location set are intersected, and the location matching results are uploaded to the blockchain, including: Step 11: Get three hash functions , cuckoo hashing is performed on the grid number of the task privacy location in the task privacy location set held by the task requester, and the generated hash value is placed in 1.2m buckets and a storage bucket; where the size of the storage bucket is a constant s, and m is the number of elements in the task privacy location set; Step 12: Obtain the hash data randomly constructed by the task requester, and fill the bucket and storage bucket in step 11; each bucket has one element, and there are exactly s elements in the storage bucket; Step 13: Get a task requester to initialize The random bit matrix T is: In which, each element in the matrix T is either 0 or 1. ; Step 14. Generate matrix U based on matrix T: in, , and denote the i-th row of matrix U and matrix T respectively, The element stored in bucket i corresponding to the cuckoo hash; Step 15: Get k selection bits initialized by the cloud service provider ; Set the task requester as the sender, the cloud service provider as the receiver, and execute k times with a length of Inadvertent transmission ; Among them, the input of the task requester is , and denote the first The cloud service provider’s input is ,when When the task requester R gets ,when When the task requester R gets ; Get all the column combinations received by the task requester to get the matrix Q: Among them, the size of the matrix Q is ; Step 16: When there is a task privacy location that matches multiple workers' privacy locations, obtain the cloud service provider generated for each matching location set. buckets, and use the hash function to match the grid number binary string in the position set After the calculation, for each ,get , put into the corresponding first 1.2n buckets, where is the set of matching positions; Put each x into the last s buckets and generate two sets: in, represents the jth hash bucket; Use the task requester to traverse the elements and matrix Q in all buckets, and , for each element in the bucket Generate encoding function , and calculate with the j-th row of matrix Q to generate two sets: Step 17: Get the collection generated by the task requester and collection Send it to the cloud service provider and calculate the hash value of each row of matrix T: For the cuckoo hash, the elements in each bucket correspond to each row j in the matrix T. If The matrix hash value corresponding to the bucket can be in the set Found in, or The matrix hash value corresponding to the bucket can be in the set If it is found in , it means that the privacy position coordinates of the current idle worker K match the privacy position coordinates of the task. The cloud service provider CS saves all matching results, generates a position matching result and sends it to the task requester R. The task requester R sends the position matching result to the blockchain through the blockchain node; Based on the location matching results, task requests and worker idleness, crowdsourcing tasks in task requests are dynamically allocated through blockchain, including: When the task requester sends the location matching result to the blockchain through the blockchain node, an association relationship between the location matching result and the corresponding task request is established based on the unique identifier of the space crowdsourcing task and the unique identity identifier of the task requester; After receiving the location matching result, the blockchain verifies whether the set in the location matching result is empty. If it is empty, the task allocation fails and a failure prompt is returned to the task requester. If it is not empty, the blockchain selects the corresponding number of idle workers based on the association between the location matching result and the corresponding task request, according to the number of required people in the corresponding task request, changes the status of the selected idle workers to a busy state, and returns the spatial crowdsourcing task to the selected idle workers.
2. According to claim 1, a spatial crowdsourcing task allocation method based on blockchain and privacy computing is characterized in that: Also includes: Select a trusted certification body; According to the trusted certification authority, trusted certificates are created for the workers, task requesters and cloud service providers who have just joined the space crowdsourcing task allocation method, and the RSA algorithm is called to generate key pairs corresponding to the workers, task requesters and cloud service providers respectively; The generated key pairs are sent to the corresponding workers, task requesters, and cloud service providers through a trusted certification authority.
3. According to claim 2, a spatial crowdsourcing task allocation method based on blockchain and privacy computing is characterized in that: Also includes: By means of a trusted authentication agency, a location-based service map is divided into a plurality of non-overlapping grids with a side length of μ; wherein each non-overlapping grid is assigned a grid number according to a preset order; Obtaining the grid information public parameters and preset privacy budget contained in the non-overlapping grids and sending them to the workers and task requesters who create trusted certificates; Obtain a trusted certificate and upload it to the blockchain.
4. According to claim 1, a spatial crowdsourcing task allocation method based on blockchain and privacy computing is characterized in that: Obtain the location records uploaded by the workers and perform privacy calculation encryption to obtain the privacy location records. Based on the smart contract, call the privacy location records and upload them to the blockchain, including: Get the location records uploaded by workers and the chosen random value ; Based on geographic indistinguishability, the geo-differential privacy value is calculated based on the random value chosen by the worker: in, is the geo-differential privacy value of worker W, To set a privacy budget, is a random value chosen by the worker, e is a natural constant, is the Lambert W function, -1 branch; Calculate the worker's private location based on the geo-differential privacy value and the worker's location record: in, The location record for worker W, The privacy location of worker W. is the angle between worker W’s location record and private location; Obtain a set of worker grid numbers after the worker's private position is mapped to the activity range grid; wherein the activity range grid includes a plurality of non-overlapping grids with a side length of μ, and the set of worker grid numbers includes the grid number of the worker's current activity range grid; Obtain the private key sent to the worker by the trusted certification authority, and determine the worker's signature information based on the private key and the worker's grid number set; The private location is encrypted based on the worker’s signature information and the public key sent by the trusted certification authority to the cloud service provider to generate a private location record: in, For worker W's private location record, The signature information of worker W. The valid timestamp of the location record uploaded by the worker. is the worker's private key, is the public key of the cloud service provider, X is the set of worker grid numbers of worker W, Sign the public key of the cloud service provider. Indicates encryption with the worker's private key. Credible certificates for workers; Get the blockchain address of worker W, call the worker location contract LC according to the blockchain address, and upload the private location record to the blockchain.
5. According to claim 1, a spatial crowdsourcing task allocation method based on blockchain and privacy computing is characterized in that: The task request uploaded by the task requester is sent to the blockchain. When the blockchain receives the task request, it calls the privacy location record through the smart contract interface and sends it to the cloud service provider, including: Obtaining the task request uploaded by the task requester; wherein the task request includes the requester's unique identity, the task release unique identity, the task reward, the required number of people and the time limit; Get the blockchain address of the task requester, call the task contract TC according to the blockchain address, and upload the task request to the blockchain; The blockchain verifies the authenticity of the task request by performing trusted verification on the trusted certificate of the task requester. After the verification is passed, the cloud service provider calls the private location records of idle workers on the blockchain through the smart contract interface to generate a collection of private location records. When the cloud service provider receives the private location record of the idle worker, the private location record is decrypted by the private key sent to the cloud service provider by the trusted certification authority and the private key of the corresponding idle worker; If the decryption fails, the cloud service provider abandons the private location record of the idle worker; The private location records of all successfully decrypted idle workers are obtained to generate a private location record set; wherein the private location record set includes a set of worker grid numbers corresponding to each idle worker.
6. According to claim 1, a spatial crowdsourcing task allocation method based on blockchain and privacy computing is characterized in that: Get the task private location collection held by the task requester, including: Get the location record of the spatial crowdsourcing task uploaded by the task requester and the chosen random value ; Based on geographic indistinguishability, the geo-differential privacy value is calculated based on the random value chosen by the task requester: in, is the geo-differential privacy value of the spatial crowdsourcing task uploaded by the task requester R, To set a privacy budget, is a random value selected by the task requester R, e is a natural constant, is the Lambert W function, -1 branch; The private location of the spatial crowdsourcing task is calculated based on the geographic differential privacy value and the location record of the spatial crowdsourcing task uploaded by the task requester: in, The location record of the spatial crowdsourcing task uploaded by the task requester R. The private location of the spatial crowdsourcing task uploaded by the task requester R, The angle between the location record and the private location of the task requester R who uploads the spatial crowdsourcing task; Obtain a set of task grid numbers after the private location of the spatial crowdsourcing task uploaded by the task requester is mapped to the activity range grid; wherein the activity range grid includes a plurality of non-overlapping grids with a side length of μ, and the set of task grid numbers includes the grid numbers of the activity range grids involved in the spatial crowdsourcing task uploaded by the task requester R; A task privacy location set is generated according to a task grid number set and a secret key sent by a trusted certification authority to a task requester; wherein the task privacy location set includes a task grid number set of a spatial crowdsourcing task.
