A controlled random sequence generation system and method for rubiks cube double face color recognition

CN122985113APending Publication Date: 2026-10-27BEIJING SHUWEI CARRIER TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611318463.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-28
Publication Date
2026-10-27

AI Technical Summary

Technical Problem

[0005]本发明提供一种魔方双面颜色识别的受控随机序列生成系统及方法,解决相关技术中基于物理随机源的双面图像识别过程中,生成的序列随机性可被预测、编码信息冗余且输出缺乏受控性的技术问题

Benefits of technology

本发明以特制双色三阶魔方的随机打乱状态作为物理随机性来源,利用消费级移动终端的图像采集功能执行颜色识别,克服了伪随机数算法输出序列具有周期性的局限,且无需部署成本较高的专用硬件随机数发生器。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122985113A_ABST
    Figure CN122985113A_ABST
Patent Text Reader

Abstract

The application relates to the technical field of random sequence generation, and discloses a controlled random sequence generation system and method for double-face color recognition of a Rubik's cube, wherein the system comprises a specially-made double-color third-order Rubik's cube, an image acquisition module, an image recognition module, an encoding generation module and an output display module. The image acquisition module acquires a nine-square color image of any two faces of the Rubik's cube; the image recognition module performs color recognition and binary mapping to obtain a 3*3 numerical matrix; the encoding generation module generates a first encoding sequence through row-by-row summation and change bit determination, and performs numerical transformation on the change bit to generate a second encoding sequence; and the output display module presents the encoding sequence pair.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of random sequence generation technology, specifically to a controlled random sequence generation system and method for double-sided color recognition of a Rubik's Cube. Background Technology

[0002] In applications where the physical randomness of a random sequence is explicitly required, generating random sequences with true physical randomness is a fundamental requirement. Existing random sequence generation methods mainly fall into two categories: pseudo-random number algorithms and dedicated hardware random number generators. Pseudo-random number algorithms are essentially deterministic computation processes, and their output sequences exhibit periodicity, lacking true physical randomness. While dedicated hardware random number generators can provide a source of physical randomness, they are costly and unsuitable for deployment on consumer-grade mobile devices.

[0003] In the scheme of image acquisition and encoding using Rubik's Cube as physical random source, the existing single-sided image recognition method is limited by the limited state information that a single side can provide. Each acquisition only obtains 3 lines of state data, and the upper limit of the range of the number of changing bits is 3. It cannot cover all encoding state combinations from zero changing bits to six changing bits, resulting in encoding blind spots and incomplete state coverage of the generated encoding sequence pairs.

[0004] Therefore, how to use consumer-grade mobile terminals to generate encoded sequence pairs that have both physical randomness and complete encoded state coverage through image acquisition and numerical encoding is the main technical problem faced by existing technologies. Summary of the Invention

[0005] This invention provides a controlled random sequence generation system and method for Rubik's Cube double-sided color recognition, which solves the technical problems in the process of double-sided image recognition based on physical random sources in related technologies, such as the predictability of the randomness of the generated sequence, the redundancy of the encoded information, and the lack of control over the output.

[0006] This invention discloses a controlled random sequence generation system for double-sided color recognition of a Rubik's Cube, comprising an image acquisition module, an image recognition module, an encoding generation module, and an output display module.

[0007] Furthermore, the color classification in the image recognition module is implemented using a color space threshold segmentation method: the pixel colors within the sampling area are converted from the RGB color space to the HSV color space; based on the color combination selected by the specially designed two-color 3x3 Rubik's Cube, the threshold ranges of the first and second colors in the HSV space are pre-defined; and the percentage of pixels falling within the threshold range of the first color is counted for the center sampled pixels of each small square. and the percentage of pixels falling within the second color threshold range ,like Then it is determined to be the first color, if Then it is determined to be the second color, if The system will then prompt you to re-acquire the image for that surface.

[0008] Furthermore, the color classification in the image recognition module is implemented using a pre-trained binary classification convolutional neural network model: the input layer of the binary classification convolutional neural network model receives pixel data of a single small grid center sampled image block, and the output layer outputs the posterior probability that the image block belongs to the first color after passing through the Softmax activation function. And the posterior probability of belonging to the second color ,satisfy The class with the higher posterior probability is selected as the judgment result; the binary classification convolutional neural network model is trained in a supervised manner on a two-color Rubik's Cube image dataset covering various lighting conditions and shooting angles, with the cross-entropy loss function as the optimization objective and the Adam optimization algorithm used to update the parameters.

[0009] Furthermore, the specially designed two-color 3x3 Rubik's Cube follows the mechanical structure of the standard 3x3 Rubik's Cube, using only two colors defined as the first color and the second color. In the initial solved state, three of the six faces are the first color and the other three are the second color. The two colors are centrally symmetrically distributed, and the center grid of each of the six faces is fixedly printed with the numbers 1 to 6.

[0010] Furthermore, in the encoding generation module, the first encoded sequence Defined as The range of values ​​for each element is: The set of changing positions Formal definition ; at the changed position At the non-changing position .

[0011] Furthermore, the system is applicable to four-color and six-color Rubik's Cubes: the multiple colors of the Rubik's Cube are divided into two color categories according to preset rules. The first color category is mapped to the value 0, and the second color category is mapped to the value 1, so that the probability of the two colors appearing is balanced. After the color category division is completed, the numerical matrix generation, row-by-row summation, encoding sequence generation and change bit determination are performed according to the same binarization rules as the two-color Rubik's Cube.

[0012] Furthermore, the image acquisition module enables white balance locking before performing the first acquisition operation to ensure that the color temperature of the two acquisitions remains consistent; the image preprocessing in the image recognition module includes cropping the image according to the boundary coordinates of the nine-grid auxiliary box, applying perspective transformation to correct the image to a frontal view if the shooting angle is tilted, and adjusting the corrected image to a uniform size.

[0013] Furthermore, the output display module supports displaying the values ​​of each element. Map the first encoded sequence to a two-bit binary number. Or the second coding sequence It is expanded into a 12-bit binary encoded sequence; the output display module records the historical output results and displays the encoded sequence pairs generated consecutively in list form.

[0014] Furthermore, the encoding generation module is also configured to: in an incremental shuffling scenario that is executed cyclically in rounds, starting from the first... 3×3 numerical matrix of the target surface of the wheel Extract four edge cells and construct an edge cell sampling sequence in a clockwise direction. ,right Generate all four cyclic shift versions and take the version with the smallest decimal value as the normalized form. Record standardized shift amount ; Calculate rotation alignment parameters Perform on the previous round of standardized grid sequence Step-by-step shifting to obtain rotated and aligned versions ;right and Perform a bitwise XOR operation to obtain the difference sequence And calculate the differential activity. ;Will With activity threshold In comparison, if Then As an effective difference And the difference order ,like Then, the higher-order differences are calculated back through the historical buffer until the threshold condition is met; the edge cell sum is then calculated. , center grid value Rotation alignment parameters Effective differential activity Difference order through After compression, the sequence is arranged into a first encoded sequence of length 5. ,in accordance with The value of Perform controlled transformation to generate the second encoded sequence .

