Electronic fence detection method, electronic equipment and storage medium

By encrypting the relevant data of the electronic fence with the coordinate data of the first electronic device and transmitting it to the cloud server for ciphertext comparison, the data security and performance cost problems during electronic fence deployment are solved, and data security is improved. .

CN119172721APending Publication Date: 2024-12-20HANGZHOU HUACHENG SOFTWARE TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411077612.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-06
Publication Date
2024-12-20

AI Technical Summary

Technical Problem

When deploying electronic fences, the existing technology faces pressure on local platform performance and cost, and there is a risk of data leakage when deploying fences to third parties, affecting data security.

Method used

By encrypting the relevant data of the electronic fence and the coordinate data of the first electronic device to the cloud server, ciphertext comparison is performed to characterize the distance between the first electronic device and the electronic fence, reduce the risk of data leakage and increase the risk of Data security.

Benefits of technology

It effectively reduces the risk of leakage of plain text data, improves data security, and reduces the performance and cost pressure of local platforms.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119172721A_ABST
    Figure CN119172721A_ABST
Patent Text Reader

Abstract

The invention discloses an electronic fence detection method, electronic equipment and a storage medium, and the method comprises the steps: obtaining coordinate data of a first mobile terminal at a current position, and carrying out the vector expansion of the coordinate data, so as to determine a first coordinate data vector; splitting the first coordinate data vector into at least two first sub-vectors, and encrypting the at least two first sub-vectors to determine a first ciphertext; transmitting the first ciphertext to a cloud server, so that the cloud server compares the first ciphertext with a second ciphertext corresponding to a preset electronic fence to obtain a comparison result; receiving a comparison result, wherein the comparison result is used for representing the distance between the first mobile terminal and the preset electronic fence; that is, in the application, the coordinate data of the first mobile terminal is encrypted to obtain the first ciphertext, the first ciphertext is transmitted to the cloud server, and then the first ciphertext is compared with the second ciphertext corresponding to the preset electronic fence at the cloud server, so that the leakage risk of plaintext data is effectively reduced, and the data security is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of encrypted data processing, and in particular to an electronic fence detection method, electronic equipment, and storage medium. Background Art

[0002] With the explosive growth of computer applications, the requirements for data management are becoming increasingly higher. Among them, services corresponding to location information are becoming more and more important. For example, electronic fences based on location services use virtual electronic fences to enclose geographic boundaries, allowing electronic devices to receive corresponding notifications or warnings when entering or leaving a specific area, or moving within a specific area, thereby enhancing the device's deployment and disarming capabilities.

[0003] In practice, deploying electronic fences locally will put local devices under greater performance and cost pressures, while deploying electronic fences directly on a third party will increase the risk of data leakage, resulting in insufficient data security. Summary of the Invention

[0004] The main technical problem solved by this application is to provide an electronic fence detection method, electronic device and storage medium. By encrypting the relevant data of the electronic fence and the coordinate data of the first electronic device respectively, transmitting them to the cloud service end, and then performing ciphertext comparison on the cloud service end, and using the comparison result to represent the distance between the first electronic device and the electronic fence, the risk of data leakage can be effectively reduced and data security can be improved.

[0005] To solve the above technical problems, a technical solution adopted in the present application is: to provide an electronic fence detection method, applied to a first mobile terminal, the method including: obtaining the coordinate data of the first mobile terminal at the current position, and performing vector expansion on the coordinate data to determine the first coordinate data vector corresponding to the coordinate data; splitting the first coordinate data vector into at least two first sub-vectors, and encrypting at least two of the first sub-vectors to determine a first ciphertext; transmitting the first ciphertext to a cloud service terminal, so that the cloud service terminal compares the first ciphertext with the second ciphertext corresponding to the preset electronic fence to obtain a comparison result; receiving the comparison result, wherein the comparison result is used to characterize the distance between the first mobile terminal and the preset electronic fence.

[0006] In some embodiments, obtaining the coordinate data of the first mobile terminal at the current position and performing vector expansion on the coordinate data include: obtaining the coordinate data of the first mobile terminal at the current position through a positioning module; performing vector expansion on the coordinate data in a target dimension to determine the first coordinate data vector corresponding to the coordinate data in the target dimension.

[0007] In some embodiments, splitting the first coordinate data vector into at least two first sub-vectors and encrypting the at least two first sub-vectors to determine a first ciphertext includes: using a random dimension vector of a target dimension to split the first coordinate data vector into at least two first sub-vectors; and encrypting the at least two first sub-vectors using an encryption matrix to determine the first ciphertext corresponding to the coordinate data.

