Method and system for realizing state calculation and behavior interaction based on multiple threads

By decomposing the state calculation and behavioral interaction of frame synchronization games through multi-threading, the problem of device lag and heating is solved, the use and synchronous operation of multi-core threads of the device are realized, and the efficiency of thread usage is improved.

CN118543115AActive Publication Date: 2024-08-27FANYOU ONLINE TECH (CHENGDU) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410633154.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-21
Publication Date
2024-08-27
Estimated Expiration
2044-05-21

AI Technical Summary

Technical Problem

Frame synchronization games involve a large number of state calculations and behavioral interactions during high-frequency state switching, which results in device freezes, overheating, and the inability of different devices to run synchronously, resulting in wasted threads and inefficient use.

Method used

Multi-threading is used to achieve state calculation and behavioral interaction. By analyzing and disassembling game running requirements, identifying state calculation tasks, monitoring sub-thread running state data, conducting feasibility tests, assigning tasks and establishing mapping relationships, and using the main thread to execute entities Behavioral interaction between sub-threads calculates status data to ensure the security and synchronization of calculation and interaction.

Benefits of technology

It reduces the freezing and heating problems of frame synchronization games, enables the use of multi-core threads on devices, ensures that different devices run synchronously, and improves thread usage efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118543115A
    Figure CN118543115A
Patent Text Reader

Abstract

According to the method and system for achieving state calculation and behavior interaction based on multiple threads, state data calculation of each entity is achieved through the sub-threads, behavior interaction between different entities is conducted through the main thread based on the calculated state data, and disassembly of a state machine system can be achieved; calculation and interaction are guaranteed to be carried out under the safe condition, the problems of jamming, hot burning and the like of frame synchronization games are reduced, use of multi-core threads of equipment is achieved, it is guaranteed that different equipment can synchronously run the games, and the use efficiency of the threads of the equipment is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of computer development, and in particular to a method and system for realizing state calculation and behavior interaction based on multithreading. Background Art

[0002] Frame synchronization games, such as frame synchronization shooting games, involve a large amount of state calculations during high-frequency state switching, and a large amount of behavioral interactions are required between different entities. If state calculations and behavioral interactions are only implemented on the main thread, it will cause problems such as device freezes and overheating, reduce the use of device threads and cause waste, and also cause different devices to be unable to run games synchronously, resulting in different devices The game is out of sync. Summary of the invention

[0003] In view of the defects in the prior art, the present invention provides a method and system for realizing state calculation and behavior interaction based on multi-threading, which analyzes and decomposes the requirements of the game running process to obtain a number of state calculation tasks, and determines the calculation attribute information of all state calculation tasks, and qualitatively calibrates the state; monitors and analyzes the running state data of all sub-threads to obtain the running attribute information of all sub-threads, and combines the calculation attribute information to perform feasibility test of state calculation task execution on the sub-threads to obtain the allocation mapping relationship between the sub-threads and the state calculation tasks, so as to allocate corresponding state calculation tasks to the sub-threads, analyze the calculation results received by the main thread from the sub-threads, determine the interaction requirements of the entity currently connected to the sub-thread and other entities, so as to use the main thread to execute the behavior interaction between different entities, use the sub-threads to realize the calculation of each entity state data and use the main thread to perform the behavior interaction between different entities based on the calculated state data, which can realize the disassembly of the state machine system, ensure that the calculation and interaction are carried out in a safe situation, reduce the problems of frame synchronization game freezing and heating, realize the use of multi-core threads of the device, ensure that different devices can run games synchronously and improve the efficiency of device thread use.

[0004] The present invention provides a method for realizing state calculation and behavior interaction based on multithreading, comprising the following steps:

[0005] Step S1, obtaining the requirements during the game running process, analyzing and decomposing the requirements to obtain a number of state calculation tasks matching the game running; identifying all state calculation tasks, and determining the calculation attribute information of all state calculation tasks;

[0006] Step S2, monitoring and analyzing the running state data of all sub-threads to obtain the running attribute information of all sub-threads; based on the calculation attribute information and the running attribute information, performing a feasibility test on the sub-threads regarding the state calculation task execution to obtain the allocation mapping relationship between all sub-threads and all state calculation tasks;

[0007] Step S3, based on the allocation mapping relationship, assigning corresponding state calculation tasks to the sub-threads; uploading the calculation results of the corresponding state calculation tasks of all sub-threads to the main thread, analyzing the calculation results received by the main thread, and determining the interaction requirements between the entity currently connected by the sub-thread and other entities;

[0008] Step S4, based on the interaction requirements, executing behavior interaction between corresponding entities; based on the working status information of the entities participating in the behavior interaction, adjusting the connection status between the main thread and the corresponding sub-thread.

[0009] In one embodiment disclosed in the present application, in the step S1, the requirements during the game operation are obtained, and the requirements are analyzed and decomposed to obtain a number of state calculation tasks matching the game operation; all state calculation tasks are identified to determine the calculation attribute information of all state calculation tasks, including:

[0010] Monitor the high-frequency switching actions of frame synchronization games during operation to obtain the frame switching requirements of the frame synchronization games, analyze and decompose the frame switching requirements, and obtain several state calculation tasks related to the transformation of different game attributes during the high-frequency switching actions of the frame synchronization games;

[0011] The task data content and data volume are identified for all state calculation tasks, and the data content type information and data calculation volume information of each of the state calculation tasks are determined, which are used as the calculation attribute information.

