CN117582652A - Weiqi man-machine playing method, device, computer equipment and storage medium - Google Patents

Weiqi man-machine playing method, device, computer equipment and storage medium Download PDF

Info

Publication number
CN117582652A
CN117582652A CN202311632047.5A CN202311632047A CN117582652A CN 117582652 A CN117582652 A CN 117582652A CN 202311632047 A CN202311632047 A CN 202311632047A CN 117582652 A CN117582652 A CN 117582652A
Authority
CN
China
Prior art keywords
falling
sub
point
coordinates
user
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311632047.5A
Other languages
Chinese (zh)
Inventor
贾强强
陈向东
何剑峰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Siming Qichuang Technology Co ltd
Original Assignee
Beijing Siming Qichuang Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Siming Qichuang Technology Co ltd filed Critical Beijing Siming Qichuang Technology Co ltd
Priority to CN202311632047.5A priority Critical patent/CN117582652A/en
Publication of CN117582652A publication Critical patent/CN117582652A/en
Pending legal-status Critical Current

Links

Landscapes

  • Information Transfer Between Computers (AREA)

Abstract

The invention relates to the technical field of weiqi AI, in particular to a weiqi man-machine playing method, a device, computer equipment and a storage medium; the method comprises the following steps: determining the current chess force level of a user, acquiring the coordinates of a user falling point, and generating an AI falling point array based on the coordinates of the user falling point; sorting the coordinates of the AI falling sub points in the AI falling sub point array based on the falling sub point winning rate to obtain a first ordered array; judging whether the number of the coordinates of the AI falling sub points in the first ordered array is consistent with the number of the grades corresponding to the candidate chess force grades; if not, processing the first ordered array to obtain a second ordered array, so that the number of the coordinates of the AI falling sub points in the second ordered array is consistent with the number of the grades; selecting AI falling point coordinates corresponding to the current chess force level from the second ordered number group to generate preset falling point coordinates, and playing chess based on the preset falling point coordinates; the invention is convenient for improving the go playing experience of the user.

Description