[0008] To solve the above technical problems, another technical solution adopted in this application is: to provide an electronic fence detection method, applied to a second mobile terminal, the method including: obtaining the electronic fence area of ​​the electronic fence set by the second mobile terminal, and performing vector expansion of the boundary coordinate data of the electronic fence area in the target dimension to determine the second coordinate data vector corresponding to the electronic fence area under the target dimension; splitting the second coordinate data vector into at least two second sub-vectors, and encrypting at least two second sub-vectors to determine a second ciphertext; transmitting the second ciphertext to the cloud service terminal, so that the cloud service terminal compares the second ciphertext with the first ciphertext corresponding to the first mobile terminal to obtain a comparison result; receiving the comparison result, wherein the comparison result is used to characterize the distance between the electronic fence set by the first mobile terminal and the second mobile terminal.

[0009] In some embodiments, obtaining the electronic fence area of ​​the electronic fence set by the second mobile terminal and performing vector expansion of the boundary coordinate data of the electronic fence area in the target dimension include: obtaining the boundary coordinate data of the electronic fence area corresponding to the electronic fence; performing vector expansion of the boundary coordinate data in the target dimension to determine the second coordinate data vector corresponding to the boundary coordinate data under the target dimension.

[0010] In some embodiments, splitting the second coordinate data vector into at least two second sub-vectors and encrypting the at least two second sub-vectors to determine a second ciphertext includes: using a random dimensional vector of a target dimension to split the second coordinate data vector into at least two second sub-vectors; and encrypting the at least two second sub-vectors using an encryption matrix to determine the second ciphertext corresponding to the boundary coordinate data of the electronic fence area.

[0011] In some embodiments, it also includes: generating an encryption matrix and a random dimension vector of the target dimension; using the encryption matrix and the random dimension vector to determine a public key set, and sending the public key set to the first mobile terminal so that the first mobile terminal uses the public key set for encryption.

[0012] In order to solve the above technical problems, another technical solution adopted in this application is: to provide an electronic fence detection method, applied to a cloud service end, the method including: receiving a first ciphertext transmitted by a first mobile end, and receiving a second ciphertext transmitted by a second mobile end; using the first ciphertext and the second ciphertext for comparison, and the obtained comparison result represents the distance between the preset electronic fences of the first mobile end and the second mobile end.

[0013] In some embodiments, the comparison between the first ciphertext and the second ciphertext to obtain a comparison result representing the distance between the preset electronic fences of the first mobile terminal and the second mobile terminal includes: determining a relationship formula using the first ciphertext and the second ciphertext; determining the comparison result of the first ciphertext and the second ciphertext using the judgment result of the relationship formula; wherein, when the judgment result of the relationship formula is less than the target threshold, determining that the coordinate data of the current position of the first mobile terminal is located within the electronic fence area of ​​the preset electronic fence corresponding to the second mobile terminal.

[0014] In order to solve the above technical problems, another technical solution adopted in this application is: to provide an electronic device, which includes a memory and a processor coupled to the memory, and the memory stores at least one computer program, and when the at least one computer program is loaded and executed by the processor, it is used to implement the electronic fence detection method as described above.

[0015] In order to solve the above technical problems, another technical solution adopted in this application is: providing a computer-readable storage medium, which has at least one program. When the at least one program is loaded and executed by the processor, it is used to implement the electronic fence detection method as described above.

[0016] Different from the current technology, the electronic fence detection method provided by the present application includes: obtaining the coordinate data of the first mobile terminal at the current position, and performing vector expansion on the coordinate data to determine the first coordinate data vector corresponding to the coordinate data; splitting the first coordinate data vector into at least two first sub-vectors, and encrypting at least two first sub-vectors to determine a first ciphertext; transmitting the first ciphertext to the cloud server, so that the cloud server compares the first ciphertext with the second ciphertext corresponding to the preset electronic fence to obtain a comparison result; receiving the comparison result, wherein the comparison result is used to characterize the distance between the first mobile terminal and the preset electronic fence; that is, in the present application, after the coordinate data of the first mobile terminal is encrypted to obtain the first ciphertext, it is transmitted to the cloud server, and then compared with the second ciphertext corresponding to the preset electronic fence at the cloud server, which effectively reduces the risk of leakage of plaintext data and improves data security. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for describing the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without inventive efforts. Among them:

[0018] Figure 1 This is a flow chart of an embodiment of an electronic fence detection method applied to a first mobile terminal in the present application;

[0019] Figure 2 This is a flow chart of an embodiment of an electronic fence detection method applied to a second mobile terminal in this application;

[0020] Figure 3 This is a flow chart of an embodiment of an electronic fence detection method applied to a cloud server in this application;

[0021] Figure 4 This is a structural diagram of an embodiment of an electronic fence detection system in this application;

[0022] Figure 5 This is a schematic structural diagram of an embodiment of an electronic device in this application;

[0023] Figure 6 It is a structural diagram of an embodiment of a computer-readable storage medium in this application. DETAILED DESCRIPTION