[0015] This invention discloses a controlled random sequence generation method for double-sided color recognition of a Rubik's Cube, comprising: Step 1: After randomly shuffling the specially made two-color 3x3 Rubik's Cube, collect the nine-square grid color images of any two different faces, identify the number of the center square of each face, and perform a validity check on the number of the two faces to confirm that the two collections correspond to different physical faces. Step 2: Perform image preprocessing, color classification and binarization mapping on the nine-grid color image respectively, determine the color of each small grid as the first color or the second color, map the first color to the value 0, and map the second color to the value 1, and obtain two 3×3 numerical matrices. Step 3: Perform row-by-row summation on the two numerical matrices to obtain six row sums, and arrange the six row sums in a preset order to form the first encoding sequence. ; Step 4, process the first encoded sequence Bank of China sum value belongs to The positions are marked as change bits and collected into the change bit position set. ,in accordance with right Perform numerical transformation to generate the second encoded sequence The position of the change In the non-changing position ; Step 5, convert the first encoded sequence Second coding sequence and the set of changing positions Presented in a visual way.

[0016] The beneficial effects of this invention are as follows: This invention uses the random scrambled state of a specially designed two-color 3x3 Rubik's Cube as the source of physical randomness, and utilizes the image acquisition function of a consumer-grade mobile terminal to perform color recognition. This overcomes the limitation of the periodicity of the output sequence of pseudo-random number algorithms, and eliminates the need to deploy a high-cost dedicated hardware random number generator.

[0017] By performing image acquisition and state encoding on any two faces of the Rubik's Cube, two sets of three rows of state data are obtained each time. The total number of changing bits can cover all values ​​from zero to six. Compared with the zero to three changing bits that can be covered by the single-face recognition method, the encoding blind spot caused by the limited state information of a single face is eliminated, and the state coverage of the encoding sequence pair is guaranteed.

[0018] In the image recognition stage, a central region sampling method is used for each small grid to avoid color mixing interference caused by the boundary of adjacent color blocks at the edge of the small grid, thereby reducing the impact of color judgment error on the accuracy of the numerical matrix.

[0019] The validity of the face ID corresponding to the two image acquisitions is verified, which eliminates the possibility of duplicate acquisition of the same face due to operational errors at the process level, and ensures that the two numerical matrices correspond to two different physical faces on the Rubik's Cube.

[0020] During the encoding generation stage, deterministic numerical transformations are performed on the positions of the changing bits by summing row by row and determining the changing bits. This ensures that the first and second encoded sequences satisfy the complementary constraint that the sum of their values ​​is constant at the changing bit positions, while maintaining the same values ​​at the non-changing bit positions. This forms a controlled complementary structure of encoded sequence pairs, meeting the needs of application scenarios that require physical randomness in the source of random sequences and require a complementary relationship between the two sequences. Attached Figure Description

[0021] Figure 1 This is a flowchart of the Rubik's Cube state coding method based on double-sided image recognition provided in an embodiment of the present invention; Figure 2 This is a schematic diagram of the data processing flowchart for the lottery application provided in an embodiment of the present invention; Figure 3 This is a schematic diagram of the grid value distribution of the surface F1 binarization matrix (M1) provided in an embodiment of the present invention; Figure 4 This is a schematic diagram of the grid value distribution of the surface F2 binarization matrix (M2) provided in an embodiment of the present invention; Figure 5 This is a schematic diagram comparing the results of row-by-row summation on both sides provided in an embodiment of the present invention; Figure 6 This is a schematic diagram illustrating the bit-by-bit comparison of the encoded sequences S1 and S2 provided in an embodiment of the present invention; Figure 7 This is a schematic diagram of bit-by-bit comparison of a 12-bit binary expansion provided in an embodiment of the present invention. Detailed Implementation

[0022] The subject matter described herein will now be discussed with reference to exemplary embodiments. It should be understood that these embodiments are discussed only to enable those skilled in the art to better understand and implement the subject matter described herein, and changes may be made to the function and arrangement of the elements discussed without departing from the scope of this specification. Various processes or components may be omitted, substituted, or added as needed in the examples. Furthermore, some features described in the examples may be combined in other examples.

[0023] Example 1 At least one embodiment of the present invention discloses a controlled random sequence generation system for double-sided color recognition of a Rubik's Cube, the method of which is described below. Figure 1 The system includes: a specially designed dual-color Rubik's Cube, an image acquisition module, an image recognition module, an encoding generation module, and an output display module.

[0024] Before execution, this embodiment requires a specially designed two-color 3x3 Rubik's Cube as the physical random source. The specially designed two-color 3x3 Rubik's Cube follows the mechanical structure of the standard 3x3 Rubik's Cube, consisting of a central axis, six center pieces, twelve edge pieces, and eight corner pieces, and can be rotated around three mutually orthogonal axes. Unlike the traditional six-color Rubik's Cube, the specially designed two-color 3x3 Rubik's Cube uses only two colors, defined as the first color and the second color. In the initial solved state, three of the six faces are the first color, and the other three are the second color, with the two colors centrally symmetrically distributed. The center cells of each of the six faces are fixedly marked with numbers 1 to 6, used to identify the face's identifier during the image acquisition stage. This embodiment runs on a computing device equipped with image acquisition capabilities, which includes an image acquisition module, an image recognition module, an encoding generation module, and an output display module.

[0025] The image acquisition module is configured to acquire a 3x3 color image of any two faces of the Rubik's Cube after randomly shuffling it. The image acquisition module performs the following operations on the specially designed two-color Rubik's Cube: Step 1: Perform at least 20 random rotations on the specially designed two-color Rubik's Cube. Each step involves rotating any layer by 90 or 180 degrees in any direction, so that the color distribution of each small square of the Rubik's Cube is fully and randomly mixed.

[0026] Step 2: Following the prompts on the image acquisition module's operation guide interface, select any one of the six faces of the Rubik's Cube as the first face. Position the first face directly towards the camera of the image acquisition module, ensuring the Rubik's Cube fully fills the 3x3 grid auxiliary frame on the acquisition interface. Perform the first image acquisition operation to obtain the 3x3 color image of the first face. And identify the numerical identifier in the center square of the first face, and record it as... .in, The first side is represented by a nine-square color image. The number indicating the center cell of the first face.

