Moving route determination method and device, electronic equipment and storage medium

By using K-dimensional KD forest and the nearest neighbor search algorithm in the game, multiple KD trees matching the real moving routes of the sample personnel are generated, the problem of mobile route fixation in the existing technology is solved, and more flexible and diversified mobile routes are achieved, and the gaming experience is improved.

CN119792932APending Publication Date: 2025-04-11JINSHAN SHIYOU (WUHAN) NETWORK TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411973527.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2023-12-29
Filing Date
2024-12-30
Publication Date
2025-04-11

AI Technical Summary

Technical Problem

In the prior art, the mobile routes designed by game developers are relatively fixed and lack flexibility, and cannot adapt to the real choices of players during the game.

Method used

Through the pre-constructed KD forest, using the closest proximity search algorithm, the current position and next position of the target personnel in the preset map are determined, and multiple KD trees are generated to match the real moving route of the sample personnel.

Benefits of technology

It realizes the flexibility and diversity of mobile routes, ensures the matching of mobile routes with the real choices of players, and improves the naturalness of the game experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119792932A_ABST
    Figure CN119792932A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a moving route determination method and device, electronic equipment and a storage medium. The scheme is as follows: acquiring a first position of a target person in a preset map at the current moment; in a pre-constructed KD forest, a target KD tree matched with the first position is determined, the KD forest comprises a plurality of KD trees, and nodes in each KD tree are determined according to real moving routes corresponding to a plurality of sample persons in a preset map; and based on the first position, determining a second position to which the target person moves at the next moment in the target KD tree by using a nearest neighbor search algorithm. Through the technical scheme provided by the embodiment of the invention, the flexibility of the determined moving route is improved.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application claims the priority of the Chinese patent application filed with the China Patent Office on December 29, 2023, with application number 202311857440.4 and invention name “A method, device, electronic device and storage medium for determining a mobile route”, the entire contents of which are incorporated by reference in this application. Technical Field

[0002] The present application relates to the field of computer technology, and in particular to a method, device, electronic device and storage medium for determining a mobile route. Background Art

[0003] In games such as First-Person Shooting (FPS), players need to control virtual characters, such as artificial intelligence (AI) robots, to move in a designed game map. These movement routes are designed and verified by game developers.

[0004] In the related art, game developers can design movement routes by constructing behavior trees, which makes the designed movement routes relatively fixed. For example, when there is a wall in front of a virtual character, the movement route designed by the game developer instructs the virtual character to climb over the wall. In the game, the player can only operate the virtual character to climb over the wall and cannot perform other operations at this location, which seriously affects the flexibility of the determined movement route. Summary of the invention

[0005] The purpose of the embodiments of the present application is to provide a method, device, electronic device and storage medium for determining a moving route, so as to improve the flexibility of the determined moving route. The specific technical solution is as follows:

[0006] In a first aspect, in order to achieve the above-mentioned object, an embodiment of the present application provides a method for determining a moving route, the method comprising:

[0007] Get the first position of the target person at the current moment in the preset map;

[0008] Determine a target KD tree matching the first position in a pre-constructed K-dimensional KD forest, wherein the KD forest includes a plurality of KD trees, and a node in each KD tree is determined according to a real movement route corresponding to each person in a plurality of groups of sample persons in the preset map;

[0009] Based on the first position, a nearest neighbor search algorithm is used to determine in the target KD tree a second position to which the target person moves at the next moment.

[0010] Optionally, the method further includes:

[0011] Obtaining the actual movement route of each person in the plurality of groups of sample persons in the preset map;

[0012] For each group of sample personnel, a plurality of first position feature vectors are generated according to the position coordinates of the personnel at the same time in the real movement routes of the group of sample personnel;

[0013] A KD tree is constructed according to a first position feature vector having the same target vector element to obtain a KD forest, wherein the target vector element is a vector element indicating a first position in the first position feature vector.

[0014] Optionally, the step of obtaining the first position of the target person at the current moment in the preset map includes:

[0015] Obtaining the current position coordinates of the target person in the preset map as the first position of the target person;

[0016] or,

[0017] Get the current location coordinates of the target person in the preset map;

[0018] Determine the target area block identifier corresponding to the position coordinates of the target person according to the correspondence between each area block obtained by evenly dividing the preset map and the area block identifier;

[0019] Based on the target area block identifier, a second position feature vector indicating the first position of the target person at the current moment in the preset map is generated.

[0020] Optionally, the step of generating a second position feature vector indicating the first position of the target person at the current moment in the preset map based on the target area block identifier includes:

[0021] generating a third position feature vector including the target area block identifier;

[0022] For each vector element in the third position feature vector, the coordinates of the vector element are transformed according to the first quantity and the second quantity to obtain a second position feature vector indicating the first position of the target person at the current moment in the preset map; wherein the first quantity is the number of area blocks included in each row after the preset map is evenly divided, and the second quantity is the number of area blocks included in each column after the preset map is evenly divided.

[0023] Optionally, the step of performing coordinate transformation on each vector element in the third position feature vector according to the first quantity and the second quantity to obtain a second position feature vector indicating the first position of the target person at the current moment in the preset map includes:

[0024] For each vector element in the third position feature vector, coordinate transformation is performed on the vector element using the following formula to obtain a second position feature vector indicating the first position of the target person at the current moment in the preset map;

[0025] ;

[0026] ;

[0027] in, for The converted horizontal axis value, is the i-th vector element in the third position feature vector, For the remainder operation, is the first quantity, for The converted ordinate value, is the second number.

[0028] Optionally, if the target person is a team member of at least two teams, the second position feature vector includes a vector element indicating a current position of each team member.

[0029] Optionally, the step of determining, based on the first position, in the target KD tree using a nearest neighbor search algorithm, a second position to which the target person moves at the next moment comprises:

[0030] Determine, by using a nearest neighbor search algorithm, a preset number of fourth positions that are closest to the first position in the target KD tree;

[0031] A fourth position is randomly selected from the preset number of fourth positions as the second position to which the target person moves next moment.

[0032] Optionally, the step of determining, in a pre-constructed KD forest, a target KD tree matching the first position, wherein the KD forest includes a plurality of KD trees, comprises:

[0033] According to a pre-established correspondence relationship between a KD tree and a region block identifier, determining a KD tree whose region block identifier matches the first position as a target KD tree;

[0034] The matching between the region block identifier and the first position is represented by: the first position is in the region block corresponding to the region block identifier, or the distance between the region block corresponding to the region block identifier and the first position is the smallest.

[0035] In a second aspect, in order to achieve the above-mentioned purpose, an embodiment of the present application provides a moving route determination device, the device comprising:

[0036] A first acquisition module is used to acquire the first position of the target person at the current moment in the preset map;