[0012] In one embodiment disclosed in the present application, in the step S2, the running state data of all sub-threads are monitored and analyzed to obtain the running attribute information of all sub-threads; based on the calculation attribute information and the running attribute information, the sub-threads are tested for feasibility of executing the state calculation task to obtain the allocation mapping relationship between all sub-threads and all state calculation tasks, including:

[0013] Monitor the running logs of all child threads to obtain the algorithm running status data currently executed by all child threads; analyze the algorithm running status data to obtain the algorithm running performance information of the child threads as the running attribute information;

[0014] The data content type information and data calculation amount information contained in the calculation attribute information are compared with the algorithm operation performance information to perform a feasibility test on the execution of the state calculation task for each sub-thread, and obtain the execution efficiency corresponding to each state calculation task executed by each sub-thread; then based on the execution efficiency, obtain the allocation mapping relationship between all sub-threads and all state calculation tasks.

[0015] In one embodiment disclosed in the present application, in the step S3, based on the allocation mapping relationship, the corresponding state calculation task is allocated to the sub-thread; the calculation results of the corresponding state calculation task of all the sub-threads are uploaded to the main thread, and the calculation results received by the main thread are analyzed to determine the interaction requirements between the entity currently connected by the sub-thread and other entities, including:

[0016] Based on the allocation mapping relationship, construct a channel between all sub-threads and their corresponding state calculation tasks, and allocate corresponding state calculation tasks to all sub-threads based on the channel;

[0017] Perform task processing progress identification on all sub-threads respectively to determine whether the sub-thread has completed the calculation of the corresponding state calculation task; if completed, build a connection link between the sub-thread and the main thread, and upload the calculation result of the corresponding state calculation task to the main thread through the connection link; analyze the calculation result received by the main thread to obtain the state switching behavior interaction requirements between the entity currently connected to the sub-thread and other entities.

[0018] In one embodiment disclosed in the present application, in the step S4, based on the interaction requirement, the behavior interaction between the corresponding entities is performed; based on the working status information of the entities participating in the behavior interaction, the connection status between the main thread and the corresponding sub-thread is adjusted, including:

[0019] Based on the interaction requirements, determine the state switching behavior interaction type information between the execution entities, so as to execute the state switching behavior interaction between the corresponding entities; identify the working status of the entities participating in the state switching behavior interaction, and obtain the behavior interaction execution progress of the corresponding entities, so as to judge whether the state switching behavior interaction is completed; if so, keep the current connection state of the main thread and the corresponding child thread unchanged; if not, interrupt the connection state of the main thread and the corresponding child thread.

[0020] The present invention also provides a system for realizing state calculation and behavior interaction based on multithreading, including:

[0021] A demand decomposition module is used to obtain the demand during the game operation, analyze and decompose the demand, and obtain several state calculation tasks that match the game operation;

[0022] A state calculation identification module is used to identify all state calculation tasks and determine the calculation attribute information of all state calculation tasks;

[0023] The sub-thread operation identification module is used to listen to and analyze the operation status data of all sub-threads and obtain the operation attribute information of all sub-threads;

[0024] A state calculation execution test module, used to perform a feasibility test on the sub-thread about the state calculation task execution based on the calculation attribute information and the operation attribute information, and obtain an allocation mapping relationship between all sub-threads and all state calculation tasks;

[0025] An entity interaction demand determination module is used to allocate corresponding state calculation tasks to the sub-threads based on the allocation mapping relationship; upload the calculation results of the corresponding state calculation tasks of all sub-threads to the main thread, analyze the calculation results received by the main thread, and determine the interaction requirements between the entity currently connected by the sub-thread and other entities;

[0026] The behavior interaction monitoring and adjustment module is used to perform behavior interaction between corresponding entities based on the interaction requirements; and to adjust the connection status between the main thread and the corresponding sub-thread based on the working status information of the entities participating in the behavior interaction.

[0027] In one embodiment disclosed in the present application, the demand decomposition module is used to obtain the demand during the game operation process, and the demand is analyzed and decomposed to obtain several state calculation tasks matching the game operation, including:

[0028] Monitor the high-frequency switching actions of frame synchronization games during operation to obtain the frame switching requirements of the frame synchronization games, analyze and decompose the frame switching requirements, and obtain several state calculation tasks related to the transformation of different game attributes during the high-frequency switching actions of the frame synchronization games;

[0029] The state calculation identification module is used to identify all state calculation tasks and determine the calculation attribute information of all state calculation tasks, including:

[0030] The task data content and data volume are identified for all state calculation tasks, and the data content type information and data calculation volume information of each of the state calculation tasks are determined, which are used as the calculation attribute information.

[0031] In one embodiment disclosed in the present application, the sub-thread operation identification module is used to listen to and analyze the operation status data of all sub-threads to obtain the operation attribute information of all sub-threads, including:

[0032] Monitor the running logs of all child threads to obtain the algorithm running status data currently executed by all child threads; analyze the algorithm running status data to obtain the algorithm running performance information of the child threads as the running attribute information;

[0033] The state calculation execution test module is used to perform a feasibility test on the sub-thread about the state calculation task execution based on the calculation attribute information and the operation attribute information, and obtain the allocation mapping relationship between all sub-threads and all state calculation tasks, including:

[0034] The data content type information and data calculation amount information contained in the calculation attribute information are compared with the algorithm operation performance information to perform a feasibility test on the execution of the state calculation task for each sub-thread, and obtain the execution efficiency corresponding to each state calculation task executed by each sub-thread; then based on the execution efficiency, obtain the allocation mapping relationship between all sub-threads and all state calculation tasks.

