Multi-threaded signal synchronization processing method and system based on ECS framework
The multi-threaded signal synchronization processing method and system for the ECS framework addresses thread competition and interference by allocating signals to different threads and processing signal queues, enhancing event processing efficiency and reliability.
Patent Information
- Application Number
- CN202410530971.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-29
- Publication Date
- 2024-12-20
- Estimated Expiration
- 2044-04-29
AI Technical Summary
The ECS framework on smartphone CPUs experiences thread competition and interference in signal interaction, leading to reduced operational stability and accuracy in managing game objects.
A multi-threaded signal synchronization processing method and system that sets signals for all events based on event attribute information, generates a signal mapping table, allocates signals to different threads, and processes signal queues for merging and response, ensuring timely and accurate event processing.
Improves the execution efficiency and reliability of event processing within the ECS framework by resolving thread competition and ensuring timely response to events.
Smart Images

Figure CN118535324B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of signal processing, and in particular to a multi-threaded signal synchronization processing method and system based on an ECS framework. Background Art
[0002] The ECS framework, or Entity-Component-System, is a mainstream framework structure. Its core idea is to decouple entity behaviors and properties, so that game developers can combine and manage game objects more flexibly. By representing game objects as a collection of entities, and each entity is composed of multiple components, the ECS framework can be used to manage entities and all their components, which can effectively improve the performance and maintainability of the game. Smartphone CPUs are multi-core systems that can work in multiple threads. When the ECS framework is running on a smartphone, different threads will compete for the entity control management of the ECS frame, making it impossible to effectively and timely divide the entity into a single thread for special management. At the same time, it will interfere with the signal interaction in the entity management process, reduce the operational stability of the entities under the ECS framework, and fail to maintain the stability and accuracy of the signal interaction under the ECS framework. Summary of the invention
[0003] In view of the defects of the prior art, the present invention provides a multi-threaded signal synchronization processing method and system based on the ECS framework, which sets signals for all events occurring in all entities based on event attribute information of all entities within the ECS framework, generates a signal mapping table corresponding to all the occurring events, realizes a one-to-one correspondence definition between signals and events, and obtains the generated signals from the ECS framework by monitoring the generated signals, and timely obtains the operation requirements of the framework; based on the signal mapping table, the signals generated within the ECS framework are sent to different threads, and corresponding signal queues are generated, so as to realize directional thread allocation of signals and effectively solve the problem of thread competition; the signal queues are also processed for signal merging, and the signal response processing progress information of the signal queues is obtained, so as to timely respond to the events occurring in the entities within the ECS framework, and judge whether the events occurring in the entities are correctly processed, so as to ensure the timeliness of the processing of the events within the framework, and then instruct the subordinate components of the entities to complete the corresponding action operations, so as to improve the execution efficiency and reliability of the events within the framework.
[0004] The present invention provides a multi-thread signal synchronization processing method based on the ECS framework, comprising the following steps:
[0005] Step S1, obtaining event attribute information of all entities within the ECS framework, and based on the event attribute information, performing signal setting for all events occurring in all entities, generating a signal mapping table corresponding to all the occurring events; monitoring the inside of the ECS framework, and obtaining the signals generated inside the ECS framework;
[0006] Step S2, based on the signal mapping table, sending the signals generated inside the ECS framework to different threads to generate corresponding signal queues; based on the signal generation characteristic information of the signal queues, performing signal merging processing on the signal queues, and monitoring the signal queues that have completed the signal merging processing to obtain the signal response processing progress information of the signal queues;
[0007] Step S3, based on the signal response processing progress information, respond to the event occurring in the entity within the ECS framework to obtain a corresponding processing output result; analyze the processing output result to determine whether the event occurring in the entity is correctly processed;
[0008] Step S4, when the event occurring in the entity is correctly processed, the entity's subordinate components are instructed to complete corresponding action operations; when the event occurring in the entity is not correctly processed, the signal queue is updated with a signal, and the event occurring in the entity is responded to and processed again until the event is correctly processed.
[0009] In one embodiment disclosed in the present application, in the step S1, event attribute information of all entities in the ECS framework is obtained, and based on the event attribute information, signal setting is performed for all events occurring in all entities, and a signal mapping table corresponding to all the occurring events is generated; the ECS framework is monitored to obtain the signal generated in the ECS framework, including:
[0010] Based on the name information of all entities within the ECS framework, the historical operation logs of the ECS framework are filtered and processed to obtain the historical event operation records of all entities within the ECS framework;
[0011] Analyze the historical event operation records to obtain the action content information of all events occurring in all entities, and use this as the event attribute information; compare all the action content information with the signal content information of all signals that can be generated by the ECS framework, determine the similarity between each action content information and each signal content information, and then based on the similarity, perform one-to-one signal setting for the events occurring in all entities, and generate a signal mapping table corresponding to all the events occurring;
[0012] Based on the entity processing data rate within the ECS framework, an entity in an active running state is identified; the entity in the active running state is monitored, all signals generated within the ECS framework are obtained, and generation event identification processing is performed on all the monitored signals respectively.
[0013] In one embodiment disclosed in the present application, in the step S2, based on the signal mapping table, the signal generated inside the ECS framework is sent to different threads to generate corresponding signal queues; based on the signal generation characteristic information of the signal queue, the signal queue is subjected to signal merging processing, and the signal queue that has completed the signal merging processing is monitored to obtain the signal response processing progress information of the signal queue, including:
[0014] Based on the signal mapping table, identifying event attribute information corresponding to the signal generated inside the ECS framework; based on the event attribute information of the signal generated inside the ECS framework, sending signals corresponding to all events that can be processed using the same process to the same thread, and sending signals corresponding to events that cannot be processed using the same process to different threads, thereby generating a corresponding signal queue;
[0015] Based on the generation event information of all the signals within the signal queue, all the signals generated within the preset event interval are merged and processed, and the arrangement positions of the signals that have completed the merge processing within the signal queue are adjusted; the signal queue that has completed the signal merge processing is monitored to obtain the response parsing and processing progress information of all the signals within the signal queue; wherein the response parsing and processing progress information includes the code data ratio information of the signals within the signal queue that have completed the parsing and processing.
[0016] In one embodiment disclosed in the present application, in the step S3, based on the signal response processing progress information, a response processing is performed on an event occurring in an entity within the ECS framework to obtain a corresponding processing output result; and the processing output result is analyzed to determine whether the event occurring in the entity is correctly processed, including:
[0017] Based on the signal response processing progress information, the signal that has completed the response parsing processing is identified from the signal queue to obtain the operation data of the event occurring in the corresponding entity within the ECS framework, and the operation data of the event is processed to obtain the component type information required for the corresponding event operation as the processing output result; the component type information required for the event operation is compared with the component type information contained in the entity subordinates. If the two are consistent, it is determined that the event occurring in the entity is correctly processed; if the two are inconsistent, it is determined that the event occurring in the entity is not correctly processed.
[0018] In one embodiment disclosed in the present application, in step S4, when the event occurring in the entity is correctly processed, the entity subordinate components are instructed to complete corresponding action operations; when the event occurring in the entity is not correctly processed, after the signal queue is updated, the event occurring in the entity is responded to again until the event is correctly processed, including:
[0019] When the event occurring in the entity is correctly processed, the corresponding task process is loaded to the corresponding component under the entity to complete the corresponding action operation; when the event occurring in the entity is not correctly processed, the signal corresponding to the event occurring in the entity is reloaded into the free position inside the signal queue, and the event occurring in the entity is responded to and processed again until the event is correctly processed.
[0020] The present invention also provides a multi-threaded signal synchronization processing system based on an ECS framework, comprising:
[0021] The signal definition module is used to obtain the event attribute information of all entities in the ECS framework, and based on the event attribute information, perform signal setting for all events occurring in all entities, and generate a signal mapping table corresponding to all the events occurring;
[0022] A signal monitoring module, used to monitor the inside of the ECS framework and obtain the signal generated inside the ECS framework;
[0023] A signal queue generation module, used to send the signals generated inside the ECS framework to different threads based on the signal mapping table to generate corresponding signal queues;
[0024] A signal merging module, configured to perform signal merging processing on the signal queue based on the signal generation characteristic information of the signal queue, and monitor the signal queue on which the signal merging processing has been completed to obtain signal response processing progress information of the signal queue;
[0025] An event response processing module, used to respond to events occurring in entities within the ECS framework based on the signal response processing progress information, so as to obtain corresponding processing output results;
[0026] A processing result judgment module is used to analyze the processing output result to determine whether the event occurring in the entity is correctly processed;
[0027] A component action control module is used to instruct the components under the entity to complete corresponding action operations when the events occurring in the entity are correctly processed;
[0028] The signal queue update processing module is used to update the signal queue when the event occurring in the entity is not processed correctly, and then respond to the event occurring in the entity again until the event is processed correctly.
[0029] In one embodiment disclosed in the present application, the signal definition module is used to obtain event attribute information of all entities within the ECS framework, and based on the event attribute information, perform signal settings for all events occurring in all entities, and generate a signal mapping table corresponding to all the events occurring, including:
[0030] Based on the name information of all entities within the ECS framework, the historical operation logs of the ECS framework are filtered and processed to obtain the historical event operation records of all entities within the ECS framework;
[0031] Analyze the historical event operation records to obtain the action content information of all events occurring in all entities, and use this as the event attribute information; compare all the action content information with the signal content information of all signals that can be generated by the ECS framework, determine the similarity between each action content information and each signal content information, and then based on the similarity, perform one-to-one signal setting for the events occurring in all entities, and generate a signal mapping table corresponding to all the events occurring;
[0032] The signal monitoring module is used to monitor the inside of the ECS framework and obtain the signal generated inside the ECS framework, including:
[0033] Based on the entity processing data rate within the ECS framework, an entity in an active running state is identified; the entity in the active running state is monitored, all signals generated within the ECS framework are obtained, and generation event identification processing is performed on all the monitored signals respectively.
[0034] In one embodiment disclosed in the present application, the signal queue generation module is used to send the signals generated inside the ECS framework to different threads based on the signal mapping table to generate corresponding signal queues, including:
[0035] Based on the signal mapping table, identifying event attribute information corresponding to the signal generated inside the ECS framework; based on the event attribute information of the signal generated inside the ECS framework, sending signals corresponding to all events that can be processed using the same process to the same thread, and sending signals corresponding to events that cannot be processed using the same process to different threads, thereby generating a corresponding signal queue;
[0036] The signal merging module is used to generate characteristic information of the signal of the signal queue, perform signal merging processing on the signal queue, monitor the signal queue that has completed the signal merging processing, and obtain the signal response processing progress information of the signal queue, including:
[0037] Based on the generation event information of all the signals within the signal queue, all the signals generated within the preset event interval are merged and processed, and the arrangement positions of the signals that have completed the merge processing within the signal queue are adjusted; the signal queue that has completed the signal merge processing is monitored to obtain the response parsing and processing progress information of all the signals within the signal queue; wherein the response parsing and processing progress information includes the code data ratio information of the signals within the signal queue that have completed the parsing and processing.
[0038] In one embodiment disclosed in the present application, the event response processing module is used to respond to events occurring in the internal entity of the ECS framework based on the signal response processing progress information, so as to obtain corresponding processing output results, including:
[0039] Based on the signal response processing progress information, the signal that has completed the response parsing processing is identified from the signal queue, so as to obtain the operation data of the event occurring in the corresponding entity within the ECS framework, and the operation data of the event is processed to obtain the component type information required for the corresponding event operation as the processing output result;
[0040] The processing result judgment module is used to analyze the processing output result to judge whether the event occurring in the entity is correctly processed, including:
[0041] The component type information required for the event operation is compared with the component type information contained in the entity. If the two are consistent, it is determined that the event occurring in the entity is correctly processed; if the two are inconsistent, it is determined that the event occurring in the entity is not correctly processed.
[0042] In one embodiment disclosed in the present application, the component action control module is used to instruct the entity's subordinate components to complete corresponding action operations when the event occurring in the entity is correctly processed, including:
[0043] When the event occurring in the entity is correctly processed, the corresponding task process is loaded to the corresponding component under the entity to complete the corresponding action operation;
[0044] The signal queue update processing module is used to update the signal queue and respond to the event of the entity again after the event of the entity is not correctly processed until the event is correctly processed, including:
[0045] When the event occurring in the entity is not processed correctly, the signal corresponding to the event occurring in the entity is reloaded into the free position in the signal queue, and the event occurring in the entity is responded to and processed again until the event is processed correctly.
[0046] Compared with the prior art, the multi-threaded signal synchronization processing method and system based on the ECS framework performs signal setting for all events occurring in all entities based on the event attribute information of all entities within the ECS framework, generates a signal mapping table corresponding to all the events occurring, realizes a one-to-one correspondence definition between signals and events, and obtains the generated signals from the ECS framework to obtain the operation requirements of the framework in a timely manner; based on the signal mapping table, the signals generated within the ECS framework are sent to different threads, corresponding signal queues are generated, and directional thread allocation of signals is realized, effectively solving the thread competition problem; the signal queues are also processed for signal merging, and the signal response processing progress information of the signal queues is obtained, so as to respond to the events occurring in the entities within the ECS framework in a timely manner, and judge whether the events occurring in the entities are correctly processed, thereby ensuring the timeliness of the processing of events within the framework, and then instructing the subordinate components of the entities to complete the corresponding action operations, thereby improving the execution efficiency and reliability of the events within the framework.
[0047] 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.
[0048] The technical solution of the present invention is further described in detail below through the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] 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.
[0050] Figure 1 A schematic diagram of a multi-threaded signal synchronization processing method based on an ECS framework provided by the present invention;
[0051] Figure 2 A schematic diagram of the framework of a multi-threaded signal synchronization processing system based on the ECS framework provided by the present invention. DETAILED DESCRIPTION
[0052] 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.
[0053] See also Figure 1 , is a flow chart of a multi-threaded signal synchronization processing method based on an ECS framework provided by an embodiment of the present invention. The multi-threaded signal synchronization processing method based on an ECS framework includes:
[0054] Step S1, obtaining event attribute information of all entities within the ECS framework, and based on the event attribute information, performing signal setting for all events occurring in all entities, generating a signal mapping table corresponding to all the occurring events; monitoring the ECS framework, and obtaining the signals generated within the ECS framework;
[0055] Step S2: Based on the signal mapping table, the signal generated inside the ECS framework is sent to different threads to generate corresponding signal queues; based on the signal generation characteristic information of the signal queue, the signal queue is subjected to signal merging processing, and the signal queue that has completed the signal merging processing is monitored to obtain the signal response processing progress information of the signal queue;
[0056] Step S3, based on the signal response processing progress information, respond to the event occurring in the entity within the ECS framework to obtain a corresponding processing output result; analyze the processing output result to determine whether the event occurring in the entity is correctly processed;
[0057] Step S4, when the event occurring in the entity is correctly processed, the subordinate components of the entity are instructed to complete the corresponding action operation; when the event occurring in the entity is not correctly processed, the signal queue is updated with a signal, and the event occurring in the entity is responded to and processed again until the event is correctly processed.
[0058] The multi-threaded signal synchronization processing method based on the ECS framework is based on the event attribute information of all entities in the ECS framework, sets signals for all events occurring in all entities, generates a signal mapping table corresponding to all the occurring events, realizes a one-to-one corresponding definition between signals and events, and obtains the generated signals from the ECS framework by monitoring, and timely obtains the operation requirements of the framework; based on the signal mapping table, the signals generated in the ECS framework are sent to different threads, and corresponding signal queues are generated, so as to realize directional thread allocation of signals and effectively solve the thread competition problem; the signal queues are also processed by signal merging, and the signal response processing progress information of the signal queues is obtained, so as to timely respond to the events occurring in the entities in the ECS framework, judge whether the events occurring in the entities are correctly processed, ensure the timeliness of the event processing in the framework, and then instruct the subordinate components of the entities to complete the corresponding action operations, so as to improve the execution efficiency and reliability of the events in the framework.
[0059] Preferably, in step S1, event attribute information of all entities in the ECS framework is obtained, and based on the event attribute information, signal setting is performed for all events occurring in all entities, and a signal mapping table corresponding to all the occurring events is generated; the ECS framework is monitored to obtain the signal generated in the ECS framework, including:
[0060] Based on the name information of all entities within the ECS framework, the historical operation logs of the ECS framework are filtered and processed to obtain the historical event operation records of all entities within the ECS framework;
[0061] Analyze the historical event operation records to obtain the action content information of all events occurring in all entities, and use this as the event attribute information; compare all action content information with the signal content information of all signals that can be generated by the ECS framework, determine the similarity between each action content information and each signal content information, and then based on the similarity, perform one-to-one signal setting for events occurring in all entities, and generate a signal mapping table corresponding to all the events occurring;
[0062] Based on the entity processing data rate within the ECS framework, the entities in the active running state are identified; the entities in the active running state are monitored, all signals generated within the ECS framework are obtained, and generation event identification processing is performed on all the monitored signals respectively.
[0063] In the above technical scheme, the ECS framework corresponding to the game inside the smart phone contains multiple entities corresponding to the game, each entity has a unique name information, and the events that can be operated by each entity are also fixed. For this reason, the name information of all entities inside the ECS framework is used as a benchmark, and the historical operation log of the ECS framework is screened and processed to obtain the historical event operation records corresponding to all entities. The historical event operation record includes the events that can be operated by each entity and the action content information of all events under it, so as to accurately identify the events that can be operated by each entity. Then the historical event operation record is analyzed to obtain the action content information of all events that occurred in all entities, and all the action content information is compared with the signal content information of all signals that can be generated by the ECS framework, and the similarity between each action content information and each signal content information is determined, so that the event and signal corresponding to the entity with the maximum similarity are uniquely set, so as to generate a signal mapping table corresponding to all events that occurred in the entity, and the corresponding event can be determined according to the received signal by querying the signal mapping table, so as to provide a reliable basis for sending the signal into the corresponding signal queue later. The entity processing data rate inside the ECS framework is obtained, and the entity processing data rate is compared with the preset rate threshold. If the entity processing data rate is greater than the preset rate threshold, it is determined that the entity is in an active running state; otherwise, it is determined that the entity is not in an active running state, and then the entity in the active running state is monitored to obtain all signals generated inside the ECS framework, and all the monitored signals are processed with generation event identification, so as to ensure the subsequent accurate processing of the signals inside the ECS framework.
[0064] Preferably, in step S2, based on the signal mapping table, the signal generated inside the ECS framework is sent to different threads to generate corresponding signal queues; based on the signal generation characteristic information of the signal queue, the signal queue is subjected to signal merging processing, and the signal queue that has completed the signal merging processing is monitored to obtain the signal response processing progress information of the signal queue, including:
[0065] Based on the signal mapping table, the event attribute information corresponding to the signal generated inside the ECS framework is identified; based on the event attribute information of the signal generated inside the ECS framework, the signals corresponding to all events that can be processed by the same process are sent to the same thread, and the signals corresponding to events that cannot be processed by the same process are sent to different threads, so as to generate a corresponding signal queue;
[0066] Based on the generation event information of all the signals within the signal queue, all the signals generated in the preset event interval are merged and processed, and the arrangement positions of the signals that have completed the merge processing within the signal queue are adjusted; the signal queue that has completed the signal merge processing is monitored to obtain the response parsing and processing progress information of all the signals within the signal queue; wherein the response parsing and processing progress information includes the code data ratio information of the signals within the signal queue that have completed the parsing and processing.
[0067] In the above technical solution, the signal mapping table uniquely defines the correspondence between the signal and the event within the ECS framework, and identifies the event attribute information corresponding to the signal generated within the ECS framework based on the signal mapping table, thereby identifying the attribute of the event that triggers the signal generation, and based on the event attribute information of the signal generated within the ECS framework, the signals corresponding to all events that can be processed by the same process are sent to the same thread, and the signals corresponding to the events that cannot be processed by the same process are sent to different threads, so as to generate a corresponding signal queue, so that the events corresponding to all signals within the same signal queue have the same event processing requirements, so that the subsequent threads can perform integrated operations on the events corresponding to all signals under the corresponding signal queue, thereby improving the efficiency of event operations. In addition, based on the event information generated by all signals within the signal queue, all signals generated within the preset event interval are merged, that is, several signals generated within the signal queue with adjacent generation times are merged, so that the subsequent signal analysis efficiency can be improved, and there is no need to perform separate analysis and processing on all signals under the signal queue, ensuring timely response to the signal. In addition, the arrangement position of the signal that has completed the merge processing within the signal queue is adjusted, for example, the signal that has completed the merge processing is adjusted to a higher priority arrangement position within the signal queue, so as to facilitate timely parsing and processing of the signal that has completed the merge processing. The signal queue that has completed the signal merging processing is also monitored to obtain the response parsing and processing progress information of all signals in the signal queue, and obtain the proportion of code data that has completed the parsing and processing within the signal, so as to provide a quantitative basis for subsequent judgment of whether the signal has completed the response parsing and processing.
[0068] Preferably, in step S3, based on the signal response processing progress information, a response processing is performed on an event occurring in an entity within the ECS framework to obtain a corresponding processing output result; and the processing output result is analyzed to determine whether the event occurring in the entity is correctly processed, including:
[0069] Based on the signal response processing progress information, the signal that has completed the response parsing processing is identified from the signal queue to obtain the operation data of the event occurring in the corresponding entity within the ECS framework, and the operation data of the event is processed to obtain the component type information required for the corresponding event operation, which is used as the processing output result; the component type information required for the event operation is compared with the component type information contained in the entity. If the two are consistent, it is determined that the event occurring in the entity is correctly processed; if the two are inconsistent, it is determined that the event occurring in the entity is not correctly processed.
[0070] In the above technical scheme, if the signal response processing progress information indicates that the proportion of code data that has been parsed and processed within the signal is 100%, it is determined that the signal has completed the response parsing processing. At this time, the operation data of the event occurring in the corresponding entity within the ECS framework is obtained, and the operation data of the event is processed to obtain the component type information required for the corresponding event operation, so that the component type of the entity required for the event operation can be accurately determined. Then the component type information required for the event operation is compared with the component type information contained in the entity. If the two are consistent, that is, the component type required for the event operation completely belongs to the component type contained in the entity, the event occurring in the entity is correctly processed, that is, the entity can independently complete the event operation by relying on its own subordinate components; if the two are inconsistent, that is, the component type required for the event operation does not completely belong to the component type contained in the entity, the event occurring in the entity is not correctly processed, and the event operation cannot be completed by relying solely on the components contained in the entity, thereby providing a reliable basis for subsequent adjustment of event processing operations.
[0071] Preferably, in step S4, when the event occurring in the entity is correctly processed, the subordinate components of the entity are instructed to complete the corresponding action operation; when the event occurring in the entity is not correctly processed, after the signal queue is updated, the event occurring in the entity is responded to again until the event is correctly processed, including:
[0072] When the event occurring in the entity is correctly processed, the corresponding task process is loaded to the corresponding component under the entity to complete the corresponding action operation; when the event occurring in the entity is not correctly processed, the signal corresponding to the event occurring in the entity is reloaded into the free position in the signal queue, and the event occurring in the entity is responded to and processed again until the event is correctly processed.
[0073] In the above technical solution, when the event of the entity is correctly processed, the corresponding task process is loaded to the corresponding component under the entity to complete the corresponding action operation, so as to ensure the accurate and efficient operation of the entity on the event. When the event of the entity is not correctly processed, the signal corresponding to the event of the entity is reloaded into the free position in the signal queue, and the event of the entity is responded to again until the event is correctly processed, thereby ensuring that the signal can be correctly parsed and processed again, and accurate changes are made for subsequent event operations.
[0074] See also Figure 2 , is a schematic diagram of a framework of a multi-threaded signal synchronization processing system based on an ECS framework provided by an embodiment of the present invention. The multi-threaded signal synchronization processing system based on an ECS framework includes:
[0075] The signal definition module is used to obtain the event attribute information of all entities within the ECS framework, and based on the event attribute information, set signals for all events occurring in all entities, and generate a signal mapping table corresponding to all the events occurring;
[0076] A signal monitoring module is used to monitor the inside of the ECS framework and obtain the signals generated inside the ECS framework;
[0077] A signal queue generation module is used to send the signals generated inside the ECS framework to different threads based on the signal mapping table to generate corresponding signal queues;
[0078] A signal merging module is used to generate characteristic information of the signal of the signal queue, perform signal merging processing on the signal queue, and monitor the signal queue that has completed the signal merging processing to obtain signal response processing progress information of the signal queue;
[0079] An event response processing module is used to respond to and process events occurring in the internal entity of the ECS framework based on the signal response processing progress information, so as to obtain corresponding processing output results;
[0080] The processing result judgment module is used to analyze the processing output result and judge whether the event occurred in the entity is correctly processed;
[0081] The component action control module is used to instruct the entity's subordinate components to complete the corresponding action operations when the events occurring in the entity are correctly processed;
[0082] The signal queue update processing module is used to update the signal queue when the event occurring in the entity is not correctly processed, and then respond to the event occurring in the entity again until the event is correctly processed.
[0083] The multi-threaded signal synchronization processing system based on the ECS framework performs signal setting for all events occurring in all entities based on the event attribute information of all entities within the ECS framework, generates a signal mapping table corresponding to all the occurring events, realizes a one-to-one correspondence definition between signals and events, and obtains the generated signals from within the ECS framework, and timely obtains the operation requirements of the framework; based on the signal mapping table, the signals generated within the ECS framework are sent to different threads, and corresponding signal queues are generated, so as to realize directional thread allocation of signals and effectively solve the problem of thread competition; the signal queues are also processed for signal merging, and the signal response processing progress information of the signal queues is obtained, so as to timely respond to the events occurring in the entities within the ECS framework, and judge whether the events occurring in the entities are correctly processed, so as to ensure the timeliness of the processing of the events within the framework, and then instruct the subordinate components of the entities to complete the corresponding action operations, so as to improve the execution efficiency and reliability of the events within the framework.
[0084] Preferably, the signal definition module is used to obtain event attribute information of all entities within the ECS framework, and based on the event attribute information, perform signal settings for all events occurring in all entities, and generate a signal mapping table corresponding to all the occurring events, including:
[0085] Based on the name information of all entities within the ECS framework, the historical operation logs of the ECS framework are filtered and processed to obtain the historical event operation records of all entities within the ECS framework;
[0086] Analyze the historical event operation records to obtain the action content information of all events occurring in all entities, and use this as the event attribute information; compare all action content information with the signal content information of all signals that can be generated by the ECS framework, determine the similarity between each action content information and each signal content information, and then based on the similarity, perform one-to-one signal setting for events occurring in all entities, and generate a signal mapping table corresponding to all the events occurring;
[0087] The signal monitoring module is used to monitor the inside of the ECS framework and obtain the signal generated inside the ECS framework, including:
[0088] Based on the entity processing data rate within the ECS framework, the entities in the active running state are identified; the entities in the active running state are monitored, all signals generated within the ECS framework are obtained, and generation event identification processing is performed on all the monitored signals respectively.
[0089] In the above technical scheme, the ECS framework corresponding to the game inside the smart phone contains multiple entities corresponding to the game, each entity has a unique name information, and the events that can be operated by each entity are also fixed. For this reason, the name information of all entities inside the ECS framework is used as a benchmark, and the historical operation log of the ECS framework is screened and processed to obtain the historical event operation records corresponding to all entities. The historical event operation record includes the events that can be operated by each entity and the action content information of all events under it, so as to accurately identify the events that can be operated by each entity. Then the historical event operation record is analyzed to obtain the action content information of all events that occurred in all entities, and all the action content information is compared with the signal content information of all signals that can be generated by the ECS framework, and the similarity between each action content information and each signal content information is determined, so that the event and signal corresponding to the entity with the maximum similarity are uniquely set, so as to generate a signal mapping table corresponding to all events that occurred in the entity, and the corresponding event can be determined according to the received signal by querying the signal mapping table, so as to provide a reliable basis for sending the signal into the corresponding signal queue later. The entity processing data rate inside the ECS framework is obtained, and the entity processing data rate is compared with the preset rate threshold. If the entity processing data rate is greater than the preset rate threshold, it is determined that the entity is in an active running state; otherwise, it is determined that the entity is not in an active running state, and then the entity in the active running state is monitored to obtain all signals generated inside the ECS framework, and all the monitored signals are processed with generation event identification, so as to ensure the subsequent accurate processing of the signals inside the ECS framework.
[0090] Preferably, the signal queue generation module is used to send the signals generated inside the ECS framework to different threads based on the signal mapping table to generate corresponding signal queues, including:
[0091] Based on the signal mapping table, the event attribute information corresponding to the signal generated inside the ECS framework is identified; based on the event attribute information of the signal generated inside the ECS framework, the signals corresponding to all events that can be processed by the same process are sent to the same thread, and the signals corresponding to events that cannot be processed by the same process are sent to different threads, so as to generate a corresponding signal queue;
[0092] The signal merging module is used to generate characteristic information of the signal of the signal queue, perform signal merging processing on the signal queue, and monitor the signal queue that has completed the signal merging processing to obtain the signal response processing progress information of the signal queue, including:
[0093] Based on the generation event information of all the signals within the signal queue, all the signals generated in the preset event interval are merged and processed, and the arrangement positions of the signals that have completed the merge processing within the signal queue are adjusted; the signal queue that has completed the signal merge processing is monitored to obtain the response parsing and processing progress information of all the signals within the signal queue; wherein the response parsing and processing progress information includes the code data ratio information of the signals within the signal queue that have completed the parsing and processing.
[0094] In the above technical solution, the signal mapping table uniquely defines the correspondence between the signal and the event within the ECS framework, and identifies the event attribute information corresponding to the signal generated within the ECS framework based on the signal mapping table, thereby identifying the attribute of the event that triggers the signal generation, and based on the event attribute information of the signal generated within the ECS framework, the signals corresponding to all events that can be processed by the same process are sent to the same thread, and the signals corresponding to the events that cannot be processed by the same process are sent to different threads, so as to generate a corresponding signal queue, so that the events corresponding to all signals within the same signal queue have the same event processing requirements, so that the subsequent threads can perform integrated operations on the events corresponding to all signals under the corresponding signal queue, thereby improving the efficiency of event operations. In addition, based on the event information generated by all signals within the signal queue, all signals generated within the preset event interval are merged, that is, several signals generated within the signal queue with adjacent generation times are merged, so that the subsequent signal analysis efficiency can be improved, and there is no need to perform separate analysis and processing on all signals under the signal queue, ensuring timely response to the signal. In addition, the arrangement position of the signal that has completed the merge processing within the signal queue is adjusted, for example, the signal that has completed the merge processing is adjusted to a higher priority arrangement position within the signal queue, so as to facilitate timely parsing and processing of the signal that has completed the merge processing. The signal queue that has completed the signal merging processing is also monitored to obtain the response parsing and processing progress information of all signals in the signal queue, and obtain the proportion of code data that has completed the parsing and processing within the signal, so as to provide a quantitative basis for subsequent judgment of whether the signal has completed the response parsing and processing.
[0095] Preferably, the event response processing module is used to respond to the event occurring in the internal entity of the ECS framework based on the signal response processing progress information, so as to obtain the corresponding processing output result, including:
[0096] Based on the signal response processing progress information, the signal that has completed the response parsing processing is identified from the signal queue, so as to obtain the operation data of the event occurring in the corresponding entity within the ECS framework, and the operation data of the event is processed to obtain the component type information required for the corresponding event operation as the processing output result;
[0097] The processing result judgment module is used to analyze the processing output result to determine whether the event occurring in the entity is correctly processed, including:
[0098] The component type information required for the event operation is compared with the component type information contained in the entity. If the two are consistent, it is determined that the event occurring in the entity is correctly processed; if the two are inconsistent, it is determined that the event occurring in the entity is not correctly processed.
[0099] In the above technical scheme, if the signal response processing progress information indicates that the proportion of code data that has been parsed and processed within the signal is 100%, it is determined that the signal has completed the response parsing processing. At this time, the operation data of the event occurring in the corresponding entity within the ECS framework is obtained, and the operation data of the event is processed to obtain the component type information required for the corresponding event operation, so that the component type of the entity required for the event operation can be accurately determined. Then the component type information required for the event operation is compared with the component type information contained in the entity. If the two are consistent, that is, the component type required for the event operation completely belongs to the component type contained in the entity, the event occurring in the entity is correctly processed, that is, the entity can independently complete the event operation by relying on its own subordinate components; if the two are inconsistent, that is, the component type required for the event operation does not completely belong to the component type contained in the entity, the event occurring in the entity is not correctly processed, and the event operation cannot be completed by relying solely on the components contained in the entity, thereby providing a reliable basis for subsequent adjustment of event processing operations.
[0100] Preferably, the component action control module is used to instruct the entity's subordinate components to complete corresponding action operations when the event occurring in the entity is correctly processed, including:
[0101] When the event of the entity is correctly handled, the corresponding task process is loaded to the corresponding component under the entity to complete the corresponding action operation;
[0102] The signal queue update processing module is used to update the signal queue when the event of the entity is not correctly processed, and then respond to the event of the entity again until the event is correctly processed, including:
[0103] When the event occurring in the entity is not processed correctly, the signal corresponding to the event occurring in the entity is reloaded into the free position in the signal queue, and the event occurring in the entity is responded to and processed again until the event is processed correctly.
[0104] In the above technical solution, when the event of the entity is correctly processed, the corresponding task process is loaded to the corresponding component under the entity to complete the corresponding action operation, so as to ensure the accurate and efficient operation of the entity on the event. When the event of the entity is not correctly processed, the signal corresponding to the event of the entity is reloaded into the free position in the signal queue, and the event of the entity is responded to again until the event is correctly processed, thereby ensuring that the signal can be correctly parsed and processed again, and accurate changes are made for subsequent event operations.
[0105] It can be seen from the contents of the above embodiments that the multi-threaded signal synchronization processing method and system based on the ECS framework performs signal setting for all events occurring in all entities based on the event attribute information of all entities within the ECS framework, generates a signal mapping table corresponding to all the events occurring, realizes a one-to-one correspondence definition between signals and events, and obtains the generated signals from the ECS framework by monitoring the generated signals, and timely obtains the operation requirements of the framework; based on the signal mapping table, the signals generated inside the ECS framework are sent to different threads, and corresponding signal queues are generated to realize directional thread allocation of signals, effectively solving the thread competition problem; the signal queues are also processed for signal merging, and the signal response processing progress information of the signal queues is obtained, so as to timely respond to the events occurring in the entities within the ECS framework, and judge whether the events occurring in the entities are correctly processed, ensure the timeliness of the event processing within the framework, and then instruct the subordinate components of the entities to complete the corresponding action operations, thereby improving the execution efficiency and reliability of the events within the framework.
[0106] 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 multi-threaded signal synchronization processing method based on the ECS framework, characterized in that: It includes the following steps: Step S1, obtaining event attribute information of all entities within the ECS framework, and based on the event attribute information, performing signal setting for all events occurring in all entities, generating a signal mapping table corresponding to all the occurring events; monitoring the inside of the ECS framework, and obtaining the signals generated inside the ECS framework; Step S2, based on the signal mapping table, sending the signals generated inside the ECS framework to different threads to generate corresponding signal queues; based on the signal generation characteristic information of the signal queues, performing signal merging processing on the signal queues, and monitoring the signal queues that have completed the signal merging processing to obtain the signal response processing progress information of the signal queues; Step S3, based on the signal response processing progress information, respond to the event occurring in the entity within the ECS framework to obtain a corresponding processing output result; analyze the processing output result to determine whether the event occurring in the entity is correctly processed; Step S4, when the event occurring in the entity is correctly processed, the entity's subordinate components are instructed to complete corresponding action operations; when the event occurring in the entity is not correctly processed, the signal queue is updated with a signal, and the event occurring in the entity is responded to and processed again until the event is correctly processed.
2. The multi-threaded signal synchronization processing method based on the ECS framework as claimed in claim 1, characterized in that: In the step S1, event attribute information of all entities within the ECS framework is obtained, and based on the event attribute information, signal setting is performed for all events occurring in all entities, and a signal mapping table corresponding to all the occurring events is generated; Monitoring the inside of the ECS framework to obtain a signal generated inside the ECS framework includes: Based on the name information of all entities within the ECS framework, the historical operation logs of the ECS framework are filtered and processed to obtain the historical event operation records of all entities within the ECS framework; Analyze the historical event operation records to obtain the action content information of all events occurring in all entities, and use this as the event attribute information; compare all the action content information with the signal content information of all signals that can be generated by the ECS framework, determine the similarity between each action content information and each signal content information, and then based on the similarity, perform one-to-one signal setting for the events occurring in all entities, and generate a signal mapping table corresponding to all the events occurring; Based on the entity processing data rate within the ECS framework, an entity in an active running state is identified; the entity in the active running state is monitored, all signals generated within the ECS framework are obtained, and generation event identification processing is performed on all the monitored signals respectively.
3. The multi-threaded signal synchronization processing method based on the ECS framework as claimed in claim 1, characterized in that: In the step S2, based on the signal mapping table, the signal generated inside the ECS framework is sent to different threads to generate corresponding signal queues; based on the signal generation characteristic information of the signal queue, the signal queue is subjected to signal merging processing, and the signal queue that has completed the signal merging processing is monitored to obtain the signal response processing progress information of the signal queue, including: Based on the signal mapping table, identifying event attribute information corresponding to the signal generated inside the ECS framework; based on the event attribute information of the signal generated inside the ECS framework, sending signals corresponding to all events that can be processed using the same process to the same thread, and sending signals corresponding to events that cannot be processed using the same process to different threads, thereby generating a corresponding signal queue; Based on the generation event information of all the signals within the signal queue, all the signals generated within the preset event interval are merged and processed, and the arrangement positions of the signals that have completed the merge processing within the signal queue are adjusted; the signal queue that has completed the signal merge processing is monitored to obtain the response parsing and processing progress information of all the signals within the signal queue; wherein the response parsing and processing progress information includes the code data ratio information of the signals within the signal queue that have completed the parsing and processing.
4. The multi-threaded signal synchronization processing method based on the ECS framework as claimed in claim 1, characterized in that: In the step S3, based on the signal response processing progress information, the event occurring in the entity inside the ECS framework is responded to and processed, so as to obtain a corresponding processing output result; Analyzing the processing output result to determine whether the event occurring at the entity is processed correctly includes: Based on the signal response processing progress information, the signal that has completed the response parsing processing is identified from the signal queue, so as to obtain the operation data of the event occurring in the corresponding entity within the ECS framework, and the operation data of the event is processed to obtain the component type information required for the corresponding event operation, which is used as the processing output result; the component type information required for the event operation is compared with the component type information contained in the entity subordinates, and if the two are consistent, it is determined that the event occurring in the entity is correctly processed; If the two are inconsistent, it is determined that the event occurring in the entity is not processed correctly.
5. The multi-threaded signal synchronization processing method based on the ECS framework as claimed in claim 1, characterized in that: In the step S4, when the event occurring in the entity is correctly processed, the entity subordinate components are instructed to complete the corresponding action operation; when the event occurring in the entity is not correctly processed, after the signal queue is updated, the event occurring in the entity is responded to again until the event is correctly processed, including: When the event occurring in the entity is correctly processed, the corresponding task process is loaded to the corresponding component under the entity to complete the corresponding action operation; when the event occurring in the entity is not correctly processed, the signal corresponding to the event occurring in the entity is reloaded into the free position inside the signal queue, and the event occurring in the entity is responded to and processed again until the event is correctly processed.
6. A multi-threaded signal synchronization processing system based on the ECS framework, characterized in that: include: The signal definition module is used to obtain the event attribute information of all entities in the ECS framework, and based on the event attribute information, perform signal setting for all events occurring in all entities, and generate a signal mapping table corresponding to all the events occurring; A signal monitoring module, used to monitor the inside of the ECS framework and obtain the signal generated inside the ECS framework; A signal queue generation module, used to send the signals generated inside the ECS framework to different threads based on the signal mapping table to generate corresponding signal queues; A signal merging module, configured to perform signal merging processing on the signal queue based on the signal generation characteristic information of the signal queue, and monitor the signal queue on which the signal merging processing has been completed to obtain signal response processing progress information of the signal queue; An event response processing module, used to respond to events occurring in entities within the ECS framework based on the signal response processing progress information, so as to obtain corresponding processing output results; A processing result judgment module is used to analyze the processing output result to determine whether the event occurring in the entity is correctly processed; A component action control module is used to instruct the components under the entity to complete corresponding action operations when the events occurring in the entity are correctly processed; The signal queue update processing module is used to update the signal queue when the event occurring in the entity is not processed correctly, and then respond to the event occurring in the entity again until the event is processed correctly.
7. The multi-threaded signal synchronization processing system based on the ECS framework as claimed in claim 6, characterized in that: The signal definition module is used to obtain event attribute information of all entities within the ECS framework, and based on the event attribute information, perform signal settings for all events occurring in all entities, and generate a signal mapping table corresponding to all the events occurring, including: Based on the name information of all entities within the ECS framework, the historical operation logs of the ECS framework are filtered and processed to obtain the historical event operation records of all entities within the ECS framework; Analyze the historical event operation records to obtain the action content information of all events occurring in all entities, and use this as the event attribute information; compare all the action content information with the signal content information of all signals that can be generated by the ECS framework, determine the similarity between each action content information and each signal content information, and then based on the similarity, perform one-to-one signal setting for the events occurring in all entities, and generate a signal mapping table corresponding to all the events occurring; The signal monitoring module is used to monitor the inside of the ECS framework and obtain the signal generated inside the ECS framework, including: Based on the entity processing data rate within the ECS framework, an entity in an active running state is identified; the entity in the active running state is monitored, all signals generated within the ECS framework are obtained, and generation event identification processing is performed on all the monitored signals respectively.
8. The multi-threaded signal synchronization processing system based on the ECS framework as claimed in claim 6, characterized in that: The signal queue generation module is used to send the signals generated inside the ECS framework to different threads based on the signal mapping table to generate corresponding signal queues, including: Based on the signal mapping table, identifying event attribute information corresponding to the signal generated inside the ECS framework; based on the event attribute information of the signal generated inside the ECS framework, sending signals corresponding to all events that can be processed using the same process to the same thread, and sending signals corresponding to events that cannot be processed using the same process to different threads, thereby generating a corresponding signal queue; The signal merging module is used to generate characteristic information of the signal of the signal queue, perform signal merging processing on the signal queue, monitor the signal queue that has completed the signal merging processing, and obtain the signal response processing progress information of the signal queue, including: Based on the generation event information of all the signals within the signal queue, all the signals generated within the preset event interval are merged and processed, and the arrangement positions of the signals that have completed the merge processing within the signal queue are adjusted; the signal queue that has completed the signal merge processing is monitored to obtain the response parsing and processing progress information of all the signals within the signal queue; wherein the response parsing and processing progress information includes the code data ratio information of the signals within the signal queue that have completed the parsing and processing.
9. The multi-threaded signal synchronization processing system based on the ECS framework as claimed in claim 6, characterized in that: The event response processing module is used to respond to the events occurring in the internal entities of the ECS framework based on the signal response processing progress information, so as to obtain corresponding processing output results, including: Based on the signal response processing progress information, the signal that has completed the response parsing processing is identified from the signal queue, so as to obtain the operation data of the event occurring in the corresponding entity within the ECS framework, and the operation data of the event is processed to obtain the component type information required for the corresponding event operation as the processing output result; The processing result judgment module is used to analyze the processing output result to judge whether the event occurring in the entity is correctly processed, including: The component type information required for the event operation is compared with the component type information contained in the entity. If the two are consistent, it is determined that the event occurring in the entity is correctly processed; if the two are inconsistent, it is determined that the event occurring in the entity is not correctly processed.
10. The multi-threaded signal synchronization processing system based on the ECS framework as claimed in claim 6, characterized in that: The component action control module is used to instruct the entity's subordinate components to complete corresponding action operations when the event occurring in the entity is correctly processed, including: When the event occurring in the entity is correctly processed, the corresponding task process is loaded to the corresponding component under the entity to complete the corresponding action operation; The signal queue update processing module is used to update the signal queue and respond to the event of the entity again after the event of the entity is not correctly processed until the event is correctly processed, including: When the event occurring in the entity is not processed correctly, the signal corresponding to the event occurring in the entity is reloaded into the free position in the signal queue, and the event occurring in the entity is responded to and processed again until the event is processed correctly.