[0037] A first determination module is used to determine a target KD tree matching the first position in a pre-constructed K-dimensional KD forest, wherein the KD forest includes a plurality of KD trees, and a node in each KD tree is determined according to a real movement route corresponding to each person in a plurality of groups of sample persons in the preset map;

[0038] The second determination module is used to determine, based on the first position and using a nearest neighbor search algorithm, a second position to which the target person moves at the next moment in the target KD tree.

[0039] Optionally, the device further comprises:

[0040] A second acquisition module is used to obtain the actual movement route of each person in the plurality of groups of sample persons in the preset map;

[0041] A generating module, for generating, for each group of sample personnel, a plurality of first position feature vectors according to the position coordinates of the personnel at the same time in the real moving routes of the group of sample personnel;

[0042] A construction module is used to construct a KD tree according to a first position feature vector with the same target vector element to obtain a KD forest, wherein the target vector element is a vector element indicating a first position in the first position feature vector.

[0043] Optionally, the first acquisition module includes:

[0044] A first acquisition submodule is used to acquire the position coordinates of the target person at the current moment in the preset map as the first position of the target person;

[0045] Alternatively, the first acquisition module includes:

[0046] The second acquisition submodule is used to obtain the current location coordinates of the target person in the preset map;

[0047] A determination submodule, configured to determine the target area block identifier corresponding to the position coordinates of the target person according to the correspondence between each area block and the area block identifier obtained by evenly dividing the preset map;

[0048] A generating submodule is used to generate a second position feature vector indicating the first position of the target person at the current moment in the preset map based on the target area block identifier.

[0049] Optionally, the generating submodule is specifically used to generate a third position feature vector including the target area block identifier;

[0050] For each vector element in the third position feature vector, the coordinates of the vector element are transformed according to the first quantity and the second quantity to obtain a second position feature vector indicating the first position of the target person at the current moment in the preset map; wherein the first quantity is the number of area blocks included in each row after the preset map is evenly divided, and the second quantity is the number of area blocks included in each column after the preset map is evenly divided.

[0051] Optionally, the generating submodule is specifically used to perform coordinate transformation on each vector element in the third position feature vector using the following formula to obtain a second position feature vector indicating the first position of the target person at the current moment in the preset map;

[0052] ;

[0053] ;

[0054] in, for The converted horizontal axis value, is the i-th vector element in the third position feature vector, For the remainder operation, is the first quantity, for The converted ordinate value, is the second number.

[0055] Optionally, if the target person is a team member of at least two teams, the second position feature vector includes a vector element indicating a current position of each team member.

[0056] Optionally, the second determination module is specifically configured to determine a preset number of fourth positions that are closest to the first position in the target KD tree by using a nearest neighbor search algorithm;

[0057] A fourth position is randomly selected from the preset number of fourth positions as the second position to which the target person moves next moment.

[0058] Optionally, the first determination module is specifically used to determine the KD tree whose region block identifier matches the first position as the target KD tree according to a pre-established correspondence between the KD tree and the region block identifier; wherein the region block identifier matches the first position as follows: the first position is in the region block corresponding to the region block identifier, or the distance between the region block corresponding to the region block identifier and the first position is the smallest.

[0059] The embodiment of the present application also provides an electronic device, including a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus;

[0060] Memory, used to store computer programs;

[0061] The processor is used to implement any of the above-mentioned steps of the moving route determination method when executing the program stored in the memory.

[0062] An embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, any of the steps of the above-mentioned method for determining a moving route is implemented.

[0063] An embodiment of the present application also provides a computer program product comprising instructions, which, when executed on a computer, enables the computer to execute any of the above-described methods for determining a moving route.

[0064] Beneficial effects of the embodiments of the present application:

[0065] The technical solution provided in the embodiment of the present application can generate multiple KD trees in advance according to the actual movement routes of multiple groups of sample personnel in a preset map to obtain a KD forest, so that after obtaining the first position of the target person at the current moment in the preset map, a target KD tree matching the first position is determined in the KD forest, and based on the first position, a nearest neighbor search algorithm is used to determine in the target KD tree the second position to which the target person will move at the next moment.

[0066] Compared with the related art, the moving routes in the KD tree generated according to the actual moving routes of the sample personnel in the preset map, each moving route is determined according to the actual moving route of the personnel. Therefore, the moving route from the first position to the second position determined based on the actual moving route matches the actual situation during the personnel movement process, so that the determined moving route is no longer relatively fixed, which is in line with the actual choice of the natural person.

[0067] In addition, since the determined movement route is determined based on the actual movement route of the person, for the same position in the preset map, the actual movement route formed according to the different choices of the person will also be different, which makes the second position determined based on the first position have multiple possibilities, thereby improving the diversity and flexibility of the determined movement route.

[0068] Of course, implementing any product or method of the present application does not necessarily require achieving all of the advantages described above at the same time. BRIEF DESCRIPTION OF THE DRAWINGS

[0069] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application, and for ordinary technicians in this field, other embodiments can also be obtained based on these drawings.

[0070] Figure 1 A schematic diagram of a first flow chart of a method for determining a moving route provided in an embodiment of the present application;

[0071] Figure 2 A second flow chart of the method for determining a moving route provided in an embodiment of the present application;

[0072] Figure 3 A schematic diagram of a preset map provided in an embodiment of the present application;

[0073] Figure 4 A third flow chart of the method for determining a moving route provided in an embodiment of the present application;

[0074] Figure 5 A fourth flow chart of the method for determining a moving route provided in an embodiment of the present application;

[0075] Figure 6 A fifth flow chart of the method for determining a moving route provided in an embodiment of the present application;

[0076] Figure 7 A sixth flow chart of the method for determining a moving route provided in an embodiment of the present application;

[0077] Figure 8 A schematic diagram of a structure of a mobile route determination device provided in an embodiment of the present application;

[0078] Fig. 9 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0079] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions 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 based on the present application belong to the scope of protection of the present application.

[0080] In the related art, game developers can use the following two methods to design movement routes: Method 1, determining the movement route by using a pre-built behavior tree; Method 2, using an artificial intelligence algorithm, such as a neural network model, to train and obtain the movement route.

[0081] However, for the above method 1, since the construction of the behavior tree requires the design of a large number of judgment statements, this greatly increases the construction cost of the behavior tree. In addition, since the behavior tree is generated based on a large number of judgment statements, the movement route determined by the behavior tree is relatively fixed and does not conform to the actual choice of the personnel. For the above method 2, the hardware cost of the network model required to be constructed using the artificial intelligence algorithm is relatively high, the labor cost is also relatively high, and the training time cost of the network model is relatively high.

[0082] In order to solve the problems in the related art, the present application embodiment also provides a method for determining a moving route. Figure 1 As shown, Figure 1 The first flow chart of the mobile route determination method provided in the embodiment of the present application. The method can be applied to any electronic device, such as a game server. The game server can be a dedicated server, such as a dedicated replica server (Dedicated-server), etc., or a functional module for providing mobile routes, such as an AI Server in a game server (i.e., a server that provides mobile routes). The electronic device is not specifically limited here. Figure 1 The method shown includes the following steps.