[0027] Step 3: Select any one of the remaining five faces as the second face, face the second face directly towards the lens of the image acquisition module, and perform a second image acquisition operation according to the same acquisition specifications as the first face to obtain a nine-grid color image of the second face. And identify the numerical identifier in the center square of the second face, and record it as... .in, This represents the nine-square color image on the second side. The number indicates the center cell of the second face. The selection of the second face is unrestricted and does not need to maintain a specific spatial correspondence with the first face.

[0028] Step 4, for and Perform validity verification: Validation and Check if the face IDs are different. If the face IDs are the same in both scans, prompt the user to repeat steps 2 and 3 until the face IDs are different. Validity verification excludes duplicate scans of the same face due to operational errors, ensuring that the two faces used for subsequent encoding calculations are two different physical faces on the Rubik's Cube.

[0029] To minimize the impact of lighting variations on the accuracy of subsequent color recognition, both image acquisition operations should be performed under the same or similar lighting conditions. If the device supports this, the white balance lock function of the image acquisition module can be enabled before performing the first acquisition operation to ensure that the color temperature of the two acquisitions remains consistent, thereby reducing color deviation caused by fluctuations in ambient lighting between the two acquisitions.

[0030] The image recognition module is configured to perform color recognition and binarization numerical mapping on a nine-grid image, obtaining two 3×3 numerical matrices: Image recognition module for images and Perform the following processes respectively: The image preprocessing submodule crops the image based on the boundary coordinates of the 3x3 grid auxiliary box, removing the cube border and background area; if the shooting angle is tilted, perspective transformation is applied to correct the image to a frontal view; the corrected image is adjusted to a uniform size so that each small square corresponds to a fixed pixel area.

[0031] The color classification submodule divides the image into nine evenly spaced sub-regions according to a 3x3 grid, with each sub-region corresponding to a small square on the Rubik's Cube. For each sub-region, the pixel color values ​​within its central area are statistically analyzed, and the sampling result is determined as either the first color or the second color.

[0032] The binarization mapping submodule performs binarization conversion according to preset mapping rules: the first color is mapped to the value 0, and the second color is mapped to the value 1.

[0033] With images For example, let's assume the nine-square grid is numbered from left to right and top to bottom as positions. line number , column number Then the 3×3 numerical matrix on the first face Defined as: ; in, Indicates the first page Line number Binarized values ​​of small cells. This indicates that the small square is identified as the first color. This indicates that the small square is identified as the second color. Indicates the line number. Indicates the column number. For the image. Perform the same process to obtain the 3×3 numerical matrix of the second face. Its elements are denoted as The meaning of row and column numbers is the same as same.

[0034] The aforementioned color classification submodule supports an implementation based on color space threshold segmentation: converting the pixel colors within the sampling area from the RGB color space to the HSV color space, where... For hue components, For saturation components, This refers to the brightness component. Based on the color combination selected for the specially designed two-color 3x3 Rubik's Cube, the threshold ranges of the first and second colors in the HSV space are pre-defined. The percentage of pixels whose center sampled pixels in each sub-region fall within the threshold range of the first color is then statistically analyzed. and the percentage of pixels falling within the second color threshold range ,in This represents the percentage of pixels that fall within the first color threshold range. This indicates the percentage of pixels falling within the second color threshold range; if Then the small square is determined to be the first color; if If it is the second color, then it is determined to be the second color; if If the image is not captured, the system will prompt you to re-capture the image for that surface.

[0035] To improve the adaptability of color recognition to complex lighting conditions, the color classification submodule can also use a pre-trained binary classification convolutional neural network model to perform color determination for each small grid. The input layer of the binary classification convolutional neural network model receives pixel data from the center sampled image patch of a single small grid, and the output layer is a fully connected layer with two neurons. After passing through the Softmax activation function, it outputs the posterior probability that the image patch belongs to the first color. And the posterior probability of belonging to the second color ,in This represents the posterior probability that the image patch belongs to the first color. This represents the posterior probability that the image patch belongs to the second color, satisfying... The class with the higher posterior probability is chosen as the decision result, i.e., if If the color is positive, it is classified as the first color; otherwise, it is classified as the second color. The binary classification convolutional neural network model was trained in a supervised manner on a dataset of two-color Rubik's Cube images covering various lighting conditions and shooting angles. The model uses the cross-entropy loss function as the optimization objective and the Adam optimization algorithm to update parameters, making it suitable for use scenarios with complex ambient lighting conditions.

[0036] The encoding generation module is configured to perform row-by-row summation on the numerical matrix to obtain the sum of six rows: The encoding generation module generates the first face value matrix. Sum the three elements in each row from top to bottom: ; ; ; in, , , These are the row sums and values ​​for the first, second, and third rows of the first page, respectively. Since the three elements in each row are taken from... The range of values ​​for each row sum is: .

[0037] For the second face numerical matrix Perform the same row-by-row summation operation: ; ; ; in, , , These are the row sums and values ​​for the first, second, and third rows of the second page, respectively, with the same range of values. .

[0038] The probability distribution characteristics of the row sum are as follows: In a fully scrambled Rubik's Cube, each cell has a 1 / 2 probability of being the first color (value 0) or the second color (value 1), and the color states of each cell are independent of each other. Therefore, the three binary elements in each row are independent and follow the same Bernoulli distribution. Let the sum of the rows be... ,but Follows binomial distribution Its probability mass function is: ; in, This represents the possible values ​​for the row and the sum of the values. The probability of each value is calculated as follows: , , , A row sum of 0 indicates that all three cells in the row are the first color, and a row sum of 3 indicates that all three cells in the row are the second color. Both of these cases represent the extreme state where the colors in the row are completely the same, with a total probability of 1 / 4. A row sum of 1 or 2 indicates that there is color mixing in the row, with a total probability of 3 / 4.

[0039] The encoding generation module is configured to arrange the six rows and values ​​to generate the first encoding sequence. : The encoding generation module will generate the above six rows and values. , , , , , Arranged in a preset order, they form a first encoded sequence of length 6. Specifically defined as: ; in, Indicates the first encoded sequence The Bit element, . Each element in the array has a value of 1. The sum of a given integer is a given integer, and the total length of the sequence is fixed at 6 digits. Since the sum of each row comes from an independent row, and the color state of each cell is independent, therefore... The values ​​at the six positions are statistically independent of each other.

