Method for lottery by first sealing and then unsealing numbers
Through the lottery method of first blocking and then unblocking, using computer cameras and encryption technology to generate and verify the lottery numbers, the problem of lack of transparency in the lottery process in the existing technology is solved, and a fair and transparent lottery process is achieved.
Patent Information
- Application Number
- PCT/CN2024/088988
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-01-13
- Filing Date
- 2024-04-20
- Publication Date
- 2025-07-17
AI Technical Summary
The lack of transparency in the existing lottery lottery process has led to the public losing confidence in its fairness and suspected of manipulating the winning numbers.
The lottery method of first blocking and then unblocking is adopted. The computer camera uses a computer camera to obtain image data to generate a password and encrypt the image data. The ciphertext and password are output through the display for decryption, the winning number is generated, and the verification software is performed afterwards.
Ensure that the winning numbers cannot be modified after the ban, and provide a transparent lottery process, so that the public can conduct post-verification to enhance fairness and trust.
Smart Images

Figure CN2024088988_17072025_PF_FP_ABST
Abstract
Description
Lottery drawing method of first blocking and then unblocking Technical field The present invention relates to a method for encrypting a digital image by using digital technology and generating a winning number with the digital image as seed information after a confidentiality period, so as to realize a virtual ball lottery drawing method of first blocking and then unblocking. Background technique Currently, most lottery drawing machines use a rotating rod to stir or an upward jet of air to drive the balls to conduct the lottery drawing. Many people think that there are abnormal phenomena in the existing lottery drawing. Some even believe that during the lottery drawing, someone will secretly manipulate the winning number of the lottery drawing according to the lottery sales results, resulting in the loss of confidence of lottery players in the fairness and transparency of the lottery. This not only affects the sales volume of the lottery, but even disrupts social order. Therefore, this article advocates using a lottery drawing method of first blocking and then unblocking to achieve the openness and transparency of the lottery drawing process. The lottery drawing method in the present invention can not only be applied to lottery drawing, but also to lottery drawing activities such as the examination seats of candidates, the degree arrangement of primary school students, the allocation of affordable housing, vehicle license plates, and new shares. Summary of the invention The method in the present invention is implemented by utilizing the randomness of image data in the photos taken by the camera on the computer and the encryption technology of digital information. The computer that conducts the lottery drawing using the method in the present invention is a digital lottery drawing machine (hereinafter, the lottery drawing machine all refers to the digital lottery drawing machine that conducts the lottery drawing using the method in the present invention). After the sealing time arrives, the lottery drawing machine calls the camera to take a photo, randomly selects one photo from the taken photos, then randomly copies the image DP from the photo, and generates the sealing password DK. Then, using the password DK, the image DP is encrypted by a predetermined encryption algorithm to generate the file EF. Next, the ciphertext information in the file EF is output to the display, and after the decryption time arrives, the sealing password DK is output to the display. The file EF is decrypted using the sealing password DK to obtain the image DP. Finally, the winning number is generated according to a predetermined lottery drawing algorithm with the image DP as the seed data, and the winning number and the image DP are output to the display. After the lottery drawing software in the lottery drawing machine is installed and started, under the condition that parameters such as the virtual ball combination mode have been set, the lottery drawing machine runs under the condition of being a single machine without external intervention (the manufacturing of the lottery drawing machine to achieve this condition has been separately filed for an invention application). At this time, the lottery drawing algorithm in the lottery drawing software has been determined. Since the winning number is based on the image DP as the seed data, once the data in the image DP is determined, the winning number is also determined. Also, because the image DP is encrypted by the password DK to generate the file EF and the ciphertext is publicly displayed through the display, on-site or remote viewers can receive the file EF through a computer with a camera. When the unsealing time arrives, the sealing password DK is output to the display. On-site or remote viewers can also receive the password DK through a computer with a camera and decrypt the file EF to obtain the image DP and calculate the winning number. On-site or remote viewers can not only compare and verify the winning number with the officially announced winning number, but also compare and verify the seed data image DP obtained by decrypting the file EF on their own computer with the officially announced seed data image DP, so as to ensure that once the image DP is encrypted to generate the file EF and the ciphertext is made public, the plaintext in the file EF is fixed, that is, the image DP is fixed, thus ensuring that the winning number is also fixed after sealing, that is, ensuring that the winning number cannot be modified, and once modified, it will be discovered. The lottery drawing software applying the method in the present invention conducts the lottery drawing in each period (time) through four processes: waiting, sealing, waiting, and unsealing. The virtual ball combination method described in this article refers to one of the following three: ① The method of drawing M0 natural numbers (i.e., the drawn virtual ball numbers) from N0 specified natural numbers (i.e., the virtual ball numbers participating in the lottery draw) as the winning numbers; ② Executing method ① twice, that is, drawing M1 natural numbers from N1 specified natural numbers as the first part of the winning numbers, and then drawing M2 natural numbers from N2 specified natural numbers as the second part of the winning numbers; ③ Executing method ① multiple times. The winning numbers described in this article refer to the numbers composed of virtual ball numbers calculated by the software using the method in the present invention. In addition, in order to make the number of digits of natural numbers in the winning numbers uniform, 0 can be added before natural numbers. For example, under the condition of drawing 7 natural numbers from 1 to 36 natural numbers, if the drawing result of a certain time is 3, 6, 15, 18, 21, 29, 32, it can be displayed as 3, 6, 15, 18, 21, 29, 32 or 03, 06, 15, 18, 21, 29, 32. Referring to Figure 1, the general workflow of the lottery draw method in the present invention is as follows: 【1】. Start the lottery draw software and initialize it; 【2】. Read the image from the camera and output it to the display; 【3】. Determine whether it is the time point for sealing the number. If it is, execute step 【4】; otherwise, return to step 【2】; 【4】. Read a frame of image SP from the camera and randomly copy the image from image SP to obtain an image DP identical to the copied area; 【5】. Generate the sealing number password DK, and then use this password to encrypt the image DP using a predetermined encryption algorithm to generate the file EF; 【6】. Split the ciphertext information in the file EF into N small segments, and output these information segments to the display one by one at a certain time interval; 【7】. Read the image from the camera and output it to the display; 【8】. Determine whether the time has passed the confidentiality period. If it has, execute step 【9】; otherwise, return to step 【7】; 【9】. Output the sealing number password DK to the display, decrypt the file EF with the sealing number password DK to obtain the image DP, and then generate the winning numbers according to the predetermined lottery draw algorithm using the image DP as the seed data, and output the winning numbers and the image DP to the display;
[0010] . Output some information related to this lottery draw to the display and wait for a certain period of time, and then execute step 【2】. The startup and initialization of the lottery software described in this article include the following: The operator starts the lottery software in the lottery machine, completes parameter settings, and the lottery software runs the working thread CAP that accesses the camera and runs the lottery thread. Among them, the completion of parameter settings is one of the following three: ① The operator sets the user password, virtual ball combination method, lottery period, current issue number, confidentiality duration after sealing, the starting time point of the first sealing after this software runs, sets the business information provided by the lottery organizer, and then the operator commands the lottery software to enter the automatic cycle lottery process without manual intervention. After receiving the command, the lottery software first judges whether the operator's settings are valid. If invalid, it returns to the setting interface and prompts the operator to reset. If valid, it accepts the parameters set by the operator; ② The lottery software sets the user password, virtual ball combination method, lottery period, current issue number, confidentiality duration after sealing, the starting time point of the first sealing after this software runs, and sets the business information provided by the lottery organizer according to the default parameters and internal rules of the software; ③ The operator only sets some of the parameters involved in ①, and the remaining parameters are determined by the lottery software according to the default parameters and internal rules of the software. Among them, steps [4] to [6] are the sealing process, steps [9] and
[0010] are the unsealing process, steps [2] and [3] are the processes of waiting for sealing, and [7] and [8] are the processes of waiting for unsealing. The meaning of "random" in "randomly copy from image SP" is that the vertex positions of the image copy area are random. The generated sealing password DK generates a random password with one or more of the following data as seed data: ① Data randomly appearing inside the system; ② Data transmitted from the camera; ③ Data in image DP; ④ Data obtained by compressing image DP. The predetermined encryption algorithm consists of one or more of the following encryption algorithms: substitution, permutation, confusion, diffusion, iteration, combination and splitting method, mathematical relationship encryption, transposition encryption, logical encryption, arithmetic encryption, block encryption, stream cipher encryption, linear encryption, non-linear encryption, symmetric encryption, asymmetric encryption, statistical data encryption, pseudo-random encryption algorithm, algorithm of stream cipher encryption generated by a polynomial that increases the number of terms and adjusts the power as the encryption process progresses, algorithm of encryption using the serial number code generated by sorting. As can be seen from the above, common symmetric encryption algorithms such as DES, 3DES, AES, RC4, Blowfish, etc. also belong to the above-mentioned predetermined encryption algorithms. The encryption of image DP to generate file EF is one of the following two: ① Encrypt the data in image DP and save the ciphertext generated during the encryption process as file EF; ② Encrypt the image data obtained after compressing image DP and save the ciphertext generated during the encryption process as file EF. Among them, the output to the monitor in step [6] is one of the following three: ① Output to the monitor and displayed on the screen of the monitor in text form; ② Output to the monitor and displayed on the screen of the monitor in the form of a QR code; ③ Output to the monitor in both text form and QR code form on the screen of the monitor. The generation of the winning numbers by using the image DP as the seed data according to the predetermined lottery algorithm means an algorithm that uses the feature code of the image DP to perform a remainder calculation on the relevant combination numbers in the virtual ball combination method according to the rules and convert them into winning numbers. The feature code of the image DP is one of the following two: ① The feature code of the data in the image DP, ② The feature code of the image data obtained after the image DP is compressed. The feature code described in this article refers to the numerical value, i.e., the digital digest, obtained by calculating all the data in the specified information using a predetermined feature code algorithm. The predetermined feature code algorithm is composed of one or more of the following algorithms: hashing algorithm, symmetric encryption algorithm, asymmetric encryption algorithm. The hashing algorithm described in the previous sentence is composed of one or more of the following algorithms: substitution, permutation, confusion, diffusion, iteration, combination splitting method, mathematical relationship operation, transposition operation, logical operation, arithmetic operation, grouping operation, linear operation, non-linear operation, pseudo-random operation. Obviously, the MD5 algorithm and the SHA hash algorithm are hashing algorithms. Among them, the said several times must be less than the time length from the next account sealing moment to the current moment. The lottery machine adopting the method in the present invention generally does not allow establishing wired communication with the outside world, nor does it allow establishing wireless communication with the outside world. However, since the method in the present invention outputs the ciphertext and the password to the monitor, we can write a dedicated verification software for reading the information displayed on the monitor to receive the ciphertext and the password and complete the lottery verification work. Referring to FIG. 2, the general verification process matching the method in the present invention is as follows: 【1】, Run the verification software APP; 【2】, Scan the images obtained by photographing the monitor of the lottery machine from the front at the time of account sealing, and parse out N small segments split from the file EF from these images, and then use these small segments to recombine into the file EF; 【3】, Scan the images obtained by photographing the monitor of the lottery machine from the front at the time of account unsealing, and parse out the password DK from these images, then use the password DK to decrypt the file EF to obtain the image DP, generate the winning numbers according to the predetermined lottery algorithm with the image DP as the seed data, and then output the winning numbers and the image DP to the monitor. In the process of "generating the winning numbers according to a predetermined lottery algorithm" described in the verification process of this article, parameters related to the lottery, such as the virtual ball combination method, the lottery period, and the current issue number, are required. These parameters can be obtained in two ways: ① Obtained from the identification information; ② Using the default parameters in the verification software APP. It is obvious that the comparison between the winning numbers calculated by the verification process of this article and the winning numbers announced by the lottery machine can be completed manually. It can also be achieved by adding the content of the winning numbers announced by the lottery machine on the basis of the verification process mentioned in this article to complete the comparison by the verification process. In addition, we can add the feature code of the image DP to the password DK, so that a more rigorous verification can be completed by comparing the feature code of the image DP during the process of decrypting the file EF. BRIEF DESCRIPTION OF THE DRAWINGS Figure 1 is a general lottery drawing work flow chart of the present invention; Figure 2 is a general verification flow chart of the present invention; Figure 3 is a lottery drawing work flow chart of the first embodiment; Figure 4 is a verification flow chart of the first embodiment; Figure 5 is a lottery drawing work flow chart of the second embodiment; Figure 6 is a verification flow chart of the second embodiment; Figure 7 is a schematic diagram of the winning numbers output to the display; Figure 8 is an example diagram of the image DP in the second embodiment; Figure 9 is an example diagram of the image YP in the second embodiment. [Corrected according to Rule 26 on 25.04.2024] Figures 10 to 15 are all screenshots of the code page. DETAILED DESCRIPTION OF THE INVENTION Referring to Figure 3, the first embodiment of the present invention is a lottery drawing method applied to a lottery machine, and its work flow is as follows: 【1】. Start the lottery drawing software and initialize; 【2】. Wait for 30 milliseconds. While waiting, the thread CAP reads the image from the camera and outputs it to the display; 【3】. The lottery drawing software determines whether it has reached the time point for sealing the number. If it has, execute step 【4】; otherwise, execute step 【2】; 【4】. The lottery drawing software reads a frame of image SP from the camera, and randomly copies the image from the image SP to obtain an image DP identical to the copied area; 【5】. The lottery drawing software generates a sealing password DK, and then encrypts the image DP with this password using a predetermined encryption algorithm to generate a file EF, and calls the public key encryption to save the sealing password DK; 【6】. The lottery software splits the ciphertext information in file EF into N small segments, adds identification information to each split small segment of information, and outputs the small segments with added identification information to the display one by one in the form of two-dimensional codes and text at a certain time interval. After all N small segments are displayed, the next step is executed; 【7】. Wait for 30 milliseconds. While waiting, thread CAP reads an image from the camera and outputs it to the display; 【8】. The lottery software determines whether the time has passed the confidentiality period. If it has passed, step 【9】 is executed; otherwise, step 【7】 is executed; 【9】. The lottery software calls the private key to decrypt the sealed number password DK, then uses the sealed number password DK to decrypt file EF to obtain image DP, generates unsealing announcement information using the identification information and the sealed number password DK, then outputs the unsealing announcement information to the display in the form of two-dimensional codes and text, generates the winning numbers according to a predetermined lottery algorithm using image DP as the seed data, and outputs the winning numbers and image DP to the display;
[0010] . The lottery software outputs some information related to this lottery to the display and waits for a certain period of time, then executes step 【2】. The identification information described in this article is composed of one or more of the following information: ① ciphertext flag; ② password flag; ③ parameter flag; ④ number of segments; ⑤ segment serial number; ⑥ information length; ⑦ feature code; ⑧ file length; ⑨ parameters set during software startup initialization. The information related to this lottery described in this article is composed of one or more of the following information: ① feature code; ② parameters set during software startup initialization. In this embodiment, the lottery method is mainly implemented by software. When writing this lottery software, there are many programming tools for us to choose. There are no insoluble technical problems in each implementation step of this lottery work process, and they can all be solved by inputting code according to the current programming technology. Since the software interface is very easy to implement, there is no need to describe the implementation of this step here. Therefore, mainly for the work process, a simple code example that has been verified in the WIN10 computer system is provided below using Microsoft Visual C++ 2010 code: #pragma once #include "cap.h" / / Header file of video capture class CCap downloaded from the network #include "afxwin.h" / / CYHTestDlg dialog box class CYHTestDlg : public CDialogEx,public IMediaReceiver { public: CYHTestDlg(CWnd* pParent = NULL); / / Standard constructor enum { IDD = IDD_YHTEST_DIALOG}; / / Dialog data protected: virtual void DoDataExchange(CDataExchange* pDX); / / DDX / DDV support / / Implementation protected: HICON m_hIcon; / / Generated message map functions virtual BOOL OnInitDialog(); afx_msg void OnSysCommand(UINT nID, LPARAM lParam); afx_msg void OnPaint(); afx_msg HCURSOR OnQueryDragIcon(); DECLARE_MESSAGE_MAP() public: afx_msg void OnBnClickedOk(); / / Command to enter the automatic loop lottery drawing process protected: void OnUpdateVideo(const BITMAPINFO *pBmi, const BYTE *pBuf); / / Update video image friend DWORD WINAPI YH_Thread(LPVOID pParam); / / Loop lottery drawing thread CCap *pCapDevice; / / Camera video capture object, i.e., thread CAP object HWND m_hDlg; / / Dialog box handle public: HDC hDC; CClientDC *pVideoDC; int m_DevNum; CStatic VideoView; / / Video display CStatic YHPhotoView; / / Display image DP when unsealing CStatic mShowBallsCtrl; / / Display winning numbers CStatic XS_EWM; / / Display QR code CTime EPlanTime; / / Sealing time CTime DPlanTime; / / Unsealing time CTimeSpan EDTermLoop; / / Lottery drawing cycle CTimeSpan EDProtectTerm; / / Confidentiality duration after sealing void InitYHParam(); / / Initialize important parameters void ShowYHText(BYTE* pEPicBuf, int BufLen, const TCHAR* FlagStr); / / Display information after being sealed for the lottery drawing picture void PublicYHPhoto(CImage *img); / / Display image DP void ShowYHResultOnDC(unsigned _int64 mTermNum); / / Display the period number and winning / / numbers void ShowVideo(int mSel); / / Open the camera with the serial number mSel and create a loop lottery drawing thread void YH_ThreadCore(); / / Main function for loop lottery drawing void ShowQRCode(const TCHAR* pCodeInfo); / / Generate a QR code using the Qrcode object and display it on the control XS_EWM void ReadyShowItem(TCHAR*pPrompt,unsigned _int64 mTermNum); / / Clear the old information and display the new prompt }; #include "stdafx.h" #include "YHTest.h" #include "YHTestDlg.h" #include "afxdialogex.h" #include "qrencode.h" / / Header file for generating QR codes downloaded from the Internet #include <cmath> #include<gdiplus.h> ………… HANDLE pThreadHandle = NULL; const BITMAPINFO * pDevBmi=NULL; const BYTE *pDevBuf=NULL; CYHTestDlg*pYHTestDlg; GdiplusStartupInput m_gdiplusStartupInput; ULONG_PTR m_gdiplusToken; CImage *m_pImage; CImage SPZP; CImage DPic; BYTE* pEF=NULL; / / Buffer space for encrypted text BYTE pRSA_EPass
[2048] ; BYTE pRSA_DPass
[2048] ; int mImgEBufLength=0; int mRandPassLen; int mRSAPassLen; int MaxLimit,mBallNum; bool bCanSame,bCanZero; CString YHResult=L""; CFont mBallFont; CFont mETextFont; unsigned _int64 mTermNum=0; ………… / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / void CYHTestDlg::DoDataExchange(CDataExchange* pDX) { / / Control binding CDialogEx::DoDataExchange(pDX); DDX_Control(pDX, IDC_VIDEO, VideoView); DDX_Control(pDX, IDC_ShowDImage, YHPhotoView); DDX_Control(pDX, IDC_DisplayStr, mShowBallsCtrl); DDX_Control(pDX, IDC_EWM, XS_EWM); } / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / void CYHTestDlg::InitYHParam() / / Step 【1】 Default parameter setting { ………… / / And only display important parameter initialization here CTime mCurtime = CTime::GetCurrentTime(); EDTermLoop = CTimeSpan(0, 0, 2, 0); EDProtectTerm = CTimeSpan(0, 0, 1, 0); EPlanTime = mCurtime + CTimeSpan(0, 0, 0, 10); DPlanTime = EPlanTime + EDProtectTerm; MaxLimit = 36; mBallNum = 7; bCanSame = false; bCanZero = false; } / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / BOOL CYHTestDlg::OnInitDialog() { ………… InitYHParam(); / / Step 【1】 Default parameter setting ………… } / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / DWORD WINAPI YH_Thread(LPVOID pParam) / / Loop the draw number thread { pYHTestDlg->YH_ThreadCore(); / / Main function of loop draw number return 0; } / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / void CYHTestDlg::ShowVideo(int mSel) { / / Open the camera with the serial number mSel and run the working thread CAP that accesses the camera, / / And create the loop draw number thread static int m_SelDevSerial = -1; if (m_SelDevSerial >= 0) { pCapDevice->ContinueRun(m_SelDevSerial); return; } HRESULT hr = pCapDevice->Init(mSel, VideoView.m_hWnd); if (SUCCEEDED(hr)) { / / Start displaying the image if (pCapDevice->Pause()) { if (SUCCEEDED(pCapDevice->Run())) / / Run the thread CAP in step [1] { m_SelDevSerial = mSel; CreateThread(NULL, 0, YH_Thread, this, 0, NULL); / / / / Create and run the loop draw number thread in step [1] }}} else { pCapDevice->Release(); delete pCapDevice; pCapDevice = NULL;} } / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / void CYHTestDlg::OnBnClickedOk() / / Command to enter the automatic loop lottery process { CWnd* pVideoWnd = GetDlgItem(IDC_VIDEO); pVideoDC = new CClientDC(pVideoWnd); int nCount = 0; pCapDevice = new CCap; pCapDevice->GetSampleCB()->SetReceiver(this); hDC = pVideoWnd->GetDC()->m_hDC; / / Enumerate video capture devices nCount = pCapDevice->EnumDevices(); if (nCount > 0) ShowVideo(0); / / Directly start displaying the video, default to select the first device m_DevNum = nCount; } [Corrected according to Rule 26 on 25.04.2024] For the remaining code, please refer to Figures 10 to 15. [Deleted according to Rule 26 on 25.04.2024] [Deleted according to Rule 26 on 25.04.2024] [Deleted according to Rule 26 on 25.04.2024] [Deleted according to Rule 26 on 25.04.2024] [Deleted according to Rule 26 on 25.04.2024] [Deleted according to Rule 26 on 25.04.2024] The program calculates the winning numbers by calling the GetYHResult function. Assume that the data pointed to by pPicDataSoul is 0X5A500BC5FDB4FC53B6961F8D69E44E4EB627D45E25C80AC3AF58B306, MaxLimit is 36, mBallNum is 7, and both bCanSame and bCanZero are 0. Then this function outputs the winning numbers "07-14-19-22-23-27-32" to DesStr. The output form of this winning number on the display can be seen in Figure 7. When using the method of the present invention for lottery drawing, this method requires that during the operation of the lottery drawing software on the lottery drawing machine, the lottery drawing machine is always under the monitoring of the camera for 24 hours a day, and these monitoring images are live broadcast on the network so that all netizens concerned about this lottery drawing activity can monitor the working status and safety of the lottery drawing machine at any time. At the same time, the verification computer (hereinafter referred to as the verification machine) runs the verification software APP. The camera of the verification machine continuously takes pictures of the image of the lottery drawing machine display for the verification machine to scan, analyze and record the verification results. Referring to Figure 4, the verification process of the first embodiment is as follows: 【1】. Start the verification software APP; 【2】. The verification software APP reads the two-dimensional code from the image data of the camera; 【3】. If a valid two-dimensional code information is read, then execute step 【4】, otherwise return to step 【2】; 【4】. The verification software APP determines whether the two-dimensional code contains the ciphertext segment in file EF according to the recognition information. If so, convert the part representing the ciphertext segment content in this two-dimensional code information into binary information and save it to the corresponding position in the buffer TEF, and then execute step 【5】. If not, execute step 【7】; 【5】. The verification software APP determines whether all N small segments split from file EF have been received. If so, execute step 【6】. If not, execute step 【2】; 【6】. The verification software APP saves the ciphertext in the buffer TEF as file EF, and then executes step 【2】; 【7】. The verification software APP determines whether the two-dimensional code is a decryption announcement information according to the recognition information. If so, extract the password DK and the recognition information and execute step 【8】. If not, execute step 【2】; 【8】. The verification software APP decrypts file EF using the password DK. If the decryption is successful, obtain the image DP and execute step 【9】. If not, execute step 【2】; 【9】. The verification software APP uses the image DP as seed data to generate the winning numbers according to a predetermined lottery algorithm, and then outputs the winning numbers and the image DP to the display;
[0010] . If the verification software APP receives an exit signal, it ends; otherwise, it returns to step 【2】. Regarding the code for parsing the text and QR codes in the image in this verification process, there are already sufficient resources available on the Internet, and the implementation code for each step is not a difficult technology to achieve. Moreover, the function for calculating the winning numbers in the verification process is still the GetYHResult function. Therefore, it is not necessary to provide the implementation code for the verification process in this article. Referring to Figure 5, the second embodiment of the present invention is still a lottery method applied to a lottery machine, and its working process is as follows: 【1】. Start the lottery software and initialize it; 【2】. Wait for 30 milliseconds. While waiting, the thread CAP reads an image from the camera and outputs it to the display; 【3】. The lottery software determines whether it has reached the account suspension time point. If it has, it executes step 【4】; otherwise, it executes step 【2】; 【4】. The lottery software reads a frame of image SP from the camera and randomly copies the image from the image SP to obtain an image DP identical to the copied area; 【5】. The lottery software copies the image DP to obtain an image YP identical to the image DP, then uses the image DP as seed data to generate the winning numbers according to a predetermined lottery algorithm and writes the winning numbers into the image YP. Then, it calculates the feature code MD of the data in the image YP, generates an account suspension announcement information using the identification information and the feature code MD, and outputs the account suspension announcement information to the display in two forms: QR code and text. It also generates an account suspension password DK using the data in the image DP and the image YP, and then encrypts the image DP and the image YP using the password DK with a predetermined encryption algorithm to generate a file EF, and calls the public key encryption to save the account suspension password DK; 【6】. The lottery software cuts the ciphertext information in the file EF into N small segments, adds identification information to each cut information segment, and outputs the information segments with added identification information to the display in two forms: QR code and text at regular time intervals. After all N small segments are displayed, it proceeds to the next step; 【7】. Wait for 30 milliseconds. While waiting, the thread CAP reads an image from the camera and outputs it to the display; 【8】. The lottery software determines whether the time has passed the confidentiality period. If it has, it executes step 【9】; otherwise, it executes step 【7】; 【9】. The lottery software calls the private key to decrypt the sealed number password DK, then uses the sealed number password DK to decrypt the file EF to obtain the image DP and the image YP. Then, it generates the unsealing announcement information by using the recognition information, the sealed number password DK, and the feature code MD. Then, it outputs the unsealing announcement information to the display in the forms of a two-dimensional code and text, generates the winning numbers according to the predetermined lottery algorithm with the image DP as the seed data, and outputs the winning numbers, the image DP (see Figure 8), and the image YP (see Figure 9) to the display;
[0010] . The lottery software outputs some information related to this lottery to the display and waits for a certain period of time. Then, it executes step 【2】. The encryption of the image DP and the image YP to generate the file EF is one of the following two methods: ① Encrypt the data of the image DP and the image YP, and save the ciphertext generated during the encryption process as the file EF. ② Compress the data of the image DP and the image YP into the data DPP, then encrypt the data DPP as the encryption object, and save the ciphertext generated during the encryption process as the file EF. Obviously, in the working process of the lottery machine in this embodiment, except for steps 【5】 and 【9】, the rest of the steps are the same as those in the first embodiment. There are no insurmountable obstacles to the implementation code of steps 【5】 and 【9】 in this embodiment. Therefore, the implementation of the code in this embodiment will not be elaborated further. See Figure 6. The verification process of the second embodiment is as follows: 【1】. Start the verification software APP; 【2】. The verification software APP reads the two-dimensional code from the image data of the camera; 【3】. If a valid two-dimensional code information is read, then execute step 【4】; otherwise, return to step 【2】; 【4】. The verification software APP determines whether the two-dimensional code contains the ciphertext segment in the file EF according to the recognition information. If so, it converts the part representing the ciphertext segment content in the two-dimensional code information into binary information and saves it to the corresponding position in the buffer TEF, and then executes step 【5】; if not, it executes step 【7】; 【5】. The verification software APP determines whether all N small segments split from the file EF have been received. If so, it executes step 【6】; if not, it executes step 【2】; 【6】. The verification software APP saves the ciphertext in the buffer TEF as the file EF, and then executes step 【2】; 【7】. The verification software APP determines whether the two-dimensional code is the unsealing announcement information according to the recognition information. If so, it extracts the password DK and the recognition information and executes step 【9】; if not, it executes step 【8】; 【8】. The verification software APP determines whether the QR code is a blocked account announcement message based on the recognition information. If so, it extracts the feature code MD and the recognition information and then executes step 【2】. If not, it executes step 【2】; 【9】. The verification software APP decrypts the file EF using the password DK. If the decryption is successful, it obtains the images DP and YP and executes step
[0010] . Otherwise, it executes step 【2】;
[0010] . The verification software APP verifies whether the feature code MD is the feature code of the image YP. If so, it executes step
[0011] , otherwise it executes step 【2】;
[0011] . The verification software APP generates a winning number using the image DP as seed data according to a predetermined lottery algorithm, and then outputs the winning number, the image DP, and the image YP to the display;
[0012] . If the verification software APP receives an exit signal, it ends. Otherwise, it returns to step 【2】. Although the present invention has been shown and described with reference to a given preferred embodiment thereof, those skilled in the art should understand that various changes in form and detail may be made herein without departing from the spirit and scope of the invention as defined by the appended claims.< / cmath>
Claims
1. A lottery method that first seals the number and then unseals it, and its working process is as follows: 【1】. Start the lottery software and initialize it; 【2】. Wait for a certain number of milliseconds. While waiting, read an image from the camera and output it to the display; 【3】. Determine whether it has reached the time point for sealing the number. If it has, execute step 【4】; otherwise, execute step 【2】; 【4】. Read a frame of image from the camera and randomly copy the image from this frame to obtain image DP; 【5】. Generate a sealing number password DK, and then use this password to encrypt image DP using a predetermined encryption algorithm to generate file EF; 【6】. Split the ciphertext information in file EF into N small segments, add identification information to each split small segment of information, and output the small segments with added identification information to the display one by one in two forms: QR code and text at a certain time interval. After all N small segments are displayed, execute the next step; 【7】. Wait for a certain number of milliseconds. While waiting, read an image from the camera and output it to the display; 【8】. Determine whether the time has passed the confidentiality period. If it has, execute step 【9】; otherwise, execute step 【7】; 【9】. Decrypt file EF with the sealing number password DK to obtain image DP, generate an unsealing announcement information using the identification information and the sealing number password DK, then output the unsealing announcement information to the display in two forms: QR code and text, and generate a winning number according to a predetermined lottery algorithm with image DP as the seed data, and output the winning number and image DP to the display; 【10】. Output some information related to this lottery to the display and wait for a certain time, then execute step 【2】.
2. The lottery method according to claim 1, characterized in that: Step 【5】 is modified to one of the following two: ① "【5】. Use the data in image DP to generate a sealing number password DK, and then use this password to encrypt image DP using a predetermined encryption algorithm to generate file EF;"; ② "【5】. Use the identification information to generate a sealing announcement information, and output the sealing announcement information to the display in two forms: QR code and text, use the data in image DP to generate a sealing number password DK, and then use this password to encrypt image DP using a predetermined encryption algorithm to generate file EF;".
3. A lottery method that first seals the number and then unseals it, and its working process is as follows: 【1】. Start the lottery software and initialize it; 【2】. Wait for a certain number of milliseconds. While waiting, read an image from the camera and output it to the display; 【3】. Determine whether it has reached the time point for sealing the number. If it has, execute step 【4】; otherwise, execute step 【2】; 【4】. Read a frame of image from the camera and randomly copy the image from this frame to obtain image DP; 【5】. Duplicate the image DP to obtain an image YP identical to the image DP. Then, use the image DP as seed data to generate a winning number according to a predetermined lottery algorithm and write the winning number into the image YP. Next, calculate the feature code MD of the data in the image YP, and generate a sealing announcement information using the identification information and the feature code MD. Then, output the sealing announcement information to the display in two forms: a two-dimensional code and text. Generate a sealing password DK using the data in the image DP and the image YP. After that, use the password DK to encrypt the image DP and the image YP using a predetermined encryption algorithm to generate a file EF; 【6】. Split the ciphertext information in the file EF into N small segments, add identification information to each split small segment of information, and output the small segments with added identification information to the display in two forms: a two-dimensional code and text at regular time intervals. After all N small segments have been displayed, proceed to the next step; 【7】. Wait for a certain number of milliseconds. While waiting, read an image from the camera and output it to the display; 【8】. Determine whether the confidentiality period has passed. If it has passed, execute step 【9】; otherwise, execute step 【7】; 【9】. Decrypt the file EF using the sealing password DK to obtain the image DP and the image YP. Then, generate an unsealing announcement information using the identification information, the sealing password DK, and the feature code MD. Next, output the unsealing announcement information to the display in two forms: a two-dimensional code and text. Generate a winning number according to a predetermined lottery algorithm using the image DP as seed data, and output the winning number, the image DP, and the image YP to the display; 【10】. Output some information related to this lottery to the display and wait for a certain period of time. Then, execute step 【2】.
4. The lottery method according to claim 1, wherein: Step 【3】 is modified to: "【3】. Determine whether a sealing instruction is received. If it is received, execute step 【4】; otherwise, execute step 【2】;”, and step 【8】 is modified to: "【8】. Determine whether an unsealing instruction is received. If it is received, execute step 【9】; otherwise, execute step 【7】;”.
5. The lottery method according to claim 3, wherein: Step 【3】 is modified to: "【3】. Determine whether a sealing instruction is received. If it is received, execute step 【4】; otherwise, execute step 【2】;”, and step 【8】 is modified to: "【8】. Determine whether an unsealing instruction is received. If it is received, execute step 【9】; otherwise, execute step 【7】;”.
6. The lottery method according to claim 1 or 2 or 4, characterized in that: The winning number and the image DP can be verified.
7. The lottery method according to claim 3 or 5, characterized in that: The winning number, the image DP, and the image YP can be verified.
8. The lottery method according to claim 1 or 2 or 3 or 4 or 5, characterized in that: After generating the sealing password DK, the sealing password DK is encrypted, and the password DK is decrypted before decrypting the file EF.
9. The lottery method according to claim 6, characterized in that: After generating the sealing password DK, the sealing password DK is encrypted, and the password DK is decrypted before decrypting the file EF.
10. The lottery method according to claim 7, characterized in that: After generating the sealing password DK, the sealing password DK is encrypted, and the password DK is decrypted before decrypting the file EF.
Citation Information
Patent Citations
Methods and equipment for generating random number and random number set
CN104407838A
Lottery claiming method and device based on block chain
CN109672693A
Information-hiding-based method and system for anti-counterfeiting authentication of lottery information
CN110111477A
Identification code determination system, identification code determination method, and identification code determination program
JP2023029258A
Games, lotteries, and sweepstakes and tickets, systems, technologies, and methods related thereto
US20180322740A1