[0035] In one embodiment disclosed in the present application, the entity interaction requirement determination module is used to allocate corresponding state calculation tasks to the sub-threads based on the allocation mapping relationship; upload the calculation results of the corresponding state calculation tasks of all sub-threads to the main thread, analyze the calculation results received by the main thread, and determine the interaction requirements between the entity currently connected by the sub-thread and other entities, including:

[0036] Based on the allocation mapping relationship, construct a channel between all sub-threads and their corresponding state calculation tasks, and allocate corresponding state calculation tasks to all sub-threads based on the channel;

[0037] Perform task processing progress identification on all sub-threads respectively to determine whether the sub-thread has completed the calculation of the corresponding state calculation task; if completed, build a connection link between the sub-thread and the main thread, and upload the calculation result of the corresponding state calculation task to the main thread through the connection link; analyze the calculation result received by the main thread to obtain the state switching behavior interaction requirements between the entity currently connected to the sub-thread and other entities.

[0038] In one embodiment disclosed in the present application, the behavior interaction monitoring and adjustment module is used to perform behavior interaction between corresponding entities based on the interaction requirements; and adjust the connection state between the main thread and the corresponding sub-thread based on the working state information of the entities participating in the behavior interaction, including:

[0039] Based on the interaction requirements, determine the state switching behavior interaction type information between the execution entities, so as to execute the state switching behavior interaction between the corresponding entities; identify the working status of the entities participating in the state switching behavior interaction, and obtain the behavior interaction execution progress of the corresponding entities, so as to judge whether the state switching behavior interaction is completed; if so, keep the current connection state of the main thread and the corresponding child thread unchanged; if not, interrupt the connection state of the main thread and the corresponding child thread.

[0040] Compared with the prior art, the method and system for realizing state calculation and behavior interaction based on multi-threading analyze and decompose the requirements of the game running process, obtain a number of state calculation tasks, determine the calculation attribute information of all state calculation tasks, and perform qualitative calibration on the state; monitor and analyze the running state data of all sub-threads, obtain the running attribute information of all sub-threads, and combine the calculation attribute information to perform feasibility test on the sub-threads to obtain the allocation mapping relationship between the sub-threads and the state calculation tasks, so as to allocate corresponding state calculation tasks to the sub-threads, analyze the calculation results received by the main thread from the sub-threads, determine the interaction requirements of the entity currently connected to the sub-thread and other entities, so as to use the main thread to execute the behavior interaction between different entities, use the sub-threads to realize the calculation of each entity state data and use the main thread to perform the behavior interaction between different entities based on the calculated state data, which can realize the disassembly of the state machine system, ensure that the calculation and interaction are carried out in a safe situation, reduce the problems of frame synchronization game jamming and heating, realize the use of multi-core threads of the device, ensure that different devices can run games synchronously and improve the efficiency of device thread use.

[0041] Other features and advantages of the present invention will be described in the following description, and partly become apparent from the description, or understood by practicing the present invention. The purpose and other advantages of the present invention can be realized and obtained by the structures particularly pointed out in the written description, claims, and drawings.

[0042] The technical solution of the present invention is further described in detail below through the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] In order to more clearly illustrate the embodiments of the present invention 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 invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0044] Figure 1A flowchart of a method for implementing state calculation and behavior interaction based on multithreading provided by the present invention.

[0045] Figure 2 A schematic diagram of the framework of a system for implementing state calculation and behavior interaction based on multi-threading provided by the present invention. DETAILED DESCRIPTION

[0046] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0047] See also Figure 1 , is a flow chart of a method for implementing state calculation and behavior interaction based on multithreading provided by an embodiment of the present invention. The method for implementing state calculation and behavior interaction based on multithreading includes:

[0048] Step S1, obtaining the requirements during the game running process, analyzing and decomposing the requirements to obtain a number of state calculation tasks matching the game running; identifying all state calculation tasks, and determining the calculation attribute information of all state calculation tasks;

[0049] Step S2, monitoring and analyzing the running state data of all sub-threads to obtain the running attribute information of all sub-threads; based on the calculation attribute information and the running attribute information, performing a feasibility test on the execution of the state calculation task on the sub-thread to obtain the allocation mapping relationship between all sub-threads and all state calculation tasks;

[0050] Step S3, based on the allocation mapping relationship, assign the corresponding state calculation task to the sub-thread; upload the calculation results of the corresponding state calculation tasks of all sub-threads to the main thread, analyze the calculation results received by the main thread, and determine the interaction requirements between the entity currently connected by the sub-thread and other entities;

[0051] Step S4, based on the interaction requirement, executing the behavior interaction between the corresponding entities; based on the working status information of the entities participating in the behavior interaction, adjusting the connection status between the main thread and the corresponding sub-thread.

[0052] The beneficial effects of the above technical solution are as follows: the method for realizing state calculation and behavior interaction based on multi-threading analyzes and decomposes the requirements of the game running process, obtains a number of state calculation tasks, and determines the calculation attribute information of all state calculation tasks, and qualitatively calibrates the state; monitors and analyzes the running state data of all sub-threads, obtains the running attribute information of all sub-threads, and combines the calculation attribute information to perform feasibility tests on the sub-threads to obtain the allocation mapping relationship between the sub-threads and the state calculation tasks, thereby allocating corresponding state calculation tasks to the sub-threads, analyzing the calculation results received by the main thread from the sub-threads, and determining the interaction requirements of the entity currently connected to the sub-thread and other entities, thereby using the main thread to execute the behavior interaction between different entities, using the sub-threads to realize the calculation of each entity state data and using the main thread to perform the behavior interaction between different entities based on the calculated state data, which can realize the disassembly of the state machine system, ensure that the calculation and interaction are carried out in a safe situation, reduce the problems of frame synchronization game jamming and heating, realize the use of multi-core threads of the device, ensure that different devices can run games synchronously and improve the efficiency of device thread use.