[0083] Step S101, obtaining the first position of the target person at the current moment in the preset map.

[0084] Step S102, in a pre-constructed KD (K-dimensional) forest, determine a target KD tree that matches the first position, the KD forest includes multiple KD trees, and the nodes in each KD tree are determined based on the actual movement routes corresponding to each person in multiple groups of sample personnel in a preset map.

[0085] Step S103, based on the first position, using a nearest neighbor search algorithm, determine in the target KD tree a second position to which the target person moves at the next moment.

[0086] exist Figure 1In the method shown, multiple KD trees can be generated in advance based on the actual movement routes of multiple groups of sample personnel in a preset map to obtain a KD forest. After obtaining the first position of the target person at the current moment in the preset map, a target KD tree matching the first position is determined in the KD forest. Based on the first position, a nearest neighbor search algorithm is used to determine the second position to which the target person will move at the next moment in the target KD tree.

[0087] Compared with the related art, the moving routes in the KD tree generated according to the actual moving routes of the sample personnel in the preset map, each moving route is determined according to the actual moving route of the personnel. Therefore, the moving route from the first position to the second position determined based on the actual moving route matches the actual situation during the personnel movement process, so that the determined moving route is no longer relatively fixed, which is in line with the actual choice of the natural person.

[0088] In addition, since the determined movement route is determined based on the actual movement route of the person, for the same position in the preset map, the actual movement route formed according to the different choices of the person will also be different, which makes the second position determined based on the first position have multiple possibilities, thereby improving the diversity and flexibility of the determined movement route.

[0089] The embodiments of the present application are described below through specific embodiments. For ease of understanding, the following description is only based on electronic devices as the execution subject, which does not serve any limiting purpose.

[0090] With respect to the above step S101, the first position of the target person at the current moment in the preset map is obtained.

[0091] The target person mentioned above may be a virtual character operated by any one or more persons in a preset map.

[0092] In an optional embodiment, when the target personnel include multiple personnel, the target personnel may be team members in at least two teams. For ease of understanding, each team includes 5 players, and there are 2 game teams, such as Team 1 and Team 2. The target personnel may include all players in Team 1 and Team 2, that is, 10 players. It may also be Person A in Team 1, the remaining 4 personnel in Team 1 (i.e. Person B, Person C, Person D, Person E), and the two personnel in Team 2 closest to Person A (i.e. Person F, Person G).

[0093] In the embodiment of the present application, there is no specific limitation on the number and composition of the target personnel.

[0094] The preset map may be a game map of an FPS. The game map may include virtual vegetation, virtual buildings, etc. Here, the preset map is not specifically limited.

[0095] In an optional embodiment, for the above-mentioned first position, the electronic device can obtain the position coordinates of the target person at the current moment in a preset map as the first position of the target person.

[0096] In another optional embodiment, for the above-mentioned first position, the electronic device can generate a position feature vector (referred to as a second position feature vector) indicating the first position of the target person according to the position coordinates of the target person at the current moment in the preset map. The generation of the second position feature vector can be seen in the following description and will not be described in detail here.

[0097] In the embodiment of the present application, the representation method of the above-mentioned first position is not specifically limited.

[0098] For the above step S102, that is, in the pre-constructed KD forest, a target KD tree matching the first position is determined, and the KD forest includes multiple KD trees. The nodes in each KD tree are determined based on the actual movement routes corresponding to each person in multiple groups of sample personnel in the preset map.

[0099] In this step, the electronic device can generate multiple KD trees in advance according to the actual movement routes corresponding to the multiple groups of sample personnel in the above-mentioned preset map to obtain a KD forest. The electronic device can determine the target KD tree matching the first position in the pre-constructed KD forest according to the first position obtained in the above-mentioned step S101. The construction method of the KD forest and the determination method of the target KD tree can be found in the description below and will not be described in detail here.

[0100] In an embodiment of the present application, for the above-mentioned multiple groups of sample personnel, the number of personnel included in each group of sample personnel may be one or more. The specifications of each group of sample personnel match the specifications of the target personnel. That is, when the target personnel includes one person, each group of sample personnel also includes one person; when the target personnel includes multiple persons, each group of sample personnel also includes the same number of persons. For ease of understanding, the above-mentioned target personnel includes personnel A-personnel G as an example for explanation. Each group of sample personnel in the above-mentioned multiple groups of sample personnel includes all the personnel in a team (such as team A), and the two personnel in another team that are closest to a certain person in team A. Here, the above-mentioned multiple groups of sample personnel are not specifically limited.

[0101] Each node in the target KD tree may indicate the corresponding position of one or more persons in a preset map.

[0102] With respect to the above step S103, that is, based on the first position, a nearest neighbor search algorithm is used to determine in the target KD tree the second position to which the target person moves at the next moment.

[0103] In this step, after determining the above-mentioned target KD tree, the electronic device uses a nearest neighbor search algorithm to determine a position adjacent to the first position in the target KD tree based on the first position and the position indicated by each node in the target KD tree, as the position to which the target person moves at the next moment (recorded as the second position).

[0104] The second position may be a two-dimensional coordinate or a three-dimensional coordinate corresponding to a position in a preset map. Depending on the preset map, the second position may be represented differently. Here, the second position is not specifically limited. For ease of understanding, the following description is made by taking the preset map as a two-dimensional map as an example.

[0105] In an optional embodiment, after determining the second position, the electronic device may display an indication mark indicating the second position in a preset map. The operator corresponding to the target person may operate the target person to move from the first position to the second position according to the indication mark, thereby forming a moving route for the target person to move from the first position to the second position.

[0106] In an optional embodiment, according to the above Figure 1 The method shown in the figure, the embodiment of the present application also provides a method for determining a moving route. Figure 2 As shown, Figure 2 A second flow chart of the method for determining a moving route provided in an embodiment of the present application. Figure 2 In the method shown, the above step S101 is refined into the following steps, namely step S1011 to step S1013.

[0107] Step S1011, obtaining the current location coordinates of the target person in the preset map.

[0108] In an optional embodiment, when the target person includes one person, the position coordinates can be represented by the two-dimensional coordinates of the target person in the preset map. For ease of understanding, taking the target person as person A, the two-dimensional coordinates of the person in the preset map at the current moment is coordinate 1, then the electronic device can determine the position coordinates of the target person at the current moment as: coordinate 1.

[0109] In another optional embodiment, when the target personnel include multiple persons, such as the 7 persons corresponding to person A to person G, the position coordinates of the target personnel can be the two-dimensional coordinates of all persons in the preset map, and the feature vectors obtained by arranging them in a preset order.