Weiqi man-machine playing method, device, computer equipment and storage medium
Technical Field
The invention relates to the technical field of weiqi AI, in particular to a weiqi man-machine playing method, a weiqi man-machine playing device, computer equipment and a storage medium.
Background
In order to provide the go entertainment or go training service for people, a certain number of go playing APP are developed in the market, and go AI is integrated in the go playing APP.
In the go playing process, the go AI determines the optimal drop point according to the current drop point of the user and the current chessboard situation, and then plays the corresponding chess piece at the optimal drop point, thereby realizing playing with the user.
However, the force of the integrated weiqi AI in the existing weiqi playing APP is high, the difference between the force and the force of the user is very different, and a fairly fair playing environment is difficult to establish based on the force of the user, so that the weiqi playing experience of the user is poor.
Disclosure of Invention
In order to facilitate promotion of the go playing experience of users, the embodiment of the invention provides a go man-machine playing method, a device, computer equipment and a storage medium.
In a first aspect, an embodiment of the present invention provides a method for playing go with human-machine, including:
determining the current chess force level of a user, acquiring the user falling sub-point coordinates of the user, and generating an AI falling sub-point array based on the user falling sub-point coordinates; the AI falling sub point number group comprises AI falling sub point coordinates and falling sub point winning rates corresponding to each AI falling sub point coordinate;
sorting the AI falling sub-point coordinates in the AI falling sub-point array based on the falling sub-point winning rate to obtain a first ordered array;
judging whether the number of the coordinates of the AI falling sub points in the first ordered array is consistent with the number of the grades corresponding to the candidate chess force grades; if not, processing the first ordered array to obtain a second ordered array, so that the number of the AI falling sub point coordinates in the second ordered array is consistent with the number of the grades;
and selecting the AI falling point coordinates corresponding to the current chess force level from the second ordered number group, generating preset falling point coordinates, and playing based on the preset falling point coordinates.
In a second aspect, an embodiment of the present invention provides a go man-machine playing device, including:
the drop feedback module is used for determining the current chess force level of the user, acquiring the user drop point coordinates of the user, and generating an AI drop point array based on the user drop point coordinates; the AI falling sub point number group comprises AI falling sub point coordinates and falling sub point winning rates corresponding to each AI falling sub point coordinate;
the sorting module is used for sorting the AI falling sub-point coordinates in the AI falling sub-point array based on the falling sub-point winning rate to obtain a first ordered array;
the judging module is used for judging whether the number of the coordinates of the AI falling sub points in the first ordered array is consistent with the number of the grades corresponding to the candidate chess force grades; if not, processing the first ordered array to obtain a second ordered array, so that the number of the AI falling sub point coordinates in the second ordered array is consistent with the number of the grades;
and the playing module is used for selecting the AI falling point coordinates corresponding to the current chess force level from the second ordered number group, generating preset falling point coordinates and playing based on the preset falling point coordinates.
In a third aspect, an embodiment of the present invention provides a computer device, where the computer device includes a memory and a processor, where the memory stores a computer program, and where the processor implements the steps of the method described above when executing the computer program.
In a fourth aspect, embodiments of the present invention provide a computer readable storage medium having stored thereon a computer program which when executed by a processor performs steps in the above-described method.
In a fifth aspect, embodiments of the present invention also provide a computer program product. The computer program product comprises a computer program which, when executed by a processor, implements the steps of any of the method embodiments described above.
In the embodiments of the go man-machine playing method, the device, the computer equipment and the storage medium, the current chess force level of the user is determined firstly, then an AI falling point array is generated according to the coordinates of the falling points of the user, the AI falling point array comprises a plurality of AI falling points corresponding to the falling points of the user, and the corresponding AI winning rates of each AI falling point are different; judging whether the number of the AI falling sub points in the AI falling sub point array is consistent with the total number of the preset chess force grades, if not, processing the number of the AI falling sub points in the AI falling sub point array until the number of the AI falling sub points is consistent with the total number of the preset chess force grades, determining the AI falling sub points in the AI falling sub point array which are correspondingly ordered based on the current chess force grade ordering of the user, and playing the chess with the user based on the determined AI falling sub points; therefore, the level of the Weiqi AI is enabled to be similar to the real chess strength level of the user, and the playing experience of the user is improved.
Drawings
FIG. 1 is a diagram of an application environment of a method for human-machine chess playing in one embodiment of the present invention;
FIG. 2 is a flow chart of a method for human-machine playing go provided in one embodiment of the invention;
fig. 3 is a schematic structural diagram of a go man-machine playing device according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of a computer device according to an embodiment of the present invention;
fig. 5 is an internal structural diagram of a computer-readable storage medium provided in one embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present disclosure more apparent, the present disclosure will be further described in detail with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the present disclosure.
It should be noted that the terms "first," "second," and the like in the description and claims herein and in the foregoing figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments described herein may be capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, apparatus, article, or device that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed or inherent to such process, method, article, or device.
In this document, the term "and/or" is merely one association relationship describing the associated object, meaning that three relationships may exist. For example, a and/or B may represent: a exists alone, A and B exist together, and B exists alone. In addition, the character "/" herein generally indicates that the front and rear associated objects are an "or" relationship.
In order to solve the above problems, the embodiments of the present disclosure provide a go man-machine playing method, which can be applied to an application environment as shown in fig. 1. Wherein the terminal 102 communicates with the server 104 via a network. The data storage system may store data that the server 104 needs to process. The data storage system may be integrated on the server 104 or may be located on a cloud or other network server. The terminal 102 may be, but not limited to, various personal computers, notebook computers, smart phones, tablet computers, internet of things devices, and portable wearable devices, where the internet of things devices may be smart speakers, smart televisions, smart air conditioners, smart vehicle devices, and the like. The portable wearable device may be a smart watch, smart bracelet, headset, or the like. The server 104 may be implemented as a stand-alone server or as a server cluster of multiple servers.
In the prior art, the method for acquiring the AI falling sub-points based on the katago source code of the original edition only can return to one AI falling sub-point in the process of playing with the Weiqi AI by a user; the current requirements cannot be met, so in this embodiment, katago source codes are optimized to return an AI sub-point array when generating AI sub-points.
Specifically, the details of optimizing katago source code are as follows:
the add class method, search, runWholeSereXeHandGetMoves (Play movePla, json & ret); the method receives the following parameters: movePla, current executive sub-square, black square is 1, white square is 2; ret: json type, after the method is executed, the data is stored in the json variable;
adding class methods, namely, search, getChoseMoves (json & ret); the ret parameter stores the final data.
By calling the above two methods, an AI drop sub-point array can be obtained from katago, and the array is represented by bestpoves, and the data of the array is sorted from high to low according to the recommendation degree/win rate.
Fig. 2 is a flowchart of a go man-machine playing method according to an embodiment of the present invention, and referring to fig. 2, the method may be performed by an apparatus for performing the method, where the apparatus may be implemented by software and/or hardware, and the method includes:
s100, determining the current chess force level of a user, acquiring the coordinates of a user falling point of the user, and generating an AI falling point array based on the coordinates of the user falling point; the AI falling sub-point number group comprises AI falling sub-point coordinates and a falling sub-point winning rate corresponding to each AI falling sub-point coordinate.
It should be noted that, in the go game or go training, the current chess force level of different users using the go play APP is different, that is, the current actual chess force level of different users is different, so that in order to ensure that the users play the go through the go play APP and the go AI, the users can obtain better go play experience, and the current chess force level of the users needs to be determined before formal play, thereby being convenient for adjusting the chess force level of the go AI according to the current chess force level of the users.
In practice, the go playing APP firstly determines the current chess force level of the user, and then the user starts to play formally with the go AI through the go playing APP; in the go playing process, the go AI acquires the coordinates of the user falling points of the user, wherein the coordinates of the user falling points are the coordinates of the user falling points on the chessboard; then, processing the coordinates of the user falling sub-points and the current chessboard situation so as to generate an AI falling sub-point array corresponding to the coordinates of the user falling sub-points; the AI falling point number group comprises a plurality of AI falling point coordinates, wherein the AI falling point coordinates are generated by the Weiqi AI aiming at the user falling point coordinates; the AI sub-point array comprises a plurality of AI sub-point coordinates, and each AI sub-point coordinate has a corresponding sub-point winning rate; the weiqi AI falls on different AI falling point coordinates, the corresponding winning rates are different, the weiqi AI falls on some AI falling point coordinates, the probability of winning by the final weiqi AI is high, and the probability of winning by the final weiqi AI is low.
Through implementation of the scheme, the current real chess strength level of the user can be obtained before formal playing, and a corresponding AI falling point array can be generated according to the falling situation of the user during formal playing, so that the following reply is conducted according to the falling situation of the user by the AI falling point array.
S200, sorting the coordinates of the AI falling sub points in the AI falling sub point array based on the falling sub point winning rate to obtain a first ordered array.
Note that, the drop point winning rate corresponding to each AI drop point coordinate in the AI drop point array acquired in step S100 is different.
In the implementation, in order to facilitate the subsequent matching of corresponding AI drop point coordinates for a user according to the current chess force level of the user, after the AI drop point array is obtained, the corresponding sequence of the AI drop point coordinates in the AI drop point array is ordered according to the sequence from high to low of the drop point winning rate corresponding to the AI drop point coordinates in the AI drop point array, so as to obtain a first ordered number group.
It should be noted that, in this embodiment, the coordinates of each AI sub-point in the first ordered array are ordered according to the order from high to low of the corresponding sub-point winning rate, and in other embodiments, the coordinates of each AI sub-point in the first ordered array may be ordered according to the order from low to high of the corresponding sub-point winning rate, which is not limited herein.
S300, judging whether the number of coordinates of the AI falling points in the first ordered array is consistent with the number of levels corresponding to the candidate chess force levels; if not, the first ordered array is processed to obtain a second ordered array, so that the number of the coordinates of the AI falling sub points in the second ordered array is consistent with the number of the grades.
It should be noted that, in this embodiment, the candidate chess force levels preset by the go AI for the current chess force level of the user are 15 levels in total, that is, the current chess force level of the user is 15 levels in total, which are respectively: level15, level14 … … Level2, level1, wherein Level15, level14 … … Level2, level1 are ordered in order of the candidate force ranking from low to high. In addition, the number of the AI-dropping sub-point coordinates in the first ordered array obtained in step S200 is random, and the number of the AI-dropping sub-point coordinates in the first ordered array may be greater than 15, may be equal to 15, or may be less than 15; in order to match the corresponding AI drop point coordinates from the first ordered array according to the current force level of the user, the number of AI drop point coordinates in the first ordered array is required to be consistent with the number of levels of the candidate force levels, that is, in this embodiment, the number of AI drop point coordinates in the first ordered array is also 15.
In implementation, after the first ordered array is obtained through the step S200, further, it is determined whether the number of AI falling sub-point coordinates in the first ordered array is consistent with the number of levels corresponding to the candidate chess force levels; if the first ordered array is inconsistent, further processing the first ordered array to generate a second ordered array, so that the number of the coordinates of the AI falling points in the second ordered array is consistent with the number of the grades corresponding to the candidate chess force grades; if the first ordered array is consistent, the first ordered array is not processed, and the first ordered array is used as a second ordered array.
S400, selecting AI falling point coordinates corresponding to the current chess force level from the second ordered number group, generating preset falling point coordinates, and playing based on the preset falling point coordinates.
It should be noted that, through implementation of step S300, the number of the coordinates of the AI falling points in the second ordered array may be made to be identical to the number of the levels of the candidate chess force levels, for example, in this embodiment, the number of the levels of the candidate chess force levels is 15, and the number of the coordinates of the AI falling points in the second ordered array is also 15, so that the coordinates of the AI falling points in the second ordered array may be in a one-to-one correspondence with the 15 candidate chess force levels according to the sequence.
In implementation, after determining the current chess force level of the user, further determining a candidate chess force level corresponding to the current chess force level of the user, then selecting an AI falling point coordinate corresponding to the current chess force level of the user from the second ordered set as a preset falling point coordinate, and then falling the Weiqi AI at the preset falling point coordinate, thereby playing with the user.
After determining the current chess force Level (Level) of the user, wherein the value of the Level is 1-15, taking the Level-1 as an index value of the second ordered array, and accordingly acquiring the corresponding AI falling sub-point coordinate bestpove from the second ordered array based on the current chess force Level (Level) of the user to serve as the preset falling sub-point coordinate.
Specifically, assuming that the current chess force Level of the user is Level3, the determined candidate chess force Level of the user is Level3, then the AI falling point coordinate with the index value of Level2 is selected from the second ordered array based on Level3, namely the 3 rd AI falling point coordinate in the second ordered array, and then the Weiqi AI falls at the 3 rd AI falling point coordinate, so that the Weiqi is played with the user.
It should be noted that, the Weiqi AI selects the 3 rd AI falling point coordinate, and the winning rate of falling pieces at the 3 rd AI falling point coordinate is ranked as the third in the second ordered array, corresponding to the current chess force level of the user, thus realizing the dynamic adjustment of the Weiqi AI chess force; the chess strength grade of the Weiqi AI is similar to the current chess strength grade of the user and slightly higher than the chess strength grade of the user, so that the user obtains the feeling of playing the chess with equal force, the feeling of playing the chess with the user is further improved, and the own chess strength level is improved in the playing process of the user.
It should be noted that, the go APP of the integrated go AI is generally difficult to be compatible with the mainstream platform, for example: windows platform, macOS platform, IOS platform and Android platform; so that it is difficult to make the go APP face more users; in order to facilitate the go APP integrating the go AI to more users, in this embodiment, the go AI is integrated into the go APP under different platforms in the following specific integration manner:
the manner of integrating the Weiqi AI into the Windows platform client is as follows:
accessing the source code address of the Weiqi AI, acquiring the Weiqi AI source code, compiling the Weiqi AI source code according to the Weiqi AI official document, and finally acquiring a Unix executable file named Weiqi AI; after a client under a Windows platform is started, performing data interaction with the Windows platform by using a GTP protocol; thus realizing the integration of the Weiqi AI into the Windows platform client.
The manner of integrating the go AI into the MacOS platform client is as follows:
accessing the source code address of the Weiqi AI, acquiring the Weiqi AI source code, compiling the Weiqi AI source code according to the Weiqi AI official document, compiling the source code to finally acquire a corresponding MacOS application program, and after the client is started, performing data interaction with the Weiqi AI by using a GTP protocol; thereby realizing the integration of the Weiqi AI into the MacOS platform client.
The manner in which the Weiqi AI is integrated into the IOS platform client is as follows:
the method comprises the steps of accessing a source code address of a Weiqi AI, obtaining the Weiqi AI source code, compiling the Weiqi AI source code according to a Weiqi AI official document, copying a Weiqi AI source code folder to an item root directory, creating a katagobridge.cpp bridging type file, and referencing the Weiqi AI entry file in an importation mode, wherein the Weiqi AI entry file comprises asyncbot.h, setup.h, play.h, nninputs.h, rules.h and global.h. After the client is started, a bridging method in katagobridge.cpp is called, and data interaction is carried out with the Weiqi AI; thereby realizing the integration of the Weiqi AI into the IOS platform client.
The manner of integrating the Weiqi AI into the Android platform client is as follows:
accessing the source code address of the Weiqi AI, acquiring the Weiqi AI source code, compiling the Weiqi AI source code according to the Weiqi AI official document, copying a source code folder to an item root directory, creating a katagobridge.cpp bridging type file, and referring to a katago entry file in an importation mode, wherein the katago entry file comprises asyncbot.h, setup.h, play.h, nninpots.h, rules.h and global.h. After the client is started, using an Android JNI technology, calling a katagobridge.cpp bridging method, and carrying out data interaction with katago; therefore, the Weiqi AI is integrated to the Android platform client.
In one embodiment, determining the current chess force level of the user comprises: based on the dichotomy, playing with the users to obtain playing results; the current chess strength level of the user is determined based on the chess playing result.
In order to determine the actual current chess strength level of the user in the shortest time, in this embodiment, the actual current chess strength level of the user is determined specifically by using a dichotomy.
In the implementation, the candidate chess force grades of the preset go AI are 15 chess force grades in total, and the chess force grades are respectively: level15, level14 … … Level2, level1, and Level15-Level1 are arranged in order of the chess force Level from high to low; the intermediate candidate chess force Level of Level15-Level1 is Level7, and the intermediate candidate chess force Level of Level7-Level1 is Level4; the intermediate candidate force Level of Level15-Level7 is Level11; the intermediate candidate force Level of Level4-Level1 is Level2; the intermediate candidate force Level of Level7-Level4 is Level6; the intermediate candidate force Level of Level11-Level7 is Level9; the intermediate candidate force rating for Level15-Level11 is Level13.
Assuming that the initial current chess force Level of the user is Level15, and then playing the Weiqi AI with the chess force Level of Level7 with the user; if the user wins, determining that the current chess strength Level of the user is between Level7 and Level1, and then playing the Weiqi AI with the chess strength Level of Level4 with the user; if the user wins, determining that the current chess strength Level of the user is between Level4 and Level1, then playing the go AI with the chess strength Level of Level2 with the user to obtain a playing result, if the playing result is that the user wins, determining that the current chess strength Level of the user is Level1, otherwise, determining that the current chess strength Level of the user is Level3; by analogy, the current chess force level of the user can be determined by only three parts of the go AI which are played with the user.
Through implementation of the scheme, based on the dichotomy, the number of games played by the Weiqi AI and the users is the least, so that the actual current chess force level of the users is obtained, and the efficiency of obtaining the actual current chess force level of the users is improved.
In one embodiment, processing the first ordered array to obtain a second ordered array, so that the number of coordinates of the AI falling sub points in the second ordered array is consistent with the number of grades, includes: judging whether the number of the coordinates of the AI falling sub points in the first ordered array is larger than the number of grades; if yes, deleting the coordinates of the AI falling sub points in the first ordered array based on the falling sub point winning rate to obtain a second ordered array, so that the number of the coordinates of the AI falling sub points in the second ordered array is consistent with the number of the grades; otherwise, calculating the quantity difference between the quantity of the AI falling sub point coordinates and the grade quantity in the first ordered array, and supplementing the corresponding quantity of the AI falling sub point coordinates to the first ordered array based on the quantity difference to obtain a second ordered array, so that the quantity of the AI falling sub point coordinates in the second ordered array is consistent with the grade quantity.
It should be noted that, the number of the AI drop point coordinates in the first ordered array obtained preliminarily is random, and in implementation, it is required to ensure that the number of the AI drop point coordinates in the first ordered array is consistent with the number of the preset chess force levels.
In the implementation, after the first ordered array is obtained, the first ordered array is marked as bestpoves, further, data correction is carried out on the first ordered array bestpoves, specifically, the number of the coordinates of the AI falling sub points in the first ordered array is counted, and then whether the number of the coordinates of the AI falling sub points is consistent with the number of the preset candidate chess force grades is judged; if not, further judging whether the number of the coordinates of the AI falling sub points in the first ordered array is larger than the number of the candidate chess force grades.
If the number of the AI falling sub point coordinates in the first ordered array is judged to be larger than the level number of the candidate chess force levels, the number of the AI falling sub point coordinates in the first ordered array is larger than the expected number of the AI falling sub point coordinates in the first ordered array; at this time, data deletion is performed on the first ordered array bestpoves, specifically, AI sub-point coordinates are deleted from the AI sub-point coordinates ordered last in the first ordered array, that is, AI sub-point coordinates in the first ordered array are deleted according to the descending order of the sub-point winning rate, so as to obtain a second ordered array, so that the number of AI sub-point coordinates in the second ordered array is consistent with the number of candidate chess force grades, that is, AI sub-point coordinate data after the first ordered array bestpoves order is 15 is deleted;
if the number of the AI drop point coordinates in the first ordered array is smaller than the number of the levels of the candidate chess force levels, performing data filling on the first ordered array bestpoves, specifically, firstly calculating the number difference between the number of the AI drop point coordinates in the first ordered array and the number of the levels, supplementing the AI drop point coordinates corresponding to the number difference into the first ordered array based on the number difference, and obtaining a second ordered array, so that the number of the AI drop point coordinates in the second ordered array is consistent with the number of the levels of the candidate chess force levels.
Through implementation of the scheme, the number of the coordinates of the AI falling sub points in the second ordered array is convenient to be consistent with the number of the levels of the candidate chess force levels, so that corresponding coordinates of the AI falling sub points can be conveniently allocated to users in the follow-up process.
In one embodiment, supplementing the corresponding number of AI-drop sub-point coordinates to the first ordered set based on the number difference to obtain a second ordered set includes: determining the coordinates of the corresponding number of AI falling sub-points based on the number difference, and acquiring the weight of each AI falling sub-point coordinate; and (3) sorting AI falling sub-point coordinates according to the order of the weights from large to small, generating an ordered falling sub-point coordinate set, and supplementing the ordered falling sub-point coordinate set to the first ordered set to obtain a second ordered array.
It should be noted that, the cross points on the chessboard form a plurality of cross points, wherein, part of the cross points are positioned as "star"; in the implementation, the Weiqi AI gives weight to each intersection point in advance according to a weight giving strategy, so that each intersection point has the corresponding weight, and the weight of each intersection point is integrated to obtain the corresponding weight information of the intersection point; wherein, the weighting strategy comprises: the weight of the crossing point of the corresponding star is highest; the closer the intersection point of the board edge is weighted lower.
In this embodiment, specific cross point weight information is as follows:
in implementation, when the number of the AI falling sub point coordinates in the first ordered array is smaller than the number of the levels of the candidate chess force levels, calculating the number difference between the number of the AI falling sub point coordinates in the first ordered array and the number of the levels of the candidate chess force levels, and then continuously acquiring the AI falling sub point coordinates with the number consistent with the number difference and the weight corresponding to each AI falling sub point coordinate by the Weiqi AI; it should be noted that, each AI falling sub-point coordinate corresponds to an intersection point on a chessboard; the AI falling point coordinates continuously acquired by the Weiqi AI are the AI falling point coordinates corresponding to the intersection points which are not occupied by the two parties on the chessboard, or the AI falling point coordinates corresponding to the intersection points with relatively higher weight on the chessboard; further, arranging AI falling sub-point coordinates continuously acquired by the Weiqi AI according to the order of the weights from large to small, so as to generate an ordered falling sub-point coordinate set; then, supplementing the ordered falling sub-point coordinate set into the first ordered array, thereby obtaining a second ordered array; that is, the AI falling sub-point coordinates which are not occupied by the black-and-white side and have the highest weight are supplemented into the first ordered group bestpoves in the order from the weight to the low, until the bestpoves length is 15. It should be noted that, the falling sub point winning rate corresponding to the AI falling sub point coordinates in the ordered array obtained at this time is still in a state of sorting from big to small.
In one embodiment, the step of playing with the user based on the predetermined falling sub-point coordinates includes: marking the coordinates of the user falling sub points or the abscissa of the preset falling sub point coordinates based on the characters in the preset first character group; marking the ordinate of the user falling sub-point coordinates or the preset falling sub-point coordinates based on the characters in the preset second character set; based on character marks in a preset third character group, corresponding to the coordinates of the user falling sub points or the coordinates of the preset falling sub points.
In the playing process, the go AI determines coordinates of falling points and then generates predetermined coordinates of falling points, and the user generates coordinates of falling points after falling points, so that the predetermined coordinates of falling points and the user coordinates of falling points need to be stored for corresponding data processing; the preset falling sub-point coordinates and the user falling sub-point coordinates comprise corresponding horizontal coordinates and vertical coordinates, and the traditional method is that the numerical representation is adopted to represent the horizontal coordinates, the vertical coordinates and chess executing parties of the preset falling sub-point coordinates and the user falling sub-points; in storage, the storage space occupied by one number is 4 bytes.
In the implementation, the chessboard is provided with 19 transverse lines and 19 longitudinal lines, one character group is preset for the 19 transverse lines and is recorded as a first character group, 19 characters including A-T in the first character group are in one-to-one correspondence with the 19 transverse lines; similarly, another character set is preset for 19 vertical lines and is recorded as a second character set, 19 characters including A-T are also included in the second character set, and the 19 characters are in one-to-one correspondence with the 19 vertical lines; in addition, a third character set is preset, wherein the third character set comprises two characters: w and B; wherein W represents one of the Weiqi AI and the white chess played by the user, and B represents one of the Weiqi AI and the black chess played by the user.
In the implementation, after the user falling sub-point coordinates or the preset falling sub-point coordinates are obtained, representing the abscissa of the user falling sub-point coordinates or the preset falling sub-point coordinates by corresponding characters in the first character group; and representing the coordinates of the user falling sub-points or the ordinate of the coordinates of the preset falling sub-points by the corresponding characters in the second character set; and the corresponding characters in the second character group are used for representing the chess executing party of the coordinates of the user drop points or the coordinates of the preset drop points.
It should be noted that, the storage space occupied by each character in the first character set, the second character set and the third character set is 1byte, and compared with the traditional storage scheme, the storage space of the preset falling sub-point coordinate information and the storage space of the user falling sub-point coordinate information are greatly reduced.
In a specific embodiment, assuming that a party playing the white chess falls at the intersection point of the second horizontal line and the second vertical line, the second horizontal line is represented by a second character B of the first character set, the second horizontal line is represented by a second character B of the second character set, and the party playing the white chess is represented by W in the third character set; in summary, it is assumed that the BBW is the result of the first character set, the second character set, and the third character set representing the event that a party playing the white chess falls at the intersection of the second horizontal line and the second vertical line.
Fig. 2 is a flow chart of a method for playing go by man in one embodiment. It should be understood that, although the steps in the flowchart of fig. 2 are shown in sequence as indicated by the arrows, the steps are not necessarily performed in sequence as indicated by the arrows; the steps are not strictly limited to the order of execution unless explicitly recited herein, and the steps may be executed in other orders; and at least some of the steps in fig. 2 may include multiple sub-steps or stages that are not necessarily performed at the same time, but may be performed at different times, nor do the order in which the sub-steps or stages are performed necessarily performed in sequence, but may be performed alternately or alternately with at least a portion of the other steps or sub-steps of other steps.
Based on the same inventive concept, the embodiment of the disclosure also provides a go man-machine playing device for realizing the go man-machine playing method. The implementation scheme of the device for solving the problem is similar to the implementation scheme recorded in the method, so the specific limitation of one or more embodiments of the go man-machine playing device provided below can be referred to the limitation of the go man-machine playing method hereinabove, and will not be repeated here.
In one embodiment, as shown in fig. 3, there is provided a go man-machine playing device, including:
the drop feedback module is used for determining the current chess force level of the user, acquiring the user drop point coordinates of the user and generating an AI drop point array based on the user drop point coordinates; the AI falling sub point number group comprises AI falling sub point coordinates and falling sub point winning rates corresponding to each AI falling sub point coordinate;
the sorting module is used for sorting the coordinates of the AI falling sub points in the AI falling sub point array based on the falling sub point winning rate to obtain a first ordered array;
the judging module is used for judging whether the number of the coordinates of the AI falling points in the first ordered array is consistent with the number of the grades corresponding to the candidate chess force grades; if not, processing the first ordered array to obtain a second ordered array, so that the number of the coordinates of the AI falling sub points in the second ordered array is consistent with the number of the grades;
and the playing module is used for selecting the AI falling point coordinates corresponding to the current chess force level from the second ordered number group, generating preset falling point coordinates and playing based on the preset falling point coordinates.
All or part of the modules in the go man-machine playing device can be realized by software, hardware and a combination thereof. The above modules may be embedded in hardware or may be independent of a processor in the computer device, or may be stored in software in a memory in the computer device, so that the processor may call and execute operations corresponding to the above modules.
In one embodiment, a computer device is provided, which may be a server, the internal structure of which may be as shown in fig. 4. The computer device includes a processor, a memory, and a network interface connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The database of the computer device is for storing data. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program, when executed by the processor, implements a go man-machine play method.
Those skilled in the art will appreciate that the architecture shown in fig. 4 is merely a block diagram of a portion of the architecture in connection with the disclosed aspects and is not limiting of the computer apparatus to which the disclosed aspects apply, and that a particular computer apparatus may include more or less components than those shown, or may combine some of the components, or have a different arrangement of components.
In one embodiment, a computer device is provided, comprising a memory and a processor, the memory having stored therein a computer program, the processor implementing the steps of the method embodiments described above when the computer program is executed.
In one embodiment, a computer readable storage medium is provided, as shown in fig. 5, having a computer program stored thereon, which when executed by a processor, implements the steps of the method embodiments described above.
In an embodiment, a computer program product is provided, comprising a computer program which, when executed by a processor, implements the steps of the method embodiments described above.
It should be noted that, the user information (including, but not limited to, user equipment information, user personal information, etc.) and the data (including, but not limited to, data for analysis, stored data, presented data, etc.) related to the present disclosure are information and data authorized by the user or sufficiently authorized by each party.
Those skilled in the art will appreciate that implementing all or part of the above-described methods in accordance with the embodiments may be accomplished by way of a computer program stored on a non-transitory computer readable storage medium, which when executed may comprise the steps of the embodiments of the methods described above. Any reference to memory, database, or other medium used in embodiments provided by the present disclosure may include at least one of non-volatile and volatile memory, among others. The nonvolatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical Memory, high density embedded nonvolatile Memory, resistive random access Memory (ReRAM), magnetic random access Memory (Magnetoresistive Random Access Memory, MRAM), ferroelectric Memory (Ferroelectric Random Access Memory, FRAM), phase change Memory (Phase Change Memory, PCM), graphene Memory, and the like. Volatile memory can include random access memory (Random Access Memory, RAM) or external cache memory, and the like. By way of illustration, and not limitation, RAM can be in the form of a variety of forms, such as static random access memory (Static Random Access Memory, SRAM) or dynamic random access memory (Dynamic Random Access Memory, DRAM), and the like. The databases referred to in the various embodiments provided by the present disclosure may include at least one of a relational database and a non-relational database. The non-relational database may include, but is not limited to, a blockchain-based distributed database, and the like. The processors involved in the embodiments provided by the present disclosure may be general-purpose processors, central processing units, graphics processors, digital signal processors, programmable logic, quantum computing-based data processing logic, etc., without limitation thereto.
The technical features of the above embodiments may be arbitrarily combined, and all possible combinations of the technical features in the above embodiments are not described for brevity of description, however, as long as there is no contradiction between the combinations of the technical features, they should be considered as the scope of the description.
The foregoing examples merely represent several embodiments of the present disclosure, which are described in more detail and are not to be construed as limiting the scope of the present disclosure. It should be noted that variations and modifications can be made by those skilled in the art without departing from the spirit of the disclosure, which are within the scope of the disclosure. Accordingly, the scope of the present disclosure should be determined from the following claims.