[0053] Preferably, in step S1, the requirements during the game operation are obtained, and the requirements are analyzed and decomposed to obtain a number of state calculation tasks matching the game operation; all state calculation tasks are identified to determine the calculation attribute information of all state calculation tasks, including:

[0054] Monitor the high-frequency switching actions of frame synchronization games during operation to obtain the frame switching requirements of the frame synchronization games, analyze and decompose the frame switching requirements, and obtain several state calculation tasks related to the transformation of different game attributes during the high-frequency switching actions of the frame synchronization games;

[0055] The task data content and data volume of all state calculation tasks are identified, and the data content type information and data calculation volume information of all state calculation tasks are determined as the calculation attribute information.

[0056] The beneficial effects of the above technical solution are as follows: frame synchronization shooting games and other frame synchronization games need to perform high-frequency state switching during operation, and the high-frequency state switching process is accompanied by a large number of state calculations. Only when all state calculations are completed accurately and timely can the normal switching of high-frequency states be guaranteed. For this reason, the high-frequency switching actions of the frame synchronization games during operation are monitored to obtain the frame switching requirements of the frame synchronization games, and the frame switching requirements are analyzed and disassembled to obtain several state calculation tasks for the transformation of different game attributes during the high-frequency switching actions of the frame synchronization games. In this way, the requirements for high-frequency switching actions of the games can be finely decomposed to ensure that all subsequent sub-threads can accurately process the assigned state calculation tasks. In addition, the task data content and data volume of all state calculation tasks are identified, and the data content type information and data calculation volume information of all state calculation tasks are determined, which are used as the calculation attribute information, so as to quantify and determine the data attributes of each state calculation task, and provide a reliable basis for the subsequent allocation of corresponding state calculation tasks to different sub-threads.

[0057] Preferably, in step S2, the running state data of all sub-threads are monitored and analyzed to obtain the running attribute information of all sub-threads; based on the calculation attribute information and the running attribute information, the feasibility test of the state calculation task execution is performed on the sub-thread to obtain the allocation mapping relationship between all sub-threads and all state calculation tasks, including:

[0058] Monitor the running logs of all child threads to obtain the running status data of the algorithms currently executed by all child threads; analyze the running status data of the algorithm to obtain the algorithm running performance information of the child thread, which is used as the running attribute information;

[0059] The data content type information and data calculation amount information contained in the calculation attribute information are compared with the algorithm operation performance information, so as to perform a feasibility test on the execution of the state calculation task for each sub-thread, and obtain the execution efficiency corresponding to each sub-thread executing each state calculation task; and then based on the execution efficiency, obtain the allocation mapping relationship between all sub-threads and all state calculation tasks.

[0060] The beneficial effects of the above technical solution are as follows: sub-threads are the main functional modules for device processing tasks, and the computing power performance of each sub-thread is different and limited. By monitoring the running logs of all sub-threads, the algorithm running status data currently executed by all sub-threads are obtained, and the algorithm running status data is analyzed to obtain the algorithm running performance information of the sub-thread, wherein the algorithm running performance information may be but is not limited to the running matching degree and running reliability information of the sub-thread for different types of algorithms. Then the data content type information and data calculation amount information contained in the computing attribute information are compared with the algorithm running performance information, so as to perform a feasibility test on the execution of the state computing task for each sub-thread, thereby quantifying and determining the execution efficiency corresponding to each state computing task executed by each sub-thread, and providing a quantitative basis for determining the allocation mapping relationship between all sub-threads and all state computing tasks. Generally speaking, if the execution efficiency of a sub-thread for a certain state computing task is the highest, the state computing task is allocated to the sub-thread, thereby forming a corresponding allocation mapping relationship.

[0061] Preferably, in step S3, based on the allocation mapping relationship, a corresponding state calculation task is allocated to the sub-thread; the calculation results of the corresponding state calculation tasks of all sub-threads are uploaded to the main thread, and the calculation results received by the main thread are analyzed to determine the interaction requirements between the entity currently connected by the sub-thread and other entities, including:

[0062] Based on the allocation mapping relationship, a channel is constructed between each of the sub-threads and the state calculation task corresponding to the sub-threads, and corresponding state calculation tasks are respectively allocated to all the sub-threads based on the channel;

[0063] The task processing progress of all sub-threads is identified separately to determine whether the sub-thread has completed the calculation of the corresponding state calculation task; if it has been completed, a connection link is established between the sub-thread and the main thread, and the calculation result of the corresponding state calculation task is uploaded to the main thread through the connection link; the calculation result received by the main thread is analyzed to obtain the state switching behavior interaction requirements between the entity currently connected to the sub-thread and other entities.

[0064] The beneficial effects of the above technical solution are as follows: based on the allocation mapping relationship, a channel is constructed between each of the sub-threads and the state calculation task corresponding to it, so that the corresponding state calculation task is respectively assigned to all the sub-threads, which can ensure that each sub-thread is accurately assigned with a suitable state calculation task. Then, the task processing progress of all the sub-threads is identified respectively to determine whether the sub-thread has completed the calculation of the corresponding state calculation task; if it has been completed, a connection link is constructed between the sub-thread and the main thread, and the calculation result of the corresponding state calculation task is uploaded to the main thread through the connection link, which can ensure that the main thread obtains the calculation results of different sub-threads in time, and then the calculation results received by the main thread are analyzed to obtain the state switching behavior interaction requirements between the entity currently connected to the sub-thread and other entities, so as to accurately calibrate the entity objects for the subsequent behavior interaction between different entities.