[0110] For example, the position coordinates corresponding to personnel A to personnel G are coordinate 1 to coordinate 7 respectively, then the position coordinates of the above target personnel at the current moment can be expressed as: [coordinate 1, coordinate 2, coordinate 3, coordinate 4, coordinate 5, coordinate 6, coordinate 7].

[0111] In the embodiment of the present application, the location coordinates of the target person at the current moment are not specifically limited.

[0112] Step S1012, determining the target area block identifier corresponding to the position coordinates of the target person according to the correspondence between each area block and the area block identifier obtained by uniformly dividing the preset map.

[0113] In an embodiment of the present application, for the above-mentioned preset map, the electronic device can evenly divide the preset map according to the first number and the second number set in advance to obtain multiple area blocks. The first number is the number of area blocks included in each row after the preset map is evenly divided, and the second number is the number of area blocks included in each column after the preset map is evenly divided. After evenly dividing the above-mentioned preset map, the electronic device can mark each area block obtained by the division to obtain the area block identifier corresponding to each area block. That is, a corresponding relationship between the area block and the area block identifier is established.

[0114] For ease of understanding, combined Figure 3 Provide explanation. Figure 3 A schematic diagram of a preset map provided in an embodiment of the present application.

[0115] Figure 3 The size of the map shown is 10000×10000, with the horizontal axis representing the length of the map and the vertical axis representing the width of the map. The electronic device can evenly divide the preset map into blocks of 100×100 to obtain Figure 3 The 10,000 area blocks shown in FIG. 1 and the area block identifier corresponding to each area block are determined. Figure 3 The area block identifier of the first area block in the preset map shown is 1.

[0116] exist Figure 3 In the preset map shown, only the first number and the second number are both 100, and the area block identifier of each area block is marked with a number as an example for explanation. In addition, the first number and the second number can be set according to the size of the preset map, user needs, etc., and the area block identifier can also be composed of letters and numbers. Here, the representation method of the area block identifier, the first number and the second number are not specifically limited.

[0117] After determining the position coordinates of the target person, the electronic device can determine the target area block identifier corresponding to the position coordinates of the target person according to the correspondence between each area block and the area block identifier obtained by evenly dividing the preset map.

[0118] For ease of understanding, the target person's position coordinates are (240, 10), combined with the above Figure 3 Take the following as an example. According to the position coordinates (240, 10), the electronic device can determine that the area block where the position coordinates are located is Figure 3 At this time, according to the correspondence between the area blocks and the area block identifiers, the electronic device can determine that the target area block identifier corresponding to the position coordinates (240, 10) of the target person is 1.

[0119] Step S1013: Based on the target area block identifier, a second position feature vector indicating the first position of the target person at the current moment in the preset map is generated.

[0120] In the embodiment of the present application, after the electronic device determines the target area block identifier, the electronic device can generate a position feature vector (recorded as a second position feature vector) according to the target area block identifier, and use the second position feature vector as the first position of the target person at the current moment. The method for generating the second position feature vector can be referred to the description below, and will not be described in detail here.

[0121] In an optional embodiment, if the target person is a member of at least two teams, the second position feature vector includes a vector element corresponding to the current position of each member of the team.

[0122] For ease of understanding, the description is still made by taking the above-mentioned personnel A to personnel G as an example. The above-mentioned second position feature vector includes vector elements corresponding to the current position of each person among personnel A to personnel G.

[0123] In an embodiment of the present application, when the above-mentioned target person is a team member of at least two teams, the electronic device determines the position to which each person included in the target person will move at the next moment when determining the above-mentioned second position based on the first position of the target person. While ensuring the accuracy of the determined second position, the determination of the second position takes into account the positional relationship between team members in the same team and the positional relationship between team members in different teams. This allows the determined second position to adapt to the battlefield form at the current moment, that is, the determined second position is a more suitable movement route determined by combining the positions of all personnel in different teams at the current moment, thereby improving the accuracy of the determined second position and improving the matching degree between the determined movement route and the actual selection situation of the personnel.

[0124] Compared with the method of directly using the position coordinates of the target person's current location as the first position, through the above steps S1011-S1013, the electronic device can convert the position coordinates of the target person's current location, thereby simplifying the representation of the first position and reducing the amount of calculation in the subsequent second position determination process.

[0125] In an optional embodiment, according to the above Figure 2 The method shown in the figure, the embodiment of the present application also provides a method for determining a moving route. Figure 4 As shown, Figure 4 This is a schematic diagram of a third flow chart of the method for determining a mobile route provided in an embodiment of the present application. Figure 4 In the method shown, the above step S1013 is refined into the following steps, namely step S1014-step S1015.

[0126] Step S1014: Generate a third position feature vector including the target region block identifier.

[0127] In an optional embodiment, when the target person includes one person, the electronic device may generate a third position feature vector according to the target area block identifier of the target person.

[0128] For ease of understanding, the target area block identifier is 425. The third position feature vector can be expressed as:

[425] .

[0129] In another optional embodiment, when the target person includes multiple persons, the electronic device may arrange the target area block identifiers of the target persons in a preset order to generate a third position feature vector.

[0130] For ease of understanding, the target personnel are still described as personnel A-personnel G. Assuming that the target area block identifiers corresponding to personnel A-personnel G determined in step S1012 are 4234, 4555, 5564, 5578, 2561, 4000, 5111, the generated third position feature vector is expressed as [4234, 4555, 5564, 5578, 2561, 4000, 5111].

[0131] In the embodiment of the present application, there is no specific limitation on the representation method of the third position feature vector.

[0132] Step S1015, for each vector element in the third position feature vector, coordinate transformation is performed on the vector element according to the first quantity and the second quantity to obtain a second position feature vector indicating the first position of the target person at the current moment in the preset map.

[0133] The first number is the number of area blocks included in each row after the preset map is evenly divided, and the second number is the number of area blocks included in each column after the preset map is evenly divided.

[0134] In an optional embodiment, for the above step S1015, that is, for each vector element in the third position feature vector, coordinate transformation is performed on the vector element according to the first quantity and the second quantity to obtain a second position feature vector indicating the first position of the target person at the current moment in the preset map, which can be specifically expressed as:

[0135] For each vector element in the third position feature vector, the coordinates of the vector element are transformed using the following formula to obtain a second position feature vector indicating the first position of the target person at the current moment in the preset map;

[0136] ;

[0137] ;

[0138] in, for The converted horizontal axis value, is the i-th vector element in the third position eigenvector, For the remainder operation, is the first quantity, for The converted ordinate value, is the second quantity.

[0139] For ease of understanding, the coordinate transformation of the third eigenvector is described by taking the third position eigenvector [4234, 4555, 5564, 5578, 2561, 4000, 5111] and the first number and the second number being 100 as an example.