[0024] The present invention will be described in further detail below with reference to the accompanying drawings and examples. It is particularly noted that the following examples are intended only to illustrate the present invention and are not intended to limit the scope of the present invention. Similarly, the following examples are only some embodiments of the present invention and are not intended to be all embodiments. All other embodiments obtained by those of ordinary skill in the art without creative effort are intended to fall within the scope of protection of the present invention.

[0025] References herein to "embodiments" mean that a particular feature, structure, or characteristic described in connection with the embodiments may be included in at least one embodiment of the present invention. The appearance of this phrase in various places in the specification does not necessarily refer to the same embodiment, nor does it constitute a separate or alternative embodiment that is mutually exclusive of other embodiments. It is understood, both explicitly and implicitly, by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0026] Electronic fences use virtual fences to enclose the geographic boundaries of a specific area, allowing mobile devices to receive corresponding notifications or warnings when entering, leaving, or moving within the specific area, thereby enhancing the ability to deploy and deploy defenses. Traditional electronic fence technology deploys electronic fence services on local platforms. However, with the rapid increase in data volume, local platforms will face greater performance and cost pressures. Deploying electronic fences on a third party (cloud service end) will increase the risk of data leakage, affecting data security.

[0027] Therefore, an electronic fence detection method is provided, which encrypts the coordinate data of the first mobile terminal to obtain a first ciphertext, transmits it to the cloud server, and then compares it with the second ciphertext corresponding to the preset electronic fence on the cloud server, effectively reducing the risk of leakage of plaintext data, improving data security, and reducing the performance and cost pressure of the local platform.

[0028] See also Figure 1 , Figure 1 This is a flow chart of an embodiment of the electronic fence detection method applied to the first mobile terminal in this application; it should be noted that if there is a substantial result, the method of this application is not based on Figure 1 The process sequence shown is limited.

[0029] like Figure 1 As shown, the electronic fence detection method applied to the first mobile terminal may include the following steps.

[0030] S110 , obtaining coordinate data of the first mobile terminal at the current position, and performing vector expansion on the coordinate data to determine a first coordinate data vector corresponding to the coordinate data.

[0031] Among them, the first mobile terminal refers to a mobile communication device; vector expansion refers to expanding the vector dimension corresponding to the preset vector of the coordinate data, so that the coordinate data becomes a corresponding multi-dimensional data vector after vector expansion.

[0032] Specifically, the positioning module is used to obtain the coordinate data corresponding to the current position of the first mobile terminal, and the coordinate data is vector expanded using a vector of a preset dimension to expand the coordinate data into a data vector of the preset dimension, that is, the coordinate data is expanded into the first coordinate data vector corresponding to the preset dimension.

[0033] S120: Split the first coordinate data vector into at least two first sub-vectors, and encrypt the at least two first sub-vectors to determine a first ciphertext.

[0034] The splitting refers to splitting the first coordinate data vector into two or more first sub-vectors using a random dimensional vector; the encryption refers to encrypting at least two first sub-vectors obtained after the splitting using a preset encryption method to obtain a first ciphertext.

[0035] Specifically, after obtaining the first coordinate data vector corresponding to the coordinate data, the first coordinate data vector is randomly split using a random dimensional vector, and the first coordinate data vector is further split into at least two first sub-vectors; and after splitting and obtaining at least two first sub-vectors, the at least two first sub-vectors are encrypted using a preset encryption method to obtain a first ciphertext corresponding to the coordinate data of the first mobile terminal.

[0036] S130: Transmit the first ciphertext to the cloud server, so that the cloud server compares the first ciphertext with the second ciphertext corresponding to the preset electronic fence to obtain a comparison result.

[0037] Among them, the cloud server refers to an open server that can be used to store data and process data and belongs to a third party; comparison refers to the cloud server using the first ciphertext and the second ciphertext to perform a preset comparison method to determine the comparison result of the data contained in the first ciphertext and the second ciphertext.

[0038] Specifically, the first mobile terminal transmits the first ciphertext to the cloud server, so that after receiving the first ciphertext, the cloud server uses the second ciphertext corresponding to the preset electronic fence and the first ciphertext to perform a preset comparison method, and then determines the comparison result of the data contained in the first ciphertext and the second ciphertext.

[0039] S140: Receive a comparison result, where the comparison result is used to represent the distance between the first mobile terminal and the preset electronic fence.

[0040] Among them, because the comparison result is the comparison result corresponding to the first ciphertext and the second ciphertext, and the first ciphertext contains the coordinate data of the current position of the first mobile terminal, and the second ciphertext contains the boundary coordinate data of the electronic fence area of ​​the preset electronic fence, therefore, the comparison result can represent the distance between the first mobile terminal and the preset electronic fence.

[0041] Specifically, the first mobile terminal receives the comparison result returned by the cloud service terminal, and then determines the distance between the first mobile terminal and the preset electronic fence based on the comparison result.