[0065] Preferably, in step S4, based on the interaction requirement, a behavior interaction between corresponding entities is performed; based on the working status information of the entities participating in the behavior interaction, a connection status between the main thread and the corresponding sub-thread is adjusted, including:

[0066] Based on the interaction requirement, determine the state switching behavior interaction type information between the execution entities, so as to execute the state switching behavior interaction between the corresponding entities; identify the working status of the entities participating in the state switching behavior interaction, and obtain the behavior interaction execution progress of the corresponding entities, so as to judge whether the state switching behavior interaction is completed; if so, keep the current connection state of the main thread and the corresponding child thread unchanged; if not, interrupt the connection state of the main thread and the corresponding child thread.

[0067] The beneficial effects of the above technical solution are: based on the interaction requirements, the state switching behavior interaction type information between the execution entities is determined, so as to execute the state switching behavior interaction between the corresponding entities. In this way, the main thread is used to process the behavior interaction between different entities, and the computing performance of the main thread can be fully utilized to perform entity behavior interaction, ensuring the synchronous execution of different devices. The working state of the entity participating in the state switching behavior interaction is also identified to obtain the behavior interaction execution progress of the corresponding entity, so as to determine whether the state switching behavior interaction has been completed, so as to adjust the connection state between the main thread and the corresponding sub-thread, make full use of the computing resources of the main thread, and improve the frame switching synchronization of the game.

[0068] See also Figure 2 , is a schematic diagram of a framework of a system for implementing state calculation and behavior interaction based on multithreading provided by an embodiment of the present invention. The system for implementing state calculation and behavior interaction based on multithreading includes:

[0069] The demand decomposition module is used to obtain the demand during the game operation, analyze and decompose the demand, and obtain several state calculation tasks that match the game operation;

[0070] A state calculation identification module is used to identify all state calculation tasks and determine the calculation attribute information of all state calculation tasks;

[0071] The sub-thread operation identification module is used to listen to and analyze the operation status data of all sub-threads and obtain the operation attribute information of all sub-threads;

[0072] A state calculation execution test module is used to perform a feasibility test on the sub-thread about the state calculation task execution based on the calculation attribute information and the operation attribute information, and obtain the allocation mapping relationship between all sub-threads and all state calculation tasks;

[0073] The entity interaction demand determination module is used to assign the corresponding state calculation task to the sub-thread based on the allocation mapping relationship; upload the calculation results of all sub-threads on the corresponding state calculation task to the main thread, analyze the calculation results received by the main thread, and determine the interaction demand between the entity currently connected by the sub-thread and other entities;

[0074] The behavior interaction monitoring and adjustment module is used to perform behavior interaction between corresponding entities based on the interaction requirements; and to adjust the connection status between the main thread and the corresponding sub-thread based on the working status information of the entities participating in the behavior interaction.

[0075] The beneficial effects of the above technical solution are as follows: the system for realizing state calculation and behavior interaction based on multi-threading analyzes and decomposes the requirements of the game running process, obtains a number of state calculation tasks, and determines the calculation attribute information of all state calculation tasks, and qualitatively calibrates the state; monitors and analyzes the running state data of all sub-threads, obtains the running attribute information of all sub-threads, and combines the calculation attribute information to perform feasibility tests on the sub-threads to obtain the allocation mapping relationship between the sub-threads and the state calculation tasks, thereby allocating corresponding state calculation tasks to the sub-threads, analyzing the calculation results received by the main thread from the sub-threads, and determining the interaction requirements of the entity currently connected to the sub-thread and other entities, thereby using the main thread to execute the behavior interaction between different entities, using the sub-threads to realize the calculation of each entity state data and using the main thread to perform the behavior interaction between different entities based on the calculated state data, which can realize the disassembly of the state machine system, ensure that the calculation and interaction are carried out in a safe situation, reduce the problems of frame synchronization game jamming and heating, realize the use of multi-core threads of the device, ensure that different devices can run games synchronously and improve the efficiency of device thread use.

[0076] Preferably, the demand decomposition module is used to obtain the demand during the game operation process, and the demand is analyzed and decomposed to obtain several state calculation tasks matching the game operation, including:

[0077] Monitor the high-frequency switching actions of frame synchronization games during operation to obtain the frame switching requirements of the frame synchronization games, analyze and decompose the frame switching requirements, and obtain several state calculation tasks related to the transformation of different game attributes during the high-frequency switching actions of the frame synchronization games;

[0078] The state calculation identification module is used to identify all state calculation tasks and determine the calculation attribute information of all state calculation tasks, including:

[0079] The task data content and data volume of all state calculation tasks are identified, and the data content type information and data calculation volume information of all state calculation tasks are determined as the calculation attribute information.