[0140] For each vector element in the third position feature vector, the electronic device can respectively use the above and The calculation formula is used to perform coordinate transformation on the vector element to obtain the horizontal coordinate value and the vertical coordinate value corresponding to the vector element, thereby generating a second position feature vector according to the horizontal coordinate value and the vertical coordinate value corresponding to each vector element.

[0141] For example, for 4234 in the third position feature vector, , , that is, the position coordinate corresponding to vector element 4234 is (34, 43). Similarly, for other vector elements in the third position feature vector, determine the position coordinate corresponding to each other element. That is, the position coordinate corresponding to vector element 4555 is (55, 46), the position coordinate corresponding to vector element 5564 is (64, 56), the position coordinate corresponding to vector element 5578 is (78, 56), the position coordinate corresponding to vector element 2561 is (61, 26), the position coordinate corresponding to vector element 4000 is (100, 40), and the position coordinate corresponding to vector element 5111 is (11, 52). At this time, the electronic device can generate a second position feature vector according to the position coordinates corresponding to each vector element, that is, the feature vector [(34, 43), (55, 46), (64, 56), (78, 56), (61, 26), (100, 40), (11, 52)].

[0142] In the embodiment of the present application, by and The calculation formula can effectively reduce the distance error between the area block identifiers in different rows and columns in the process of determining the second position using the nearest neighbor search algorithm in the later stage.

[0143] For ease of understanding, combined with the above Figure 3 The following is an example of the region block identifier 103, the region block identifier 203 and the region block identifier 101. Figure 3 It can be seen from the preset map shown that the distance between each position coordinate in the area block corresponding to the area block identifier 103 and each position coordinate in the area block corresponding to the area block identifier 101 is greater than the distance between each position coordinate in the area block corresponding to the area block identifier 103 and each position coordinate in the area block corresponding to the area block identifier 203. At this time, for the points in the area blocks corresponding to the area block identifiers 103, 203 and 101, if the area block identifiers are directly used for the nearest neighbor search, the distance between the area block identifier 101 and the area block identifier 103 must be smaller than the distance between the area block identifier 103 and the area block identifier 203, which will cause an error in the second position obtained by the nearest neighbor search, affecting the accuracy of the determined moving route. Therefore, through the above and The calculation formula can be used to perform coordinate transformation on each vector element in the third position feature vector, thereby reducing the error between the identifiers of each area block in different rows and columns and improving the accuracy of the moving route determined by the nearest neighbor search algorithm.

[0144] In addition, compared with the method of directly using the target person's current location coordinates as the first position, the above-mentioned method of using the second position feature vector as the first position can effectively reduce the amount of data of the first position, thereby reducing the amount of calculation in the subsequent second position determination process, while ensuring the accuracy of the determined second position, while improving the efficiency of determining the second position.

[0145] For ease of understanding, only 4555 in the third position feature vector is used as an example for explanation. When the horizontal coordinate value of the current position coordinate of the target person is between 55 and 56, and the vertical coordinate value is between 45-46, the determined target area block identifier is 4555, and the position coordinate obtained by performing coordinate conversion on the vector element 4555 in step S1015 is (55, 46). Compared with the four-digit position coordinates, the two-digit position coordinates have a smaller amount of data, and the amount of calculation in the later calculation is relatively small, and the calculation process is simpler, which can effectively reduce the amount of calculation in the later second position determination process and improve the efficiency of determining the second position.

[0146] In an optional embodiment, according to the above Figure 1 The method shown in the figure, the embodiment of the present application also provides a method for determining a moving route. Figure 5 As shown, Figure 5 A fourth flow chart of the method for determining a moving route provided in an embodiment of the present application. The method comprises the following steps.

[0147] Step S501, obtaining the actual movement route of each person in the plurality of groups of sample persons in a preset map.

[0148] The persons in each group of sample persons may be persons who play the game together in a preset map. The game time of different groups of sample persons may be the same or different. The sample persons may be virtual characters operated by any one or more persons. Here, the multiple groups of sample persons are not specifically limited.

[0149] The electronic device can obtain the real movement route of each person in the multiple groups of sample persons in the preset map during the game. Each real movement route includes the corresponding position coordinates of the virtual character at different times. The representation method of the position coordinates is the same as the representation method of the position coordinates of the target person at the current moment, and no specific description is given here.

[0150] Step S502: for each group of sample persons, a plurality of first position feature vectors are generated according to the position coordinates of the persons at the same time in the real movement routes of the group of sample persons.

[0151] In an optional embodiment, when each group of sample personnel includes only one person, for each group of sample personnel, the position coordinates of the person at each moment in the actual moving route of the group of sample personnel are vector elements in a first position feature vector.

[0152] In another optional embodiment, when each group of sample personnel includes only multiple persons, for each group of sample personnel, the electronic device can obtain the position coordinates corresponding to each person at the same time in the actual moving route corresponding to each person included in the group of sample personnel, thereby generating multiple first position feature vectors based on the obtained position coordinates.

[0153] For ease of understanding, each group of sample personnel includes 7 personnel such as personnel A to personnel G as shown above. The electronic device can generate a first position feature vector according to the position coordinates corresponding to the 7 personnel at each moment. There is a corresponding first position feature vector at each moment.

[0154] The number of the first position feature vectors generated is multiple, and the number of the first position vectors generated is not specifically limited here.

[0155] The method for generating the first position feature vector may refer to the method for generating the second position feature vector, and will not be described in detail here.

[0156] In an optional embodiment, the electronic device may be composed of an AIServer (i.e., a server providing a mobile route), Kafka, Hadoop, Storm, and Mongo. Among them, AIServer is a server providing a mobile route, Kafka is a high-throughput distributed publish-subscribe messaging system, Hadoop is a distributed file system, Storm is a streaming computing framework, and Mongo is a key-value database.

[0157] When each of the above-mentioned multiple groups of sample personnel plays the game, the game background (such as the above-mentioned game server) can record the real movement route of the sample personnel and send the real movement route to the AIServer. After receiving the real movement route, the AIServer can write the real movement route to Kafka. Kafka stores the written real movement route to Hadoop through the components in Storm.

[0158] AIServer can use Python (a computer programming language) script to generate multiple first position feature vectors for the real movement route stored in Hadoop through the above steps S501 and S502, and store the generated first position feature vectors in Mongo.

[0159] Step S503, constructing a KD tree according to the first position feature vector having the same target vector element to obtain a KD forest, wherein the target vector element is the vector element indicating the first position in the first position feature vector.

[0160] In this step, after generating the first position feature vector, the electronic device can obtain the first position feature vector with the same target vector element from all the generated first position feature vectors, and construct a KD tree based on the obtained first position feature vector to obtain multiple KD trees, that is, a KD forest. That is, each group of first position feature vectors with the same target vector element can construct a KD tree, and all KD trees can form a KD forest.

