Jigsaw creation method and device, storage medium and electronic equipment
By performing virtual segmentation and view window display on the client, the problem of inefficient puzzle creation is solved, and the effect of reducing network requests and improving loading speed is achieved.
Patent Information
- Application Number
- CN202411048575.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-31
- Publication Date
- 2024-11-26
AI Technical Summary
Puzzle creation is inefficient because each puzzle piece needs to be downloaded separately from the server, resulting in too many network requests.
By performing virtual segmentation on the client, using the view window to display different areas of the initial picture, simulate the effect of puzzle pieces without physically cutting the picture, thereby reducing network requests.
Improves puzzle creation efficiency, reduces the number of network requests, improves loading speed, and reduces server burden.
Smart Images

Figure CN119027544A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computers, and in particular to a puzzle creation method, device, storage medium and electronic device. Background Art
[0002] In the puzzle creation scenario, it is usually necessary to split a large image into multiple small images (puzzle pieces), and each puzzle piece is a separate image file. However, this method will result in a large number of network requests, because each puzzle piece needs to be downloaded from the server separately, which leads to the problem of low puzzle creation efficiency. Therefore, there is a problem of low puzzle creation efficiency.
[0003] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention
[0004] The embodiments of the present application provide a puzzle creation method, device, storage medium and electronic device to at least solve the technical problem of low puzzle creation efficiency.
[0005] According to one aspect of an embodiment of the present application, a puzzle creation method is provided, comprising: in response to a request to create a target puzzle, obtaining an initial picture and at least two view windows, wherein the view window is used to display the image content of any area on the initial picture; setting each of the at least two view windows to respectively display the image content of a specified area on the initial picture, to obtain at least two view windows after setting, wherein the at least two view windows after setting are used to display all the image content on the initial picture; determining the at least two view windows after setting as puzzle pieces of the target puzzle, wherein different puzzle pieces correspond to different image contents of the specified areas.
[0006] According to another aspect of an embodiment of the present application, a puzzle creation device is further provided, including: an acquisition unit, used to respond to a request to create a target puzzle, to acquire an initial picture and at least two view windows, wherein the view window is used to display the image content of any area on the initial picture; a setting unit, used to set each of the at least two view windows to respectively display the image content of a specified area on the initial picture, to obtain at least two view windows after setting, wherein the at least two view windows after setting are used to display all the image content on the initial picture; a determination unit, used to determine the at least two view windows after setting as puzzle pieces of the target puzzle, wherein different puzzle pieces correspond to different image contents of the specified areas.
[0007] As an optional solution, the above-mentioned acquisition of the initial image and at least two view windows includes: acquiring the above-mentioned initial image and a first number of view windows, wherein the above-mentioned first number of view windows are used to display all image contents on the above-mentioned initial image; acquiring a quantity adjustment operation performed on the above-mentioned first number of view windows; and acquiring a second number of view windows in response to the above-mentioned quantity adjustment operation, wherein the above-mentioned second number of view windows are used to display all image contents on the above-mentioned initial image, and the above-mentioned second number is different from the above-mentioned first number.
[0008] As an optional solution, the above-mentioned obtaining of the quantity adjustment operation performed on the above-mentioned first number of view windows includes: obtaining the first adjustment operation performed on the above-mentioned first number of view windows, wherein the above-mentioned first adjustment operation is used to determine the number of row arrangements corresponding to the above-mentioned second number of view windows, and the above-mentioned row arrangement number is used to indicate the number of jigsaw pieces of the above-mentioned target jigsaw puzzle in any row, and the above-mentioned quantity adjustment operation includes the above-mentioned first adjustment operation; obtaining the second adjustment operation performed on the above-mentioned first number of view windows, wherein the above-mentioned second adjustment operation is used to determine the number of column arrangements corresponding to the above-mentioned second number of view windows, and the above-mentioned column arrangement number is used to indicate the number of jigsaw pieces of the above-mentioned target jigsaw puzzle in any column, and the above-mentioned quantity adjustment operation includes the above-mentioned second adjustment operation, and the product of the number of row arrangements corresponding to the above-mentioned second number of view windows and the number of column arrangements corresponding to the above-mentioned second number of view windows is equal to the above-mentioned second number.
[0009] As an optional solution, after determining the at least two view windows after the above settings as puzzle pieces of the above target puzzle, the above method further includes: scrambling the positions and postures of the above puzzle pieces in the above target puzzle to obtain a scrambled target puzzle.
[0010] As an optional scheme, after the positions and postures of the above-mentioned puzzle pieces in the above-mentioned target puzzle are scrambled to obtain the scrambled target puzzle, the above-mentioned method also includes at least one of the following: in response to a posture adjustment operation performed on the first fragment, displaying the first fragment after the posture is adjusted, wherein the above-mentioned first fragment is the puzzle piece in the above-mentioned scrambled target puzzle; in response to a position adjustment operation performed on the second fragment, displaying the second fragment after the position is adjusted, wherein the above-mentioned second fragment is the puzzle piece in the above-mentioned scrambled target puzzle.
[0011] As an optional scheme, after the above-mentioned jigsaw puzzle pieces are scrambled in terms of their positions and postures in the target jigsaw puzzle to obtain a scrambled target jigsaw puzzle, the method further includes: in response to a restoration operation performed on the scrambled target jigsaw puzzle to obtain a restored target jigsaw puzzle; and verifying the restored target jigsaw puzzle to obtain a verification result, wherein the verification result is used to indicate whether the position and posture of the jigsaw puzzle pieces in the restored target jigsaw puzzle have a similarity greater than or equal to a preset threshold with respect to the position and posture of the jigsaw puzzle pieces in the target jigsaw puzzle before scrambling.
[0012] As an optional solution, the method further includes: setting an area ratio between the frame of the target puzzle and the interface displaying the target puzzle to be less than or equal to 1.
[0013] According to another aspect of the embodiments of the present application, a computer program product or a computer program is provided, the computer program product or the computer program including computer instructions, the computer instructions being stored in a computer-readable storage medium. A processor of an electronic device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the electronic device performs the above puzzle creation method.
[0014] According to another aspect of an embodiment of the present application, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the puzzle creation method through the computer program.
[0015] In an embodiment of the present application, in response to a request to create a target puzzle, an initial picture and at least two view windows are obtained, wherein the view window is used to display the image content of any area on the initial picture; each of the at least two view windows is set to display the image content of a specified area on the initial picture, respectively, to obtain at least two view windows after setting, wherein the at least two view windows after setting are used to display all the image content on the initial picture; the at least two view windows after setting are determined as puzzle pieces of the target puzzle, wherein different puzzle pieces correspond to different image contents of the specified areas.
[0016] By setting the view window to display the image content of a specified area on the initial image, a "virtual segmentation" is actually performed on the client. This segmentation is not achieved by physically cutting the image, but by adjusting the display area of the view window to simulate the effect of jigsaw puzzle pieces. This means that there is no need to download a large number of jigsaw puzzle pieces from the server, but only to download a complete initial image and then segment and display it on the client.
[0017] Furthermore, the set view window is determined as a jigsaw puzzle, which visually presents a jigsaw puzzle effect similar to the traditional method to the user, but does not actually add additional network requests. Because all jigsaw puzzle pieces are displayed through different view windows based on the same initial image, the purpose of reducing the number of network requests is achieved, thereby achieving the technical effect of improving the efficiency of jigsaw puzzle creation, and thus solving the technical problem of low jigsaw puzzle creation efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0019] Figure 1 is a schematic diagram of an application environment of an optional jigsaw puzzle creation method according to an embodiment of the present application;
[0020] Figure 2 is a schematic diagram of a process of an optional puzzle creation method according to an embodiment of the present application;
[0021] Figure 3 is a schematic diagram of an optional puzzle creation method according to an embodiment of the present application;
[0022] Figure 4 is a schematic diagram of another optional puzzle creation method according to an embodiment of the present application;
[0023] Figure 5 is a schematic diagram of an optional jigsaw puzzle creation device according to an embodiment of the present application;
[0024] Figure 6 It is a schematic diagram of the structure of an optional electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0025] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.
[0026] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0027] According to one aspect of the embodiments of the present application, a puzzle creation method is provided. Optionally, as an optional implementation, the puzzle creation method can be but is not limited to being applied to: Figure 1 In the environment shown, the environment may include, but is not limited to, a user device 102 and a server 112 . The user device 102 may include, but is not limited to, a display 104 , a processor 106 , and a memory 108 . The server 112 includes a database 114 and a processing engine 116 .
[0028] The specific process can be as follows:
[0029] Step S102, the user device 102 obtains a request to create a target puzzle;
[0030] Step S104, sending the creation request to the server 112 via the network 110;
[0031] Steps S106-S110, the server 112, in response to the creation request of the target puzzle, obtains the initial image and at least two view windows through the database 114, further sets each of the at least two view windows through the processing engine 116 to respectively display the image content of the specified area on the initial image, obtains the at least two view windows after setting, and determines the at least two view windows after setting as puzzle pieces of the target puzzle;
[0032] Step S112 , sending the puzzle pieces of the target puzzle to the user device 102 via the network 110 , and the user device 102 displays the puzzle pieces of the target puzzle on the display 104 via the processor 106 , and stores the puzzle pieces of the target puzzle in the memory 108 .
[0033] remove Figure 1In addition to the examples shown, the terminal device can be a terminal device configured with a target client, which can include but is not limited to at least one of the following: a mobile phone (such as an Android phone, an iOS phone, etc.), a laptop, a tablet computer, a PDA, a MID (Mobile Internet Devices), a PAD, a desktop computer, a smart TV, etc. The target client can be a video client, an instant messaging client, a browser client, an education client, etc. The network can include but is not limited to: a wired network, a wireless network, wherein the wired network includes: a local area network, a metropolitan area network and a wide area network, and the wireless network includes: Bluetooth, WIFI and other networks that realize wireless communication. The server can be a single server, or a server cluster composed of multiple servers, or a cloud server. The above is only an example, and no limitation is made to this in this embodiment.
[0034] Optionally, as an optional implementation, as Figure 2 As shown, the puzzle creation method can be executed by an electronic device, which can be, for example, Figure 1 The user device or server shown in the figure comprises:
[0035] S202, in response to a request to create a target puzzle, obtaining an initial image and at least two view windows, wherein the view window is used to display image content of any area on the initial image;
[0036] S204, setting each of the at least two view windows to display the image content of the specified area on the initial picture respectively, to obtain at least two view windows after setting, wherein the at least two view windows after setting are used to display all the image content on the initial picture;
[0037] S206: Determine the at least two set view windows as jigsaw pieces of the target jigsaw puzzle, wherein different jigsaw pieces correspond to image contents of different designated areas.
[0038] Optionally, in this embodiment, the "target puzzle" may refer to the jigsaw puzzle that is ultimately to be created or generated. It is a whole composed of multiple fragments (or "pieces"), and the player's goal is to restore a complete image or scene by rearranging these fragments. In this process, each fragment plays a key role because they together form the picture of the entire puzzle.
[0039] Optionally, in this embodiment, the "initial picture" can be the basis of the jigsaw puzzle, that is, the original image to be restored by the entire jigsaw puzzle. It is a complete picture and can be any subject, such as landscape, people, buildings, etc. In the process of creating the jigsaw puzzle, this picture will be "split" into multiple parts, each part corresponding to a jigsaw puzzle piece. However, the "segmentation" here is not physical cutting, but a visual segmentation effect achieved through technical means.
[0040] Optionally, in this embodiment, a "view window" can be an interface element, which is used to display a portion of the initial image on a client (such as a browser, an application program interface, etc.). These view windows can be regarded as "frames" or "windows", and each window can display any area on the initial image. This means that by adjusting the display parameters of the view window, a specific portion of the image can be selectively displayed.
[0041] Optionally, in this embodiment, each of the at least two view windows is set to display the image content of a specified area on the initial image, which involves specific configuration of the view windows. Each view window is set to display a specific area of the initial image. This is achieved by adjusting CSS properties such as "background-position" of the view window to ensure that each view window accurately displays a portion of the image. In this way, when users view these view windows, they will see different parts of the initial image, as if the image has been physically divided into multiple fragments.
[0042] Optionally, in this embodiment, at least two view windows are set to display the entire image content of the initial image. Through the above settings, all view windows work together to ensure that the entire content of the initial image is displayed. Although the image is visually "divided" into multiple parts, as a whole, these parts together still constitute the complete initial image. This is the core mechanism of the jigsaw puzzle game: the player needs to identify and reassemble these visual "fragments" to restore the complete image.
[0043] Alternatively, in this embodiment, the "jigsaw puzzle pieces" can be visual representations of view windows. Each set view window is considered a piece in the jigsaw puzzle. The player's task in the game is to rearrange these pieces (i.e., view windows) to restore the complete appearance of the original picture. The advantage of this method is that it avoids the need to actually cut the picture, thereby reducing network requests and server burden.
[0044] Optionally, in this embodiment, each puzzle piece (viewing window) shows a unique area of the initial image. This means that no two pieces will show exactly the same image content. This is the basic rule of the jigsaw puzzle game: each piece is unique, and the player needs to identify the specific image content on each piece and place it in the correct position to complete the puzzle. In this way, the game remains challenging and interesting.
[0045] It should be noted that this embodiment reduces the number of network requests. In the related art, each puzzle piece is a separate image file that needs to be downloaded from the server. In this embodiment, only a complete initial image needs to be downloaded and then split and displayed on the client. This not only improves the loading speed, but also reduces the burden on the server.
[0046] To further illustrate, let's assume that we have a landscape photo as the initial image and we want to create a 3x3 jigsaw puzzle. First, get the landscape photo. Then, create 9 view windows, because a 3x3 jigsaw puzzle requires 9 pieces. Next, set each view window to display a different part of the photo. For example, the first view window displays the upper left corner of the photo, the second displays the upper middle part, and so on. Finally, these 9 set view windows become jigsaw puzzle pieces.
[0047] Through the embodiments provided by the present application, setting a view window to display the image content of a specified area on the initial image is actually a "virtual segmentation" performed on the client. This segmentation is not achieved by physically cutting the image, but by adjusting the display area of the view window to simulate the effect of jigsaw puzzle pieces. This means that there is no need to download a large number of jigsaw puzzle pieces from the server, but only to download a complete initial image, and then segment and display it on the client.
[0048] Furthermore, the set view window is determined as a jigsaw puzzle, which visually presents a jigsaw puzzle effect similar to the traditional method to the user, but does not actually add additional network requests. Because all jigsaw puzzle pieces are displayed through different view windows based on the same initial image, the purpose of reducing the number of network requests is achieved, thereby achieving the technical effect of improving the efficiency of jigsaw puzzle creation.
[0049] As an optional solution, get the initial image and at least two view windows, including:
[0050] S1-1, obtaining an initial picture and a first number of view windows, wherein the first number of view windows is used to display all image contents on the initial picture;
[0051] S1-2, obtaining a quantity adjustment operation performed on a first quantity of view windows;
[0052] S1-3, in response to the quantity adjustment operation, obtaining a second number of view windows, wherein the second number of view windows is used to display all image contents on the initial picture, and the second number is different from the first number.
[0053] It should be noted that this embodiment describes a process for dynamically adjusting the difficulty of a jigsaw puzzle game, which is achieved by changing the number of view windows (i.e., jigsaw puzzle pieces). First, the system obtains an initial image and a certain number of view windows (a first number), which can together display the entire content of the initial image. Subsequently, the system allows the user or game designer to adjust the number of these view windows, for example, by increasing or decreasing the number of view windows to change the difficulty of the jigsaw puzzle. In response to this adjustment operation, the system obtains a new number of view windows (a second number), which can also display the entire content of the initial image, but the second number is different from the first number.
[0054] To further illustrate, it is optional to assume that initially, the system obtains an initial image of a landscape photo and 9 view windows (the first number is 9), and these 9 view windows respectively display different parts of the photo and together form a complete photo. Later, the user feels that the game is too easy and wants to increase the difficulty, so he performs a quantity adjustment operation and increases the number of view windows to 16 (the second number is 16). Now, these 16 view windows still jointly display the entire content of the same landscape photo, but the area displayed by each view window is smaller, so the difficulty of the jigsaw puzzle game has increased.
[0055] By dynamically adjusting the number of view windows, jigsaw puzzles can achieve personalized difficulty settings to meet the needs of different players. For novice players, the number of view windows can be reduced to reduce the difficulty; for advanced players, the number of view windows can be increased to increase the challenge. This flexible difficulty adjustment mechanism not only enhances the appeal of the game, but also helps to maintain player engagement and interest. At the same time, it also provides game designers with more creative space and adjustment options to create a richer and more diverse jigsaw puzzle experience.
[0056] As an optional solution, obtaining the quantity adjustment operation performed on the first quantity of view windows includes:
[0057] S2-1, obtaining a first adjustment operation performed on a first number of view windows, wherein the first adjustment operation is used to determine the number of row arrangements corresponding to a second number of view windows, the number of row arrangements being used to represent the number of jigsaw puzzle pieces of a target jigsaw puzzle in any row, and the number adjustment operation includes the first adjustment operation;
[0058] S2-2, obtaining a second adjustment operation performed on the first number of view windows, wherein the second adjustment operation is used to determine the number of column arrangements corresponding to the second number of view windows, the number of column arrangements being used to represent the number of jigsaw puzzle pieces of the target jigsaw puzzle in any column, the quantity adjustment operation including the second adjustment operation, the product of the number of row arrangements corresponding to the second number of view windows and the number of column arrangements corresponding to the second number of view windows being equal to the second number.
[0059] It should be noted that this embodiment describes how to perform a quantity adjustment operation on a first number of view windows (jigsaw puzzle pieces) to determine a second number of view windows and their arrangement. Specifically, this adjustment process includes two key operations: a first adjustment operation and a second adjustment operation. The first adjustment operation is used to determine the number of arrangements of the second number of view windows in each row of the target puzzle (row arrangement number), while the second adjustment operation is used to determine the number of arrangements of each column (column arrangement number). These two operations together constitute a quantity adjustment operation, and the product of the row arrangement number and the column arrangement number should be equal to the second number, that is, the total number of view windows.
[0060] To further illustrate, let's assume that initially, the jigsaw puzzle has 9 view windows (3x3 arrangement), and the player wants to increase the difficulty, so he performs a quantity adjustment operation. First, through the first adjustment operation, the player determines that the new number of row arrangements is 4, which means that each row will have 4 jigsaw pieces. Then, through the second adjustment operation, the player determines that the number of column arrangements is 4, that is, each column also has 4 pieces. In this way, the total number of view windows (the second number) becomes 4x4=16, and the difficulty increases accordingly.
[0061] Through the combination of the first adjustment operation and the second adjustment operation, the player or game designer can flexibly adjust the difficulty and layout of the jigsaw puzzle. This mechanism not only enriches the content and playability of the game, but also allows personalized difficulty settings based on the actual needs and skill levels of the players. Ultimately, the effect of this dynamic adjustment is to enhance the player's participation and satisfaction, making the jigsaw puzzle more interesting and challenging.
[0062] As an optional solution, after determining the at least two set view windows as puzzle pieces of the target puzzle, the method further includes:
[0063] The positions and postures of the jigsaw pieces in the target jigsaw puzzle are scrambled to obtain a scrambled target jigsaw puzzle.
[0064] It should be noted that in the process of generating a jigsaw puzzle, once the set view window (i.e., jigsaw pieces) is determined, the next step is usually to shuffle the positions and postures of these jigsaw pieces. This means that the jigsaw pieces that were originally arranged according to a certain pattern (such as a grid) will be rearranged to form a chaotic initial state for players to challenge and reassemble. The "position scrambling" here means that the placement of the jigsaw pieces on the jigsaw board will be randomly changed, and the "posture scrambling" may involve rotating or flipping the pieces to increase the complexity of the game.
[0065] To further illustrate, optionally assume that this embodiment has a jigsaw puzzle consisting of 16 pieces, which were originally arranged neatly in a 4x4 grid. After the jigsaw puzzle pieces are shuffled, the pieces may be scattered on the puzzle board, and some pieces may even be rotated or flipped, making the original image content difficult to recognize at a glance. In this way, when players start the game, they need to carefully observe the content of each piece and try to find the relationship between them in order to reassemble them correctly.
[0066] By shuffling the positions and postures of the puzzle pieces, the jigsaw puzzle can present a challenging initial state, thus stimulating the player's desire to explore and interest in solving puzzles. This shuffling process not only increases the complexity and playability of the game, but also allows for personalized difficulty adjustments based on the player's actual needs and skill level. Ultimately, the effect of this shuffling process is to increase the player's participation, sense of challenge, and sense of achievement, making the jigsaw puzzle an interesting and challenging educational activity.
[0067] As an optional solution, after the positions and postures of the jigsaw pieces in the target jigsaw puzzle are shuffled to obtain the shuffled target jigsaw puzzle, the method further includes at least one of the following:
[0068] S3-1, in response to a posture adjustment operation performed on a first fragment, displaying the first fragment after the posture adjustment, wherein the first fragment is a puzzle piece in a shuffled target puzzle;
[0069] S3-2, in response to the position adjustment operation performed on the second fragment, displaying the second fragment after the position adjustment, wherein the second fragment is a puzzle piece in the shuffled target puzzle.
[0070] Optionally, in this embodiment, in addition to basic posture and position adjustments, the system can also provide more advanced functions, such as an automatic alignment function, where when a player drags a fragment to a position close to the correct position, the system will automatically fine-tune its position to better match; or provide a fragment preview function, allowing the player to preview the possible effects of the fragment adjustment before adjusting it.
[0071] It should be noted that during the jigsaw puzzle game, the player will adjust the posture and position of the scrambled puzzle pieces to complete the puzzle. The "posture adjustment operation" here refers to the player's rotation, flipping and other operations on the puzzle pieces to change the direction or orientation of the pieces; the "position adjustment operation" refers to the player changing the position of the puzzle pieces on the game interface. The system needs to respond to these operations of the player and display the status of the adjusted pieces in real time.
[0072] To further illustrate, in an optional jigsaw puzzle game, the player first sees a shuffled puzzle. They may first select a piece (such as the first piece) and try to rotate or flip it to better match the surrounding pieces or restore the overall structure of the picture. The system needs to be able to respond to this operation and immediately display the state of the rotated or flipped piece. Similarly, the player may also drag a piece (such as the second piece) to a new position, and the system also needs to respond and display the new position of the piece after it is moved.
[0073] By responding to the player's gesture and position adjustment operations and displaying the adjusted puzzle piece status in real time, jigsaw puzzles can provide a smoother and more intuitive gaming experience. Players can see the results of their operations instantly, so they can understand and master the game faster, while also increasing the interactivity and fun of the game. This instant feedback mechanism helps maintain player interest and engagement, making them more willing to continue to challenge and complete jigsaw puzzles.
[0074] As an optional solution, after the positions and postures of the jigsaw pieces in the target jigsaw puzzle are shuffled to obtain the shuffled target jigsaw puzzle, the method further includes:
[0075] S4-1, in response to a restoration operation performed on the scrambled target puzzle, a restored target puzzle is obtained;
[0076] S4-2, verifying the restored target puzzle to obtain a verification result, wherein the verification result is used to indicate whether the position and posture of the puzzle pieces in the restored target puzzle are similar to the position and posture of the puzzle pieces in the target puzzle before scrambling, and whether the similarity is greater than or equal to a preset threshold.
[0077] Optionally, in this embodiment, the verification process can be implemented by a variety of algorithms, such as calculating the pixel difference between the restored puzzle and the original puzzle, matching feature points, etc. In addition, in order to increase the fun and challenge of the game, the system can also set different difficulty levels corresponding to different preset thresholds. At a higher difficulty level, the player needs to restore the position and posture of the puzzle pieces more accurately to meet the verification standard.
[0078] It should be noted that during the jigsaw puzzle game, players will try to restore the scrambled puzzle pieces to their original positions and postures to reconstruct the complete picture. This process is called the "restoration operation", that is, the player moves, rotates or flips the pieces to return them to the correct position and posture. After completing the restoration operation, the system will verify the player's puzzle results to determine whether the position and posture of the puzzle pieces in the restored target puzzle are similar to those before the scramble. This verification process will produce a verification result.
[0079] To further illustrate, it is optional to assume that the player has completed a jigsaw puzzle. They have moved all the puzzle pieces to the positions they think are correct and adjusted the posture of each piece. At this time, the player chooses to submit their puzzle results. The system will respond to this submission operation and verify the player's puzzle. If the verification result shows that the similarity between the puzzle restored by the player and the original image (the puzzle before scrambling) is greater than or equal to a preset threshold (such as 90%), then the system will determine that the player has completed the jigsaw puzzle.
[0080] By responding to the player's restoration operation and verifying the restored puzzle, the jigsaw game can provide a clear goal and feedback mechanism. Players can know whether their puzzle results meet the requirements of the game and adjust their strategies and methods. This verification mechanism not only increases the challenge and playability of the game, but also helps players improve their observation and logical thinking skills. At the same time, by setting different difficulty levels and preset thresholds, the game can adapt to players of different levels and needs and provide a more personalized gaming experience.
[0081] As an optional solution, the method further includes:
[0082] The area ratio between the frame of the target puzzle and the interface displaying the target puzzle is set to be less than or equal to 1.
[0083] Optionally, in this embodiment, the area ratio may be set in consideration of other factors, such as the user's operating habits, the resolution and size of the screen, etc. The designer may adjust the size and position of the puzzle frame according to these factors to ensure that the game has a good display effect on various devices. In addition, with the development of responsive design technology, the interface of the puzzle game can also automatically adapt to screens of different sizes, thereby providing a more flexible and convenient user experience.
[0084] It should be noted that this embodiment describes one aspect of the jigsaw puzzle interface design, namely, setting the area ratio between the frame of the target puzzle and the interface displaying the puzzle. This ratio is set to be less than or equal to 1, which means that the area of the puzzle frame will not exceed the area of the entire display interface. This ensures that the display of the jigsaw puzzle in the user interface is reasonable and does not exceed the interface range, thereby providing a good user experience.
[0085] For further explanation, it is optional to assume that there is a mobile phone screen in this embodiment, and its display area is 100 square units. If the area of the puzzle frame is set to 80 square units in this embodiment, then the area ratio is 0.8 (80 / 100), which is less than 1 and satisfies the condition. In this way, the puzzle game can be fully displayed on the mobile phone screen without any part being cut off or blocked.
[0086] By setting the area ratio between the frame of the target puzzle and the display interface to be less than or equal to 1, it can be ensured that the puzzle game can be displayed completely and clearly on various devices without incomplete display or cluttered interface. This design not only improves the visual effect of the game, but also enhances the user's operating experience. At the same time, it also makes the game easier to promote and share, because users do not need to worry about device compatibility issues. Overall, this design effect helps to improve the attractiveness of puzzle games and user satisfaction.
[0087] As an optional solution, for ease of understanding, the above puzzle creation method is applied to the application scenarios of the Internet Web and H5. A very flexible and practical puzzle device supports the configuration of puzzles with any number of fragments, and supports the exchange of image positions by clicking and dragging the mouse on the web side and touching and dragging the gestures on the mobile side to complete the puzzle. The image fragments of traditional puzzle technology rely on the server to be pre-segmented, and the client must download the complete original image and all the segmented fragments from the server, which increases the amount of data transmission.
[0088] Optionally, in this embodiment, the client only needs to download the original image from the server, and the fragment segmentation work is completed by the client itself. Through this distributed processing, the client effectively reduces rows*cols image requests and significantly reduces the network load. This not only optimizes the utilization of network resources, but also greatly improves the user experience and effectively avoids the page white screen phenomenon that may occur during the fragment loading process.
[0089] Secondly, traditional puzzle technology usually only supports fixed-size NN grid puzzles, such as 33, which limits users' personalized choices.
[0090] Optionally, in this embodiment, any combination of jigsaw puzzle pieces of rows*cols specifications is supported, breaking the limitations of traditional jigsaw puzzles. Users can freely choose the complexity of the jigsaw puzzle according to their personal preferences and abilities, such as 3x3, 3x4, 3x5, 5x6 and other specifications, to fully meet personalized needs.
[0091] Furthermore, this embodiment not only supports traditional mouse click operations, but is also compatible with touch screen operations of mobile devices, broadening the user's usage scenarios. Through advanced adaptive technology, a smooth and consistent user experience can be provided on different screen sizes and devices. These technical advantages significantly reduce the user's development and maintenance costs, while enhancing the versatility and accessibility of the puzzle device on different devices.
[0092] Specifically, in this embodiment, the client uses multiple Element, and accurately set its backgroundImage, backgroundSize and backgroundPosition properties to achieve local segmentation of the image. This technical method effectively reduces the network requests to download rows*cols puzzle pieces from the server, thereby significantly improving the initial loading speed of the puzzle game. By reducing network dependence, the user experience is further enhanced and the slow loading problem caused by network delay is avoided.
[0093] Optionally, this embodiment supports users to freely select any rows*cols puzzle pieces to play the game according to their personal preferences and abilities. The width and height of the pieces will be dynamically calculated and adjusted according to the number of rows and columns selected by the user. This flexible customization provides users with a diverse puzzle experience, meeting the needs of different difficulties and challenges. Users can adjust the difficulty of the game according to their abilities and interests, thereby maintaining the continued appeal and challenge of the game.
[0094] Optionally, this embodiment uses responsive design to adapt to different screen sizes, ensuring that an optimized user interface can be provided on both the PC and mobile terminals. This embodiment supports cross-platform operation without the need for specific development and optimization for different devices. This design reduces development and maintenance costs, improves development efficiency and system scalability. At the same time, cross-platform compatibility expands the user base, improves the market coverage of the product and the overall user experience.
[0095] To further illustrate, an optional technical implementation for jigsaw puzzle game development is as follows: Figure 3 As shown, the specific steps are as follows:
[0096] S5-1, data state management: This embodiment uses useState to comprehensively manage the core data of the puzzle game, including but not limited to the number of rows and columns (rows and cols) of the puzzle, the URL of the image, and the width and height of the puzzle (puzzleWidth and puzzleHeight). In order to ensure that the puzzle can present the best effect on various devices, this embodiment sets puzzleWidth to window.screen.width, thereby achieving adaptive adjustment of the puzzle width.
[0097] S5-2, puzzle device customization: through customization <puzzle>Component, this embodiment can flexibly set the size and appearance of the puzzle. Pass attributes such as rows, cols, image URL, and puzzle size to <puzzle>Components to achieve personalized puzzle display.
[0098] S5-3, fragment data processing: According to the number of rows and columns of the puzzle, this embodiment creates an array named puzzleList, whose length is rows*cols. Each array element represents a puzzle fragment, including properties such as initial coordinate position (position), size (width and height), background image (backgroundImage), background size (backgroundSize), and background image positioning (backgroundPosition). At the same time, this embodiment assigns an initial index (originIndex) in the array to each fragment to facilitate subsequent verification of whether the puzzle is completed.
[0099] S5-4, fragment element rendering and interaction: By traversing the puzzleList array, this embodiment creates one for each fragment. element and set its appearance through inline styles. To ensure that the puzzle pieces can show different parts of the original image, this embodiment accurately controls the backgroundImage, backgroundSize and backgroundPosition properties of each piece. To implement the dragging function of the pieces, this embodiment uses <draggable>The component wraps each fragment element and synchronizes its position attribute with the position value of the corresponding element in puzzleList. In this way, when the user drags the fragment, the fragment can be arranged and displayed normally. After the drag ends, this embodiment recalculates the position of the fragment to update the fragment position to ensure the correctness of the puzzle.
[0100] Optionally, in this embodiment, the key steps in the technical implementation of the jigsaw puzzle game are as follows: Figure 4 The specific instructions are as follows:
[0101] S6-1, puzzle device initialization settings: First, get the original image link (url field) of the puzzle from the server. Use React's useState hook to initialize and manage the key data of the puzzle game, including puzzle specifications (number of rows and columns), image url, puzzle device size, etc. For example, const[info,setInfo]=useState({rows:3,cols:4,img:url,puzzleWidth:'300px',puzzleHeight:'400px'}) means that the puzzle device size is 300px400px, and the original image is divided into 34 pieces. In order to adapt to devices of different sizes, puzzleWidth can be set to window.screen.width*0.8, that is, the puzzle width is 80% of the screen width.
[0102] S6-2, create an array of puzzle pieces: according to the product of rows and cols, create an array named puzzleList to store the data of puzzle pieces. Through nested loops, traverse the rows and columns, set the initial coordinate position (position), width (width), height (height), background image (backgroundImage), background size (backgroundSize) and background image positioning (backgroundPosition) for each array element. In this way, each fragment can show a different part of the original image. At the same time, the originIndex is used to record the initial index of each fragment in the array for subsequent verification of whether the puzzle is completed.
[0103] S6-3, Rendering puzzle pieces: Traverse the puzzleList array and create a Element, and use inline styles to set its width, height, background image and other attributes. In this way, each fragment can correctly fill the corresponding part of the background image.
[0104] S6-4, drag function implementation: use <draggable>The component wraps each fragment element to enable dragging. <draggable>The position property is synchronized with the position value of the corresponding element in puzzleList to ensure that the fragments can be arranged and displayed normally during the dragging process.
[0105] S6-5, fragment order shuffling: randomly shuffle the order of elements in the puzzleList array, and recalculate the position of each fragment in the puzzle device according to the new index to achieve random arrangement of the fragments.
[0106] S6-6, fragment exchange and puzzle verification: Use the onStop method provided by react-draggable to detect the end of dragging. According to the position where the dragging stops, find the puzzle fragment index of the target position. If there is a valid puzzle fragment at the target position and it is not the same as the current index, swap the positions of the two fragments in the array. After the exchange, recalculate and update the position of each fragment. Finally, verify whether the puzzle is successful by comparing the originIndex of each element in puzzleList with the current index. If they are completely consistent, it means that the puzzle is successful; otherwise, it means that the puzzle is not successful and you can continue the puzzle game.
[0107] To further illustrate, the optional development of a React.js puzzle application, the specific steps are as follows:
[0108] S7-1, Project initialization and dependency installation: First, introduce React.js in the client environment and start to create a single-page application. This requires a series of initialization operations, including configuring the entry file and entry method. In order to successfully build a React single-page application, developers need to install Node.js and the pnpm package manager first. Then, use the command npmcreate vite@latest to quickly create a new React project and enter the project name according to the prompts. After the project is created, execute the pnpminstall command to install the dependencies required for the project.
[0109] S7-2, import and render the puzzle device: In the project's App.jsx file, import the puzzle device module using the ES6 import syntax. Then, use it in App.jsx <puzzle>< / puzzle> Component to render the puzzle device and make it visible on the page. By default, the puzzle device is configured as a 3*3 grid layout, and its width and height are both set to 80% of the screen width to achieve a good user experience.
[0110] S7-3, request and manage the original image URL of the puzzle: initiate a request to the server to obtain the original image URL of the puzzle, and manage this URL through the useState hook of React. For example, you can use const[imgUrl,setImgUrl]=useState('default_url'); to initialize the state, and update the original image URL through setImgUrl after the request is successful.
[0111] S7-4, define and manage puzzle parameters: In App.jsx, continue to use the useState hook to define and manage key parameters such as the number of rows (rows), the number of columns (cols), the original image URL (imgUrl), the puzzle width (puzzleWidth) and the height (puzzleHeight) of the puzzle. In order to ensure that the puzzle device can adapt to different screen sizes, puzzleWidth and puzzleHeight can be set as a percentage of the screen width. For example, const[puzzleWidth,setPuzzleWidth]=useState(window.screen.width*0.8); and const[puzzleHeight,setPuzzleHeight]=useState(window.screen.width*0.8); can set the size of the puzzle device to 80% of the screen width. But please note that under normal circumstances, the height of the puzzle may not maintain the same ratio as the width. The same value is used here to simplify the explanation. In actual applications, adjustments should be made according to specific needs.
[0112] S7-5, apply data to the puzzle device and realize interaction: apply the data managed in useState to <puzzle> In the component, the configured devices are as follows: <Puzzle rows={rows}cols={cols}img={imgUrl}puzzleWidth={puzzleWidth}puzzleHeight={puzzle Height}>< / puzzle> . This configuration makes the puzzle device highly flexible and can be adaptively adjusted according to different parameters. The user can rearrange the puzzle by dragging each fragment. After dragging, the dragged fragment will exchange positions with the fragment at the target position. By comparing the originIndex (initial index) of each fragment with the actual index (index), it can be determined whether the puzzle is completed. When the originIndex of each fragment is exactly the same as the index, it means that the puzzle is successfully completed. At this time, the client can initiate a request to the server to notify the successful puzzle event.
[0113] Through the embodiment provided by this application, an efficient image processing technology is adopted by utilizing multiple elements, and fine-tunes their backgroundImage, backgroundSize, and backgroundPosition properties, and this embodiment achieves accurate segmentation of the image. The advantage of this technical method is that it significantly reduces the number of image fragments that need to be downloaded from the server. In the traditional method, the server needs to generate and transmit a separate image file for each puzzle piece, which causes huge overhead in terms of network requests. The technology of this embodiment effectively circumvents this problem by segmenting the entire image on the client, thereby greatly improving the loading speed of the jigsaw game and optimizing the user experience.
[0114] Furthermore, the jigsaw puzzle game of this embodiment supports users to flexibly select the number of jigsaw puzzle pieces according to their personal preferences and abilities. Users can define the total amount of pieces by setting the number of rows and columns, and the system dynamically calculates the size of each piece based on these parameters. This design not only provides users with a diverse jigsaw puzzle experience, but also allows them to adjust the game difficulty according to their abilities. This flexibility is unmatched by traditional jigsaw puzzle games, and it greatly enriches the playability and interactivity of the game.
[0115] In addition, the jigsaw puzzle game of this embodiment is designed with full consideration of the requirements of self-adaptation and cross-platform compatibility. By adopting the responsive design principle, the game can automatically adapt to the screen size of different devices, providing a consistent and high-quality user experience whether on the PC or mobile side. This design not only reduces the cost of development and maintenance, but also ensures that users can enjoy smooth and interesting jigsaw puzzle games on different devices.
[0116] It is understandable that in the specific implementation of this application, related data such as user information is involved. When the above embodiments of this application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of relevant data need to comply with relevant laws, regulations and standards of relevant countries and regions.
[0117] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.
[0118] According to another aspect of the embodiments of the present application, a puzzle creation device for implementing the above puzzle creation method is also provided. Figure 5 As shown, the device comprises:
[0119] An acquisition unit 502 is used to acquire an initial image and at least two view windows in response to a request to create a target puzzle, wherein the view window is used to display image content of any area on the initial image;
[0120] A setting unit 504 is used to set each of the at least two view windows to display the image content of a specified area on the initial picture, respectively, to obtain at least two view windows after setting, wherein the at least two view windows after setting are used to display all the image content on the initial picture;
[0121] The determining unit 506 is configured to determine the at least two view windows after being set as jigsaw pieces of a target jigsaw puzzle, wherein different jigsaw pieces correspond to image contents of different designated areas.
[0122] For the specific implementation, reference may be made to the example shown in the above puzzle creation method, which will not be described in detail in this example.
[0123] As an optional solution, the acquisition unit 502 includes:
[0124] A first acquisition module is used to acquire an initial image and a first number of view windows, wherein the first number of view windows is used to display all image contents on the initial image;
[0125] A second acquisition module is used to acquire a quantity adjustment operation performed on a first quantity of view windows;
[0126] The third acquisition module is used to acquire a second number of view windows in response to the quantity adjustment operation, wherein the second number of view windows is used to display all image contents on the initial picture, and the second number is different from the first number.
[0127] For the specific implementation, reference may be made to the example shown in the above puzzle creation method, which will not be described in detail in this example.
[0128] As an optional solution, the second acquisition module includes:
[0129] A first acquisition submodule is used to acquire a first adjustment operation performed on a first number of view windows, wherein the first adjustment operation is used to determine the number of row arrangements corresponding to the second number of view windows, the number of row arrangements is used to represent the number of jigsaw puzzle pieces of a target jigsaw puzzle in any row, and the number adjustment operation includes the first adjustment operation;
[0130] A second acquisition submodule is used to acquire a second adjustment operation performed on the first number of view windows, wherein the second adjustment operation is used to determine the number of column arrangements corresponding to the second number of view windows, the number of column arrangements is used to represent the number of jigsaw puzzle pieces of the target jigsaw puzzle in any column, and the quantity adjustment operation includes the second adjustment operation, the product of the number of row arrangements corresponding to the second number of view windows and the number of column arrangements corresponding to the second number of view windows is equal to the second number.
[0131] For the specific implementation, reference may be made to the example shown in the above puzzle creation method, which will not be described in detail in this example.
[0132] As an optional solution, the device also includes:
[0133] The scrambling unit is used for scrambling the positions and postures of the jigsaw pieces in the target jigsaw after determining the at least two set view windows as jigsaw pieces of the target jigsaw to obtain the scrambled target jigsaw.
[0134] For the specific implementation, reference may be made to the example shown in the above puzzle creation method, which will not be described in detail in this example.
[0135] As an optional solution, the device further includes at least one of the following:
[0136] A first display module is used for displaying the first fragment after the posture adjustment is performed on the first fragment after the positions and postures of the puzzle pieces in the target puzzle are scrambled to obtain the scrambled target puzzle, wherein the first fragment is the puzzle piece in the scrambled target puzzle;
[0137] The second display module is used to display the second fragment after the position adjustment operation is performed on the second fragment after the position and posture of the puzzle piece in the target puzzle are scrambled to obtain the scrambled target puzzle, wherein the second fragment is the puzzle piece in the scrambled target puzzle.
[0138] For the specific implementation, reference may be made to the example shown in the above puzzle creation method, which will not be described in detail in this example.
[0139] As an optional solution, the device also includes:
[0140] A restoration module, for obtaining a restored target puzzle by scrambling the positions and postures of the puzzle pieces in the target puzzle to obtain the scrambled target puzzle, and then responding to a restoration operation performed on the scrambled target puzzle to obtain a restored target puzzle;
[0141] The verification module is used to verify the restored target puzzle after scrambling the positions and postures of the puzzle pieces in the target puzzle to obtain the scrambled target puzzle, wherein the verification result is used to indicate whether the similarity between the positions and postures of the puzzle pieces in the restored target puzzle and the positions and postures of the puzzle pieces in the target puzzle before scrambling is greater than or equal to a preset threshold.
[0142] For the specific implementation, reference may be made to the example shown in the above puzzle creation method, which will not be described in detail in this example.
[0143] As an optional solution, the device also includes:
[0144] The setting unit 504 is used to set the area ratio between the frame of the target puzzle and the interface displaying the target puzzle to be less than or equal to 1.
[0145] For the specific implementation, reference may be made to the example shown in the above puzzle creation method, which will not be described in detail in this example.
[0146] According to another aspect of the embodiment of the present application, an electronic device for implementing the above puzzle creation method is also provided. The electronic device can be, but is not limited to, Figure 1 The user device 102 or the server 112 shown in FIG. 1 is used as an example to illustrate the electronic device as the user device 102. Figure 6 As shown, the electronic device includes a memory 602 and a processor 604. The memory 602 stores a computer program, and the processor 604 is configured to execute the steps in any of the above method embodiments through the computer program.
[0147] Optionally, in this embodiment, the electronic device may be located in at least one network device among a plurality of network devices of a computer network.
[0148] Optionally, in this embodiment, the processor may be configured to perform the following steps through a computer program:
[0149] S1, in response to a request to create a target puzzle, obtaining an initial image and at least two view windows, wherein the view window is used to display image content of any area on the initial image;
[0150] S2, setting each of the at least two view windows to display the image content of a specified area on the initial picture respectively, to obtain at least two view windows after setting, wherein the at least two view windows after setting are used to display all the image content on the initial picture;
[0151] S3, determining the at least two view windows after setting as jigsaw pieces of the target jigsaw puzzle, wherein different jigsaw pieces correspond to image contents of different designated areas.
[0152] Alternatively, a person skilled in the art may understand that: Figure 6 The structure shown is for illustration only. Figure 6 The structure of the electronic device is not limited. Figure 6 More or fewer components (such as network interfaces, etc.) as shown in, or with Figure 6 Different configurations are shown.
[0153] Among them, the memory 602 can be used to store software programs and modules, such as the program instructions / modules corresponding to the puzzle creation method and device in the embodiment of the present application. The processor 604 executes various functional applications and data processing by running the software programs and modules stored in the memory 602, that is, realizing the above-mentioned puzzle creation method. The memory 602 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 602 may further include a memory remotely located relative to the processor 604, and these remote memories may be connected to the electronic device via a network. Examples of the above-mentioned networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof. Among them, the memory 602 may be specifically, but not limited to, used to store information such as initial images, view windows, and target puzzles. As an example, such as Figure 6 As shown, the memory 602 may include but is not limited to the acquisition unit 502, setting unit 504 and determination unit 506 in the puzzle creation device. In addition, it may also include but is not limited to other module units in the puzzle creation device, which will not be repeated in this example.
[0154] Optionally, the transmission device 606 is used to receive or send data via a network. Specific examples of the network may include a wired network and a wireless network. In one example, the transmission device 606 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices and routers via a network cable so as to communicate with the Internet or a local area network. In one example, the transmission device 606 is a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0155] In addition, the electronic device further comprises: a display 608 for displaying information such as the initial image, the view window and the target puzzle; and a connection bus 610 for connecting various module components in the electronic device.
[0156] In other embodiments, the user device or server may be a node in a distributed system, wherein the distributed system may be a blockchain system, and the blockchain system may be a distributed system formed by connecting the multiple nodes through network communication. Among them, a peer-to-peer network may be formed between the nodes, and any form of computing device, such as a server, user device, or other electronic device, may become a node in the blockchain system by joining the peer-to-peer network.
[0157] According to one aspect of the present application, a computer program product is provided, the computer program product comprising a computer program / instruction, the computer program / instruction comprising a program code for executing the method shown in the flow chart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication part, and / or installed from a removable medium. When the computer program is executed by a central processing unit, various functions provided by the embodiments of the present application are executed.
[0158] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0159] It should be noted that the computer system of the electronic device is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0160] The computer system includes a central processing unit (CPU), which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) or the program loaded from the storage part to the random access memory (RAM). In the random access memory, various programs and data required for system operation are also stored. The central processing unit, the read-only memory and the random access memory are connected to each other through a bus. The input / output interface (I / O interface) is also connected to the bus.
[0161] The following components are connected to the input / output interface: an input part including a keyboard, a mouse, etc.; an output part including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker; a storage part including a hard disk, etc.; and a communication part including a network interface card such as a local area network card, a modem, etc. The communication part performs communication processing via a network such as the Internet. A drive is also connected to the input / output interface as needed. Removable media, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., are installed on the drive as needed so that the computer program read therefrom is installed into the storage part as needed.
[0162] In particular, according to an embodiment of the present application, the process described in each method flow chart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer readable medium, and the computer program contains a program code for executing the method shown in the flow chart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication part, and / or installed from a removable medium. When the computer program is executed by a central processing unit, various functions defined in the system of the present application are executed.
[0163] According to one aspect of the present application, a computer-readable storage medium is provided, and a processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the methods provided in the above-mentioned various optional implementations.
[0164] Optionally, in this embodiment, the computer-readable storage medium may be configured to store a computer program for performing the following steps:
[0165] S1, in response to a request to create a target puzzle, obtaining an initial image and at least two view windows, wherein the view window is used to display image content of any area on the initial image;
[0166] S2, setting each of the at least two view windows to display the image content of a specified area on the initial picture respectively, to obtain at least two view windows after setting, wherein the at least two view windows after setting are used to display all the image content on the initial picture;
[0167] S3, determining the at least two view windows after setting as jigsaw pieces of the target jigsaw puzzle, wherein different jigsaw pieces correspond to image contents of different designated areas.
[0168] Optionally, in the embodiments of the present application, the term "module" or "unit" refers to a computer program or a part of a computer program that has a predetermined function and works together with other related parts to achieve a predetermined goal, and can be implemented in whole or in part by using software, hardware (such as processing circuits or memories) or a combination thereof. Similarly, a processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be part of an overall module or unit that includes the function of the module or unit.
[0169] Optionally, in this embodiment, a person of ordinary skill in the art may understand that all or part of the steps in the various methods of the above embodiments may be completed by instructing hardware related to the electronic device through a program, and the program may be stored in a computer-readable storage medium, and the storage medium may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0170] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0171] If the integrated units in the above embodiments are implemented in the form of software functional units and sold or used as independent products, they can be stored in the above computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling one or more computer devices (which can be personal computers, servers or network devices, etc.) to execute all or part of the steps of the methods of each embodiment of the present application.
[0172] In the above embodiments of the present application, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.
[0173] In the several embodiments provided in the present application, it should be understood that the disclosed user equipment can be implemented in other ways. Among them, the device embodiments described above are only schematic, for example, the division of units is only a logical function division, and there may be other division methods in actual implementation, for example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0174] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0175] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0176] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application. < / draggable> < / draggable> < / draggable> < / puzzle> < / puzzle>
Claims
1. A puzzle creation method, It is characterized in that include: In response to a request to create a target puzzle, an initial image and at least two view windows are obtained, wherein the view window is used to display image content of any area on the initial image; Setting each of the at least two view windows to display the image content of a specified area on the initial picture respectively, and obtaining at least two view windows after setting, wherein the at least two view windows after setting are used to display all the image content on the initial picture; The at least two view windows after setting are determined as puzzle pieces of the target puzzle, wherein different puzzle pieces correspond to image contents of different designated areas.
2. The method according to claim 1, It is characterized in that The obtaining of the initial image and at least two view windows includes: Acquire the initial picture and a first number of view windows, wherein the first number of view windows is used to display all image contents on the initial picture; Acquire a quantity adjustment operation performed on the first quantity of view windows; In response to the quantity adjustment operation, a second quantity of view windows is acquired, wherein the second quantity of view windows is used to display all image content on the initial picture, and the second quantity is different from the first quantity.
3. The method according to claim 2, It is characterized in that The acquiring of the quantity adjustment operation performed on the first quantity of view windows comprises: Acquire a first adjustment operation performed on the first number of view windows, wherein the first adjustment operation is used to determine the number of row arrangements corresponding to the second number of view windows, the number of row arrangements being used to represent the number of jigsaw pieces of the target jigsaw puzzle in any row, and the number adjustment operation includes the first adjustment operation; Obtain a second adjustment operation performed on the first number of view windows, wherein the second adjustment operation is used to determine the number of column arrangements corresponding to the second number of view windows, the number of column arrangements being used to represent the number of jigsaw puzzle pieces of the target jigsaw puzzle in any column, the quantity adjustment operation including the second adjustment operation, the product of the number of row arrangements corresponding to the second number of view windows and the number of column arrangements corresponding to the second number of view windows being equal to the second number.
4. The method according to claim 1, It is characterized in that After determining the at least two set view windows as puzzle pieces of the target puzzle, the method further includes: The positions and postures of the jigsaw pieces in the target jigsaw puzzle are shuffled to obtain a shuffled target jigsaw puzzle.
5. The method according to claim 4, It is characterized in that After the positions and postures of the jigsaw pieces in the target jigsaw puzzle are shuffled to obtain the shuffled target jigsaw puzzle, the method further includes at least one of the following: In response to a posture adjustment operation performed on a first fragment, displaying the first fragment after the posture adjustment, wherein the first fragment is a puzzle piece in the scrambled target puzzle; In response to a position adjustment operation performed on a second piece, the second piece after the position adjustment is displayed, wherein the second piece is a puzzle piece in the shuffled target puzzle.
6. The method according to claim 4, It is characterized in that After the positions and postures of the jigsaw pieces in the target jigsaw puzzle are shuffled to obtain the shuffled target jigsaw puzzle, the method further includes: In response to a restoration operation performed on the scrambled target puzzle, a restored target puzzle is obtained; The restored target puzzle is verified to obtain a verification result, wherein the verification result is used to indicate whether the position and posture of the puzzle pieces in the restored target puzzle are similar to the positions and postures of the puzzle pieces in the target puzzle before scrambling, and whether the similarity is greater than or equal to a preset threshold.
7. The method according to any one of claims 1 to 6, It is characterized in that The method further comprises: The area ratio between the frame of the target puzzle and the interface displaying the target puzzle is set to be less than or equal to 1.
8. A jigsaw puzzle creation device, It is characterized in that include: an acquisition unit, configured to acquire an initial image and at least two view windows in response to a request to create a target puzzle, wherein the view windows are configured to display image content of any area on the initial image; A setting unit, used for setting each of the at least two view windows to display the image content of a specified area on the initial picture respectively, to obtain at least two view windows after setting, wherein the at least two view windows after setting are used for displaying all the image content on the initial picture; The determining unit is used to determine the at least two view windows after setting as puzzle pieces of the target puzzle, wherein different puzzle pieces correspond to image contents of different designated areas.
9. A computer-readable storage medium, It is characterized in that The computer-readable storage medium includes a stored program, wherein the program executes the method described in any one of claims 1 to 7 when executed by an electronic device.
10. An electronic device comprising a memory and a processor, It is characterized in that A computer program is stored in the memory, and the processor is configured to execute the method according to any one of claims 1 to 7 through the computer program.