[0080] The beneficial effects of the above technical solution are as follows: frame synchronization shooting games and other frame synchronization games need to perform high-frequency state switching during operation, and the high-frequency state switching process is accompanied by a large number of state calculations. Only when all state calculations are completed accurately and timely can the normal switching of high-frequency states be guaranteed. For this reason, the high-frequency switching actions of the frame synchronization games during operation are monitored to obtain the frame switching requirements of the frame synchronization games, and the frame switching requirements are analyzed and disassembled to obtain several state calculation tasks for the transformation of different game attributes during the high-frequency switching actions of the frame synchronization games. In this way, the requirements for high-frequency switching actions of the games can be finely decomposed to ensure that all subsequent sub-threads can accurately process the assigned state calculation tasks. In addition, the task data content and data volume of all state calculation tasks are identified, and the data content type information and data calculation volume information of all state calculation tasks are determined, which are used as the calculation attribute information, so as to quantify and determine the data attributes of each state calculation task, and provide a reliable basis for the subsequent allocation of corresponding state calculation tasks to different sub-threads.

[0081] Preferably, the sub-thread operation identification module is used to listen to and analyze the operation status data of all sub-threads to obtain the operation attribute information of all sub-threads, including:

[0082] Monitor the running logs of all child threads to obtain the running status data of the algorithms currently executed by all child threads; analyze the running status data of the algorithm to obtain the algorithm running performance information of the child thread, which is used as the running attribute information;

[0083] The state calculation execution test module is used to perform a feasibility test on the sub-thread about the state calculation task execution based on the calculation attribute information and the operation attribute information, and obtain the allocation mapping relationship between all sub-threads and all state calculation tasks, including:

[0084] The data content type information and data calculation amount information contained in the calculation attribute information are compared with the algorithm operation performance information, so as to perform a feasibility test on the execution of the state calculation task for each sub-thread, and obtain the execution efficiency corresponding to each sub-thread executing each state calculation task; and then based on the execution efficiency, obtain the allocation mapping relationship between all sub-threads and all state calculation tasks.

[0085] The beneficial effects of the above technical solution are as follows: sub-threads are the main functional modules for device processing tasks, and the computing power performance of each sub-thread is different and limited. By monitoring the running logs of all sub-threads, the algorithm running status data currently executed by all sub-threads are obtained, and the algorithm running status data is analyzed to obtain the algorithm running performance information of the sub-thread, wherein the algorithm running performance information may be but is not limited to the running matching degree and running reliability information of the sub-thread for different types of algorithms. Then the data content type information and data calculation amount information contained in the computing attribute information are compared with the algorithm running performance information, so as to perform a feasibility test on the execution of the state computing task for each sub-thread, thereby quantifying and determining the execution efficiency corresponding to each state computing task executed by each sub-thread, and providing a quantitative basis for determining the allocation mapping relationship between all sub-threads and all state computing tasks. Generally speaking, if the execution efficiency of a sub-thread for a certain state computing task is the highest, the state computing task is allocated to the sub-thread, thereby forming a corresponding allocation mapping relationship.

[0086] Preferably, the entity interaction requirement determination module is used to allocate a corresponding state calculation task to the sub-thread based on the allocation mapping relationship; upload the calculation results of the corresponding state calculation tasks of all sub-threads to the main thread, analyze the calculation results received by the main thread, and determine the interaction requirements between the entity currently connected by the sub-thread and other entities, including:

[0087] Based on the allocation mapping relationship, a channel is constructed between each of the sub-threads and the state calculation task corresponding to the sub-threads, and corresponding state calculation tasks are respectively allocated to all the sub-threads based on the channel;

[0088] The task processing progress of all sub-threads is identified separately to determine whether the sub-thread has completed the calculation of the corresponding state calculation task; if it has been completed, a connection link is established between the sub-thread and the main thread, and the calculation result of the corresponding state calculation task is uploaded to the main thread through the connection link; the calculation result received by the main thread is analyzed to obtain the state switching behavior interaction requirements between the entity currently connected to the sub-thread and other entities.

[0089] The beneficial effects of the above technical solution are as follows: based on the allocation mapping relationship, a channel is constructed between each of the sub-threads and the state calculation task corresponding to it, so that the corresponding state calculation task is respectively assigned to all the sub-threads, which can ensure that each sub-thread is accurately assigned with a suitable state calculation task. Then, the task processing progress of all the sub-threads is identified respectively to determine whether the sub-thread has completed the calculation of the corresponding state calculation task; if it has been completed, a connection link is constructed between the sub-thread and the main thread, and the calculation result of the corresponding state calculation task is uploaded to the main thread through the connection link, which can ensure that the main thread obtains the calculation results of different sub-threads in time, and then the calculation results received by the main thread are analyzed to obtain the state switching behavior interaction requirements between the entity currently connected to the sub-thread and other entities, so as to accurately calibrate the entity objects for the subsequent behavior interaction between different entities.

[0090] Preferably, the behavior interaction monitoring and adjustment module is used to perform behavior interaction between corresponding entities based on the interaction requirements; and adjust the connection state between the main thread and the corresponding sub-thread based on the working state information of the entities participating in the behavior interaction, including:

[0091] Based on the interaction requirement, determine the state switching behavior interaction type information between the execution entities, so as to execute the state switching behavior interaction between the corresponding entities; identify the working status of the entities participating in the state switching behavior interaction, and obtain the behavior interaction execution progress of the corresponding entities, so as to judge whether the state switching behavior interaction is completed; if so, keep the current connection state of the main thread and the corresponding child thread unchanged; if not, interrupt the connection state of the main thread and the corresponding child thread.