[0161] For ease of understanding, the target vector element is (34, 43) as an example. The electronic device can obtain the first position feature vector with the first vector element (34, 43) from all the generated first position feature vectors as a set of feature vectors. The electronic device can generate a KD tree based on the group of feature vectors. Similarly, for different target vector elements, corresponding KD trees are generated to obtain a KD forest. The construction method of each KD tree in the above KD forest can refer to the construction method of the KD tree in the relevant technology. Here, the construction method of the above KD forest is not specifically limited.

[0162] In an optional embodiment, the AIServer may extract the first position feature vector having the same element as the target vector from the Mongo, and construct a KD tree based on the extracted first position feature vector to obtain a KD forest.

[0163] In an optional embodiment, when each group of sample personnel includes multiple persons, each first position feature vector corresponding to the group of sample personnel includes a vector element indicating the position of each person. At this time, since each node in the constructed KD tree is a first position feature vector, each node in the KD tree can indicate the positions of all persons included in each group of sample personnel.

[0164] In an optional embodiment, since the target vector elements in each first position feature vector for constructing the KD tree are the same, the target vector elements of the first position feature vectors used to construct different KD trees are different, and the region block identifiers corresponding to different target vector elements are also different. Therefore, the electronic device can establish a corresponding relationship between the KD tree and the region block identifier.

[0165] In the embodiment of the present application, according to the different movement routes of each person in the sample personnel, the KD forest constructed above may include the KD tree corresponding to the area block identifier of each area block in the preset map, or the KD tree corresponding to the area block identifier of some area blocks in the preset map. Here, the number of KD trees included in the above KD forest is not specifically limited.

[0166] Through the above steps S501-S503, a KD forest can be constructed according to the actual movement routes corresponding to each person in multiple groups of sample personnel, so that the nodes included in each KD tree in the KD forest are the actual position coordinates generated by the person's movement process in the preset map, so that the electronic device can determine the second position to which the target person will move at the next moment according to the KD tree in the KD forest, ensuring the matching of the determined second position and the person's actual choice.

[0167] Step S504, obtaining the first position of the target person at the current moment in the preset map.

[0168] Step S505, in the pre-constructed KD forest, determine the target KD tree that matches the first position, the KD forest includes multiple KD trees, and the nodes in each KD tree are determined based on the actual movement routes corresponding to each person in multiple groups of sample personnel in the preset map.

[0169] Step S506: Based on the first position, a nearest neighbor search algorithm is used to determine in the target KD tree a second position to which the target person moves at the next moment.

[0170] The above steps S504 to S506 are the same as the above steps S101 to S103.

[0171] In an optional embodiment, according to the above Figure 1 The method shown in the figure, the embodiment of the present application also provides a method for determining a moving route. Figure 6 As shown, Figure 6 A fifth flow chart of the method for determining a moving route provided in an embodiment of the present application. Figure 6 In the method shown, the above step S103 is refined into the following steps, namely step S1031-step S1032.

[0172] Step S1031, using a nearest neighbor search algorithm, determining a preset number of fourth positions that are closest to the first position in the target KD tree.

[0173] In this step, the electronic device can use a nearest neighbor search algorithm to calculate a preset number of nodes in the KD tree that are closest to the first position, and determine the positions indicated by the preset number of nodes as a preset number of fourth positions that are closest to the first position.

[0174] For ease of understanding, an example is given in which the first position feature vector corresponding to each node in the target KD tree is a two-dimensional coordinate.

[0175] For each node in the target KD tree, the electronic device may use the nearest neighbor search algorithm to search for a preset number of nodes that are closest to the second position feature vector indicating the first position.

[0176] In an optional embodiment, the electronic device may use the following formula to calculate the distance between the second position feature vector indicating the first position and the node.

[0177] ;

[0178] in, is the horizontal coordinate value of the first position feature vector corresponding to the node, is the horizontal coordinate value in the second position feature vector, is the ordinate value of the first position feature vector corresponding to the node, is the ordinate value in the second position feature vector.

[0179] In the above node search process, since the nearest neighbor search algorithm is used, it is not necessary to perform distance calculation for each node in the target KD tree, which effectively reduces the time complexity of node search. The process of searching a preset number of nodes using the nearest neighbor search algorithm can refer to the use process of the nearest neighbor search algorithm in the relevant technology, which will not be described in detail here.

[0180] After finding a preset number of nodes in the target KD tree, the electronic device can determine the position corresponding to each node (recorded as the fourth position) based on the position coordinates corresponding to the first position feature vector corresponding to each node in the actual moving route.

[0181] The above preset number can be set according to the number of nodes included in the target KD tree and user needs, etc. Here, the above preset number is not specifically limited.

[0182] Step S1032: randomly select a fourth position from a preset number of fourth positions as the second position to which the target person moves next moment.

[0183] Through the above steps S1031-S1032, the electronic device can randomly select a fourth position from a preset number of fourth positions as the position to which the target person moves next moment, thereby increasing the selectivity of the second position, improving the diversity and flexibility of determining the second position, and thus improving the diversity and flexibility of the determined movement route.

[0184] In an optional embodiment, according to the above Figure 1 The method shown in the figure, the embodiment of the present application also provides a method for determining a moving route. Figure 7 As shown, Figure 7 The sixth flow chart of the method for determining a moving route provided in the embodiment of the present application is as follows. Figure 6 In the method shown, the above step S102 is refined into the following steps, namely step S1021.

[0185] Step S1021: According to the pre-established correspondence between the KD tree and the region block identifier, the KD tree whose region block identifier matches the first position is determined as the target KD tree.

[0186] The matching between the region block identifier and the first position may be represented as follows: the first position is in the region block corresponding to the region block identifier, or the distance between the region block corresponding to the region block identifier and the first position is the smallest.

[0187] In the embodiment of the present application, since each KD tree is generated based on the first position feature vector with the same target vector element when constructing the above-mentioned KD forest, the target vector elements corresponding to each KD tree are different. That is, the region blocks indicated by the target vector elements corresponding to each KD tree are different. The electronic device can establish a corresponding relationship between each KD tree and the region block identifier based on the target vector elements corresponding to each KD tree and the corresponding relationship between each region block and the region block identifier.

[0188] In an optional embodiment, if in the correspondence between the above-mentioned first KD tree and the area block identifier, there is a KD tree corresponding to the area block identifier corresponding to each area block included in the preset map, the electronic device can determine the KD tree corresponding to the target area block identifier corresponding to the area block where the first position is located as the target KD tree based on the correspondence between the first KD tree and the area block identifier.

[0189] In another optional embodiment, if in the correspondence between the above-mentioned first KD tree and the area block identifier, not every area block included in the preset map corresponds to an area block identifier that has a corresponding KD tree, the electronic device can determine, based on the correspondence between the first KD tree and the area block identifier, the KD tree corresponding to the area block identifier having the smallest distance between the area block corresponding to the area block identifier and the area block where the first position is located as the target KD tree.