[0042] In some embodiments, the first mobile terminal may receive a warning or expulsion message based on the comparison result.

[0043] In this embodiment, the coordinate data of the first mobile terminal is encrypted to obtain a first ciphertext, which is then transmitted to the cloud server, and then compared with the second ciphertext corresponding to the preset electronic fence on the cloud server to obtain the distance between the coordinate data of the first mobile terminal and the preset electronic fence, which effectively reduces the risk of leakage in the processing of plaintext data and improves data security.

[0044] In some embodiments, step S110 obtains the coordinate data of the first mobile terminal at the current position and performs vector expansion on the coordinate data, which may include the following operations.

[0045] First, the coordinate data of the first mobile terminal at the current position is obtained through the positioning module;

[0046] The positioning module refers to a data acquisition module that can obtain coordinate data of the current position.

[0047] Specifically, the coordinate data of the current position of the first mobile terminal can be obtained in real time through the positioning module, that is, the coordinate data corresponding to the current position can be obtained at the current time.

[0048] In some embodiments, the coordinate data of the first mobile terminal at the current position can be periodically obtained, that is, the coordinate data is obtained again after an interval time. For example, the interval time can be 1 minute, 2 minutes, etc., and the interval time can be set according to actual conditions.

[0049] Then, the coordinate data is vector-expanded in the target dimension to determine a first coordinate data vector corresponding to the coordinate data in the target dimension.

[0050] The target dimension refers to the dimensional data used for vector expansion and can be set according to actual conditions.

[0051] Specifically, after obtaining the coordinate data of the first mobile terminal at the current position, a target dimension is set, and then the coordinate data is vector-expanded according to the target dimension to form a first coordinate data vector corresponding to the target dimension.

[0052] For example, the coordinate data of the first mobile terminal at the current position is set to l i =(x i ,y i ), the target dimension is (d+η+4), then: first, (x i ,y i ) is expanded into a (η+4)-dimensional partial vector (r i ||l i || 2 ,2r i l i ,r i ,l i,η), and then use 0 to fill in the target dimension of (d+η+4) dimensions, where d is the first vector dimension configuration parameter and η is the second vector dimension configuration parameter; in some embodiments, d can be set to 8, and 4, then when obtaining the (η+4)-dimensional partial vector (r i ||l i || 2 ,2r i l i ,r i ,l i,η ), then add 8 more 0s to (d+η+4) dimensions = (8+4+4) dimensions = 16 dimensions, as follows:

[0053]

[0054] in, Represents the first coordinate data vector corresponding to the target dimension, r i Represents the first random number, l i,η represents the first random vector of η dimension, l i represents the coordinate data of the first mobile terminal at the current position, and ||·|| represents the L2 normal form.

[0055] Among them, the following conditions are met: r w is the second random number, l w,μ is the second random vector representing the η dimension, Represents the inner product operation.

[0056] In some embodiments, step S120 of splitting the first coordinate data vector into at least two first sub-vectors and encrypting the at least two first sub-vectors to determine a first ciphertext may include the following operations.

[0057] First, a first coordinate data vector is split into at least two first sub-vectors using a random dimension vector of a target dimension.

[0058] The random dimension vector refers to a random dimension vector under the target dimension; the splitting here refers to splitting the first coordinate data vector into two or more first sub-vectors.

[0059] Specifically, a random dimension vector under a target dimension is determined, and then the obtained first coordinate data vector is randomly split using the random dimension vector to obtain at least two first sub-vectors.

[0060] For example, if the target dimension is set to (d+η+4) and the random dimension vector under the target dimension is S=(1,0,1,0), then the first coordinate data vector Randomly split into two first sub-vectors For vector subscript z, set the elements from 1 to (d+η+4), then:

[0061]

[0062] Among them, the value range of z is 1-(d+η+4), represents one of the first subvectors, represents another first subvector.

[0063] Then, the at least two first sub-vectors are encrypted using an encryption matrix to determine a first ciphertext corresponding to the coordinate data.

[0064] The encryption matrix is ​​a reversible encryption matrix.

[0065] Specifically, a reversible encryption matrix is ​​set, and then the at least two first sub-vectors obtained after the split are encrypted using the reversible encryption matrix, thereby generating a first ciphertext corresponding to the coordinate data.

[0066] For example, if the reversible encryption matrix is ​​set to {M1, M2}, the two first sub-vectors are encrypted using the reversible encryption matrix {M1, M2}. Encrypt to generate the first ciphertext corresponding to the coordinate data

[0067] In this embodiment, the coordinate data of the current position corresponding to the first mobile terminal is vector expanded, vector split and encrypted with an encryption matrix to obtain the first ciphertext corresponding to the coordinate data, which greatly improves data security. The first ciphertext is then transmitted to the cloud service end for ciphertext comparison, which also reduces the performance and cost pressures of the local platform.