[0092] The beneficial effects of the above technical solution are: based on the interaction requirements, the state switching behavior interaction type information between the execution entities is determined, so as to execute the state switching behavior interaction between the corresponding entities. In this way, the main thread is used to process the behavior interaction between different entities, and the computing performance of the main thread can be fully utilized to perform entity behavior interaction, ensuring the synchronous execution of different devices. The working state of the entity participating in the state switching behavior interaction is also identified to obtain the behavior interaction execution progress of the corresponding entity, so as to determine whether the state switching behavior interaction has been completed, so as to adjust the connection state between the main thread and the corresponding sub-thread, make full use of the computing resources of the main thread, and improve the frame switching synchronization of the game.

[0093] It can be seen from the contents of the above embodiments that the method and system for realizing state calculation and behavior interaction based on multi-threading analyzes and decomposes the requirements of the game running process, obtains a number of state calculation tasks, and determines the calculation attribute information of all state calculation tasks, and qualitatively calibrates the state; monitors and analyzes the running state data of all sub-threads, obtains the running attribute information of all sub-threads, and combines the calculation attribute information to perform feasibility tests on the sub-threads to obtain the allocation mapping relationship between the sub-threads and the state calculation tasks, thereby allocating corresponding state calculation tasks to the sub-threads, analyzing the calculation results received by the main thread from the sub-threads, and determining the interaction requirements of the entity currently connected to the sub-thread and other entities, thereby using the main thread to perform behavior interaction between different entities, using the sub-threads to realize the calculation of each entity state data and using the main thread to perform behavior interaction between different entities based on the calculated state data, which can realize the disassembly of the state machine system, ensure that calculation and interaction are carried out in a safe situation, reduce problems such as freeze and overheating of frame synchronization games, realize the use of multi-core threads of devices, ensure that different devices can run games synchronously and improve the efficiency of device thread use.

[0094] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.

Claims

1. A method for realizing state calculation and behavior interaction based on multithreading, characterized in that: It includes the following steps: Step S1, obtaining the requirements during the game running process, analyzing and decomposing the requirements to obtain a number of state calculation tasks matching the game running; identifying all state calculation tasks, and determining the calculation attribute information of all state calculation tasks; Step S2, monitoring and analyzing the running state data of all sub-threads to obtain the running attribute information of all sub-threads; based on the calculation attribute information and the running attribute information, performing a feasibility test on the sub-threads regarding the state calculation task execution to obtain the allocation mapping relationship between all sub-threads and all state calculation tasks; Step S3, based on the allocation mapping relationship, assigning corresponding state calculation tasks to the sub-threads; uploading the calculation results of the corresponding state calculation tasks of all sub-threads to the main thread, analyzing the calculation results received by the main thread, and determining the interaction requirements between the entity currently connected by the sub-thread and other entities; Step S4, executing behavior interaction between corresponding entities based on the interaction requirements; Based on the working status information of the entities participating in the behavior interaction, the connection status between the main thread and the corresponding child thread is adjusted.

2. The method for realizing state calculation and behavior interaction based on multithreading as claimed in claim 1, characterized in that: In the step S1, the requirements during the game operation are obtained, and the requirements are analyzed and decomposed to obtain a number of state calculation tasks matching the game operation; Identify all state calculation tasks and determine the calculation attribute information of all state calculation tasks, including: Monitor the high-frequency switching actions of frame synchronization games during operation to obtain the frame switching requirements of the frame synchronization games, analyze and decompose the frame switching requirements, and obtain several state calculation tasks related to the transformation of different game attributes during the high-frequency switching actions of the frame synchronization games; The task data content and data volume are identified for all state calculation tasks, and the data content type information and data calculation volume information of each of the state calculation tasks are determined, which are used as the calculation attribute information.

3. The method for realizing state calculation and behavior interaction based on multithreading as claimed in claim 1, characterized in that: In the step S2, the running state data of all the sub-threads are monitored and analyzed to obtain the running attribute information of all the sub-threads; based on the calculation attribute information and the running attribute information, the feasibility test of the state calculation task execution is performed on the sub-threads to obtain the allocation mapping relationship between all the sub-threads and all the state calculation tasks, including: Monitor the running logs of all child threads to obtain the algorithm running status data currently executed by all child threads; analyze the algorithm running status data to obtain the algorithm running performance information of the child threads as the running attribute information; The data content type information and data calculation amount information contained in the calculation attribute information are compared with the algorithm operation performance information to perform a feasibility test on the execution of the state calculation task for each sub-thread, and obtain the execution efficiency corresponding to each state calculation task executed by each sub-thread; then based on the execution efficiency, obtain the allocation mapping relationship between all sub-threads and all state calculation tasks.

4. The method for realizing state calculation and behavior interaction based on multithreading as claimed in claim 1, characterized in that: In the step S3, based on the allocation mapping relationship, the corresponding state calculation task is allocated to the sub-thread; the calculation results of the corresponding state calculation task of all the sub-threads are uploaded to the main thread, and the calculation results received by the main thread are analyzed to determine the interaction requirements between the entity currently connected by the sub-thread and other entities, including: Based on the allocation mapping relationship, construct a channel between all sub-threads and their corresponding state calculation tasks, and allocate corresponding state calculation tasks to all sub-threads based on the channel; Perform task processing progress identification on all sub-threads respectively to determine whether the sub-thread has completed the calculation of the corresponding state calculation task; if completed, build a connection link between the sub-thread and the main thread, and upload the calculation result of the corresponding state calculation task to the main thread through the connection link; analyze the calculation result received by the main thread to obtain the state switching behavior interaction requirements between the entity currently connected to the sub-thread and other entities.