[0190] The distance between the area block corresponding to the area block identifier and the area block where the first position is located can be calculated by using the area block identifier to convert the coordinates into the two-dimensional coordinates. The calculation method can refer to the above The calculation formula is not explained in detail here.

[0191] Through the above step S1021, the electronic device can determine the target KD tree from the multiple KD trees included in the KD forest according to the correspondence between each KD tree and the area block identifier, thereby reducing the time complexity of determining the target KD tree and improving the efficiency of determining the target KD tree.

[0192] Based on the same inventive concept, according to the mobile route determination method provided in the above embodiment of the present application, the embodiment of the present application also provides a mobile route determination device. Figure 8 As shown, Figure 8 A schematic diagram of a structure of a mobile route determination device provided in an embodiment of the present application. The device includes the following modules.

[0193] The first acquisition module 801 is used to acquire the first position of the target person at the current moment in the preset map;

[0194] A first determination module 802 is used to determine a target KD tree matching the first position in a pre-constructed KD forest, wherein the KD forest includes a plurality of KD trees, and a node in each KD tree is determined according to a real movement route corresponding to each person in a plurality of groups of sample persons in a preset map;

[0195] The second determination module 803 is used to determine, based on the first position, a second position to which the target person moves at the next moment in the target KD tree by using a nearest neighbor search algorithm.

[0196] Optionally, the above-mentioned moving route determination device may further include:

[0197] The second acquisition module is used to obtain the actual movement route of each person in the multiple groups of sample persons in the preset map;

[0198] A generating module, for generating, for each group of sample personnel, a plurality of first position feature vectors according to the position coordinates of the personnel at the same time in the real moving routes of the group of sample personnel;

[0199] The construction module is used to construct a KD tree according to the first position feature vector with the same target vector element to obtain a KD forest, and the target vector element is the vector element indicating the first position in the first position feature vector.

[0200] Optionally, the first acquisition module 801 includes:

[0201] The first acquisition submodule is used to obtain the current position coordinates of the target person in the preset map as the first position of the target person;

[0202] Alternatively, the first acquisition module 801 includes:

[0203] The second acquisition submodule is used to obtain the current location coordinates of the target person in the preset map;

[0204] A determination submodule is used to determine the target area block identifier corresponding to the position coordinates of the target person according to the correspondence between each area block and the area block identifier obtained by uniform segmentation of the preset map;

[0205] The generating submodule is used to generate a second position feature vector indicating the first position of the target person at the current moment in the preset map based on the target area block identifier.

[0206] Optionally, the above-mentioned generating submodule may be specifically used to generate a third position feature vector including a target area block identifier;

[0207] For each vector element in the third position feature vector, the coordinates of the vector element are transformed according to the first quantity and the second quantity to obtain a second position feature vector indicating the first position of the target person at the current moment in the preset map; wherein the first quantity is the number of area blocks included in each row after the preset map is evenly divided, and the second quantity is the number of area blocks included in each column after the preset map is evenly divided.

[0208] Optionally, the above-mentioned generating submodule may be specifically used to perform coordinate transformation on each vector element in the third position feature vector using the following formula to obtain a second position feature vector indicating the first position of the target person at the current moment in the preset map;

[0209] ;

[0210] ;

[0211] in, for The converted horizontal axis value, is the i-th vector element in the third position eigenvector, For the remainder operation, is the first quantity, for The converted ordinate value, is the second quantity.

[0212] Optionally, if the target person is a team member of at least two teams, the second position feature vector includes a vector element indicating a corresponding current position of each team member.

[0213] Optionally, the second determination module 803 may be specifically configured to determine a preset number of fourth positions that are closest to the first position in the target KD tree by using a nearest neighbor search algorithm;

[0214] A fourth position is randomly selected from a preset number of fourth positions as the second position to which the target person moves next moment.

[0215] Optionally, the first determination module 802 may be specifically configured to determine the KD tree whose region block identifier matches the first position as the target KD tree according to a pre-established correspondence between the KD tree and the region block identifier; wherein the region block identifier matches the first position as follows: the first position is in the region block corresponding to the region block identifier, or the distance between the region block corresponding to the region block identifier and the first position is the smallest.

[0216] Through the device provided in the embodiment of the present application, multiple KD trees can be generated in advance according to the actual movement routes of multiple groups of sample personnel in a preset map to obtain a KD forest. After obtaining the first position of the target person at the current moment in the preset map, a target KD tree matching the first position is determined in the KD forest. Based on the first position, a nearest neighbor search algorithm is used to determine the second position to which the target person will move at the next moment in the target KD tree.

[0217] Compared with the related art, the moving routes in the KD tree generated according to the actual moving routes of the sample personnel in the preset map, each moving route is determined according to the actual moving route of the personnel. Therefore, the moving route from the first position to the second position determined based on the actual moving route matches the actual situation during the personnel movement process, so that the determined moving route is no longer relatively fixed, which is in line with the actual choice of the natural person.

[0218] In addition, since the determined movement route is determined based on the actual movement route of the person, for the same position in the preset map, the actual movement route formed according to the different choices of the person will also be different, which makes the second position determined based on the first position have multiple possibilities, thereby improving the diversity and flexibility of the determined movement route.

[0219] Based on the same inventive concept, according to the method for determining a moving route provided in the above-mentioned embodiment of the present application, the embodiment of the present application also provides an electronic device, such as Fig. 9 As shown, it includes a processor 901, a communication interface 902, a memory 903 and a communication bus 904, wherein the processor 901, the communication interface 902, and the memory 903 communicate with each other through the communication bus 904.

[0220] Memory 903, used for storing computer programs;

[0221] The processor 901 is used to execute the program stored in the memory 903 to implement the following steps:

[0222] Get the first position of the target person at the current moment in the preset map;

[0223] In a pre-constructed KD forest, a target KD tree matching the first position is determined, wherein the KD forest includes a plurality of KD trees, and a node in each KD tree is determined according to a real moving route corresponding to each person in a plurality of groups of sample persons in a preset map;

[0224] Based on the first position, a nearest neighbor search algorithm is used to determine the second position to which the target person moves at the next moment in the target KD tree.

[0225] Through the electronic device provided in the embodiment of the present application, multiple KD trees can be generated in advance according to the actual movement routes of multiple groups of sample personnel in a preset map to obtain a KD forest. After obtaining the first position of the target person at the current moment in the preset map, a target KD tree matching the first position is determined in the KD forest. Based on the first position, a nearest neighbor search algorithm is used to determine the second position to which the target person will move at the next moment in the target KD tree.

[0226] Compared with the related art, the moving routes in the KD tree generated according to the actual moving routes of the sample personnel in the preset map, each moving route is determined according to the actual moving route of the personnel. Therefore, the moving route from the first position to the second position determined based on the actual moving route matches the actual situation during the personnel movement process, so that the determined moving route is no longer relatively fixed, which is in line with the actual choice of the natural person.

