CN114897489A - Online voting result storage method, device, equipment and readable storage medium - Google Patents

Online voting result storage method, device, equipment and readable storage medium Download PDF

Info

Publication number
CN114897489A
CN114897489A CN202210438551.0A CN202210438551A CN114897489A CN 114897489 A CN114897489 A CN 114897489A CN 202210438551 A CN202210438551 A CN 202210438551A CN 114897489 A CN114897489 A CN 114897489A
Authority
CN
China
Prior art keywords
voting
information
face image
database
feature vector
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210438551.0A
Other languages
Chinese (zh)
Inventor
尹嘉峻
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Puhui Enterprise Management Co Ltd
Original Assignee
Ping An Puhui Enterprise Management Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An Puhui Enterprise Management Co Ltd filed Critical Ping An Puhui Enterprise Management Co Ltd
Priority to CN202210438551.0A priority Critical patent/CN114897489A/en
Publication of CN114897489A publication Critical patent/CN114897489A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q10/00Administration; Management
    • G06Q10/10Office automation; Time management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q2230/00Voting or election arrangements

Landscapes

  • Engineering & Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Human Resources & Organizations (AREA)
  • Strategic Management (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Entrepreneurship & Innovation (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Economics (AREA)
  • Marketing (AREA)
  • Operations Research (AREA)
  • Quality & Reliability (AREA)
  • Tourism & Hospitality (AREA)
  • General Business, Economics & Management (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The invention relates to the field of security mechanisms, and discloses an online voting result storage method, an online voting result storage device, online voting result storage equipment and a storage medium, wherein the method comprises the following steps: receiving identity information input by a user, recording the user voting process when the identity information passes verification to obtain voting information, storing the voting information into a voting block in a pre-constructed first database, acquiring system time, carrying out digital signature on the voting information according to the system time to obtain a timestamp sequence, carrying out hash calculation on the voting block according to the voting information and the timestamp sequence to obtain a voting hash value, and copying the voting hash value into a second database connected with the first database. The invention can improve the safety of the voting information.

Description

Online voting result storage method, device, equipment and readable storage medium
Technical Field
The present invention relates to the field of security mechanisms, and in particular, to an online voting result storage method and apparatus, an electronic device, and a readable storage medium.
Background
Online voting refers to the act of voting on the web, e.g., voting online on a large representative of a person, etc.
At present, the voting result of online voting mostly adopts a simple database to store the voting result, and the voting result is easily tampered due to the lack of protection measures such as encryption and the like, so that the voting system does not trust the identity of the user.
Disclosure of Invention
The invention provides an online voting result storage method, an online voting result storage device, an electronic device and a computer readable storage medium, and aims to improve the security of voting information.
In order to achieve the above object, the present invention provides an online voting result storage method, which includes:
receiving identity information input by a user, and verifying the identity information;
when the identity information passes the verification, recording the user voting process to obtain voting information;
storing the voting information into a voting block in a pre-constructed first database;
acquiring system time, and carrying out digital signature on the voting information according to the system time to obtain a timestamp sequence;
performing hash calculation on the voting block according to the voting information and the timestamp sequence to obtain a voting hash value;
copying the voting hash value to a second database connected to the first database.
Optionally, the performing a hash calculation on the voting block according to the voting information and the timestamp sequence to obtain a voting hash value includes:
the voting hash value hash (key) is calculated using the following formula:
Hash(key)=h(x)(A+B+C+D)
where h (x) is a hash function, A, B, C, D is the hash value, the timestamp sequence, the voting information, and the random array of the previous voting block associated with the voting block.
Optionally, the verifying the identity information includes:
extracting the ID card number in the identity information;
judging whether the identity card number can be successfully matched with the identity card number in a preset voting denomination database or not;
when the identity card number is unsuccessfully matched with the identity card number in the preset voting denomination database, judging that the identity information verification fails;
when the identity card number is successfully matched with the identity card number in a preset voting denomination database, judging whether the user corresponding to the identity card number votes;
when the user corresponding to the identification card number has voted, judging that the identity information verification is not passed;
and when the user corresponding to the identity card number does not vote, judging that the identity information passes verification.
Optionally, the verifying the identity information includes:
extracting face image information in the identity information;
respectively carrying out global feature extraction and local feature extraction on the face image information to obtain a face image global feature vector and a face image local feature vector;
judging whether the similarity between the global feature vector of the face image and the similarity between the local feature vector of the face image and the global feature vector of a preset standard face image are larger than a preset value;
when any one of the similarity of the global feature vector and the local feature vector of the face image and the global feature vector and the local feature vector of a preset standard face image is not greater than a preset value, judging that the identity information verification is not passed;
when the similarity between the global feature vector and the local feature vector of the face image and the global feature vector and the local feature vector of a preset standard face image are larger than a preset value, judging whether a user corresponding to the face image stores a voting record;
when the user corresponding to the face image stores a voting record, judging that the identity information is not verified;
and when the user corresponding to the face image does not store the voting record, judging that the identity information is verified to be passed.
Optionally, the performing global feature extraction and local feature extraction on the face image information respectively to obtain a face image global feature vector and a face image local feature vector includes:
calculating the low-frequency coefficient of the face image information by using the following calculation formula:
Figure BDA0003614003330000031
f (x, y) represents a face image with the size of M multiplied by N pixels, u and v represent frequency domain variables of pixel point coordinates of the face image, x and y represent horizontal coordinates and vertical coordinates of pixel points of the face image respectively, R represents a real number coefficient in a low-frequency coefficient F (u, v), I represents an imaginary number coefficient in the low-frequency coefficient F (u, v), and j represents an imaginary number;
real number coefficients and imaginary number coefficients in the low-frequency coefficients of the face image information are connected in series to obtain a face image global feature vector;
dividing the face image information according to a preset direction and scale to obtain a plurality of face image blocks with different direction scales;
and calculating local feature vectors of each group of the face image blocks by using a kernel function of a two-dimensional Gabor wavelet.
Optionally, the storing the voting information into a voting block in a pre-constructed first database includes:
extracting a storage identifier in the voting information;
inquiring whether a corresponding voting block exists in the first database or not according to the storage identifier;
if the corresponding voting block does not exist in the first database, constructing a new voting block, and storing the voting information to the new voting block;
and if the corresponding voting block exists in the first database, storing the voting information into the voting block.
Optionally, the digitally signing the voting information according to the system time to obtain a timestamp sequence includes:
standardizing the system time to obtain standardized time;
and carrying out Hash change on the standardized time to obtain a time stamp sequence.
In order to solve the above problems, the present invention also provides an offline product recommendation apparatus, including:
the identity authentication module is used for receiving identity information input by a user and authenticating the identity information;
the information storage module is used for recording the user voting process when the identity information passes the verification to obtain voting information, storing the voting information into a voting block in a pre-constructed first database to obtain system time, performing digital signature on the voting information according to the system time to obtain a timestamp sequence, and performing hash calculation on the voting block according to the voting information and the timestamp sequence to obtain a voting hash value;
and the hash value copying module is used for copying the voting hash value into a second database connected with the first database.
In order to solve the above problem, the present invention also provides an electronic device, including:
a memory storing at least one computer program; and
and the processor executes the computer program stored in the memory to realize the online voting result storage method.
In order to solve the above problem, the present invention further provides a computer-readable storage medium, in which at least one computer program is stored, and the at least one computer program is executed by a processor in an electronic device to implement the online voting result saving method described above.
The embodiment of the invention firstly verifies the identity information input by the user to complete a first round of verification to ensure the successful voting, further records the voting process of the user and stores the voting information into a voting zone in a pre-constructed first database to facilitate the subsequent checking and rechecking of the voting result, secondly digitally signs the voting information according to the system time to obtain a time stamp sequence to complete the preliminary encryption of the voting information, thereby improving the safety of the on-line voting result storage, and finally carries out the hash calculation on the voting zone according to the voting information and the time stamp sequence to obtain the voting hash value, copies the voting hash value into a second database connected with the first database to complete the secondary encryption of the voting information, thereby further improving the safety of the on-line voting result storage, thereby reducing the likelihood of tampering with the voting information. Therefore, the online voting result storage method, the online voting result storage device, the electronic device and the readable storage medium provided by the embodiment of the invention can improve the security of the voting information.
Drawings
Fig. 1 is a schematic flow chart illustrating an online voting result storage method according to an embodiment of the present invention;
FIG. 2 is a block diagram of an offline product recommendation device according to an embodiment of the present invention;
fig. 3 is a schematic diagram of an internal structure of an electronic device for implementing a method for storing an online voting result according to an embodiment of the present invention;
the implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
The embodiment of the invention provides an online voting result storage method. The execution subject of the online voting result saving method includes, but is not limited to, at least one of the electronic devices that can be configured to execute the method provided by the embodiments of the present application, such as a server, a terminal, and the like. In other words, the online voting result saving method may be performed by software or hardware installed in the terminal device or the server device, and the software may be a blockchain platform. The server may include an independent server, or a cloud server providing basic cloud computing services such as cloud service, a cloud database, cloud computing, cloud functions, cloud storage, Network service, cloud communication, middleware service, domain name service, security service, Content Delivery Network (CDN), big data and an artificial intelligence platform.
Referring to fig. 1, which is a schematic flow chart of an online voting result storage method according to an embodiment of the present invention, in an embodiment of the present invention, the online voting result storage method includes:
s1, receiving identity information input by a user, and verifying the identity information;
in the embodiment of the present invention, the identity information may be valid information for identity authentication, and the present invention is not limited to this, for example, an identity card number, fingerprint information, face information, and the like.
The embodiment of the invention ensures whether the user has the voting qualification or not by receiving the identity information input by the user and verifying the identity information, avoids the occurrence of the vote swiping behavior and improves the voting effectiveness.
Further, as an optional embodiment of the present invention, the verifying the identity information includes:
extracting the ID card number in the identity information;
judging whether the identity card number can be successfully matched with the identity card number in a preset voting denomination database or not;
when the identity card number is unsuccessfully matched with the identity card number in the preset voting denomination database, judging that the identity information verification fails;
when the identity card number is successfully matched with the identity card number in a preset voting denomination database, judging whether a user corresponding to the identity card number votes;
when the user corresponding to the identification card number has voted, judging that the identity information verification is not passed;
and when the user corresponding to the identity card number does not vote, judging that the identity information passes verification.
In this embodiment of the present invention, the preset voting denomination database may be a database containing identity information of users who are allowed to vote.
In the embodiment of the invention, whether the identity card number can be successfully matched with the identity card number in the preset voting denomination database is determined, whether the user corresponding to the identity card number is an allowed voting user is determined, the voting validity is preliminarily ensured, and the possibility of ticket swiping is reduced.
In an optional embodiment of the invention, whether the identity card number votes or not can be judged by reading the data of the voting record database.
As another optional embodiment of the present invention, the verifying the identity information further includes:
extracting face image information in the identity information;
respectively carrying out global feature extraction and local feature extraction on the face image information to obtain a face image global feature vector and a face image local feature vector;
judging whether the similarity between the global feature vector of the face image and the similarity between the local feature vector of the face image and the global feature vector of a preset standard face image are larger than a preset value;
when any one of the similarity of the global feature vector and the local feature vector of the face image and the global feature vector and the local feature vector of a preset standard face image is not greater than a preset value, judging that the identity information verification is not passed;
when the similarity between the global feature vector and the local feature vector of the face image and the global feature vector and the local feature vector of a preset standard face image are larger than a preset value, judging whether a user corresponding to the face image stores a voting record;
when the user corresponding to the face image stores a voting record, judging that the identity information is not verified;
and when the user corresponding to the face image does not store the voting record, judging that the identity information is verified to be passed.
In the embodiment of the present invention, the global feature may be an overall feature of the face image. The local feature may be a local expression of an image feature of the face image information, reflecting a local characteristic possessed on an image. The preset standard face image can be a face image of a voteable user.
According to the embodiment of the invention, the global feature extraction and the local feature extraction are carried out on the face image of the user, and the similarity between the user and the user capable of voting is determined, so that whether the identity information verification passes or not is judged, and the safety of the voting process is improved.
Further, the performing global feature extraction and local feature extraction on the face image information respectively to obtain a face image global feature vector and a face image local feature vector includes:
calculating the low-frequency coefficient of the face image information by using the following calculation formula:
Figure BDA0003614003330000071
f (x, y) represents a face image with the size of M multiplied by N pixels, u and v represent frequency domain variables of pixel point coordinates of the face image, x and y represent horizontal coordinates and vertical coordinates of pixel points of the face image respectively, R represents a real number coefficient in a low-frequency coefficient F (u, v), I represents an imaginary number coefficient in the low-frequency coefficient F (u, v), and j represents an imaginary number;
real number coefficients and imaginary number coefficients in the low-frequency coefficients of the face image information are connected in series to obtain a face image global feature vector;
dividing the face image information according to a preset direction and scale to obtain a plurality of face image blocks with different direction scales;
and calculating local feature vectors of each group of the face image blocks by using a kernel function of a two-dimensional Gabor wavelet.
In the embodiment of the invention, the kernel function of the two-dimensional Gabor wavelet is a complex value function, and the characteristics related to the face image can be extracted in different scales and different directions of a frequency domain.
And S2, when the identity information passes the verification, recording the user voting process to obtain the voting information.
In the embodiment of the present invention, the voting process includes a stage of viewing voter information by the user and a voting stage, for example, when the user participates in the large representative voting, viewing the large representative candidate information and the voting result after the user enters the voting system may be a voting process.
In the optional embodiment of the invention, the voting information is recorded by monitoring the voting process of the users in real time, so that a judgment basis is provided for subsequent review or check whether some users have malicious votes, and the subsequent review is facilitated.
And S3, storing the voting information into a voting block in a pre-constructed first database.
In the embodiment of the invention, the first database constructed and used can be a shared database in a block chain form, wherein data in the block chain has the characteristics of being incapable of being forged, having trace in the whole process, being traceable, being publicly transparent, being maintained collectively and the like. The voting block may be a newly created block in the blockchain database, including the hash value of the previous block and a random number group.
The embodiment of the invention stores the voting information into the voting block in the pre-constructed first database, and ensures that the voting information has the characteristics of unforgeability, trace remaining in the whole process, traceability, public transparency, collective maintenance and the like, thereby reducing the probability of falsification of the voting content and improving the effectiveness of online voting.
Further, as an optional embodiment of the present invention, the storing the voting information into a voting block in a pre-constructed first database includes:
extracting a storage identifier in the voting information;
inquiring whether a corresponding voting block exists in the first database or not according to the storage identifier;
if the corresponding voting block does not exist in the first database, constructing a new voting block, and storing the voting information to the new voting block;
and if the corresponding voting block exists in the first database, storing the voting information into the voting block.
In the embodiment of the present invention, the storage identifier includes a storage path and a storage target of the voting information.
According to the embodiment of the invention, whether the storage area exists is judged by extracting the corresponding storage identification, so that the voting information is successfully stored in the database, and the recheckability of the voting information is further ensured.
And S4, acquiring system time, and digitally signing the voting information according to the system time to obtain a timestamp sequence.
In the embodiment of the present invention, the system time may be beijing time or other local time, and the present invention is not limited thereto.
In the embodiment of the invention, the voting information is digitally signed to obtain the timestamp sequence, so that the accurate time generated by the voting information can be determined, the voting information is prevented from being tampered, and credible time certification, content authenticity and integrity certification are provided for electronic data of the voting information, and the electronic data has authority and credibility as evidence.
Further, as an optional embodiment of the present invention, the digitally signing the voting information according to the system time to obtain a time stamp sequence includes:
standardizing the system time to obtain standardized time;
and carrying out Hash change on the standardized time to obtain a time stamp sequence.
In the embodiment of the present invention, the normalized time may be a time format conforming to a hash function.
And S5, performing hash calculation on the voting blocks according to the voting information and the timestamp sequence to obtain voting hash values.
In this embodiment of the present invention, the timestamp sequence may be data generated by using a digital signature technique, and the signed object includes information such as original file information, signature parameters, and signature time, for example, 2022.3.116: 00 electronic data generated by digital signature may be a timestamp sequence. According to the voting information and the timestamp sequence, the voting block is subjected to hash calculation to obtain the voting hash value, so that the voting information is processed in a secret manner, and the unforgeability and traceability of the voting information are ensured.
Further, as an optional embodiment of the present invention, the performing hash calculation on the voting block according to the voting information and the timestamp sequence to obtain a voting hash value includes:
the voting hash value hash (key) is calculated using the following formula:
Hash(key)=h(x)(A+B+C+D)
wherein, h (x) can be a hash function, and MD5, SHA-1, etc. are common functions. A, B, C, D are the hash value, the timestamp sequence, the voting information, and the random array of the previous chunk, respectively.
In an optional embodiment of the present invention, the hash value, the timestamp sequence, and the voting information of the previous block are fixed values, so that the voting hash value can be calculated only according to the random array given by the system, thereby ensuring that the voting information is not changed, and improving the security and confidentiality of the voting information.
And S6, copying the voting hash value to a second database connected with the first database.
In an embodiment of the present invention, the second database may be a newly constructed block connected to the voting block in the block chain.
In an optional embodiment of the present invention, in order to further improve the security of the voting information, the voting hash value corresponding to the voting information is copied to a new database, so that a risk coefficient caused by information loss is reduced, and the security of the voting information is further ensured.
In the embodiment of the invention, firstly, the identity information input by the user is verified, a first round of verification is completed, the successful voting is ensured, further, the voting process of the user is recorded and the voting information is stored in a voting area in a pre-constructed first database, so that the voting result can be conveniently checked and rechecked subsequently, secondly, the system time is obtained, the voting information is digitally signed according to the system time to obtain a time stamp sequence, the preliminary encryption of the voting information is completed, the security of on-line voting result storage is improved, finally, the voting area is subjected to hash calculation according to the voting information and the time stamp sequence to obtain a voting hash value, the voting hash value is copied into a second database connected with the first database, and the secondary encryption of the voting information is completed, the security of on-line voting result storage is further improved, and therefore the possibility that the voting information is tampered is reduced. Therefore, the online voting result storage method provided by the embodiment of the invention can improve the safety of the voting information.
Fig. 2 is a functional block diagram of the offline product recommendation apparatus according to the present invention.
The offline product recommendation device 100 according to the present invention can be installed in an electronic device. According to the implemented functions, the offline product recommendation apparatus may include an identity verification module 101, an information storage module 102, and a hash value replication module 103, which may also be referred to as a unit, and refers to a series of computer program segments that can be executed by a processor of an electronic device and can perform fixed functions, and are stored in a memory of the electronic device.
In the present embodiment, the functions regarding the respective modules/units are as follows:
the identity authentication module 101 is configured to receive identity information input by a user, and authenticate the identity information.
In the embodiment of the present invention, the identity information may be valid information for identity authentication, and the present invention is not limited, for example, an identity card number, fingerprint information, face information, and the like.
The embodiment of the invention ensures whether the user has the voting qualification or not by receiving the identity information input by the user and verifying the identity information, avoids the occurrence of the voting behavior and improves the voting effectiveness.
Further, as an optional embodiment of the present invention, the verifying the identity information includes:
extracting the identity card number in the identity information;
judging whether the identity card number can be successfully matched with an identity card number in a preset voting denomination database or not;
when the identity card number is not successfully matched with the identity card number in the preset voting denomination database, judging that the identity information is not verified;
when the identification number is matched with an identification number in a preset voting denomination database, judging whether the user corresponding to the identification number votes;
when the user corresponding to the identification card number has voted, judging that the identity information verification is not passed;
and when the user corresponding to the identity card number does not vote, judging that the identity information passes verification.
In this embodiment of the present invention, the preset voting denomination database may be a database containing identity information of users who are allowed to vote.
In the embodiment of the invention, whether the identity card number can be successfully matched with the identity card number in the preset voting denomination database is determined, whether the user corresponding to the identity card number is an allowed voting user is determined, the voting validity is preliminarily ensured, and the possibility of ticket swiping is reduced.
In an optional embodiment of the invention, whether the identity card number votes or not can be judged by reading the data of the voting record database.
As another optional embodiment of the present invention, the verifying the identity information further includes:
extracting face image information in the identity information;
respectively carrying out global feature extraction and local feature extraction on the face image information to obtain a face image global feature vector and a face image local feature vector;
judging whether the similarity between the global feature vector of the face image and the similarity between the local feature vector of the face image and the global feature vector of a preset standard face image are larger than a preset value;
when any one of the similarity of the global feature vector and the local feature vector of the face image and the global feature vector and the local feature vector of a preset standard face image is not greater than a preset value, judging that the identity information verification is not passed;
when the similarity between the global feature vector and the local feature vector of the face image and the global feature vector and the local feature vector of a preset standard face image are larger than a preset value, judging whether a user corresponding to the face image stores a voting record;
when the user corresponding to the face image stores a voting record, judging that the identity information is not verified;
and when the user corresponding to the face image does not store the voting record, judging that the identity information is verified to be passed.
In the embodiment of the present invention, the global feature may be an overall feature of the face image. The local feature may be a local expression of an image feature of the face image information, reflecting a local characteristic possessed on an image. The preset standard face image can be a face image of a voteable user.
According to the embodiment of the invention, global feature extraction and local feature extraction are carried out on the face image of the user, and the similarity between the user and the voting user is determined, so that whether the identity information verification passes or not is judged, and the safety of the voting process is improved.
Further, the performing global feature extraction and local feature extraction on the face image information respectively to obtain a face image global feature vector and a face image local feature vector includes:
calculating the low-frequency coefficient of the face image information by using the following calculation formula:
Figure BDA0003614003330000121
f (x, y) represents a face image with the size of M multiplied by N pixels, u and v represent frequency domain variables of pixel point coordinates of the face image, x and y represent horizontal coordinates and vertical coordinates of pixel points of the face image respectively, R represents a real number coefficient in a low-frequency coefficient F (u, v), I represents an imaginary number coefficient in the low-frequency coefficient F (u, v), and j represents an imaginary number;
real number coefficients and imaginary number coefficients in the low-frequency coefficients of the face image information are connected in series to obtain a face image global feature vector;
dividing the face image information according to a preset direction and scale to obtain a plurality of face image blocks with different direction scales;
and calculating local feature vectors of each group of the face image blocks by using a kernel function of a two-dimensional Gabor wavelet.
In the embodiment of the invention, the kernel function of the two-dimensional Gabor wavelet is a complex value function, and the characteristics related to the face image can be extracted in different scales and different directions of a frequency domain.
The information storage module 102 is configured to, when the identity information is verified, record the user voting process to obtain voting information, store the voting information into a voting block in a pre-constructed first database, obtain system time, perform digital signature on the voting information according to the system time to obtain a timestamp sequence, and perform hash calculation on the voting block according to the voting information and the timestamp sequence to obtain a voting hash value.
In the embodiment of the present invention, the voting process includes a stage of viewing voter information by the user and a voting stage, for example, when the user participates in the large representative voting, viewing the large representative candidate information and the voting result after the user enters the voting system may be a voting process.
In the optional embodiment of the invention, the voting information is recorded by monitoring the voting process of the users in real time, so that a judgment basis is provided for subsequent review or check whether some users have malicious votes, and the subsequent review is facilitated.
In the embodiment of the invention, the first database constructed and used can be a shared database in a block chain form, wherein data in the block chain has the characteristics of being incapable of being forged, having trace in the whole process, being traceable, being publicly transparent, being maintained collectively and the like. The voting block may be a newly created block in the blockchain database, including the hash value of the previous block and a random number group.
The embodiment of the invention stores the voting information into the voting block in the pre-constructed first database, and ensures that the voting information has the characteristics of unforgeability, trace remaining in the whole process, traceability, public transparency, collective maintenance and the like, thereby reducing the probability of falsification of the voting content and improving the effectiveness of online voting.
Further, as an optional embodiment of the present invention, the storing the voting information into a voting block in a pre-constructed first database includes:
extracting a storage identifier in the voting information;
inquiring whether a corresponding voting block exists in the first database or not according to the storage identifier;
if the corresponding voting block does not exist in the first database, constructing a new voting block, and storing the voting information to the new voting block;
and if the corresponding voting block exists in the first database, storing the voting information into the voting block.
In the embodiment of the present invention, the storage identifier includes a storage path and a storage target of the voting information.
According to the embodiment of the invention, whether the storage area exists is judged by extracting the corresponding storage identification, so that the voting information is successfully stored in the database, and the recheckability of the voting information is further ensured.
In the embodiment of the present invention, the system time may be beijing time or other local time, and the present invention is not limited thereto.
In the embodiment of the invention, the voting information is digitally signed to obtain the timestamp sequence, so that the accurate time generated by the voting information can be determined, the voting information is prevented from being tampered, and credible time certification, content authenticity and integrity certification are provided for electronic data of the voting information, and the electronic data has authority and credibility as evidence.
Further, as an optional embodiment of the present invention, the digitally signing the voting information according to the system time to obtain a time stamp sequence includes:
standardizing the system time to obtain standardized time;
and carrying out Hash change on the standardized time to obtain a time stamp sequence.
In the embodiment of the present invention, the normalized time may be a time format conforming to a hash function.
In this embodiment of the present invention, the timestamp sequence may be data generated by using a digital signature technique, and the signed object includes information such as original file information, signature parameters, and signature time, for example, 2022.3.116: 00 electronic data generated by digital signature may be a timestamp sequence. According to the voting information and the timestamp sequence, the voting block is subjected to hash calculation to obtain the voting hash value, so that the voting information is processed in a secret manner, and the unforgeability and traceability of the voting information are ensured.
Further, as an optional embodiment of the present invention, the performing hash calculation on the voting block according to the voting information and the timestamp sequence to obtain a voting hash value includes:
the voting hash value hash (key) is calculated using the following formula:
Hash(key)=h(x)(A+B+C+D)
wherein, h (x) can be a hash function, and MD5, SHA-1, etc. are common functions. A, B, C, D are the hash value, the timestamp sequence, the voting information, and the random array of the previous chunk, respectively.
In an optional embodiment of the present invention, the hash value, the timestamp sequence, and the voting information of the previous block are fixed values, so that the voting hash value can be calculated only according to the random array given by the system, thereby ensuring that the voting information is not changed, and improving the security and confidentiality of the voting information.
The hash value copying module 103 is configured to copy the voting hash value to a second database connected to the first database.
In an embodiment of the present invention, the second database may be a newly constructed block connected to the voting block in the block chain.
In an optional embodiment of the present invention, in order to further improve the security of the voting information, the voting hash value corresponding to the voting information is copied to a new database, so that a risk coefficient caused by information loss is reduced, and the security of the voting information is further ensured.
Fig. 3 is a schematic structural diagram of an electronic device implementing the online voting result storage method according to the present invention.
The electronic device may comprise a processor 10, a memory 11, a communication bus 12 and a communication interface 13, and may further comprise a computer program, such as an off-line product recommendation program, stored in the memory 11 and executable on the processor 10.
The memory 11 includes at least one type of readable storage medium, which includes flash memory, removable hard disk, multimedia card, card type memory (e.g., SD or DX memory, etc.), magnetic memory, magnetic disk, optical disk, etc. The memory 11 may in some embodiments be an internal storage unit of the electronic device, for example a removable hard disk of the electronic device. The memory 11 may also be an external storage device of the electronic device in other embodiments, such as a plug-in mobile hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, which are provided on the electronic device. Further, the memory 11 may also include both an internal storage unit and an external storage device of the electronic device. The memory 11 may be used not only to store application software installed in the electronic device and various types of data, such as codes of offline product recommendation programs, etc., but also to temporarily store data that has been output or is to be output.
The processor 10 may be composed of an integrated circuit in some embodiments, for example, a single packaged integrated circuit, or may be composed of a plurality of integrated circuits packaged with the same or different functions, including one or more Central Processing Units (CPUs), microprocessors, digital Processing chips, graphics processors, and combinations of various control chips. The processor 10 is a Control Unit (Control Unit) of the electronic device, connects various components of the whole electronic device by using various interfaces and lines, and executes various functions of the electronic device and processes data by running or executing programs or modules (e.g., offline product recommendation programs, etc.) stored in the memory 11 and calling data stored in the memory 11.
The communication bus 12 may be a PerIPheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. The bus may be divided into an address bus, a data bus, a control bus, etc. The communication bus 12 is arranged to enable connection communication between the memory 11 and at least one processor 10 or the like. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.
Fig. 3 shows only an electronic device having components, and those skilled in the art will appreciate that the structure shown in fig. 3 does not constitute a limitation of the electronic device, and may include fewer or more components than those shown, or some components may be combined, or a different arrangement of components.
For example, although not shown, the electronic device may further include a power supply (such as a battery) for supplying power to each component, and preferably, the power supply may be logically connected to the at least one processor 10 through a power management device, so that functions of charge management, discharge management, power consumption management and the like are realized through the power management device. The power supply may also include any component of one or more dc or ac power sources, recharging devices, power failure detection circuitry, power converters or inverters, power status indicators, and the like. The electronic device may further include various sensors, a bluetooth module, a Wi-Fi module, and the like, which are not described herein again.
Optionally, the communication interface 13 may include a wired interface and/or a wireless interface (e.g., WI-FI interface, bluetooth interface, etc.), which is generally used to establish a communication connection between the electronic device and other electronic devices.
Optionally, the communication interface 13 may further include a user interface, which may be a Display (Display), an input unit (such as a Keyboard (Keyboard)), and optionally, a standard wired interface, or a wireless interface. Alternatively, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch device, or the like. The display, which may also be referred to as a display screen or display unit, is suitable, among other things, for displaying information processed in the electronic device and for displaying a visualized user interface.
It is to be understood that the described embodiments are for purposes of illustration only and that the scope of the appended claims is not limited to such structures.
The off-line product recommendation program stored in the memory 11 of the electronic device is a combination of a plurality of computer programs, which when executed in the processor 10, may implement:
receiving identity information input by a user, and verifying the identity information;
when the identity information passes the verification, recording the user voting process to obtain voting information;
storing the voting information into a voting block in a pre-constructed first database;
acquiring system time, and carrying out digital signature on the voting information according to the system time to obtain a timestamp sequence;
performing hash calculation on the voting block according to the voting information and the timestamp sequence to obtain a voting hash value;
copying the voting hash value to a second database connected to the first database.
Specifically, the processor 10 may refer to the description of the relevant steps in the embodiment corresponding to fig. 1 for a specific implementation method of the computer program, which is not described herein again.
Further, the electronic device integrated module/unit, if implemented in the form of a software functional unit and sold or used as a separate product, may be stored in a computer readable storage medium. The computer readable medium may be non-volatile or volatile. The computer-readable medium may include: any entity or device capable of carrying said computer program code, recording medium, U-disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM).
Embodiments of the present invention may also provide a computer-readable storage medium, where the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor of an electronic device, the computer program may implement:
receiving identity information input by a user, and verifying the identity information;
when the identity information passes the verification, recording the user voting process to obtain voting information;
storing the voting information into a voting block in a pre-constructed first database;
acquiring system time, and carrying out digital signature on the voting information according to the system time to obtain a timestamp sequence;
performing hash calculation on the voting block according to the voting information and the timestamp sequence to obtain a voting hash value;
copying the voting hash value to a second database connected to the first database.
Further, the computer usable storage medium may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function, and the like; the storage data area may store data created according to the use of the blockchain node, and the like.
In the several embodiments provided in the present invention, it should be understood that the disclosed apparatus, device and method may be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the modules is only one logical functional division, and other divisions may be realized in practice.
The modules described as separate parts may or may not be physically separate, and parts displayed as modules may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment.
In addition, functional modules in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional module.
It will be evident to those skilled in the art that the invention is not limited to the details of the foregoing illustrative embodiments, and that the present invention may be embodied in other specific forms without departing from the spirit or essential attributes thereof.
The present embodiments are therefore to be considered in all respects as illustrative and not restrictive, the scope of the invention being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any reference signs in the claims shall not be construed as limiting the claim concerned.
The block chain is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, a consensus mechanism, an encryption algorithm and the like. A block chain (Blockchain), which is essentially a decentralized database, is a series of data blocks associated by using a cryptographic method, and each data block contains information of a batch of network transactions, so as to verify the validity (anti-counterfeiting) of the information and generate a next block. The blockchain may include a blockchain underlying platform, a platform product service layer, an application service layer, and the like.
Furthermore, it is obvious that the word "comprising" does not exclude other elements or steps, and the singular does not exclude the plural. A plurality of units or means recited in the system claims may also be implemented by one unit or means in software or hardware. The terms second, etc. are used to denote names, but not any particular order.
Finally, it should be noted that the above embodiments are only for illustrating the technical solutions of the present invention and not for limiting, and although the present invention is described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that modifications or equivalent substitutions may be made on the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention.

Claims (10)

1. An online voting result storage method, characterized in that the method comprises:
receiving identity information input by a user, and verifying the identity information;
when the identity information passes the verification, recording the user voting process to obtain voting information;
storing the voting information into a voting block in a pre-constructed first database;
acquiring system time, and carrying out digital signature on the voting information according to the system time to obtain a timestamp sequence;
performing hash calculation on the voting block according to the voting information and the timestamp sequence to obtain a voting hash value;
copying the voting hash value to a second database connected to the first database.
2. The method for saving online voting results according to claim 1, wherein the performing a hash calculation on the voting blocks according to the voting information and the time stamp sequences to obtain voting hash values comprises:
the voting hash value hash (key) is calculated using the following formula:
Hash(key)=h(x)(A+B+C+D)
where h (x) is a hash function, A, B, C, D is the hash value, the timestamp sequence, the voting information, and the random array of the previous voting block associated with the voting block.
3. The method for saving the result of online voting according to claim 1, wherein the verifying the identity information comprises:
extracting the ID card number in the identity information;
judging whether the identity card number can be successfully matched with the identity card number in a preset voting denomination database or not;
when the identity card number is unsuccessfully matched with the identity card number in the preset voting denomination database, judging that the identity information verification fails;
when the identity card number is successfully matched with the identity card number in a preset voting denomination database, judging whether the user corresponding to the identity card number votes;
when the user corresponding to the identification card number has voted, judging that the identity information verification is not passed;
and when the user corresponding to the identity card number does not vote, judging that the identity information passes verification.
4. The method for saving the result of online voting according to claim 1, wherein the verifying the identity information comprises:
extracting face image information in the identity information;
respectively carrying out global feature extraction and local feature extraction on the face image information to obtain a face image global feature vector and a face image local feature vector;
judging whether the similarity between the global feature vector of the face image and the similarity between the local feature vector of the face image and the global feature vector of a preset standard face image are larger than a preset value;
when any one of the similarity of the global feature vector and the local feature vector of the face image and the global feature vector and the local feature vector of a preset standard face image is not greater than a preset value, judging that the identity information verification is not passed;
when the similarity between the global feature vector and the local feature vector of the face image and the global feature vector and the local feature vector of a preset standard face image are larger than a preset value, judging whether a user corresponding to the face image stores a voting record;
when the user corresponding to the face image stores a voting record, judging that the identity information is not verified;
and when the user corresponding to the face image does not store the voting record, judging that the identity information is verified to be passed.
5. The method for saving online voting results according to claim 4, wherein the performing global feature extraction and local feature extraction on the face image information respectively to obtain a face image global feature vector and a face image local feature vector comprises:
calculating the low-frequency coefficient of the face image information by using the following calculation formula:
Figure FDA0003614003320000021
f (x, y) represents a face image with the size of M multiplied by N pixels, u and v represent frequency domain variables of pixel point coordinates of the face image, x and y represent horizontal coordinates and vertical coordinates of pixel points of the face image respectively, R represents a real number coefficient in a low-frequency coefficient F (u, v), I represents an imaginary number coefficient in the low-frequency coefficient F (u, v), and j represents an imaginary number;
real number coefficients and imaginary number coefficients in the low-frequency coefficients of the face image information are connected in series to obtain a face image global feature vector;
dividing the face image information according to a preset direction and scale to obtain a plurality of face image blocks with different direction scales;
and calculating local feature vectors of each group of the face image blocks by using a kernel function of a two-dimensional Gabor wavelet.
6. An on-line voting result preservation method according to claim 1, wherein the step of storing the voting information in a voting block in a pre-constructed first database comprises:
extracting a storage identifier in the voting information;
inquiring whether a corresponding voting block exists in the first database or not according to the storage identifier;
if the corresponding voting block does not exist in the first database, constructing a new voting block, and storing the voting information to the new voting block;
and if the corresponding voting block exists in the first database, storing the voting information into the voting block.
7. The method for saving the online voting result according to claim 1, wherein the digitally signing the voting information according to the system time to obtain the time stamp sequence comprises:
standardizing the system time to obtain standardized time;
and carrying out Hash change on the standardized time to obtain a time stamp sequence.
8. An online voting result holding apparatus, comprising:
the identity authentication module is used for receiving identity information input by a user and authenticating the identity information;
the information storage module is used for recording the user voting process when the identity information passes the verification to obtain voting information, storing the voting information into a voting block in a pre-constructed first database to obtain system time, performing digital signature on the voting information according to the system time to obtain a timestamp sequence, and performing hash calculation on the voting block according to the voting information and the timestamp sequence to obtain a voting hash value;
and the hash value copying module is used for copying the voting hash value into a second database connected with the first database.
9. An electronic device, characterized in that the electronic device comprises:
at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores computer program instructions executable by the at least one processor to cause the at least one processor to perform the method of on-line voting result preservation according to any one of claims 1 to 7.
10. A computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the online voting result holding method according to any one of claims 1 to 7.
CN202210438551.0A 2022-04-25 2022-04-25 Online voting result storage method, device, equipment and readable storage medium Pending CN114897489A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210438551.0A CN114897489A (en) 2022-04-25 2022-04-25 Online voting result storage method, device, equipment and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210438551.0A CN114897489A (en) 2022-04-25 2022-04-25 Online voting result storage method, device, equipment and readable storage medium

Publications (1)

Publication Number Publication Date
CN114897489A true CN114897489A (en) 2022-08-12

Family

ID=82717823

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210438551.0A Pending CN114897489A (en) 2022-04-25 2022-04-25 Online voting result storage method, device, equipment and readable storage medium

Country Status (1)

Country Link
CN (1) CN114897489A (en)

Similar Documents

Publication Publication Date Title
CN110771095B (en) System and method for implementing blockchain-based digital certificates
CN110800254B (en) System and method for generating digital signature
CN108009445B (en) Semi-centralized trusted data management system
CN112651035A (en) Data processing method, device, electronic equipment and medium
CN112668575B (en) Key information extraction method and device, electronic equipment and storage medium
CN114154987B (en) Meta-universe safety system based on NFR and inter-link network and operation method
CN111914029A (en) Block chain-based medical data calling method and device, electronic equipment and medium
CN115270193B (en) Data file secure sharing method and device based on block chain and collaborative synchronization
CN113158207A (en) Block chain based report generation method and device, electronic equipment and storage medium
CN113381992B (en) License management method based on block chain
CN113822675A (en) Block chain based message processing method, device, equipment and storage medium
CN112200637A (en) Financing lease transaction processing method and system based on block chain
CN114697132B (en) Method, device, equipment and storage medium for intercepting repeated access request attack
CN114897489A (en) Online voting result storage method, device, equipment and readable storage medium
CN114629663A (en) Block chain-based digital commodity transaction method and device
CN114826725A (en) Data interaction method, device, equipment and storage medium
CN114401096B (en) Block chain data uplink control method, device, equipment and storage medium
CN113343288B (en) Block chain intelligent contract security management system based on TEE
CN117272396B (en) Anti-tampering method for test result
CN116707835B (en) Method and system for realizing patient information interaction based on blockchain
CN114978529A (en) Block chain-based identity verification method and related equipment
CN107710675A (en) Authenticity determining device and authenticating method
CN113870003A (en) Loan information identity auditing method and device, electronic equipment and storage medium
CN114826570A (en) Certificate acquisition method, device, equipment and storage medium
CN114614993A (en) System interaction method and device, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination