Operation control method and device, storage medium and electronic device
By pre-stored graph models in each state of the map, only one corresponding graph model is stored for each instance, which solves the storage and running burden problems caused by the excessive number of graph models in the copy connectivity detection method, and achieves more efficient resources. use.
Patent Information
- Application Number
- CN202010623237.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-06-30
- Publication Date
- 2024-09-27
- Estimated Expiration
- 2040-06-30
AI Technical Summary
In the existing technology, the replica connectivity detection method needs to retain a large number of graph models, resulting in excessive storage and operation burden on the server.
By pre-stored graph models in each state of the map, only one corresponding graph model is stored for each instance, which is used for connectivity detection and reduces the number of retained graph models.
It reduces the amount of data stored on the server, reduces the operating burden on the server, and improves resource utilization.
Smart Images

Figure CN111840998B
Abstract
Description
Technical Field
[0001] The present application relates to the field of the Internet, and more specifically, to an operation control method and device, a storage medium, and an electronic device. Background Art
[0002] Currently, when performing operations (e.g., pathfinding, skill release) on different points in a map (e.g., a game map), the operations cannot be performed due to collision bodies, disconnected locations, etc. In addition, it takes a long time to determine that the operation cannot be performed, and the determination operation is complicated.
[0003] For example, if point A on the map cannot find a path to point B, in order to determine that it is unconnected, all expandable points on the map need to be expanded, resulting in an explosion of the search space (all expandable points on the map need to be searched).
[0004] Therefore, before performing operations on different points on the map, connectivity checks can be performed. The scenes in some maps will change dynamically. For example, a collision body suddenly appears or disappears on the map. The dynamic changes in the scene will bring additional connectivity changes to the map.
[0005] For the above-mentioned dynamically changing scenarios, dynamic graph connectivity determination can be performed. In the related art, all associated edges of dynamically changing nodes are deleted in the connectivity graph model of the map, and connectivity detection is performed by dynamically maintaining a spanning tree (e.g., Euler-Tour Tree).
[0006] However, a replica generally has multiple instances, and each instance has a different state at runtime. If the current state of the graph model is retained for each instance, too many graph models need to be retained, which greatly increases the storage and operation burden of the server.
[0007] Therefore, the replica connectivity detection method in the related art has the problem of excessive storage and operation burden on the server due to the excessive number of graph models that need to be retained. Summary of the invention
[0008] The embodiments of the present application provide an operation control method and device, a storage medium and an electronic device to at least solve the problem in the related art that the storage and operation burden of the server is too heavy due to the excessive number of graph models that need to be retained in the replica connectivity detection method.
[0009] According to one aspect of an embodiment of the present application, an operation control method is provided, including: obtaining a first operation request of a target object, wherein the first operation request is used to request to perform a first operation between a first node and a second node of a target map, and the target object is used to trigger the target map to switch between multiple states by performing a target operation on the target map; in response to the first operation request, obtaining a first graph model corresponding to the first state of the target map from multiple graph models, wherein the multiple states correspond one-to-one to the multiple graph models, and each of the multiple graph models is used to perform connectivity detection between multiple nodes of the target map; in a case where connectivity between the first node and the second node is detected according to the first graph model, controlling the execution of the first operation between the first node and the second node.
[0010] According to another aspect of an embodiment of the present application, an operation control device is provided, including: a first acquisition unit, used to acquire a first operation request of a target object, wherein the first operation request is used to request to perform a first operation between a first node and a second node of a target map, and the target object is used to trigger the target map to switch between multiple states by performing a target operation on the target map; a second acquisition unit, used to respond to the first operation request, and acquire a first graph model corresponding to the first state of the target map from multiple graph models, wherein the multiple states correspond one-to-one to the multiple graph models, and each of the multiple graph models is used to perform connectivity detection between multiple nodes of the target map; a first control unit, used to control the execution of the first operation between the first node and the second node when connectivity is detected between the first node and the second node according to the first graph model.
[0011] According to another aspect of the embodiments of the present application, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when run.
[0012] According to another aspect of the embodiments of the present application, an electronic device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0013] In an embodiment of the present application, a method of pre-storing graph models of maps in various states is adopted, by obtaining a first operation request of a target object, wherein the first operation request is used to request to perform a first operation between a first node and a second node of a target map, and the target object is used to trigger the target map to switch between multiple states by performing a target operation on the target map; in response to the first operation request, a first graph model corresponding to the first state of the target map is obtained from multiple graph models, wherein the multiple states correspond one-to-one to the multiple graph models, and each of the multiple graph models is used to perform connectivity detection between multiple nodes of the target map; after the first node is detected according to the first graph model, When connected with the second node, the control executes the first operation between the first node and the second node. Since the graph models under various states of the map are pre-calculated and stored, the graph model can be used to perform connectivity detection under various states of the map. Since each instance of the replica can correspond to a graph model at a time, there is no need to retain the graph model of each instance, which can achieve the purpose of reducing the number of retained graph models, thereby achieving the technical effect of reducing the amount of data stored in the server and alleviating the operating burden of the server, thereby solving the problem of excessive storage and operating burden on the server caused by too many graph models that need to be retained in the replica connectivity detection method in the related technology. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0015] Figure 1 is a schematic diagram of a hardware environment of an operation control method according to an embodiment of the present application;
[0016] Figure 2 is a flow chart of an optional operation control method according to an embodiment of the present application;
[0017] Figure 3 is a schematic diagram of an optional operation control method according to an embodiment of the present application;
[0018] Figure 4 is a schematic diagram of another optional operation control method according to an embodiment of the present application;
[0019] Figure 5 is a schematic diagram of another optional operation control method according to an embodiment of the present application;
[0020] Figure 6 is a schematic diagram of another optional operation control method according to an embodiment of the present application;
[0021] Figure 7is a flowchart of another optional operation control method according to an embodiment of the present application;
[0022] Figure 8 is a schematic diagram of an optional operation control device according to an embodiment of the present application;
[0023] Fig. 9 It is a structural block diagram of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0024] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.
[0025] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0026] According to one aspect of the embodiments of the present application, a method embodiment of an operation control method is provided. Optionally, in this embodiment, the above operation control method can be applied to Figure 1 In the hardware environment composed of the terminal 101 and the server 103 shown in FIG. Figure 1As shown, the server 102 is connected to the terminal 101 through a network, and can be used to provide services (such as game services, application services, etc.) for the terminal or the client installed on the terminal. A database 105 can be set on the server or independently of the server to provide data storage services for the server 103. The above network includes but is not limited to: a wide area network, a metropolitan area network or a local area network. The terminal 101 is not limited to a PC (Personal Computer), a mobile phone, a tablet computer, etc. The operation control method of the embodiment of the present application can be executed by the server 103, or by the terminal 101, or by the server 103 and the terminal 101. Among them, the terminal 101 executes the operation control method of the embodiment of the present application, which can also be executed by the client installed thereon.
[0027] Optionally, an operation control method is provided in an embodiment of the present application. Figure 2 is a flow chart of an optional operation control method according to an embodiment of the present application, such as Figure 2 As shown, the method may include the following steps:
[0028] Step S202, obtaining a first operation request of a target object, wherein the first operation request is used to request to perform a first operation between a first node and a second node of a target map, and the target object is used to trigger the target map to switch between multiple states by performing a target operation on the target map;
[0029] Step S204, in response to the first operation request, obtaining a first graph model corresponding to a first state of the target map from the multiple graph models, wherein the multiple states correspond one-to-one to the multiple graph models, and each of the multiple graph models is used to perform connectivity detection between multiple nodes of the target map;
[0030] Step S206 , when it is detected according to the first graph model that the first node is connected to the second node, control execution of a first operation between the first node and the second node.
[0031] Through the above steps S202 to S206, a first operation request of the target object is obtained, wherein the first operation request is used to request to perform a first operation between the first node and the second node of the target map, and the target object is used to trigger the target map to switch between multiple states by performing the target operation on the target map; in response to the first operation request, a first graph model corresponding to the first state of the target map is obtained from multiple graph models, wherein the multiple states correspond one-to-one to the multiple graph models, and each of the multiple graph models is used to perform connectivity detection between multiple nodes of the target map; when connectivity between the first node and the second node is detected according to the first graph model, the first operation is controlled to be executed between the first node and the second node, thereby solving the problem in the related art that the copy connectivity detection method has excessive storage and operation burden on the server due to the excessive number of graph models that need to be retained, thereby reducing the amount of data stored in the server and alleviating the server operation burden.
[0032] In the technical solution provided in step S202, a first operation request of the target object is obtained, wherein the first operation request is used to request to perform a first operation between a first node and a second node of the target map, and the target object is used to trigger the target map to switch between multiple states by performing a target operation on the target map.
[0033] The operation control method in this embodiment can be applied to a scene of controlling a virtual object to perform an operation in a map, and the map can be a game map, or other maps (e.g., a shopping map, etc.). In this embodiment, the target map is described by taking a game map (e.g., a dungeon map) as an example.
[0034] The target map may include map units, which may be the smallest unit of map division, and each map unit may be a polygon. The polygon may be a polygon of regular shape, for example, for a grid map, the map unit of the grid map is a grid in the map, and the grid is a regular quadrilateral; the polygon may also be a polygon of irregular shape, for example, for a navigation map, the map unit of the navigation map is a navigation grid in the map, and the navigation grid is an irregular polygon. In this embodiment, the target map is described by taking a navigation map as an example.
[0035] The game map may be a map in a target game, and the target game may include but is not limited to an MMO game. A user of the target game may use a client of the target game running on his terminal device to log in to the target game through an account to control the interaction between the client and the server of the target game. The same account may control a virtual character in the target game, or may control multiple virtual characters in the target game at the same time. In this embodiment, controlling a virtual character is used as an example for explanation.
[0036] The target user can use the target account to log in to the target client to start the target game. The virtual character controlled by the target user is the target object. In the process of operating the target object to perform operations in the game map, the terminal device can detect the operation performed by the target user on the target client, and generate an operation request based on the detected operation, for example, a first operation request, the first operation request is used to request to perform a first operation between the first node and the second node of the target map, and the first operation may include but is not limited to one of the following: moving operation (pathfinding operation), skill release operation.
[0037] For a move operation, the first node corresponds to the starting point of the move (e.g., the navigation grid where the starting point is located), and the second node corresponds to the end point of the move (e.g., the navigation grid where the end point is located). For a skill release operation, the first node corresponds to the starting point of the skill release operation, and the second node corresponds to the end point of the skill release operation, or the middle point of the skill release operation (a point between the starting point and the end point).
[0038] For example, for pathfinding, the found path is not fixed and will be affected by dynamic scene changes. It is necessary to calculate the connectivity in real time before pathfinding. In addition, it is necessary not only to detect the connectivity of pathfinding, but also to detect the connectivity of skill trajectories to ensure the integrity of skill release.
[0039] In order to adapt to the dynamic changes of the scene, you can add air walls to the map (such as Figure 3 As shown in the figure, the air wall ID is recorded in the polygon (navigation grid) of the map, and the air wall navigation area is filtered through the filter. The air wall is a simple and effective way to dynamically change the instance, but it will bring additional connectivity changes.
[0040] The target map may have multiple states, and the settings of the multiple states may correspond to known changes of the target map, and the changes may correspond to the opening and closing of air walls on the map.
[0041] For example, for a dungeon map, before killing the first BOSS, the first air wall is opened, and the second and third air walls are closed. After killing the first BOSS, the second air wall is opened, and the first and third air walls are closed. After killing the second BOSS, the third air wall is opened, and the first and second air walls are closed.
[0042] The opening or closing of the air wall associated with the node in the above map may correspond to multiple states of the target map, and the target object may be used to trigger the target map to switch between multiple states by performing a target operation on the target map.
[0043] In the technical solution provided in step S204, in response to the first operation request, a first graph model corresponding to the first state of the target map is obtained from multiple graph models, wherein the multiple states correspond one-to-one to the multiple graph models, and each of the multiple graph models is used to perform connectivity detection between multiple nodes of the target map.
[0044] The multiple states of the target map correspond one-to-one to the multiple graph models, and each of the multiple graph models may be a connectivity detection model of the map, which is used to perform connectivity detection between multiple nodes of the target map.
[0045] In response to the first operation request, the server may first determine the current state of the target map, for example, the first state, and match a first graph model corresponding to the first state from multiple graph models according to the state identifier of the first state.
[0046] Different objects may correspond to different instances of the target map, and the state of each instance is different. For example, for a map copy, the progress of different players is different, and it is impossible to retain the current state graph model for each instance.
[0047] By precalculating the connectivity in each state according to the replica process, a connectivity detection model in each state is obtained. Based on the connectivity detection model in each state, resources can be reused to improve resource utilization.
[0048] In the technical solution provided in step S206, when it is detected that the first node is connected to the second node according to the first graph model, the first operation is controlled to be performed between the first node and the second node.
[0049] If connectivity between the first node and the second node is detected according to the first graph model (the connectivity may be connectivity in any direction or connectivity in a certain direction), the server may control the first node and the second node to perform a first operation.
[0050] For example, if the first operation request is a path-finding request (movement request), a path between the first node and the second node may be found for the target object, and the target object may be controlled to move from the first node to the second node according to the found path.
[0051] For another example, if the first operation request is a skill release request, and it has been determined that the skill trajectory is connected, the target object can be controlled to release the skill along the direction of the first node and the second node (skill trajectory).
[0052] As an optional embodiment, before acquiring the first graph model corresponding to the first state of the target map from the multiple graph models, the method further includes:
[0053] S11, obtaining an initial graph model corresponding to a first state of the target map, wherein nodes of the initial graph model correspond one-to-one to nodes of the target map;
[0054] S12, identifying strongly connected components in the initial graph model, wherein the strongly connected components include multiple connected nodes in the initial graph model that are interconnected, or are interconnected and exist or disappear at the same time;
[0055] S13, shrinking the initial graph model using the strongly connected component to obtain a first graph model, wherein the strongly connected component is shrunk into a node in the first graph model.
[0056] When performing connectivity detection, static connectivity detection of undirected graphs can be performed by dividing connected blocks. For dynamic connectivity detection, different methods can be used to perform client connectivity detection and server connectivity detection.
[0057] Client-side pathfinding can focus on the big world (big world real-time combat game). Two unconnected areas in the big world can be connected by a portal. The above portal can be one-way or two-way. Pathfinding requires the ability to identify the portal, for example, through offMeshLink to identify the portal.
[0058] offMeshLink can break through the geometric restrictions in the map and forcibly connect two polygons without common edges. Common scenarios can be: cliff jump points (such as Figure 4 ), offMeshLink is essentially a convex polygon with only two vertices (a line segment, such as Figure 5 ), connect an undirected edge from one polygon to the line segment, and then connect an edge from the line segment to the other polygon.
[0059] If there is a one-way portal from point A to point B, then point A can be connected to B, but point B cannot be connected to A.
[0060] After obtaining the initial graph model corresponding to each state of the target map, if there are unidirectional edges in the initial graph model, the strongly connected component (a set of navigation grids) can be used to shrink the points to reduce the number of navigation grids. A strongly connected component is a maximum node subset of a directed graph, in which each node can reach other nodes, that is, they are interconnected.
[0061] The strongly connected component algorithm may include but is not limited to: Tarjan algorithm, which performs a timestamp operation on the search tree generated by DFS (Depth First Search). The same strongly connected component can be shrunk into a point, re-graphed (reconstructed the initial graph model), and finally a DAG (Directed Acyclic Graph) can be obtained. For the first state, the first graph model is finally obtained.
[0062] For the server side, connectivity detection is generally required regardless of whether there is a dynamic change. The connectivity detection method in this embodiment can be applicable to the scene of dynamic change.
[0063] Since the server does not need to consider portals, it can be considered an undirected graph. For ordinary large worlds, the server can complete the detection of connected blocks using a simple detection method. For dungeon maps with dynamically changing scenes, some polygons can be removed from the graph to detect the connectivity of a dynamic undirected graph.
[0064] On the server side, the initial graph (initial graph model) can also be simplified by shrinking the points. The shrinking point condition can be connectivity and the same Area value, that is, the nodes must appear and disappear at the same time. The simplification process is similar to the above and will not be repeated here.
[0065] In a map, an Area represents a terrain area on the map. A convex polygon contains only one type of Area (for example, Figure 6 As shown in the figure). The Filter configures the weight (calculation of path finding dissipation) and feasibility of each Area as path finding parameters. When path finding, Area can be filtered according to the Filter, and the Filter data can be changed dynamically at runtime.
[0066] Through this embodiment, by using strong connectivity vectors to shrink points, the number of navigation grids can be reduced, the scale of the graph model can be reduced, and the connectivity detection efficiency can be improved.
[0067] As an optional embodiment, after acquiring the first graph model corresponding to the first state of the target map from the multiple graph models, the method further includes:
[0068] S21, determining a first target node corresponding to the first node in the first graph model, wherein the first target node corresponds to a first node set in the target map, and each node in the first node set is interconnected, or is interconnected and exists or disappears at the same time;
[0069] S22, determining a second target node corresponding to the second node in the first graph model, wherein the second target node corresponds to a second node set in the target map, and each node in the second node set is interconnected, or is interconnected and exists or disappears at the same time;
[0070] S23, when the first target node and the second target node are connected on the first graph model, determine that the first node and the second node are connected.
[0071] After acquiring a first graph model corresponding to a first state of the target map from a plurality of graph models, the first graph model may be used to perform connectivity detection between the first node and the second node.
[0072] The first node may correspond to a first node set in the target map (a strongly connected component), and the nodes in the first node set may be interconnected (corresponding to the connectivity detection scenario of the client), and the nodes in the first node set may also be interconnected and exist or disappear at the same time (corresponding to the connectivity detection scenario of the server).
[0073] The second node may correspond to a second node set in the target map (a strongly connected component), and each node in the second node set may be interconnected (corresponding to the connectivity detection scenario of the client), or each node in the second node set may be interconnected and exist or disappear at the same time (corresponding to the connectivity detection scenario of the server).
[0074] If the first target node and the second target node are connected on the first graph model, it can be determined that each node in the first node set is connected to each node in the second node set, and therefore, it can be determined that the first node and the second node are connected; otherwise, it is determined that the first node and the second node are not connected.
[0075] Through this embodiment, the connectivity of nodes in the map (which may correspond to the navigation grid) is determined by the connectivity of corresponding nodes in the graph model, which can improve the efficiency of connectivity detection.
[0076] As an optional embodiment, after determining the second target node corresponding to the second node in the first graph model, the method further includes:
[0077] S31, traverse the first graph model, and detect the connectivity between the first target node and the second target node.
[0078] In the first graph model, closure transfer can be performed through the Floyd algorithm to obtain the overall connectivity detection, or the connectivity between the first target node and the second target node can be detected by traversing the first graph model.
[0079] In the DAG graph obtained by shrinking the points, all edges are portals, and portals are generally deployed manually. Therefore, the number of edges on the DAG graph is controllable, and the search depth of the DAG graph is controllable. The number of nodes in the DAG graph is generally still in the order of 10^4. The spatial complexity of using the Floyd algorithm for connectivity detection is too high. The DAG graph can be traversed directly to reduce the complexity of connectivity detection.
[0080] Through this embodiment, by traversing the graph model to perform connectivity detection, the complexity of connectivity detection can be reduced and the efficiency of connectivity detection can be improved.
[0081] As an optional embodiment, after acquiring the first graph model corresponding to the first state of the target map from the multiple graph models, the method further includes:
[0082] S41, when it is detected according to the first graph model that the first node and the second node are not connected, sending indication information to the target object, wherein the indication information is used to indicate the rejection of the first operation request.
[0083] If it is detected according to the first graph model that the first node and the second node are not connected, it can be determined that the first operation cannot be performed. The server can send indication information to the target object, and the indication information is used to indicate the rejection of the first operation request. In addition to indicating the rejection of the first operation request, the indication information can also indicate the reason for rejecting the first operation request, for example, the first operation request is rejected due to the lack of connectivity between the first node and the second node.
[0084] The method of sending the indication information to the target object may be to send the indication information to the client corresponding to the target object. After receiving the indication information, the client may display the indication information. The target user may determine the operation to be performed later according to the displayed indication information, such as changing the second node, or re-initiating the operation request after waiting for a period of time.
[0085] Through this embodiment, by sending indication information of rejecting the operation request to the target object, the convenience of obtaining user information can be improved.
[0086] As an optional embodiment, after controlling to perform the first operation between the first node and the second node, the method further includes:
[0087] S51, detecting that a target object performs a second operation on a target map, wherein the second operation is used to trigger the target map to switch from a first state to a second state, and the target operation includes the second operation;
[0088] S52, in response to the second operation, controlling the target map to switch to a second state.
[0089] The target user can control the target object to perform various operations in the target map (for example, killing the BOSS of the copy map), thereby triggering the state switching of the target map.
[0090] For example, the user may perform a second operation on the target map to trigger the target map to switch from a first state to a second state.
[0091] After detecting that the target object performs a second operation on the target map, the server can control the target map to switch to a second state. The state switching method can be to update the state identifier of the target map from the first state identifier of the first state to the second state identifier of the second state.
[0092] Through this embodiment, the switching of the map state is triggered by the detected object operation, so that the timeliness of the map state update can be guaranteed.
[0093] As an optional embodiment, after the control target map is switched to the second state, the method further includes:
[0094] S61, obtaining a second operation request of the target object, wherein the second operation request is used to request to perform a third operation between a third node and a fourth node of the target map;
[0095] S62, in response to the second operation request, acquiring a second graph model corresponding to the second state from the plurality of graph models;
[0096] S63, when it is detected according to the second graph model that the third node and the fourth node are connected, control execution of a third operation between the third node and the fourth node.
[0097] After the state of the target map is switched to the second state, if a second operation request of the target object is obtained, the second operation request is used to request to perform a third operation between the third node and the fourth node of the target map. The third operation can be the same operation as the first operation or a different operation, which is not limited in this embodiment.
[0098] In response to the second operation request, the server may obtain a second graph model corresponding to the second state from a plurality of graph models, and perform a connectivity check between the third node and the fourth node in a manner similar to the above. If the third node and the fourth node are connected, the server may control the execution of the third operation between the third node and the fourth node; otherwise, the second operation request may be rejected, and indication information indicating the rejection of the second operation request may be sent to the target object.
[0099] Through this embodiment, by using the graph model corresponding to the current state to perform connectivity detection, the accuracy of connectivity detection can be improved.
[0100] The operation control method in the embodiment of the present application is described below in conjunction with optional examples. The operation control method in this example is applied to the path-finding scenario of the dungeon map.
[0101] In this example, the connectivity in various states can be pre-calculated according to the replica process to obtain a connectivity detection model (graph model) in various states, and the connectivity detection model is used to perform connectivity detection on the replica map.
[0102] like Figure 7 As shown, the process of the operation control method in this example may include the following steps:
[0103] Step S702, receiving a path-finding request.
[0104] The server may receive a pathfinding request sent by a client, where the pathfinding request is used to request to find a path from one node to another node.
[0105] Step S704: Perform connectivity detection using the connectivity detection model.
[0106] Before pathfinding, a connectivity check can be performed. The server can use a connectivity check model corresponding to the current state of the replica map to check the connectivity between the two nodes.
[0107] Step S706, respond to the route-finding request and perform map route-finding.
[0108] If it is determined that the two nodes are connected, the above-mentioned path finding request can be responded to, and map path finding can be performed to obtain a path between the two nodes. The method of map path finding can refer to related technologies, which will not be described in detail in this example.
[0109] Through this example, the connectivity under various states is pre-calculated according to the replica process to obtain the corresponding connectivity detection model, which can reduce the number of retained graph models and improve the efficiency of connectivity detection.
[0110] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.
[0111] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in each embodiment of the present application.
[0112] According to another aspect of the embodiment of the present application, an operation control device for implementing the above operation control method is also provided. The device can be applied to the above animation creation device. Figure 8 is a schematic diagram of an optional operation control device according to an embodiment of the present application, such as Figure 8 As shown, the device may include:
[0113] (1) a first acquisition unit 802, configured to acquire a first operation request of a target object, wherein the first operation request is used to request to perform a first operation between a first node and a second node of a target map, and the target object is used to trigger the target map to switch between multiple states by performing a target operation on the target map;
[0114] (2) a second acquisition unit 804, connected to the first acquisition unit 802, configured to respond to the first operation request and acquire a first graph model corresponding to a first state of the target map from the plurality of graph models, wherein the plurality of states correspond one-to-one to the plurality of graph models, and each of the plurality of graph models is used to perform connectivity detection between the plurality of nodes of the target map;
[0115] (3) A first control unit 806, connected to the second acquisition unit 804, for controlling execution of a first operation between the first node and the second node when connectivity between the first node and the second node is detected according to the first graph model.
[0116] It should be noted that the first acquisition unit 802 in this embodiment can be used to execute step S202 in the embodiment of the present application, the second acquisition unit 804 in this embodiment can be used to execute step S204 in the embodiment of the present application, and the first control unit 806 in this embodiment can be used to execute step S206 in the embodiment of the present application.
[0117] Through the above module, a first operation request of the target object is obtained, wherein the first operation request is used to request to perform a first operation between a first node and a second node of the target map, and the target object is used to trigger the target map to switch between multiple states by performing the target operation on the target map; in response to the first operation request, a first graph model corresponding to the first state of the target map is obtained from multiple graph models, wherein the multiple states correspond one-to-one to the multiple graph models, and each of the multiple graph models is used to perform connectivity detection between multiple nodes of the target map; when connectivity between the first node and the second node is detected according to the first graph model, the first operation is controlled to be performed between the first node and the second node, thereby solving the problem in the related art that the storage and operation burden of the server is too heavy due to the excessive number of graph models that need to be retained in the copy connectivity detection method, reducing the amount of data stored in the server, and alleviating the server operation burden.
[0118] As an optional embodiment, the above device also includes:
[0119] a third acquisition unit, configured to acquire an initial graph model corresponding to the first state of the target map before acquiring the first graph model corresponding to the first state of the target map from the plurality of graph models, wherein the nodes of the initial graph model correspond to the nodes of the target map one-to-one;
[0120] An identification unit, used for identifying strongly connected components in the initial graph model, wherein the strongly connected components include multiple connected nodes in the initial graph model that are interconnected, or are interconnected and exist or disappear at the same time;
[0121] The execution unit is used to shrink the initial graph model using the strongly connected component to obtain a first graph model, wherein the strongly connected component is shrunk into a node in the first graph model.
[0122] As an optional embodiment, the above device also includes:
[0123] A first determining unit is used to determine a first target node corresponding to the first node in the first graph model after acquiring a first graph model corresponding to a first state of the target map from a plurality of graph models, wherein the first target node corresponds to a first node set in the target map, and each node in the first node set is interconnected, or is interconnected and exists or disappears at the same time;
[0124] A second determining unit is used to determine a second target node corresponding to the second node in the first graph model, wherein the second target node corresponds to a second node set in the target map, and each node in the second node set is interconnected, or is interconnected and exists or disappears at the same time;
[0125] The third determining unit is used to determine that the first node is connected to the second node when the first target node and the second target node are connected on the first graph model.
[0126] As an optional embodiment, the above device also includes:
[0127] The traversal unit is used to traverse the first graph model after determining the second target node corresponding to the second node in the first graph model, and detect the connectivity between the first target node and the second target node.
[0128] As an optional embodiment, the above device also includes:
[0129] A sending unit is used to, after acquiring a first graph model corresponding to a first state of a target map from a plurality of graph models, send an indication message to a target object when it is detected according to the first graph model that the first node is not connected to the second node, wherein the indication message is used to indicate the rejection of the first operation request.
[0130] As an optional embodiment, the above device also includes:
[0131] a detection unit, configured to detect that a target object performs a second operation on a target map after controlling the execution of a first operation between the first node and the second node, wherein the second operation is used to trigger the target map to switch from a first state to a second state, and the target operation includes the second operation;
[0132] The second control unit is used to control the target map to switch to a second state in response to the second operation.
[0133] As an optional embodiment, the above device also includes:
[0134] a fourth acquisition unit, configured to acquire a second operation request of the target object after controlling the target map to switch to the second state, wherein the second operation request is used to request to perform a third operation between a third node and a fourth node of the target map;
[0135] a fifth acquisition unit, configured to respond to the second operation request and acquire a second graph model corresponding to the second state from the plurality of graph models;
[0136] The third control unit is used to control the execution of a third operation between the third node and the fourth node when the third node and the fourth node are connected according to the second graph model.
[0137] It should be noted that the examples and application scenarios implemented by the above modules and corresponding steps are the same, but are not limited to the contents disclosed in the above embodiments. It should be noted that the above modules as part of the device can be run in Figure 1In the hardware environment shown, it can be implemented by software or by hardware, wherein the hardware environment includes a network environment.
[0138] According to another aspect of an embodiment of the present application, an electronic device for implementing the above-mentioned operation control method is also provided. The electronic device may be a server, a terminal, or a combination thereof.
[0139] Fig. 9 is a structural block diagram of an electronic device according to an embodiment of the present application, such as Fig. 9 As shown, the electronic device includes a memory 902 and a processor 904. The memory 902 stores a computer program, and the processor 904 is configured to execute the steps in any of the above method embodiments through the computer program.
[0140] Optionally, in this embodiment, the electronic device may be located in at least one network device among a plurality of network devices of a computer network.
[0141] Optionally, in this embodiment, the processor may be configured to perform the following steps through a computer program:
[0142] S1, obtaining a first operation request of a target object, wherein the first operation request is used to request to perform a first operation between a first node and a second node of a target map, and the target object is used to trigger the target map to switch between multiple states by performing a target operation on the target map;
[0143] S2, in response to the first operation request, obtaining a first graph model corresponding to a first state of the target map from a plurality of graph models, wherein the plurality of states correspond one-to-one to the plurality of graph models, and each of the plurality of graph models is used to perform connectivity detection between a plurality of nodes of the target map;
[0144] S3, when it is detected that the first node and the second node are connected according to the first graph model, controlling execution of a first operation between the first node and the second node.
[0145] Among them, the memory 902 can be used to store software programs and modules, such as program instructions / modules corresponding to the operation control method and device in the embodiment of the present application. The processor 904 executes various functional applications and data processing by running the software programs and modules stored in the memory 902, that is, realizing the above-mentioned operation control method. The memory 902 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 902 may further include a memory remotely arranged relative to the processor 904, and these remote memories may be connected to the terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0146] As an example, Fig. 9 As shown, the memory 902 may include but is not limited to the first acquisition unit 802, the second acquisition unit 804, and the first control unit 806 in the model control device. In addition, it may also include but is not limited to other module units in the model control device, which will not be repeated in this example.
[0147] Optionally, the transmission device 906 is used to receive or send data via a network. Specific examples of the above-mentioned network may include a wired network and a wireless network. In one example, the transmission device 906 includes a NIC (Network Interface Controller), which can be connected to other network devices and a router via a network cable so as to communicate with the Internet or a local area network. In one example, the transmission device 906 is an RF (Radio Frequency) module, which is used to communicate with the Internet wirelessly.
[0148] In addition, the electronic device further includes: a display 908 for displaying the interface of the client; and a connection bus 910 for connecting various module components in the electronic device.
[0149] Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments, and this embodiment will not be described in detail here.
[0150] It can be understood by those skilled in the art that Fig. 9 The structure shown is for illustration only. The device for implementing the above operation control method may be a terminal device, which may be a smart phone (such as an Android phone, an iOS phone, etc.), a tablet computer, a PDA, a MID (Mobile Internet Devices), a PAD, or other terminal devices. Fig. 9It does not limit the structure of the above electronic device. For example, the terminal device may also include Fig. 9 More or fewer components (such as network interfaces, display devices, etc.) shown in, or having Fig. 9 Different configurations are shown.
[0151] A person of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing the hardware related to the terminal device through a program, and the program can be stored in a computer-readable storage medium, and the storage medium may include: a flash drive, a ROM (Read-Only Memory), a RAM (Random Access Memory), a disk or an optical disk, etc.
[0152] According to another aspect of the embodiment of the present application, a storage medium is also provided. Optionally, in this embodiment, the storage medium can be used to execute the program code of the operation control method.
[0153] Optionally, in this embodiment, the storage medium may be located on at least one network device among a plurality of network devices in the network shown in the above embodiment.
[0154] Optionally, in this embodiment, the storage medium is configured to store program codes for executing the following steps:
[0155] S1, obtaining a first operation request of a target object, wherein the first operation request is used to request to perform a first operation between a first node and a second node of a target map, and the target object is used to trigger the target map to switch between multiple states by performing a target operation on the target map;
[0156] S2, in response to the first operation request, obtaining a first graph model corresponding to a first state of the target map from a plurality of graph models, wherein the plurality of states correspond one-to-one to the plurality of graph models, and each of the plurality of graph models is used to perform connectivity detection between a plurality of nodes of the target map;
[0157] S3, when it is detected that the first node and the second node are connected according to the first graph model, controlling execution of a first operation between the first node and the second node.
[0158] Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments, which will not be described in detail in this embodiment.
[0159] Optionally, in this embodiment, the storage medium may include, but is not limited to, various media that can store program codes, such as a USB flash drive, a ROM, a RAM, a mobile hard disk, a magnetic disk, or an optical disk.
[0160] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0161] If the integrated units in the above embodiments are implemented in the form of software functional units and sold or used as independent products, they can be stored in the above computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling one or more computer devices (which may be personal computers, servers, or network devices, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application.
[0162] In the above embodiments of the present application, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.
[0163] In the several embodiments provided in the present application, it should be understood that the disclosed client can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0164] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0165] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0166] The above is only an optional implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. An operation control method, characterized in that: include: Acquire a first operation request of a target object, wherein the first operation request is used to request to perform a first operation between a first node and a second node of a target map, and the target object is used to trigger the target map to switch between multiple states by performing a target operation on the target map; In response to the first operation request, acquiring a first graph model corresponding to a first state of the target map from a plurality of graph models, wherein the plurality of states correspond one-to-one to the plurality of graph models, and each of the plurality of graph models is used to perform connectivity detection between a plurality of nodes of the target map; When it is detected according to the first graph model that the first node is connected to the second node, controlling execution of the first operation between the first node and the second node; Wherein, after obtaining the first graph model corresponding to the first state of the target map from multiple graph models, the method further includes: determining a first target node corresponding to the first node in the first graph model, wherein the first target node corresponds to a first node set in the target map, and the nodes in the first node set are all interconnected, or are all interconnected and exist or disappear at the same time; determining a second target node corresponding to the second node in the first graph model, wherein the second target node corresponds to a second node set in the target map, and the nodes in the second node set are all interconnected, or are all interconnected and exist or disappear at the same time; and in the case that the first target node and the second target node are connected on the first graph model, determining that the first node and the second node are connected.
2. The method according to claim 1, characterized in that Before acquiring the first graph model corresponding to the first state of the target map from the plurality of graph models, the method further includes: Acquire an initial graph model corresponding to the first state of the target map, wherein the nodes of the initial graph model correspond one-to-one to the nodes of the target map; Identifying strongly connected components in the initial graph model, wherein the strongly connected components include a plurality of connected nodes among a plurality of nodes in the initial graph model that are interconnected, or that are interconnected and exist or disappear at the same time; The initial graph model is shrunk by using the strongly connected component to obtain the first graph model, wherein the strongly connected component is shrunk into a node in the first graph model.
3. The method according to claim 1, characterized in that After determining the second target node corresponding to the second node in the first graph model, the method further includes: The first graph model is traversed to detect connectivity between the first target node and the second target node.
4. The method according to claim 1, characterized in that: After acquiring the first graph model corresponding to the first state of the target map from the plurality of graph models, the method further includes: When it is detected according to the first graph model that the first node and the second node are not connected, an indication message is sent to the target object, wherein the indication message is used to indicate that the first operation request is rejected.
5. The method according to any one of claims 1 to 4, characterized in that After the controlling performs the first operation between the first node and the second node, the method further includes: detecting that the target object performs a second operation on the target map, wherein the second operation is used to trigger the target map to switch from the first state to a second state, and the target operation includes the second operation; In response to the second operation, the target map is controlled to switch to the second state.
6. The method according to claim 5, characterized in that After controlling the target map to switch to the second state, the method further includes: Acquire a second operation request of the target object, wherein the second operation request is used to request to perform a third operation between a third node and a fourth node of the target map; In response to the second operation request, acquiring a second graph model corresponding to the second state from the multiple graph models; When it is detected according to the second graph model that the third node is connected to the fourth node, control is performed to perform the third operation between the third node and the fourth node.
7. An operation control device, characterized in that: include: A first acquisition unit is used to acquire a first operation request of a target object, wherein the first operation request is used to request to perform a first operation between a first node and a second node of a target map, and the target object is used to trigger the target map to switch between multiple states by performing a target operation on the target map; a second acquisition unit, configured to respond to the first operation request and acquire a first graph model corresponding to a first state of the target map from a plurality of graph models, wherein the plurality of states correspond one-to-one to the plurality of graph models, and each of the plurality of graph models is used to perform connectivity detection between a plurality of nodes of the target map; a first control unit, configured to control execution of the first operation between the first node and the second node when connectivity between the first node and the second node is detected according to the first graph model; Wherein, after obtaining the first graph model corresponding to the first state of the target map from multiple graph models, it also includes: determining the first target node corresponding to the first node in the first graph model, wherein the first target node corresponds to the first node set in the target map, and the nodes in the first node set are all interconnected, or are all interconnected and exist or disappear at the same time; determining the second target node corresponding to the second node in the first graph model, wherein the second target node corresponds to the second node set in the target map, and the nodes in the second node set are all interconnected, or are all interconnected and exist or disappear at the same time; when the first target node and the second target node are connected on the first graph model, determining that the first node and the second node are connected.
8. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, wherein the computer program is configured to execute the method according to any one of claims 1 to 6 when executed.
9. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to execute the method according to any one of claims 1 to 6 through the computer program.