Claims (10)

1. A method for playing go on a human-computer game, comprising:
determining the current chess force level of a user, acquiring the user falling sub-point coordinates of the user, and generating an AI falling sub-point array based on the user falling sub-point coordinates; the AI falling sub point number group comprises AI falling sub point coordinates and falling sub point winning rates corresponding to each AI falling sub point coordinate;
sorting the AI falling sub-point coordinates in the AI falling sub-point array based on the falling sub-point winning rate to obtain a first ordered array;
judging whether the number of the coordinates of the AI falling sub points in the first ordered array is consistent with the number of the grades corresponding to the candidate chess force grades; if not, processing the first ordered array to obtain a second ordered array, so that the number of the AI falling sub point coordinates in the second ordered array is consistent with the number of the grades;
and selecting the AI falling point coordinates corresponding to the current chess force level from the second ordered number group, generating preset falling point coordinates, and playing based on the preset falling point coordinates.
2. A method according to claim 1, wherein said determining the current chess power level of the user comprises:
based on the dichotomy, playing with the users to obtain playing results; and determining the current chess strength level of the user based on the chess playing result.
3. The method of claim 1, wherein processing the first ordered array to obtain a second ordered array such that the number of AI drop point coordinates in the second ordered array is consistent with the number of levels comprises:
judging whether the number of the coordinates of the AI falling sub points in the first ordered array is larger than the number of grades;
if yes, deleting the AI falling sub point coordinates in the first ordered array based on the falling sub point winning rate to obtain a second ordered array, so that the number of the AI falling sub point coordinates in the second ordered array is consistent with the number of the grades;
otherwise, calculating the quantity difference between the quantity of the AI falling sub point coordinates in the first ordered array and the grade quantity, and supplementing the corresponding quantity of the AI falling sub point coordinates to the first ordered array based on the quantity difference to obtain a second ordered array, so that the quantity of the AI falling sub point coordinates in the second ordered array is consistent with the grade quantity.
4. A method according to claim 3, wherein said supplementing the first ordered set with a corresponding number of AI drop sub-point coordinates based on the number difference results in a second ordered set, comprising:
determining the corresponding number of AI falling sub-point coordinates based on the number difference, and acquiring the weight of each AI falling sub-point coordinate;
and sequencing the AI sub-point coordinates according to the sequence from big to small of the weight, generating an ordered sub-point coordinate set, and supplementing the ordered sub-point coordinate set to the first ordered set to obtain a second ordered set.
5. The method of claim 4, wherein the step of obtaining weights for each of the AI drop sub-point coordinates comprises:
weighting each intersection on the chessboard according to a preset weighting strategy to generate intersection weight information; the intersection weight information includes a weight of each of the intersections.
6. A method according to claim 1, wherein said step of playing with said user based on said predetermined drop point coordinates comprises:
marking the coordinates of the user falling sub points or the abscissa of the preset falling sub point coordinates based on characters in a preset first character group;
marking the coordinates of the user falling sub points or the ordinate of the preset falling sub point coordinates based on characters in a preset second character set;
and executing chess parties corresponding to the coordinates of the user drop points or the coordinates of the preset drop points based on character marks in a preset third character set.
7. A go man-machine play device, the device comprising:
the drop feedback module is used for determining the current chess force level of the user, acquiring the user drop point coordinates of the user, and generating an AI drop point array based on the user drop point coordinates; the AI falling sub point number group comprises AI falling sub point coordinates and falling sub point winning rates corresponding to each AI falling sub point coordinate;
the sorting module is used for sorting the AI falling sub-point coordinates in the AI falling sub-point array based on the falling sub-point winning rate to obtain a first ordered array;
the judging module is used for judging whether the number of the coordinates of the AI falling sub points in the first ordered array is consistent with the number of the grades corresponding to the candidate chess force grades; if not, processing the first ordered array to obtain a second ordered array, so that the number of the AI falling sub point coordinates in the second ordered array is consistent with the number of the grades;
and the playing module is used for selecting the AI falling point coordinates corresponding to the current chess force level from the second ordered number group, generating preset falling point coordinates and playing based on the preset falling point coordinates.
8. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor implements the steps of the method of any of claims 1 to 6 when the computer program is executed.
9. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the method of any of claims 1 to 6.
10. A computer program product comprising a computer program, characterized in that the computer program, when being executed by a processor, implements the steps of the method of any of claims 1 to 6.
CN202311632047.5A 2023-12-01 2023-12-01 Weiqi man-machine playing method, device, computer equipment and storage medium Pending CN117582652A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311632047.5A CN117582652A (en) 2023-12-01 2023-12-01 Weiqi man-machine playing method, device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311632047.5A CN117582652A (en) 2023-12-01 2023-12-01 Weiqi man-machine playing method, device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN117582652A true CN117582652A (en) 2024-02-23