[0068] The present application also provides an electronic fence detection method applied to a second mobile terminal.

[0069] See also Figure 2 , Figure 2 It is a flow chart of an embodiment of an electronic fence detection method applied to a second mobile terminal in this application.

[0070] like Figure 2 As shown, the electronic fence detection method applied to the second mobile terminal may include the following operations.

[0071] S210: Acquire the electronic fence area of ​​the electronic fence set by the second mobile terminal, and perform vector expansion of the boundary coordinate data of the electronic fence area in the target dimension to determine a second coordinate data vector corresponding to the electronic fence area in the target dimension.

[0072] The second mobile terminal refers to a communication device used to set up an electronic fence.

[0073] Specifically, the electronic fence is set using the second mobile terminal to determine the electronic fence area corresponding to the electronic fence, and the boundary coordinate data of the electronic fence area is vector expanded using a preset vector of a preset dimension, and the boundary coordinate data is expanded into a data vector of a preset dimension, that is, the boundary coordinate data is expanded into a second coordinate data vector corresponding to the preset dimension.

[0074] S220: Split the second coordinate data vector into at least two second sub-vectors, and encrypt the at least two second sub-vectors to determine a second ciphertext.

[0075] Specifically, after obtaining the second coordinate data vector corresponding to the boundary coordinate data of the electronic fence, the second coordinate data is randomly split using a random dimensional vector, and the second coordinate data vector is then split into at least two second sub-vectors; and the at least two second sub-vectors are encrypted using a preset encryption method to obtain a second ciphertext corresponding to the boundary coordinate data of the electronic fence set by the second mobile terminal.

[0076] S230: Transmit the second ciphertext to the cloud server, so that the cloud server compares the second ciphertext with the first ciphertext corresponding to the first mobile terminal to obtain a comparison result.

[0077] Specifically, the second mobile terminal transmits the second ciphertext to the cloud server, so that after receiving the second ciphertext, the cloud server can use the second ciphertext to compare with the first ciphertext in a preset comparison method, and then determine the comparison result of the data contained in the first ciphertext and the second ciphertext.

[0078] S240: Receive a comparison result, where the comparison result is used to represent the distance between the electronic fences set by the first mobile terminal and the second mobile terminal.

[0079] Specifically, the second mobile terminal receives the comparison result returned by the cloud service terminal, and then determines the distance between the electronic fence and the first mobile terminal based on the comparison result, and determines the location information of the first mobile terminal.

[0080] In some embodiments, the second mobile terminal may warn or drive away the first mobile terminal based on the comparison result.

[0081] In this embodiment, the boundary coordinate data of the electronic fence set by the second mobile terminal is encrypted to obtain a second ciphertext, which is then transmitted to the cloud service terminal. The second ciphertext is then compared with the first ciphertext corresponding to the first mobile terminal on the cloud service terminal to obtain the distance between the first mobile terminal and the electronic fence, effectively reducing the risk of leakage in the processing of plaintext data and improving data security.

[0082] In some embodiments, step S210 acquires the electronic fence area of ​​the electronic fence set by the second mobile terminal, and performs vector expansion of the boundary coordinate data of the electronic fence area to the target dimension, which may include the following operations.

[0083] First, the boundary coordinate data of the electronic fence area corresponding to the electronic fence is obtained.

[0084] Specifically, after the second mobile terminal sets the electronic fence, for the electronic fence area corresponding to the electronic fence, boundary coordinate data of each boundary of the electronic fence area is obtained.

[0085] Then, the boundary coordinate data is vector-expanded in the target dimension to determine a second coordinate data vector corresponding to the boundary coordinate data in the target dimension.

[0086] The target dimension refers to the dimensional data used for vector expansion and can be set according to actual conditions.

[0087] Specifically, after obtaining the boundary coordinate data of the electronic fence corresponding to the second mobile terminal, a target dimension is set, and then the boundary coordinate data is vector-expanded according to the target dimension to form a second coordinate data vector corresponding to the target dimension.

[0088] For example, set the boundary coordinate data to l w =(x w ,y w ), the target dimension is (d+η+4), then there is a way to expand the vector based on the coordinate data to obtain the second coordinate data vector.

[0089]

[0090] in, Represents the second coordinate data vector corresponding to the target dimension, r w Represents the second random number, l w,η represents the second random vector of η dimensions, l w represents the boundary coordinate data of the electronic fence set by the second mobile terminal, and ||·|| represents the L2 paradigm.

[0091] In some embodiments, step S220 of splitting the second coordinate data vector into at least two second sub-vectors and encrypting the at least two second sub-vectors to determine a second ciphertext may include the following operations.

[0092] First, the second coordinate data vector is split into at least two second sub-vectors using a random dimension vector of the target dimension.