[0227] In addition, since the determined movement route is determined based on the actual movement route of the person, for the same position in the preset map, the actual movement route formed according to the different choices of the person will also be different, which makes the second position determined based on the first position have multiple possibilities, thereby improving the diversity and flexibility of the determined movement route.

[0228] The communication bus mentioned in the above electronic device can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.

[0229] The communication interface is used for communication between the above electronic device and other devices.

[0230] The memory may include a random access memory (RAM) or a non-volatile memory (NVM), such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.

[0231] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0232] Based on the same inventive concept, according to the mobile route determination method provided in the above-mentioned embodiments of the present application, the embodiments of the present application also provide a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the steps of any of the above-mentioned mobile route determination methods are implemented.

[0233] Based on the same inventive concept, according to the mobile route determination method provided in the above-mentioned embodiments of the present application, the embodiments of the present application also provide a computer program product containing instructions, which, when executed on a computer, enables the computer to execute any mobile route determination method in the above-mentioned embodiments.

[0234] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from a website site, a computer, a server or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or a data center that includes one or more available media integrated. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive Solid State Disk (SSD)), etc.

[0235] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0236] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for embodiments such as devices, electronic devices, computer-readable storage media, and computer program products, since they are basically similar to method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiments.

[0237] The above description is only a preferred embodiment of the present application and is not intended to limit the protection scope of the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application are included in the protection scope of the present application.

Claims

1. A method for determining a moving route, characterized in that: The method comprises: Get the first position of the target person at the current moment in the preset map; Determine a target KD tree matching the first position in a pre-constructed K-dimensional KD forest, wherein the KD forest includes a plurality of KD trees, and a node in each KD tree is determined according to a real movement route corresponding to each person in a plurality of groups of sample persons in the preset map; Based on the first position, a nearest neighbor search algorithm is used to determine in the target KD tree a second position to which the target person moves at the next moment.

2. The method according to claim 1, characterized in that The method further comprises: Obtaining the actual movement route of each person in the plurality of groups of sample persons in the preset map; For each group of sample personnel, a plurality of first position feature vectors are generated according to the position coordinates of the personnel at the same time in the real movement routes of the group of sample personnel; A KD tree is constructed according to a first position feature vector having the same target vector element to obtain a KD forest, wherein the target vector element is a vector element indicating a first position in the first position feature vector.

3. The method according to claim 1, characterized in that The step of obtaining the first position of the target person at the current moment in the preset map includes: Obtaining the current position coordinates of the target person in the preset map as the first position of the target person; or, Get the current location coordinates of the target person in the preset map; Determine the target area block identifier corresponding to the position coordinates of the target person according to the correspondence between each area block obtained by evenly dividing the preset map and the area block identifier; Based on the target area block identifier, a second position feature vector indicating the first position of the target person at the current moment in the preset map is generated.

4. The method according to claim 3, characterized in that The step of generating a second position feature vector indicating the first position of the target person at the current moment in the preset map based on the target area block identifier includes: generating a third position feature vector including the target area block identifier; For each vector element in the third position feature vector, the coordinates of the vector element are transformed according to the first quantity and the second quantity to obtain a second position feature vector indicating the first position of the target person at the current moment in the preset map; wherein the first quantity is the number of area blocks included in each row after the preset map is evenly divided, and the second quantity is the number of area blocks included in each column after the preset map is evenly divided.

5. The method according to claim 4, characterized in that The step of performing coordinate conversion on each vector element in the third position feature vector according to the first quantity and the second quantity to obtain a second position feature vector indicating the first position of the target person at the current moment in the preset map comprises: For each vector element in the third position feature vector, coordinate transformation is performed on the vector element using the following formula to obtain a second position feature vector indicating the first position of the target person at the current moment in the preset map; ; ; in, for The converted horizontal axis value, is the i-th vector element in the third position feature vector, For the remainder operation, is the first quantity, for The converted ordinate value, is the second number.

6. The method according to claim 3 or 4, characterized in that: If the target person is a member of at least two teams, the second position feature vector includes a vector element indicating the current position of each member of the team.

7. The method according to claim 1, characterized in that The step of determining, based on the first position, in the target KD tree using a nearest neighbor search algorithm, a second position to which the target person moves at the next moment comprises: Determine, by using a nearest neighbor search algorithm, a preset number of fourth positions that are closest to the first position in the target KD tree; A fourth position is randomly selected from the preset number of fourth positions as the second position to which the target person moves next moment.

8. The method according to claim 1, characterized in that The step of determining a target KD tree matching the first position in a pre-constructed KD forest, wherein the KD forest includes a plurality of KD trees, comprises: According to a pre-established correspondence relationship between a KD tree and a region block identifier, determining a KD tree whose region block identifier matches the first position as a target KD tree; The matching between the region block identifier and the first position is represented by: the first position is in the region block corresponding to the region block identifier, or the distance between the region block corresponding to the region block identifier and the first position is the smallest.

9. A moving route determination device, characterized in that: The device comprises: A first acquisition module is used to acquire the first position of the target person at the current moment in the preset map; A first determination module is used to determine a target KD tree matching the first position in a pre-constructed K-dimensional KD forest, wherein the KD forest includes a plurality of KD trees, and a node in each KD tree is determined according to a real movement route corresponding to each person in a plurality of groups of sample persons in the preset map; The second determination module is used to determine, based on the first position and using a nearest neighbor search algorithm, a second position to which the target person moves at the next moment in the target KD tree.

10. The device according to claim 9, characterized in that The device also includes: A second acquisition module is used to obtain the actual movement route of each person in the plurality of groups of sample persons in the preset map; A generating module, for generating, for each group of sample personnel, a plurality of first position feature vectors according to the position coordinates of the personnel at the same time in the real moving routes of the group of sample personnel; A construction module is used to construct a KD tree according to a first position feature vector with the same target vector element to obtain a KD forest, wherein the target vector element is a vector element indicating a first position in the first position feature vector.

11. The device according to claim 9, characterized in that The first acquisition module includes: A first acquisition submodule is used to acquire the position coordinates of the target person at the current moment in the preset map as the first position of the target person; Alternatively, the first acquisition module includes: The second acquisition submodule is used to obtain the current location coordinates of the target person in the preset map; A determination submodule, configured to determine the target area block identifier corresponding to the position coordinates of the target person according to the correspondence between each area block and the area block identifier obtained by evenly dividing the preset map; A generating submodule is used to generate a second position feature vector indicating the first position of the target person at the current moment in the preset map based on the target area block identifier.

12. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, for implementing the method steps described in any one of claims 1 to 8 when executing a program stored in a memory.

13. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method steps described in any one of claims 1 to 8 are implemented.