5. The method for realizing state calculation and behavior interaction based on multithreading as claimed in claim 1, characterized in that: In the step S4, based on the interaction requirement, a behavior interaction between corresponding entities is performed; Adjusting the connection state between the main thread and the corresponding child thread based on the working state information of the entity participating in the behavior interaction includes: Based on the interaction requirements, determine the state switching behavior interaction type information between the execution entities, so as to execute the state switching behavior interaction between the corresponding entities; identify the working status of the entities participating in the state switching behavior interaction, and obtain the behavior interaction execution progress of the corresponding entities, so as to judge whether the state switching behavior interaction is completed; if so, keep the current connection state of the main thread and the corresponding child thread unchanged; if not, interrupt the connection state of the main thread and the corresponding child thread.

6. A system for realizing state calculation and behavior interaction based on multithreading, characterized in that: include: A demand decomposition module is used to obtain the demand during the game operation, analyze and decompose the demand, and obtain several state calculation tasks that match the game operation; A state calculation identification module is used to identify all state calculation tasks and determine the calculation attribute information of all state calculation tasks; The sub-thread operation identification module is used to listen to and analyze the operation status data of all sub-threads and obtain the operation attribute information of all sub-threads; A state calculation execution test module, used to perform a feasibility test on the sub-thread about the state calculation task execution based on the calculation attribute information and the operation attribute information, and obtain an allocation mapping relationship between all sub-threads and all state calculation tasks; An entity interaction demand determination module is used to allocate corresponding state calculation tasks to the sub-threads based on the allocation mapping relationship; upload the calculation results of the corresponding state calculation tasks of all sub-threads to the main thread, analyze the calculation results received by the main thread, and determine the interaction requirements between the entity currently connected by the sub-thread and other entities; A behavior interaction monitoring and adjustment module, used for executing behavior interactions between corresponding entities based on the interaction requirements; Based on the working status information of the entities participating in the behavior interaction, the connection status between the main thread and the corresponding child thread is adjusted.

7. The system for realizing state calculation and behavior interaction based on multithreading as claimed in claim 6, characterized in that: The demand decomposition module is used to obtain the demand during the game operation process, and the demand is analyzed and decomposed to obtain several state calculation tasks matching the game operation, including: Monitor the high-frequency switching actions of frame synchronization games during operation to obtain the frame switching requirements of the frame synchronization games, analyze and decompose the frame switching requirements, and obtain several state calculation tasks related to the transformation of different game attributes during the high-frequency switching actions of the frame synchronization games; The state calculation identification module is used to identify all state calculation tasks and determine the calculation attribute information of all state calculation tasks, including: The task data content and data volume are identified for all state calculation tasks, and the data content type information and data calculation volume information of each of the state calculation tasks are determined, which are used as the calculation attribute information.

8. The system for realizing state calculation and behavior interaction based on multithreading as claimed in claim 6, characterized in that: The sub-thread operation identification module is used to listen to and analyze the operation status data of all sub-threads to obtain the operation attribute information of all sub-threads, including: Monitor the running logs of all child threads to obtain the algorithm running status data currently executed by all child threads; analyze the algorithm running status data to obtain the algorithm running performance information of the child threads as the running attribute information; The state calculation execution test module is used to perform a feasibility test on the sub-thread about the state calculation task execution based on the calculation attribute information and the operation attribute information, and obtain the allocation mapping relationship between all sub-threads and all state calculation tasks, including: The data content type information and data calculation amount information contained in the calculation attribute information are compared with the algorithm operation performance information to perform a feasibility test on the execution of the state calculation task for each sub-thread, and obtain the execution efficiency corresponding to each state calculation task executed by each sub-thread; then based on the execution efficiency, obtain the allocation mapping relationship between all sub-threads and all state calculation tasks.

9. The system for realizing state calculation and behavior interaction based on multithreading as claimed in claim 6, characterized in that: The entity interaction requirement determination module is used to allocate corresponding state calculation tasks to the sub-threads based on the allocation mapping relationship; upload the calculation results of the corresponding state calculation tasks by all sub-threads to the main thread, analyze the calculation results received by the main thread, and determine the interaction requirements between the entity currently connected by the sub-thread and other entities, including: Based on the allocation mapping relationship, construct a channel between all sub-threads and their corresponding state calculation tasks, and allocate corresponding state calculation tasks to all sub-threads based on the channel; Perform task processing progress identification on all sub-threads respectively to determine whether the sub-thread has completed the calculation of the corresponding state calculation task; if completed, build a connection link between the sub-thread and the main thread, and upload the calculation result of the corresponding state calculation task to the main thread through the connection link; analyze the calculation result received by the main thread to obtain the state switching behavior interaction requirements between the entity currently connected to the sub-thread and other entities.

10. The system for realizing state calculation and behavior interaction based on multithreading as claimed in claim 6, characterized in that: The behavior interaction monitoring and adjustment module is used to perform behavior interaction between corresponding entities based on the interaction requirements; Adjusting the connection state between the main thread and the corresponding child thread based on the working state information of the entity participating in the behavior interaction includes: Based on the interaction requirements, determine the state switching behavior interaction type information between the execution entities, so as to execute the state switching behavior interaction between the corresponding entities; identify the working status of the entities participating in the state switching behavior interaction, and obtain the behavior interaction execution progress of the corresponding entities, so as to judge whether the state switching behavior interaction is completed; if so, keep the current connection state of the main thread and the corresponding child thread unchanged; if not, interrupt the connection state of the main thread and the corresponding child thread.

Citation Information

Patent Citations

  • Data processing method, readable storage medium and electronic equipment

    CN110860086A

  • Data synchronization method and device, electronic equipment and computer readable storage medium

    CN117851047A