[0093] The random dimension vector refers to a random dimension vector under the target dimension; the splitting here refers to splitting the first coordinate data vector into two or more first sub-vectors.

[0094] Specifically, a random dimension vector under a target dimension is determined, and then the obtained second coordinate data vector is randomly split using the random dimension vector to obtain at least two second sub-vectors.

[0095] For example, if the target dimension is set to (d+η+4), and the random dimension vector under the target dimension is S=(1,0,1,0), then the second coordinate data vector Randomly split into two second sub-vectors For vector subscript z, set the elements from 1 to (d+η+4), then:

[0096]

[0097] Among them, the value range of z is 1-(d+η+4), represents one of the second subvectors, represents another second sub-vector.

[0098] Then, the at least two second sub-vectors are encrypted using the encryption matrix to determine the second ciphertext corresponding to the boundary coordinate data of the electronic fence area.

[0099] The encryption matrix is ​​a reversible encryption matrix.

[0100] Specifically, a reversible encryption matrix is ​​set, and the at least two second sub-vectors obtained after the split are encrypted using the reversible encryption matrix, thereby generating a second ciphertext corresponding to the boundary coordinate data of the electronic fence area.

[0101] For example, if the reversible encryption matrix is ​​set to {M1, M2}, the two second sub-vectors are encrypted using the reversible encryption matrix {M1, M2}. Encrypt to generate the second ciphertext corresponding to the coordinate data

[0102] in, It is to invert the matrix and then transpose it.

[0103] In some embodiments, the following operations may also be included.

[0104] Generates a random dimension vector of the encryption matrix and the target dimension.

[0105] The encryption matrix can be an existing reversible matrix, the target dimension can be set according to actual conditions, and the random dimension vector can be randomly selected under the target dimension.

[0106] A public key set is determined using an encryption matrix and a random dimension vector, and the public key set is sent to the first mobile terminal, so that the first mobile terminal performs encryption using the public key set.

[0107] After determining the encryption matrix and random dimension vector, the encryption matrix and random dimension vector can be used as a public key set, and then sent from the second mobile terminal to the first mobile terminal, so that the first mobile terminal can use the encryption matrix and random dimension vector in the public key set to perform corresponding data processing and encryption operations.

[0108] In this embodiment, the boundary coordinate data of the electronic fence corresponding to the second mobile terminal is vector expanded and vector split for encryption matrix encryption to obtain the second ciphertext corresponding to the boundary coordinate data, which greatly improves data security. The second ciphertext is then transmitted to the cloud service end for ciphertext comparison, which also reduces the performance and cost pressures of the local platform.

[0109] This application also provides an electronic fence detection method applied to a cloud service end.

[0110] See also Figure 3 , Figure 3 This is a flow chart of an embodiment of an electronic fence detection method applied to a cloud service end in this application.

[0111] like Figure 3 As shown, the electronic fence detection method applied to the cloud service end may include the following operations.

[0112] S310: Receive a first ciphertext transmitted by a first mobile terminal, and receive a second ciphertext transmitted by a second mobile terminal.

[0113] Specifically, after the first mobile terminal and the second mobile terminal generate the corresponding first ciphertext and second ciphertext respectively, the first mobile terminal actively sends the first ciphertext to the cloud service terminal, and the second mobile terminal actively sends the second ciphertext to the cloud service terminal, and the cloud service terminal directly receives the first ciphertext and the second ciphertext.

[0114] S320: Compare the first ciphertext and the second ciphertext to obtain a comparison result representing the distance between the preset electronic fences of the first mobile terminal and the second mobile terminal.

[0115] In some embodiments, step S320 compares the first ciphertext and the second ciphertext to obtain a comparison result representing the distance between the preset electronic fences of the first mobile terminal and the second mobile terminal, which may include the following operations.

[0116] First, a relationship is determined using the first ciphertext and the second ciphertext.

[0117] The relational expression is constructed using the first ciphertext and the second ciphertext.

[0118] Specifically, a relational expression is constructed using the first ciphertext and the second ciphertext, and then a judgment is performed using the relational expression to obtain a judgment result of the relational expression, which represents a comparison result of the first ciphertext and the second ciphertext.

[0119] Then, the comparison result of the first ciphertext and the second ciphertext is determined using the judgment result of the relationship formula.

[0120] Among them, when the judgment result of the relationship formula is less than the target threshold, the coordinate data of the current position of the first mobile terminal is determined to be located within the electronic fence area of ​​the preset electronic fence corresponding to the second mobile terminal; when the judgment result of the relationship formula is greater than the target threshold, the coordinate data of the current position of the first mobile terminal is determined to be located outside the electronic fence area of ​​the preset electronic fence corresponding to the second mobile terminal, and the comparison result is sent to the first mobile terminal and the second mobile terminal.

[0121] For example, the relationship is set as:

[0122]