Family

ID=89919843

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311632047.5A Pending CN117582652A (en) 2023-12-01 2023-12-01 Weiqi man-machine playing method, device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN117582652A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117861190A (en) * 2024-03-11 2024-04-12 科大讯飞(苏州)科技有限公司 Drop point selection method, drop point selection device, display device, and storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117861190A (en) * 2024-03-11 2024-04-12 科大讯飞(苏州)科技有限公司 Drop point selection method, drop point selection device, display device, and storage medium

Similar Documents

Publication Publication Date Title
CN111432226B (en) Live broadcast recommendation method and device, server, terminal and storage medium
CN117582652A (en) Weiqi man-machine playing method, device, computer equipment and storage medium
CN105378662A (en) Bundle package generation
CN113326948A (en) Data processing method, device, equipment and storage medium of federal learning model
CN113326900A (en) Data processing method and device of federal learning model and storage medium
CN107807935B (en) Using recommended method and device
CN112090074B (en) Virtual article control method, device, equipment and medium in application
US20240033644A1 (en) Automatic detection of prohibited gaming content
CN111523030B (en) Newspaper disc information recommendation method and device and computer readable storage medium
CN112245934A (en) Data analysis method, device and equipment for virtual resources in virtual scene application
CN110874609B (en) User clustering method, storage medium, device and system based on user behaviors
CN109948062A (en) A kind of target matching method, device, server, system and storage medium
US20220129239A1 (en) Democratic skip
JP7335739B2 (en) SYSTEM, METHOD AND PROGRAM FOR PROVIDING A GAME
US20180039712A1 (en) Systems and methods for matching users
KR20160026477A (en) Method for providing user customized stock investment information and apparatus and system using the same
US20220067052A1 (en) Providing dynamically customized rankings of game items
CN114493781A (en) User behavior prediction method and device, electronic equipment and storage medium
CN113420970A (en) Task scheduling method under intelligent warehousing environment
Dietrich et al. A column generation approach for combinatorial auctions
CN112231545B (en) Method, device, equipment and storage medium for ordering aggregation set
CN114820879B (en) Method for constructing game drawing board by thinking guide picture, electronic equipment and storage medium
KR102083511B1 (en) Server connecting method and server system using the method
TW202326552A (en) System for accelerating consumer feedback and profit sharing including a transaction server, a database unit and a processing unit
CN116966571A (en) Data processing method, device, equipment, storage medium and program product

Legal Events

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