[0040] The encoding generation module is configured to process the first encoded sequence. Perform a change bit determination and obtain the set of change bit positions. : The encoding generation module processes the first encoded sequence. Each position ( The following judgments are executed sequentially: If Then the position Marked as a changed position, it means that the corresponding row of the cube is in an extreme state where all colors are the same; if Then the position The mark is a non-changeable position, which means that the two colors are mixed in the Rubik's Cube row corresponding to that position.

[0041] Traverse the first encoded sequence All 6 positions are used to collect the position indices of all positions that are determined to be change positions into the change position set. Change position set The formal definition is: ; Change position set Size An integer between 0 and 6 represents the first encoded sequence. The total number of changing positions. Based on the probability distribution characteristics of row sums and values, the probability of each position being identified as a changing position is exactly equal to... The probability that each position is determined to be a non-changing position is Since the six positions are independent of each other, the first coding sequence Total number of changing bits Follows binomial distribution Its expected value is 1.5 and its variance is 9 / 8.

[0042] The encoding generation module is configured to be based on the set of changing bit positions. For the first encoded sequence Perform numerical transformation to generate the second encoded sequence. : The encoding generation module uses the first encoding sequence As input, based on the set of changing bit positions Generate the second encoded sequence bit by bit according to the following rules. : For each position ( ), The calculation rules are as follows: ; in, Indicates the second encoded sequence The Bit element. Due to changes in bit position. The value can only be 0 or 3. The above mapping relationship is specifically expressed as follows: If but ,like but ; non-changing position , It remains unchanged.

[0043] First coding sequence With the second coding sequence Together they form a pair of encoded sequences, where the first encoded sequence With the second coding sequence The changing bits carry symmetrical and complementary information, while the non-changing bits have completely identical values. First coded sequence With the second coding sequence Satisfy at the position of the change position The deterministic constraints satisfy the following at the non-changing position: This structure provides deterministic constraints. It allows coded sequence pairs to form constrained complementary relationships at changing bit positions, while maintaining numerical consistency at non-changing bit positions, resulting in a controlled complementary sequence pair structure.

[0044] Second coding sequence The marginal distribution of each bit and the first coding sequence All edge distributions are numerically consistent and satisfy the following conditions: The probability mass function. Specifically, the position of the changing bit. Its probability distribution is , , with the first encoded sequence The distribution at this position is symmetrical; at the non-changing position... The distributions are exactly the same. Therefore, the first coding sequence With the second coding sequence Both have symmetrical statistical properties, and in a statistical sense, they have equivalent random properties.

[0045] The output display module is configured to visually represent the encoded sequence pairs and the set of changed bit positions. The output display module will display the first encoded sequence. Second coding sequence and the set of changing positions The output is presented in a visual format and includes: the first encoded sequence. The six-digit value, the second encoded sequence The set of six-digit values ​​and variable positions Member list and The value.

[0046] The output can be copied as text or exported to the target application via a predefined application programming interface (API) to allow for the adaptation of the first encoded sequence to specific use cases. Second coding sequence Perform further format conversion. For example, change the values ​​of each element. The first encoded sequence is mapped to two binary digits (corresponding to 00, 01, 10, and 11 respectively). Or the second coding sequence It is expanded into a 12-bit binary encoded sequence.

[0047] To facilitate comparison of output results across multiple generation scenarios, the output display module can also record historical output results and display consecutively generated coded sequence pairs in a list format, aiding in intuitive observation of the randomness of the sequence.

[0048] This invention uses a specially made two-color 3x3 Rubik's Cube as the physical random source. By randomly shuffling the cube, it introduces real physical randomness, overcoming the limitation that pseudo-random number algorithms have periodic output sequences and lack a source of physical randomness.

[0049] In the color recognition stage, sampling is performed on the central region of each small square instead of the entire region. This avoids color aliasing interference caused by the boundary of adjacent color blocks at the edge of the small square, and reduces the impact of the image recognition misjudgment rate on the accuracy of subsequent coding.

[0050] During the encoding generation stage, the binarized values ​​of each small cell are compressed into row sums by summing row by row. Then, the change bit determination rule distinguishes between extreme state rows with completely identical colors (row sum value of 0 or 3) and mixed state rows (row sum value of 1 or 2). For extreme state rows, the first encoding sequence is used to determine the row sum value. With the second coding sequence A numerical interchange transformation is performed between them to generate a constrained pair of complementary coded sequences. This is because the positions of the changed bits are... Deterministic constraints and non-changing position The deterministic constraints are simultaneously met, and the first encoded sequence With the second coding sequence Maintaining symmetry in overall statistical properties allows the encoded sequence pairs to simultaneously possess both a physical randomness source and a controlled complementary structure, meeting the needs of application scenarios that require physical randomness in the source of random numbers and a complementary relationship between the two sequences.

[0051] In addition, the identity number of the face is identified by the central grid number, and the face identity validity is verified after collection. This process eliminates the possibility of repeated collection of the same face due to operational errors, ensuring that the two numerical matrices correspond to two different physical faces on the Rubik's Cube, thereby ensuring the validity of the encoding results.

[0052] The method described in this invention is not limited to two-color 3x3 Rubik's Cubes, but is also applicable to four-color Rubik's Cubes, six-color Rubik's Cubes, and other Rubik's Cube variants with more colors. When using a four-color or six-color Rubik's Cube, the various colors of the cube can be pre-divided into two color categories according to certain rules: for example, warm-toned colors (such as red, orange, and yellow) can be classified into the first color category, and cool-toned colors (such as blue, green, and white) into the second color category; or the cube can be divided equally or approximately equally according to the actual color composition of the cube, so that the probability of the two color categories is as balanced as possible, thereby satisfying the statistical assumption of this method that the probability of each value in the binarization mapping is close to 1 / 2. After the color category division is completed, the image recognition module maps the color of each small square to the corresponding color category, and performs all subsequent steps such as numerical matrix generation, row-by-row summation, encoding sequence generation, and change bit determination according to the same binarization rules (the first color category is mapped to the value 0, and the second color category is mapped to the value 1), without requiring any changes to the core algorithm flow. Therefore, the method provided in this embodiment has good color configuration scalability and can be adapted to application scenarios where Rubik's Cubes of different color specifications are used as physical random sources.

[0053] Example 2 In applications that generate controlled random sequences based on Rubik's Cube double-sided color recognition, the operator holds the Rubik's Cube and performs incremental scrambling operations. After each round of scrambling, an image is captured from the target face of the Rubik's Cube, a 3×3 numerical matrix is ​​obtained through color recognition, and a controlled random sequence is generated based on the matrix data through encoding transformation.

[0054] Existing methods typically extract a circular sampling sequence from a two-sided matrix, standardize it by taking the minimum value of four rotationally equivalent versions, then calculate the first-order temporal difference vector between adjacent rounds, and perform offset mapping and conditional encoding on the difference results before compressing and concatenating them into a random sequence output. This method suffers from two synergistic drawbacks. First, the rotational deviation introduced by actual hand-held flipping is not strictly a multiple of 90 degrees, but may be non-standard angles such as 45 degrees. In this case, the only four rotationally equivalent versions cannot cover the intermediate rotational states, resulting in the same physical position corresponding to different index positions in the circular sequences of different rounds during cross-round comparisons. The temporal difference actually compares the color values ​​of different physical grids, generating spurious difference signals unrelated to the actual state changes. Second, in low-frequency incremental scrambling scenarios, only one to two steps are performed per round, resulting in minimal actual color changes. Most elements in the first-order difference vector are zero, and the limited actual change signal is overwhelmed by the spurious difference signal generated by rotational misalignment. Furthermore, the low-activity difference across multiple rounds leads to repetitive values ​​and periodic patterns in the encoded sequence, resulting in severely insufficient randomness.

[0055] This embodiment uses only four edge cells of the target surface (top center, right center, bottom center, and left center) to construct the sampling sequence, ensuring that the length of the sampling sequence is consistent with the number of cyclic shift versions (both are 4). The standardization process covers four rotationally equivalent states: 0°, 90°, 180°, and 270°. Based on this, the difference in the standardized shift amount between adjacent rounds is used to perform rotational alignment on the previous round's sequence, ensuring that the differences correspond to the same physical edge cell during bit-by-bit comparison, thus eliminating spurious difference signals introduced by rotational deviation. Simultaneously, difference activity detection and adaptive order adjustment are introduced. When the activity of the first-order difference is insufficient, it automatically backtracks to a higher-order difference, accumulating multiple rounds of minute color changes into an effective difference with sufficient activity.

[0056] Before executing this embodiment, a specially made two-color 3x3 Rubik's Cube of the same specifications as in Embodiment 1 needs to be prepared as the physical random source, and it needs to be run on a computing device equipped with image acquisition capabilities. This embodiment executes cyclically in rounds, let the current round number be . , This indicates the current round number. The computing device maintains a historical buffer, retaining the most recent round number. The standardized circular sequence of the wheel and the corresponding standardized shift data. This indicates the maximum number of rounds that the history buffer can retain.

[0057] At least one embodiment of the present invention discloses a controlled random sequence generation system for double-sided color recognition of a Rubik's Cube, the system comprising: The image acquisition module and image recognition module are configured to acquire a nine-square color image of the target face of the Rubik's Cube and obtain the first... 3×3 numerical matrix and grid sampling sequence : Following the same processing flow as the image acquisition module and image recognition module in Embodiment 1, a nine-square color image is acquired after randomly shuffling the target face of the Rubik's Cube. Color recognition and binarization numerical mapping are then performed on the image to obtain the... 3×3 numerical matrix of the target surface of the wheel Its elements line number , column number .

[0058] From a 3×3 numerical matrix Extract the four edge cells (top center, right center, bottom center, left center) and read the resulting edge cell sampling sequence in a clockwise direction. Its elements are denoted as , , Indicates the index number of the edge grid sampling sequence; extracts the center grid value. , Indicates the first Binarized values ​​of the center grid of the target surface. Edge grid sampling sequence. Store in the history buffer.

[0059] The clockwise reading order of the four side cells is: row 1, column 2; row 2, column 3; row 3, column 2; row 2, column 1, with corresponding coordinates as follows: , , , ,index The numbers are 0, 1, 2, and 3 in sequence. Corner cells (the four corner positions) are not involved in the construction of the sampling sequence, and their color states are not included in subsequent encoding calculations.

[0060] The encoding generation module is configured to sample the edge grid sequence. Generate all four cyclic shift versions and obtain the normalized form. and standardized shift amount : The encoding generation module samples the edge grid sequence. Generate all 4 cyclic shift versions, the first one. Versions ( ) is defined as the sampling sequence of the edge grid. Circular shift to the left The sequence obtained by step , This represents the number of steps in the cyclic shift, corresponding to a physical rotation angle. For each version, treat its four binary elements arranged in order as a 4-bit binary number, and calculate the corresponding decimal value. : ; in, Indicates the first The decimal value corresponding to each cyclic shift version. Take... The smallest version as a standardized form The corresponding number of shift steps is denoted as the standardized shift amount. : ; in, Indicates the first The standardized displacement of the wheel, Indicates the first The normalized form of the lattice sampling sequence. If multiple versions correspond to the same minimum decimal value, the version with the smallest shift step is selected. The normalized form... and standardized shift amount Store it in the history buffer for later use.

[0061] Since the sequence is constructed using only 4 side cells, with a sequence length of 4, there are exactly 4 independent cyclic shift versions (corresponding to four equivalent rotational states: 0°, 90°, 180°, and 270°), and the number of versions is consistent with the sequence length. This processing allows the normalization process to cover the equivalent rotational states that are multiples of 90 degrees introduced by hand-held flipping, thereby eliminating the influence of rotational deviations in subsequent rotational alignment steps.

[0062] The encoding generation module is configured to generate standardized grid sequences. Calculate the sum of the border cells : The encoding generation module generates standardized grid sequences. Sum all four elements and calculate the sum of the border cells. : ; in, For standardized grid sequence The One element, To sum the indices, where the values ​​range from 0 to 3, Indicates the first The sum of the edge grids of the wheel, the range of values ​​is: Since each grid element is taken independently from... , Follows binomial distribution .

[0063] The encoding generation module is configured to calculate rotation alignment parameters. Perform rotation and alignment on the previous round of standardized grid sequence to obtain the aligned version. : The encoding generation module calculates the normalized shift difference between the current round and the previous round, using it as a rotation alignment parameter: ; in, Indicates the first Wheel rotation alignment parameters, Indicates the first The standardized displacement of the wheel, Indicates the first The standardized displacement of the wheel.

[0064] The normalized grid sequence of the previous round in the history buffer implement Step left circular shift to get the rotated and aligned version : ; in, For rotated and aligned version The One element, For the previous round of standardized grid sequence In circular index The element at that location. After the above rotation and alignment operations, the normalized grid sequence is obtained. With rotation-aligned version At the same index position The corresponding element reflects the color state of the same physical edge of the Rubik's Cube in two adjacent rounds.

[0065] Rotation Alignment Parameters The modulus and the cyclic shift version number are kept consistent, both being 4, corresponding to the relative deviations between the four rotation states of 0°, 90°, 180°, and 270°. By applying the same shift to the previous sequence, the indexes of the two sequences are compared bit by bit. All of them correspond to the same physical grid, thus ensuring that subsequent difference calculations reflect the true color state changes.

[0066] The encoding generation module is configured to calculate the bit-by-bit XOR difference after rotation and alignment. and differential activity : The encoding generation module generates standardized grid sequences. With rotation-aligned version Perform a bitwise XOR operation to obtain the difference sequence. : ; in, This represents the binary XOR operation. Represents the difference sequence The One element, This indicates that the color of the physical grid cell changed between the two rounds. This indicates that the color has not changed.

[0067] Statistical difference series The number of elements with a median value of 1 is used as the differential activity: ; in, To sum the indices, where the values ​​range from 0 to 3, Indicates the first The differential activity of the wheel, with a value range of [value missing]. This reflects the number of physical grid cells whose color changes between the current round and the reference round.

[0068] The encoding generation module is configured to be based on differential activity thresholds. Perform adaptive order determination to obtain effective differences. and difference order : The encoding generation module will use differential activity With activity threshold Comparison, among which The differential activity threshold is represented by the following rules, which determine the effective difference and the difference order: like Then directly set the effective difference. Difference order ,in Indicates the effective difference. This indicates the difference order, and the process jumps to the subsequent step of calculating the effective difference activity.

[0069] like Then proceed to the higher-order difference process: sequentially process the first... Turn number The cumulative rotation alignment difference is calculated for each round. wheel( , (Indicates the step size of the differential backtracking rounds), calculate the cumulative alignment shift: ; in, Indicates the current round and the number of... The cumulative alignment shift between wheels Indicates the first The standardized displacement of the wheel.

[0070] For standardized grid sequences implement Step left circular shift to obtain the first... Wheel rotation alignment version ; Calculate the alignment difference: ; in, Indicates the current round and the number of... The first alignment difference sequence between rounds One element, For the first Wheel rotation alignment version 1 Each element.

[0071] and its activity level ,in Indicates the current round and the number of... Alignment differential activity between wheels The sum index is used for calculation, and the value range is 0 to 3.

[0072] Traversal Choose to satisfy The smallest The difference corresponding to the value is taken as the effective difference. ,Record If none of the orders satisfy the threshold, then take... The difference corresponding to the largest order is taken as the effective difference. Record the corresponding .

[0073] The physical meaning of higher-order differences is to change the reference cycle of the difference from the adjacent 1st cycle. The history of wheels dates back to the first The process involves multiple rounds of incremental scrambling, accumulating the combined effect of numerous small color changes. In low-frequency incremental scrambling scenarios, a single round of operation only changes the color of a small number of cells, resulting in insufficient active cells in the first-order difference. By extending the reference rounds forward, the accumulated color changes from multiple rounds can be reflected in a single difference sequence, ensuring that the effective difference contains a sufficient amount of real change information.

[0074] Activity threshold The settings are based on the following: there are 4 side grids in total. This means that at least two physical grid cells change color, accounting for 50% or more of all grid cells. At this point, the change information carried by the difference sequence is sufficient to support the randomness requirements of subsequent encoding generation. A value that is too low (e.g., 1) will cause even a tiny change in a single cell to trigger the encoding process. If the value is too high (e.g., 3), the high-order difference process will be frequently triggered in low-frequency scrambling scenarios. A balance is struck between the availability of first-order differentials and the triggering frequency of higher-order differentials.

[0075] The encoding generation module is configured to handle effective differences. Calculate effective differential activity : The encoding generation module counts the effective differences. The number of elements with a median value of 1 is used as the effective difference activity: ; in, Represents the effective difference The One element, To sum the indices, where the values ​​range from 0 to 3, This represents the effective differential activity, with a value range of [value range missing]. This reflects the number of edge cells that undergo color change in the selected effective difference after adaptive order determination, which is used for subsequent encoding sequence generation.

[0076] The encoding generation module is configured to arrange and concatenate multi-dimensional feature values ​​to generate a first encoding sequence of length 5. : The encoding generation module arranges the above feature values ​​in the following preset order, and performs operations on each value. Compression (to map all elements uniformly to) ), forming a first encoded sequence of length 5. : ; The definitions of each element are as follows: ; ; ; ; ; in, Indicates the first encoded sequence The Bit element, , Indicates the first The sum of the edges and values ​​of the wheel. Indicates the first Binarized numerical values ​​of the center grid of the target surface of the wheel. Indicates the first Wheel rotation alignment parameters, Indicates effective differential activity. Indicates the difference order. First encoded sequence. Each element in the array has a value of 1. One of the integers.

[0077] in, , Its value already satisfies The range constraints do not require additional execution. Processing. Since the corner cells are not included in the sampling calculation, the dimensions associated with the corner cells no longer appear in the encoded sequence, and the encoded sequence length is 5 bits.

[0078] It should be noted that the edge grid and value The range of values ​​is ,implement After compression The range of values ​​is ,in and All mapped to Effective differential activity The range of values ​​is the same. ,implement After compression The range of values ​​is ,in and All mapped to Difference order The range of values ​​is ,implement After compression The range of values ​​is Different Values ​​share the same encoding bit in the modulo 4 sense, and higher-order backtracking information is folded into the sequence in a periodic manner.

[0079] The encoding generation module is configured to be based on right Perform a controlled transformation to generate a second encoded sequence. : The encoding generation module uses the first encoding sequence As input, based on rotation alignment parameters The values ​​are generated bit by bit according to the following rules to form the second encoding sequence. Second coding sequence The length of the first encoded sequence They are the same, both being 5 characters long.

[0080] when At that time, for the first encoded sequence All 5 positions undergo an offset mapping based on the difference order: ; in, Indicates the second encoded sequence The Bit element, Indicates the first encoded sequence The Bit element, This indicates the order of the difference.

[0081] when When, the edge cell and value derived bit (corresponding) Perform a complementary mapping, leaving the remaining bits unchanged: ; Output the first encoded sequence With the second coding sequence As a controlled random sequence pair generated in this round.

[0082] The above The controlled transformation at time and the transformation logic of the encoding generation module in Example 1 have a structural correspondence: both are executed at specific positions. The complementary mapping, and satisfying at the mapped position The deterministic constraints. In this embodiment, the mapped positions are edge cells and value-derived bits ( ), which is determined by the semantic properties of the border and the value.

[0083] Rotation Alignment Parameters The rationale for using the value as a condition for selecting transformation branches stems from its physical meaning: This means that there is a non-zero rotational deviation (an integer multiple of 90 degrees) between the two rounds of acquisition. By performing a uniform order offset mapping on all bits, the rotational state information is integrated into the second encoding sequence. The generation process; When the two rotation states are consistent, complementary mapping is performed only on edge cells and value-derived bits to maintain the complementary constraint structure of sequence pairs in this dimension.

[0084] The output display module is configured to output controlled random sequence pairs and auxiliary information. The output display module will display the first encoded sequence. Second coding sequence Difference order Rotation alignment parameters Effective differential activity The output is presented in a visual format and includes: the first encoded sequence. 5-bit numerical sequence, second encoded sequence 5-bit numerical sequence, difference order numerical values, rotation alignment parameters The numerical value and effective differential activity The value.

[0085] Auxiliary information output (difference order) Rotation alignment parameters Effective differential activity This allows users to evaluate the difference quality relied upon for this round of sequence generation in specific application scenarios, such as when the difference order is... Larger and more effective differential activity Still below the activity threshold At this time, the user may choose to perform additional randomization processing on the output results of this round.

[0086] Referring to the expansion method of the output display module in Embodiment 1, the first encoded sequence output in this step With the second coding sequence It also supports retrieving the values ​​of each element. The first encoded sequence is mapped to two binary digits (corresponding to 00, 01, 10, and 11 respectively). Or the second coding sequence It is expanded into a 10-bit binary encoding sequence to suit application scenarios with specific requirements for the bit width of the encoding sequence.

[0087] This invention uses only the four edge cells of the target surface to construct the sampling sequence, excluding the participation of corner cells, ensuring that the sampling sequence length is consistent with the number of cyclic shift versions (both are 4). The standardization process covers four equivalent rotational states: 0°, 90°, 180°, and 270°, resulting in a simple and clear logical structure. Since the rotational deviation introduced by hand-held flipping is included in the standardization range, the standardized shift amount... It can accurately record the rotation state during each round of data acquisition. Based on this, it utilizes the difference in standardized displacement between adjacent rounds. Rotation alignment is performed on the previous sequence so that the difference between rounds corresponds to the same physical edge of the Rubik's Cube when comparing each edge. This fundamentally eliminates the spurious difference signal introduced by the rotation deviation and ensures that the color change reflected by the difference sequence is consistent with the actual physical edge state change.

[0088] Based on rotation alignment, differential activity detection and adaptive order adjustment are introduced. When the activity of the first-order differential is insufficient, it automatically backtracks to a higher-order differential in the historical buffer, accumulating multiple rounds of small color changes into effective differentials with sufficient activity. This processing enables the encoded sequence to still extract effective random sources from real color change information in low-frequency incremental scrambling scenarios, avoiding sequence repetition values ​​and periodic patterns caused by continuous low-activity differentials.

[0089] The above-mentioned synergistic treatments specifically address the problems of spurious differential contamination and periodic repetition patterns in controlled random sequences under the combined conditions of rotational deviation introduced by handheld operation and insufficient differential activity caused by low-frequency incremental scrambling.

[0090] The method described in this invention is not limited to two-color 3x3 Rubik's Cubes, but is applicable to four-color Rubik's Cubes, six-color Rubik's Cubes, and other Rubik's Cube variants with more colors. When using a four-color or six-color Rubik's Cube, the multiple colors of the cube can be pre-divided into two color categories according to certain rules, and the same binarization rule (the first color category is mapped to the value 0, and the second color category is mapped to the value 1) is applied to each small cell to obtain a binarized numerical matrix. The color classification should aim to balance the probability of occurrence of the two color categories to satisfy the statistical assumption of this method that the probability of each edge cell taking a value is close to 1 / 2. After completing the above mapping, all steps in this embodiment, such as edge cell sampling sequence construction, cyclic shift standardization, rotation alignment difference, and encoding sequence generation, do not need to be modified and can be directly applied to the controlled random sequence generation scenario of multi-color Rubik's Cubes.

[0091] See Figures 2-7 The following application examples are proposed: A mobile lottery application uses a two-color 3x3 Rubik's Cube as the physical random source in scenarios requiring the generation of random numbers. The user holds a specially designed two-color 3x3 Rubik's Cube and, guided by the application interface, randomly scrambles the cube. Then, the user sequentially faces two different faces towards the camera to capture images. The system automatically performs color recognition, encoding generation, and outputs a controlled random encoding sequence pair for generating the lottery numbers for that round.

[0092] Image acquisition module: After the user scrambles the Rubik's Cube by performing at least 20 random rotations, first finds one face (with the center square numbered). The first data acquisition is completed by facing the camera directly, obtaining a nine-grid color image. Then turn the other side (the center grid number label) The second data acquisition is performed directly in front of the camera to obtain a nine-grid color image. System verification The verification passed, and both acquisitions were valid. Both acquisitions were performed under the same lighting conditions, and the white balance lock function of the image acquisition module was enabled.

[0093] Table 1 Image Acquisition Module Output

[0094] Image recognition module: Image recognition module and Image preprocessing, color classification, and binarization are performed separately to obtain two 3×3 numerical matrices. The first color (white) is mapped to a value of 0, and the second color (black) is mapped to a value of 1. Taking color space thresholding as an example, the percentage of pixels falling within the white threshold range is counted for the center pixels of each sub-region. The percentage of pixels falling within the black threshold range The color category corresponding to the one with the larger proportion is taken as the judgment result.

[0095] Table 2. 3×3 Binarized Numerical Matrix of Two Facets

[0096] Encoding generation module – row-by-row summation: The encoding generation module has and Sum the elements in each row separately to obtain the sum of the six rows: ; ; Table 3. Results of row-by-row summation

[0097] Encoding generation module – First encoding sequence generate: Arrange the six rows and values ​​in a preset order to form a first encoded sequence of length 6: ; Encoding generation module – Change bit determination: right Each position is determined to be a change bit (value is 0 or 3). Only position 6 is considered. The value at the specified position is determined to be a changing position; all other positions are considered to be changing positions. It is determined to be a non-changing bit.

[0098] The set of changing positions is , .

[0099] Table 4 Results of Change Position Determination

[0100] Encoding generation module – Second encoding sequence generate: Based on the set of changing positions For the first encoded sequence Perform the transformation bit by bit: only at position 6. The remaining positions remain unchanged.

[0101] ; At position 6 of the change position It satisfies the deterministic constraints; the remaining non-changing positions are located... The constraints also apply.

[0102] Table 5. Output of encoded sequence pairs

[0103] Output display module: The output display module visually presents the coding results of this round of drawing on the application interface. The output includes the first coding sequence. Second coding sequence , set of changing positions and the number of changing bits .

[0104] The two sequences can be further expanded into 12-bit binary codes: each element is then divided into... Mapping, Expand as , Expand as The number allocation algorithm for the lottery application can be directly called. The application history bar synchronously records the output results of this round, allowing for comparison and observation of the randomness of the sequence during multiple consecutive rounds of lottery.

[0105] In this application scenario, the data originates from two image acquisitions of the physical Rubik's Cube and is obtained through color recognition. , Two binary matrices are compressed into six row sums by summing row by row, and the set is determined by the change bit determination. Finally, coded sequence pairs are generated through complementary mapping. The data flow between modules is progressive. Physical randomness is introduced by scrambling the Rubik's Cube, and the controlled complementary structure is guaranteed by the change bit determination and complementary mapping rules. The two work together to ensure that the output encoded sequence pair has both a source of physical randomness and a deterministic constraint structure, which meets the dual requirements of randomness, fairness and verifiability in lottery applications.

[0106] The embodiments of the present invention have been described above. However, the embodiments are not limited to the specific implementation methods described above. The specific implementation methods described above are merely illustrative and not restrictive. Those skilled in the art can make more equivalent embodiments under the guidance of the present embodiments, and all of them are within the protection scope of the present embodiments.

Claims

1. A controlled random sequence generation system for double-sided color recognition of a Rubik's Cube, characterized in that, include: The image acquisition module is configured to randomly shuffle a specially designed two-color 3x3 Rubik's Cube and then acquire color images of any two different faces within a 3x3 grid. and And identify the digital identifier of the center grid of each face. and ,right and Perform a validity check to confirm that the two acquisitions correspond to different physical surfaces; The image recognition module is configured to perform image preprocessing, color classification, and binarization mapping on the nine-grid color image, determining the color of each small square as either a first color or a second color, mapping the first color to the value 0, and the second color to the value 1, thereby obtaining two 3×3 numerical matrices. and ; The encoding generation module is configured to process the numerical matrix. and Perform the summation row by row to obtain the sum of the six rows. , , , , , The six rows and values ​​are arranged in a preset order to form the first encoding sequence. ,right Bank of China sum value belongs to The positions are marked as change bits and collected into the change bit position set. ,in accordance with right Perform numerical transformation to generate the second encoded sequence The position of the change In the non-changing position ; The output display module is configured to display the first encoded sequence. Second coding sequence and the set of changing positions Presented in a visual way.

2. The controlled random sequence generation system for double-sided color recognition of a Rubik's Cube according to claim 1, characterized in that, The color classification in the image recognition module is achieved using a color space threshold segmentation method: the pixel colors within the sampling area are converted from the RGB color space to the HSV color space; based on the color combination selected by the specially designed two-color 3x3 Rubik's Cube, the threshold ranges of the first and second colors in the HSV space are pre-defined; and the percentage of pixels falling within the threshold range of the first color is counted for the center sampled pixels of each small square. and the percentage of pixels falling within the second color threshold range ,like Then it is determined to be the first color, if Then it is determined to be the second color, if The system will then prompt you to re-acquire the image for that surface.

3. The controlled random sequence generation system for double-sided color recognition of a Rubik's Cube according to claim 1, characterized in that, The color classification in the image recognition module is implemented using a pre-trained binary classification convolutional neural network model: the input layer of the binary classification convolutional neural network model receives pixel data from a single small grid center sampled image block, and the output layer outputs the posterior probability that the image block belongs to the first color after passing through the Softmax activation function. And the posterior probability of belonging to the second color ,satisfy The category with the higher posterior probability is selected as the judgment result; The binary classification convolutional neural network model is trained in a supervised manner on a two-color Rubik's Cube image dataset covering various lighting conditions and shooting angles. The cross-entropy loss function is used as the optimization objective, and the Adam optimization algorithm is used to update the parameters.

4. The controlled random sequence generation system for double-sided color recognition of a Rubik's Cube according to claim 1, characterized in that, The specially designed two-color 3x3 Rubik's Cube follows the mechanical structure of the standard 3x3 Rubik's Cube, using only two colors defined as the first color and the second color. In the initial solved state, three of the six faces are the first color and the other three are the second color. The two colors are centrally symmetrically distributed, and the center grid of each of the six faces is fixedly printed with the numbers 1 to 6.

5. The Rubik's Cube state coding system based on double-sided image recognition according to claim 1, characterized in that, In the encoding generation module, the first encoded sequence Defined as The range of values ​​for each element is: The set of changing positions Formal definition ; at the changed position At the non-changing position .

6. The controlled random sequence generation system for double-sided color recognition of a Rubik's Cube according to claim 1, characterized in that, The system is applicable to both four-color and six-color Rubik's Cubes: it divides the multiple colors of the Rubik's Cube into two color categories according to preset rules. The first color category is mapped to the value 0, and the second color category is mapped to the value 1, so that the probability of the two colors appearing is balanced. After the color category division is completed, the system performs numerical matrix generation, row-by-row summation, encoding sequence generation, and change bit determination according to the same binarization rules as the two-color Rubik's Cube.

7. The controlled random sequence generation system for double-sided color recognition of a Rubik's Cube according to claim 1, characterized in that, Before performing the first acquisition operation, the image acquisition module enables the white balance lock function to ensure that the color temperature of the two acquisitions is consistent. The image preprocessing in the image recognition module includes cropping the image according to the boundary coordinates of the nine-square grid auxiliary box. If the shooting angle is tilted, perspective transformation is applied to correct the image to a frontal view, and the corrected image is adjusted to a uniform size.

8. The controlled random sequence generation system for double-sided color recognition of a Rubik's Cube according to claim 1, characterized in that, The output display module supports displaying the values ​​of each element. Map the first encoded sequence to a two-bit binary number. Or the second coding sequence It is expanded into a 12-bit binary encoded sequence; the output display module records the historical output results and displays the encoded sequence pairs generated consecutively in list form.

9. The controlled random sequence generation system for double-sided color recognition of a Rubik's Cube according to claim 1, characterized in that, The encoding generation module is further configured to: in an incremental shuffling scenario that is executed cyclically in rounds, starting from the first... 3×3 numerical matrix of the target surface of the wheel Extract four edge cells and construct an edge cell sampling sequence in a clockwise direction. ,right Generate all four cyclic shift versions and take the version with the smallest decimal value as the normalized form. Record standardized shift amount ; Calculate rotation alignment parameters Perform on the previous round of standardized grid sequence Step-by-step shifting to obtain rotated and aligned versions ;right and Perform a bitwise XOR operation to obtain the difference sequence And calculate the differential activity. ;Will With activity threshold In comparison, if Then As an effective difference And the difference order ,like Then, the higher-order differences are calculated back through the historical buffer until the threshold condition is met; the edge cell sum is then calculated. , center grid value Rotation alignment parameters Effective differential activity Difference order through After compression, the sequence is arranged into a first encoded sequence of length 5. ,in accordance with The value of Perform controlled transformation to generate the second encoded sequence .

10. A controlled random sequence generation method for double-sided color recognition of a Rubik's Cube, used to execute the controlled random sequence generation system for double-sided color recognition of a Rubik's Cube as described in any one of claims 1 to 9, characterized in that, include: Step 1: After randomly shuffling the specially made two-color 3x3 Rubik's Cube, collect the nine-square grid color images of any two different faces, identify the number of the center square of each face, and perform a validity check on the number of the two faces to confirm that the two collections correspond to different physical faces. Step 2: Perform image preprocessing, color classification and binarization mapping on the nine-grid color image respectively, determine the color of each small grid as the first color or the second color, map the first color to the value 0, and map the second color to the value 1, and obtain two 3×3 numerical matrices. Step 3: Perform row-by-row summation on the two numerical matrices to obtain six row sums, and arrange the six row sums in a preset order to form the first encoding sequence. ; Step 4, process the first encoded sequence Bank of China sum value belongs to The positions are marked as change bits and collected into the change bit position set. ,in accordance with right Perform numerical transformation to generate the second encoded sequence The position of the change In the non-changing position ; Step 5, convert the first encoded sequence Second coding sequence and the set of changing positions Presented in a visual way.