[0123] in, is the first ciphertext, is the second ciphertext, Represents the inner product operation.

[0124] Then we have:

[0125]

[0126] By judging through the above relationship, the cloud service end can determine whether the first mobile end is within the electronic fence under privacy protection.

[0127] The correctness verification is as follows:

[0128]

[0129] Therefore, when Available

[0130] We can further calculate:

[0131]

[0132] Because r i ,r w ,l i,w ,l w,ω Satisfy r i *r w >l i,w ,l w,ω >0, when Easy to get d(l w ,li ) 2 -R 2 ≤0, that is, d(l i ,l w )≤R. This relationship holds true, indicating that the first mobile terminal is within the electronic fence area.

[0133] In this embodiment, the first ciphertext corresponding to the first mobile terminal and the second ciphertext corresponding to the second mobile terminal are compared to determine the coordinate data of the first mobile terminal and the distance of the electronic fence set by the second mobile terminal. The comparison is performed under ciphertext, which improves the security of the data and reduces the performance and cost pressure of the local platform.

[0134] In some embodiments, an electronic fence detection system is also provided.

[0135] See Figure 4 , Figure 4 It is a structural diagram of an embodiment of the electronic fence detection system in this application.

[0136] like Figure 4 As shown, the electronic fence detection system 500 includes an initialization module 510, a first upload module 520, a second upload module 530, and a distance determination module 540. Initialization module 510 is used to initialize the entire system and generate an encryption matrix and random vector key for location encryption. For example, the second mobile terminal first randomly generates two (d+η+4)×(d+η+4) reversible matrices {M1, M2} and a (d+η+4) random dimensional vector S of 0, 1, to form a public key set. The second mobile terminal then sends the public key set to each first mobile terminal via a trusted channel.

[0137] The first upload module 520 will periodically encrypt and upload the coordinate data of the current location to the cloud server. Specifically, the first mobile terminal will encrypt the coordinate data of the location into the first ciphertext in the form of an encryption token described by the distance judgment module, for example Furthermore, the first mobile terminal sends the first ciphertext to the cloud service terminal through a secure channel.

[0138] The second upload module 530 can pre-configure the location and radius of the geo-fence. Once configured, the second mobile terminal encrypts the geo-fence's boundary coordinates into the second ciphertext described by the distance determination module, using matrix encryption and vector decomposition techniques. After encryption is complete, the second mobile terminal transmits the encrypted geo-fence location as ciphertext to the cloud server via a secure channel.

[0139] The distance judgment module 540, after receiving the first ciphertext regularly uploaded by the first mobile terminal, calculates whether the distance between the first mobile terminal and the center of the electronic fence satisfies the inequality based on the second ciphertext corresponding to the electronic fence using the first ciphertext and the second ciphertext, for example If the inequality is satisfied, If the first mobile terminal is within the electronic fence area, otherwise the first mobile terminal is not within the electronic fence area. Finally, the cloud service end will send the corresponding notification or alarm information to the first mobile terminal through the secure channel, and the second mobile terminal will take corresponding measures after receiving the notification or alarm information.

[0140] In some embodiments, an electronic device is also provided.

[0141] See Figure 5 , Figure 5 FIG2 is a schematic diagram of the structure of an electronic device according to an embodiment of the present application. The electronic device can perform the electronic fence detection step in the above method.

[0142] The electronic device 600 includes a memory 620, a processor 610 coupled to the memory, and at least one computer program stored in the memory 620 and executable on the processor 610. When the processor 610 loads and executes the at least one computer program, it is configured to implement the geo-fence detection step in the above-described method. For details regarding this method, please refer to the detailed description of the above-described method and will not be repeated here.

[0143] In some embodiments, a computer-readable storage medium is also included.

[0144] See also Figure 6 , Figure 6 It is a structural diagram of an embodiment of a computer-readable storage medium in this application.

[0145] The computer-readable storage medium 700 stores at least one program 710. When loaded and executed by the processor, the at least one program 710 is used to implement the steps of generating a digital three-dimensional code and detecting an electronic fence in the above-mentioned method. For details on these steps, please refer to the detailed description of the above-mentioned method and will not be repeated here.

[0146] The above scheme encrypts the relevant data of the electronic fence and the coordinate data of the first electronic device respectively, transmits them to the cloud service end, and then performs ciphertext comparison on the cloud service end, and uses the comparison result to represent the distance between the first electronic device and the electronic fence, which can effectively reduce the risk of data leakage and improve data security.

[0147] In the several embodiments provided by the present invention, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the modules or units is merely a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interface, device or unit, which can be electrical, mechanical or other forms.

[0148] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of this embodiment.

[0149] In addition, the functional units in various embodiments of the present invention may be integrated into a single processing unit, each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.

[0150] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) or a processor to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0151] The above description is only an embodiment of the present invention and does not limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made by using the contents of the description and drawings of the present invention, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. A method for detecting an electronic fence, It is characterized in that Applied to the first mobile terminal, the method includes: Acquire coordinate data of the first mobile terminal at the current position, and perform vector expansion on the coordinate data to determine a first coordinate data vector corresponding to the coordinate data; Splitting the first coordinate data vector into at least two first sub-vectors, and encrypting at least two of the first sub-vectors to determine a first ciphertext; Transmitting the first ciphertext to a cloud server, so that the cloud server compares the first ciphertext with a second ciphertext corresponding to a preset electronic fence to obtain a comparison result; The comparison result is received, wherein the comparison result is used to represent the distance between the first mobile terminal and a preset electronic fence.

2. The electronic fence detection method according to claim 1, It is characterized in that The acquiring the coordinate data of the first mobile terminal at the current position and performing vector expansion on the coordinate data includes: Acquire coordinate data of the first mobile terminal at the current position through the positioning module; The coordinate data is vector-expanded in a target dimension to determine a first coordinate data vector corresponding to the coordinate data in the target dimension.

3. The electronic fence detection method according to claim 1, It is characterized in that The step of splitting the first coordinate data vector into at least two first sub-vectors and encrypting at least two of the first sub-vectors to determine a first ciphertext includes: Using a random dimension vector of a target dimension, splitting the first coordinate data vector into at least two first sub-vectors; At least two of the first sub-vectors are encrypted using an encryption matrix to determine a first ciphertext corresponding to the coordinate data.

4. An electronic fence detection method, It is characterized in that Applied to the second mobile terminal, the method includes: Acquire an electronic fence area of ​​the electronic fence set by the second mobile terminal, and perform vector expansion of the boundary coordinate data of the electronic fence area in a target dimension to determine a second coordinate data vector corresponding to the electronic fence area in the target dimension; Splitting the second coordinate data vector into at least two second sub-vectors, and encrypting at least two of the second sub-vectors to determine a second ciphertext; Transmitting the second ciphertext to the cloud server, so that the cloud server compares the second ciphertext with the first ciphertext corresponding to the first mobile terminal to obtain a comparison result; The comparison result is received, wherein the comparison result is used to represent the distance between the first mobile terminal and the electronic fence set by the second mobile terminal.

5. The electronic fence detection method according to claim 4, It is characterized in that The obtaining of the electronic fence area of ​​the electronic fence set by the second mobile terminal and performing vector expansion of the boundary coordinate data of the electronic fence area in the target dimension includes: Acquire boundary coordinate data of the electronic fence area corresponding to the electronic fence; The boundary coordinate data is vector-expanded in a target dimension to determine a second coordinate data vector corresponding to the boundary coordinate data in the target dimension.

6. The electronic fence detection method according to claim 4, It is characterized in that The step of splitting the second coordinate data vector into at least two second sub-vectors and encrypting at least two second sub-vectors to determine a second ciphertext includes: Using a random dimension vector of a target dimension, splitting the second coordinate data vector into at least two second sub-vectors; At least two of the second sub-vectors are encrypted using an encryption matrix to determine a second ciphertext corresponding to the boundary coordinate data of the electronic fence area.

7. The electronic fence detection method according to claim 4, It is characterized in that Also includes: Generate random dimension vectors of encryption matrix and target dimension; A public key set is determined using the encryption matrix and the random dimension vector, and the public key set is sent to the first mobile terminal, so that the first mobile terminal uses the public key set for encryption.

8. An electronic fence detection method, It is characterized in that Applied to cloud servers, including: receiving a first ciphertext transmitted by a first mobile terminal, and receiving a second ciphertext transmitted by a second mobile terminal; The first ciphertext and the second ciphertext are compared to obtain a comparison result representing the distance between the preset electronic fences of the first mobile terminal and the second mobile terminal.

9. The electronic fence detection method according to claim 8, It is characterized in that The comparing the first ciphertext and the second ciphertext to obtain a comparison result representing a distance between the first mobile terminal and the preset electronic fence of the second mobile terminal includes: Determine a relationship using the first ciphertext and the second ciphertext; Determine a comparison result between the first ciphertext and the second ciphertext using a judgment result of the relationship formula; When the judgment result of the relationship is less than the target threshold, the coordinate data of the current position of the first mobile terminal is determined to be located within the electronic fence area of ​​the preset electronic fence corresponding to the second mobile terminal.

10. An electronic device, It is characterized in that The electronic device includes a memory and a processor coupled to the memory, the memory stores at least one computer program, and when the at least one computer program is loaded and executed by the processor, it is used to implement the electronic fence detection method as described in any one of claims 1-9.

11. A computer-readable storage medium, It is characterized in that The computer-readable storage medium has at least one program, and when the at least one program is loaded and executed by the processor, it is used to implement the electronic fence detection method according to any one of claims 1 to 9.