Interactive Data Processing Method, Apparatus, Electronic Device, and Storage Medium
By analyzing Bluetooth interactive data in the application and setting changing parameters, combined with the verification parameters of the game engine, the problem of low Bluetooth interactive data analysis in multiplayer games is solved, achieving more efficient data processing and game performance improvement.
Patent Information
- Application Number
- CN202210392125.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-14
- Publication Date
- 2025-07-25
- Estimated Expiration
- 2042-04-14
AI Technical Summary
When multiple people use the same Bluetooth peripheral to play together, the parsing efficiency of Bluetooth interactive data is low, and it takes up too much computing power for the game engine, resulting in delayed game response.
The application's data processing thread parses Bluetooth peripheral interactive data, sets user-specific changes parameters, and judges the key operation status when the game engine feedbacks the parameters, and only checks the target keys to reduce the data processing burden of the game engine.
It improves the parsing efficiency of Bluetooth interactive data, saves the computing power of the game engine, avoids game response delays, and improves the performance of game logic processing and picture rendering.
Smart Images

Figure CN114699764B_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present application relate to the technical field of data processing, and in particular, to an interactive data processing method, apparatus, electronic device, and storage medium. Background Art
[0002] With the development of technology, people have developed entertainment from offline to online. In particular, the game industry has developed rapidly. Currently, when developing games, many development processes are based on the unity3D platform. Games developed through the unity3D platform usually include the unity3D game engine in the game APP, which is specifically used for game logic processing and screen rendering. For some games that need to use Bluetooth peripherals for interaction, such as using a dance mat and other Bluetooth peripherals for game control, it involves sending Bluetooth interaction data to the game engine, and the game engine completes the control of the game according to the Bluetooth interaction data.
[0003] During the game process, it is necessary to ensure that the Bluetooth is in a connected state. When the terminal carrying the game APP receives the Bluetooth interaction data, it will be transmitted to the game engine for data processing. This processing process includes a lot of basic processing of the data, wasting the computing power of the game engine. Moreover, for the application scenario where multiple people use the same Bluetooth peripheral to play games together, on the one hand, when multiple people use the same Bluetooth peripheral to play games together, the Bluetooth interaction data will be mixed with the interaction data corresponding to each game user, and the parsing of the Bluetooth interaction data will be more complex, which will reduce the parsing efficiency of the Bluetooth interaction data; on the other hand, due to the more content in the Bluetooth interaction data involved, the parsing process takes more time, and at the same time, it will also occupy a large amount of computing power of the game engine, which will further cause the game engine to be unable to concentrate its computing power on the processing of game logic and the rendering of the screen, resulting in the problem of response delay during the game process. Summary of the Invention
[0004] Embodiments of the present application provide an interactive data processing method, apparatus, electronic device, and storage medium to improve the parsing efficiency of Bluetooth interaction data of multiple people and save the computing power of the game engine.
[0005] In a first aspect, an embodiment of the present application provides an interactive data processing method, which is applied to an application program embedded with a game engine. The game engine is used to control a game module in the running state of the application program. The method includes:
[0006] When receiving the interaction data sent by the Bluetooth peripheral, parsing out the key operation information corresponding to each user from the interaction data, and setting the change parameter corresponding to each user to a first preset value. When the change parameter is set to the first preset value, it indicates that the key operation information of the user corresponding to the change parameter has changed;
[0007] Continuously receive the verification parameters fed back by the game engine at a preset frequency. Each time the verification parameters are received, determine whether the change parameter is the first preset value. The verification parameters include at least one user identifier and the key identifiers of the target key positions corresponding to each user identifier. The target key position is the key position to be triggered shown to the user identified by the corresponding user identifier;
[0008] When the change parameter is the first preset value, for any target user identifier and its corresponding target user, determine the key operation state corresponding to the target user according to the key identifier of the target key position corresponding to the target user identifier and the key operation information corresponding to the target user, and set the change parameter to the second preset value;
[0009] Send the key operation state corresponding to the target user to the game engine, so that the game engine can determine whether the target user has performed a key operation on the target key position according to the key operation state, and adjust the display duration of the target key position.
[0010] In a second aspect, an embodiment of the present application further provides an interactive data processing device, which includes:
[0011] A parsing module, configured to, when receiving the interactive data sent by the Bluetooth peripheral, parse out the key operation information corresponding to each user from the interactive data, and set the change parameter corresponding to each user to the first preset value. When the change parameter is set to the first preset value, it indicates that the key operation information of the user corresponding to the change parameter has changed;
[0012] A judgment module, configured to continuously receive the verification parameters fed back by the game engine at a preset frequency. Each time the verification parameters are received, determine whether the change parameter is the first preset value. The verification parameters include at least one user identifier and the key identifiers of the target key positions corresponding to each user identifier. The target key position is the key position to be triggered shown to the user identified by the corresponding user identifier;
[0013] A key operation state determination module, configured to, when the change parameter is the first preset value, for any target user identifier and its corresponding target user, determine the key operation state corresponding to the target user according to the key identifier of the target key position corresponding to the target user identifier and the key operation information corresponding to the target user, and set the change parameter to the second preset value;
[0014] A sending module, configured to send the key operation state corresponding to the target user to the game engine, so that the game engine determines whether the target user has performed a key operation on the target key according to the key operation state, and adjusts the display duration of the target key.
[0015] In a third aspect, an embodiment of the present application further provides an electronic device, where the electronic device includes:
[0016] One or more processors;
[0017] A storage device, configured to store one or more programs,
[0018] When the one or more programs are executed by the one or more processors, the one or more processors implement the interactive data processing method provided in any embodiment of the present application.
[0019] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored, and characterized in that when the program is executed by a processor, it implements the interactive data processing method provided in any embodiment of the present application.
[0020] In the technical solution of the embodiment of the present application, other data processing threads of the application program are used to complete the parsing process of the interaction data, and then the parsing result is sent to the game engine embedded in the application program. The game engine can directly perform subsequent processing according to the received parsing result of the interaction data. In this way, the game engine can concentrate its limited computing power on the processing of game logic and the rendering of the screen, saving the computing power consumed by the game engine during the parsing of the interaction data, and at the same time avoiding the problem of response delay that may occur during the game process. In addition, for the processing of the key operation information corresponding to each user in the interaction data, a corresponding change parameter is set for each user. Each time the interaction data is received, the change parameter corresponding to the user is set to the first preset value to indicate that the key operation information corresponding to the user has changed. At the same time, the verification parameter feedback by the game engine at a preset frequency is continuously received, and each time the verification parameter is received, it is judged whether the change parameter is the first preset value. Only when the change parameter is the first preset value, for any target user identifier and its corresponding target user, based on the verification parameter and the key operation information corresponding to the target user, the key operation state corresponding to the target user is determined, and the change parameter is set to the second preset value, and then the key operation state corresponding to the target user is sent to the game engine. Since the verification parameter includes at least one user identifier and the key identifier of the target key corresponding to each user identifier, and the target key is the to-be-triggered key displayed to the user identified by the corresponding user identifier, that is to say, when verifying the key operation information corresponding to the user in the present application, only the operation of the target key needs to be verified. Compared with verifying all keys in the prior art, the present application has higher processing efficiency for the interaction data. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] Figure 1 It is a schematic flowchart of the interaction data processing method provided in Embodiment 1 of the present application;
[0022] Figure 2 It is a schematic structural diagram of a two-player dance mat provided in Embodiment 1 of the present application;
[0023] Figure 3 It is a schematic flowchart of determining the key operation state provided in Embodiment 1 of the present application;
[0024] Figure 4 It is a schematic flowchart of the game engine adjusting the display duration of the target key provided in Embodiment 1 of the present application;
[0025] Figure 5 It is a schematic structural diagram of an interaction data processing device provided in Embodiment 2 of the present application;
[0026] Figure 6 It is a schematic structural diagram of an electronic device provided in Embodiment 3 of the present application. Detailed implementation manners
[0027] The present application will be further described in detail below with reference to the accompanying drawings and embodiments. It can be understood that the specific embodiments described herein are only used to explain the present application, rather than limiting the present application. In addition, it should be noted that for the convenience of description, only the parts related to the present application rather than all the structures are shown in the accompanying drawings.
[0028] Embodiment 1
[0029] Figure 1 As shown in the flowchart of the interactive data processing method provided in Embodiment 1 of the present application, this embodiment is applicable to the scenario of interactive data processing. This method is applied to an application program embedded with a game engine, and the game engine is used to control the game modules in the running state of the application program. It can be executed by an interactive data processing device, which can be implemented in a hardware and / or software manner and is generally integrated in an electronic device such as a computer with data operation capabilities. The specific steps are as follows:
[0030] Step 101: When receiving the interactive data sent by the Bluetooth peripheral device, parse out the key operation information corresponding to each user from the interactive data, and set the change parameter corresponding to each user to the first preset value.
[0031] It should be noted that when the change parameter is set to the first preset value, it indicates that the key operation information of the user corresponding to the change parameter has changed. The Bluetooth peripheral device refers to the peripheral device that needs to be operated when the user plays a game, and this peripheral device can communicate with the game running end (such as a mobile phone, a tablet, etc.) through a built-in Bluetooth module. In a specific example, the Bluetooth peripheral device can be a key operation device, such as a dance mat, a game controller, etc. For the convenience of subsequent description, this embodiment will be described by taking a dance mat as an example.
[0032] In addition, the Bluetooth peripheral device can support multiple people to play games. For example, for a dance mat, two game areas can be set. Please refer to Figure 2 , Figure 2 which is a schematic structural diagram of a two-person dance mat provided in Embodiment 1 of the present application.
[0033] There are two game areas in this two-person dance mat, namely the first game area 201 and the second game area 202, which are respectively used by two users. The key operation information corresponding to the two game areas will be encapsulated according to a preset data format, and the encapsulated interactive data will be sent by the dance mat to the game running end installed with the aforementioned application program for subsequent interactive data processing.
[0034] It should be noted that for a key operation device, the key being pressed and the key being lifted are two key states, which respectively correspond to different key operation information. Taking a dance mat as an example, in a specific example, there are 4 direction keys on the dance mat, namely "up", "down", "left", and "right", and there is also a standing key, such as "middle". Different combinations between keys can correspond to different key operations.
[0035] In order to adapt to the user's actions when using the dance mat and the corresponding key operations that are expected to be triggered, the combination of "up" and "middle" can be adapted to the user triggering the "up key operation". That is to say, when the user steps on the "middle" standing key with one foot and steps on the "up" direction key with the other foot, it is considered that the user has triggered the "up key operation".
[0036] The reason for introducing the standing key is that people are used to using one foot as a supporting foot to keep the body stable and using the other foot for other operations. Based on this habit, when designing the dance mat, a standing key (such as the oval foot pedal key in the game area in Figure 2 ) can be set. This standing key can be used for the user to stand on and can also be used for the user to keep the body stable when performing key operations.
[0037] Moreover, after introducing the standing key, not only can it adapt to the usage habits of most users, but it can also filter out some other interferences. For example, when the user is using a dance mat without a standing key and steps on a certain direction key, if a child or a pet in the family steps on other direction keys at this time, the stepping operation on other direction keys constitutes an interference during the game and belongs to accidental touch, resulting in an inability to accurately judge the key operation information corresponding to the user.
[0038] After introducing the standing key, after the user steps on "middle" and "up" at the same time, the corresponding "up key operation" has been generated. At this time, if a pet or a child steps on other keys, the combination of keys is "middle", "up", and "other". Since there is no matching key operation, this combination will not be recognized. Based on this scenario, introducing the standing key can effectively filter out this accidental touch and thus effectively avoid misjudgment of key operations.
[0039] When the dance mat transmits values to the game running end, in order to facilitate distinguishing the key operation information corresponding to each user, different element positions can be set for different users. It should be noted that the interactive data transmitted by the dance mat is a string array, and this string array includes multiple elements, and each element has a corresponding element position in the string array.
[0040] Correspondingly, when parsing the interaction data, for any target user among all users, according to the preset mapping relationship between the user and the positions of each element in the string array, the target element position corresponding to the target user is obtained, and then the target element corresponding to the target element position in the string array is extracted, and the key operation information corresponding to the target user is generated based on the target element.
[0041] In a specific example, taking two users as an example, it can be set that the elements with odd element positions are the key operation information corresponding to User 1, and the elements with even element positions are the key operation information corresponding to User 2. Then for User 1, the odd element positions can be determined as the target element positions corresponding to the user, and for User 2, the even element positions can be determined as the target element positions corresponding to the user.
[0042] Of course, the maximum number of users that different Bluetooth peripherals can support for common operations is different. Therefore, when determining the target element position, the user identifier n corresponding to the target user can be obtained first, where n = 1, 2, 3,..., N, and N is the maximum number of users that the Bluetooth peripheral can support for common operations. Then, the product of the user identifier n and the element m is determined as the target element position corresponding to the target user n, where m = 1, 2, 3,..., M, and M is the total number of elements corresponding to each user.
[0043] Still taking the above two users as an example, it should be noted that when setting the user identifier, it can be set in ascending order of positive integers (i.e., 1, 2, 3, 4, 5...). Then for the user identifier 1, if you want to obtain the first element corresponding to the user identifier 1, that is, element 1, the element position of element 1 corresponding to the user identifier 1 in the string array is the product of 1 and 1, which is element position 1, and the element position of element 2 corresponding to the user identifier 1 in the string array is the product of 1 and 2, which is element position 2; the element position of element 2 corresponding to the user identifier 2 in the string array is the product of 2 and 2, which is element position 4.
[0044] It should be noted that the maximum number of users that different Bluetooth peripherals can support for common operations is different, that is, the N values corresponding to different Bluetooth peripherals are different. Therefore, the type of the Bluetooth peripheral can be determined first, and then according to the pre-stored mapping relationship between the type of the Bluetooth peripheral and the N value, the N value corresponding to the current Bluetooth peripheral interacting with the game running end can be determined.
[0045] Specifically, an element at a certain fixed element position in the interaction data can be set as the peripheral type determination element. Since the element positions of the elements in the string array usually start from serial number 0, the element position of serial number 0 can be set as the element position of the peripheral type determination element.
[0046] Therefore, first, the peripheral device type determination element is parsed from the interaction data, then the type of the Bluetooth peripheral device is determined according to the peripheral device type determination element, and then according to the mapping relationship between the type of the pre-stored Bluetooth peripheral device and the N value, the N value corresponding to the currently interacting Bluetooth peripheral device is determined.
[0047] In addition, in this step, generating the key operation information corresponding to the target user according to the target element can be carried out in the way of single data transfer value. Single data transfer value means that the data at one position in the string array represents a transferred value.
[0048] Since in the interaction data, in addition to the key operation information corresponding to the user, other information will also be included, such as hardware information. In a specific example, taking the element as 16-bit data, generally the key operation information will be set in the lower 8 bits, and other information will be set in the higher 8 bits. Therefore, when generating the key operation information corresponding to the target user according to the target element, the preset extraction value can be used to perform an AND operation with the target element, so as to extract the data in the lower 8 bits as the key operation information.
[0049] It should be noted that the preset extraction value can be 0xff of 16 bits, and the binary representation is "0000 0000 1111 1111".
[0050] After the above process, the key operation information corresponding to each user can be extracted. In order to improve the efficiency of data processing, a change parameter is introduced in this embodiment. It should be noted that in this embodiment, a corresponding change parameter will be set for each user to indicate whether the key operation information corresponding to the user has changed.
[0051] It should be noted that the Bluetooth peripheral device usually only sends interaction data when the key position changes. Specifically, since the Bluetooth peripheral device in this embodiment has different key position states corresponding to the button being pressed and the button being lifted respectively, when the user changes from operating one key position to operating another key position, there will inevitably be a situation where the key is lifted. Even if the user operates a certain key position twice in a row, it is necessary to press the key again after the key is lifted, and the key operation information corresponding to the key being lifted is different from the key operation information corresponding to the key being pressed.
[0052] If the operation of the user pressing a certain key position is set as an effective operation, then for the above reasons, the key operation information corresponding to the user's two consecutive effective operations corresponds to 3 pieces of interaction data, that is, including the key operation information corresponding to "effective operation", the key operation information corresponding to "key lifted", and the key operation information corresponding to "next effective operation".
[0053] That is to say, the interactive data sent each time is different from the previous interactive data. Therefore, in this step, once the interactive data is received, after parsing out the key operation information corresponding to each user, the change parameter corresponding to the user will be set to the first preset value, and the first preset value indicates that the key operation information of the user corresponding to the change parameter has changed.
[0054] It should be noted that the change parameter is usually one of two values, which are the first preset value and the second preset value respectively. The first preset value indicates that the key operation information of the user corresponding to the change parameter has changed, and the second preset value indicates that the key operation information of the user corresponding to the change parameter has not changed.
[0055] Step 102: Continuously receive the verification parameters fed back by the game engine at a preset frequency. Each time the verification parameters are received, determine whether the change parameter is the first preset value.
[0056] In this step, the verification parameters include at least one user identifier and the key identifier of the target key corresponding to each user identifier. The target key is the key to be triggered shown to the user identified by the corresponding user identifier.
[0057] The game engine will feed back the verification parameters at a preset frequency. Specifically, when the game engine controls the game logic of the game, it will calculate the target key shown to the user each time, so that the user can operate the target key on the Bluetooth peripheral. To improve the parsing efficiency of the interactive data, the game engine will encapsulate the key identifier of the target key and the user identifier of the user who needs to perform the operation into the verification parameters, and continuously feed back the verification parameters at a preset frequency during the display of the target key.
[0058] Each time the verification parameters of the game engine are received, the application program will determine whether the change parameter corresponding to the user is the first preset value. Only when it is the first preset value, will the content of the subsequent step 103 be executed.
[0059] Step 103: When the change parameter is the first preset value, for any target user identifier and its corresponding target user, determine the key operation state corresponding to the target user according to the key identifier of the target key corresponding to the target user identifier and the key operation information corresponding to the target user, and set the change parameter to the second preset value.
[0060] In this step, the key operation state may include an operation determination value and an operation speed value. Specifically, the process of determining the key operation state can refer to Figure 3 , Figure 3 which is the schematic flow chart of determining the key operation state provided in Embodiment 1 of this application.
[0061] Such asFigure 3 As shown, the process of determining the key operation state may include:
[0062] Step 301: Determine whether the key identifier of the target key corresponding to the target user identifier matches the key operation information corresponding to the target user, obtain a judgment result, and determine the operation judgment value corresponding to the target user according to the judgment result.
[0063] It should be noted that this step can be determined using a switch statement. Among them, the switch statement can contain multiple program blocks, each program block will correspond to a corresponding program block label, and each program block respectively determines the operation judgment value of a key. When determining the operation judgment value, it will be determined based on the key identifier of the corresponding key.
[0064] Correspondingly, the key identifier of the target key included in the verification parameter feedback by the game engine can be used as the integer variable within the parentheses of the switch statement, and the switch statement will execute the program block with the program block label being this integer variable. That is to say, in this embodiment, only the program block corresponding to the key identifier of the target key will be executed. Compared with the method in the prior art where each key is judged, the method in this embodiment will improve the efficiency of key judgment to a certain extent, and thus improve the efficiency of interactive data processing.
[0065] In addition, "matching" in this step means being the same or corresponding. Specifically, when they are the same, the program block label needs to be directly set to the corresponding identifier of each of the foregoing key operations, and the key identifier is also set to the corresponding identifier of each of the foregoing key operations. At this time, as long as the two are the same, it can be determined that the key identifier of the target key corresponding to the target user identifier matches the key operation information corresponding to the target user.
[0066] For the corresponding method, a mapping relationship between the key identifier and the key operation needs to be established. If the key identifier and the key operation information have the established mapping relationship, it is determined that the key identifier of the target key corresponding to the target user identifier matches the key operation information corresponding to the target user.
[0067] It should be noted that when determining the operation judgment value according to the judgment result, if the key identifier of the target key corresponding to the target user identifier matches the key operation information corresponding to the target user, the operation judgment value is set to the first judgment value, and the first judgment value indicates that the target user has performed a key operation on the target key;
[0068] If the key identifier of the target key corresponding to the target user identifier does not match the key operation information corresponding to the target user, the operation judgment value is set to the second judgment value, and the second judgment value indicates that the target user has not performed a key operation on the target key.
[0069] It should be noted that both the first determination value and the second determination value can be pre-customized. As long as a mapping relationship is set between the customized value and "whether a key operation has been performed", and the game engine can determine whether the target user has performed a key operation on the target key according to this mapping relationship.
[0070] Step 302: Obtain the reference moment and the comparison moment corresponding to the key operation information of the target user in this analysis. The comparison moment includes: the first comparison moment for the key operation information of the target user in the previous analysis, or the second comparison moment for determining the operation determination value in this analysis.
[0071] Step 303: Determine the operation speed value corresponding to the target user according to the reference moment and the comparison moment.
[0072] It should be noted that there are two ways to determine the operation speed value. One is to reflect the speed at which the user operates the Bluetooth peripheral, and the other is to reflect the reaction speed of the user's operation according to the displayed target key.
[0073] For the first type, the moment of the key operation information of the target user in this analysis can be used as the reference moment, and the moment of the key operation information of the target user in the previous analysis can be used as the first comparison moment. Then, the time difference between the reference moment and the first comparison moment is determined, and the reciprocal of the time difference is determined as the operation speed value corresponding to the target user. The operation speed value is used to represent the number of operations per unit time of the target user.
[0074] For the second type, the moment of the key operation information of the target user in this analysis can be used as the reference moment, and the moment of determining the operation determination value in this analysis can be used as the second comparison moment. Then, the time difference between the reference moment and the second comparison moment is determined, and the reciprocal of the time difference is determined as the operation speed value corresponding to the target user. The operation speed value is used to represent the number of operations per unit time of the target user.
[0075] Taking the first comparison moment as an example, if the obtained reference moment is 2022-03-22-08-33-45-050 and the first comparison moment is 2022-03-22-08-33-43-650, then the time difference between the two is 1 second and 400 milliseconds, that is, 1400 milliseconds. That is to say, the time difference between the user's two operations is 1400 milliseconds. Then, the number of operations per unit time (in milliseconds) of the user, that is, the operation speed value, is 1 / 1400.
[0076] Step 304: Package the operation determination value and the operation speed value into the key operation state corresponding to the target user.
[0077] In this step, the encapsulated data format only needs to correspond to the parsing method of the game engine for parsing data. For the data encapsulation process, relevant technologies can be referred to and will not be elaborated here.
[0078] Step 104: Send the key operation status corresponding to the target user to the game engine, so that the game engine can determine whether the target user has performed a key operation on the target key according to the key operation status, and adjust the display duration of the target key.
[0079] In this step, after sending the key operation status to the game engine, the game engine will determine whether the user has performed a key operation on the target key according to the pre-established mapping relationship between the operation determination value and "whether an operation is performed".
[0080] Furthermore, the display duration of the target key can be adjusted according to this operation speed value. Specifically, reference can be made to Figure 4 , Figure 4 which is the flow diagram of the game engine adjusting the display duration of the target key provided in Embodiment 1 of this application.
[0081] As Figure 4 shown, the process of the game engine adjusting the display duration of the target key may include:
[0082] Step 401: The game engine determines the target speed interval in which the operation speed value is located based on the preset speed interval table.
[0083] In this step, the preset speed interval table can be as shown in Table 1.
[0084] Table 1
[0085] Operating speed value (times / second) Speed range Between 0 and 0.5 (excluding 0.5) [0,0.5) Between 0.5 and 1 (excluding 1) [0.5,1) Between 1 and 1.5 (excluding 1.5) [1,1.5) ...... ......
[0086] In a specific example, if the operation speed value of the target user is 1.2 times per second, it can be known from Table 1 that the corresponding target speed interval is [1, 1.5).
[0087] Step 402: The game engine determines the target display duration corresponding to the target speed interval according to the mapping relationship between the preset speed interval and the display duration.
[0088] In this step, the mapping relationship between the preset speed interval and the display duration can be as shown in Table 2.
[0089] Table 2
[0090]
[0091]
[0092] If the target speed range is [1, 1.5), it can be known from Table 2 that the target display duration corresponding to the target speed range is 0.8 seconds.
[0093] Step 403: The game engine adjusts the display duration of the target key position to the target display duration.
[0094] In this step, the display duration of the target key position for the target user can be adjusted to 0.8 seconds.
[0095] In addition, when the game engine goes from the display of the current target key position to the trigger of the display of the next target key position, a conditional determination needs to be made. For example, this conditional determination can be to determine whether the display duration of the current target key position reaches the target display duration, or this conditional determination can also be to determine whether, within the target display duration, the key position operation state corresponding to the target user is received, and the operation determination value in the key position operation state is the first determination value.
[0096] It should be noted that within the target display duration, if the key position operation state corresponding to the target user is received, and the operation determination value in the key position operation state is the first determination value, it indicates that the user has correctly performed a key position operation on the target key position according to the displayed key position to be triggered within the target display duration. As long as one of the above two conditions is met, the display of the next target key position can be triggered, as follows:
[0097] When the display duration of the current target key position reaches the target display duration, the game engine triggers the display of the next target key position;
[0098] Or, within the target display duration, when the key position operation state corresponding to the target user is received and the operation determination value in the key position operation state is the first determination value, the game engine triggers the display of the next target key position, and the first determination value indicates that the target user has performed a key position operation on the target key position.
[0099] In this embodiment, other data processing threads of the application are used to complete the parsing process of the interaction data, and then the parsing result is sent to the game engine embedded in the application. The game engine can directly perform subsequent processing based on the received parsing result of the interaction data. In this way, the game engine can concentrate its limited computing power on the processing of game logic and the rendering of the screen, saving the computing power consumed by the game engine during the processing of interaction data and avoiding the problem of response delay that may occur during the game. In addition, for the processing of the key operation information corresponding to each user in the interaction data, a corresponding change parameter is set for each user. Each time the interaction data is received, the change parameter corresponding to the user is set to the first preset value to indicate that the key operation information corresponding to the user has changed. At the same time, the verification parameter feedback by the game engine at a preset frequency is continuously received, and each time the verification parameter is received, it is determined whether the change parameter is the first preset value. Only when the change parameter is the first preset value, for any target user identifier and its corresponding target user, based on the verification parameter and the key operation information corresponding to the target user, the key operation state corresponding to the target user is determined, the change parameter is set to the second preset value, and then the key operation state corresponding to the target user is sent to the game engine. Since the verification parameter includes at least one user identifier and the key identifier of the target key corresponding to each user identifier, and the target key is the key to be triggered displayed to the user identified by the corresponding user identifier, that is to say, when verifying the key operation information corresponding to the user in this application, only the operation of the target key needs to be verified. Compared with the prior art in which all keys are verified, the processing efficiency of the interaction data in this application is higher.
[0100] Embodiment 2
[0101] Figure 5 FIG. is a schematic structural diagram of an interaction data processing device provided in Embodiment 2 of the present application. The interaction data processing device provided in the embodiments of the present application can execute the interaction data processing method provided in any embodiment of the present application, and has corresponding functional modules and beneficial effects for executing the method. The device can be implemented in a software and / or hardware manner. As Figure 5 shown, the interaction data processing device specifically includes:
[0102] A parsing module 501, configured to parse out the key operation information corresponding to each user from the interaction data when receiving the interaction data sent by the Bluetooth peripheral device, and set the change parameter corresponding to each user to the first preset value. When the change parameter is set to the first preset value, it indicates that the key operation information of the user corresponding to the change parameter has changed;
[0103] A determination module 502, configured to continuously receive verification parameters fed back by a game engine at a preset frequency. Each time the verification parameters are received, it determines whether the change parameter is a first preset value. The verification parameters include at least one user identifier and the key identifiers of the target key positions respectively corresponding to each user identifier. The target key positions are the key positions to be triggered shown to the user identified by the corresponding user identifier;
[0104] A key operation status determination module 503, configured to, when the change parameter is the first preset value, for any target user identifier and its corresponding target user, determine the key operation status corresponding to the target user according to the key identifier of the target key position corresponding to the target user identifier and the key operation information corresponding to the target user, and set the change parameter to a second preset value;
[0105] A sending module 504, configured to send the key operation status corresponding to the target user to the game engine, so that the game engine determines whether the target user has performed a key operation on the target key position according to the key operation status, and adjusts the display duration of the target key position.
[0106] Embodiment III
[0107] Figure 6 The structural schematic diagram of an electronic device provided in Embodiment III of the present application is shown as Figure 6 shown. The electronic device includes a processor 610, a memory 620, an input device 630, and an output device 640. The number of processors 610 in the electronic device may be one or more. Figure 6 Taking one processor 610 as an example; the processor 610, the memory 620, the input device 630, and the output device 640 in the electronic device may be connected through a bus or other means. Figure 6 Taking the connection through a bus as an example.
[0108] The memory 620, as a computer-readable storage medium, can be used to store software programs, computer-executable programs, and modules, such as the program instructions / modules corresponding to the interactive data processing method in the embodiments of the present invention. The processor 610 executes various functional applications and data processing of the electronic device by running the software programs, instructions, and modules stored in the memory 620, that is, implements the above-mentioned interactive data processing method:
[0109] In the case of receiving the interactive data sent by the Bluetooth peripheral device, parse out the key operation information corresponding to each user from the interactive data, and set the change parameter corresponding to each user to the first preset value. When the change parameter is set to the first preset value, it indicates that the key operation information of the user corresponding to the change parameter has changed;
[0110] Continuously receive the verification parameters fed back by the game engine at a preset frequency. Each time the verification parameters are received, determine whether the change parameter is the first preset value. The verification parameters include at least one user identifier and the key identifier of the target key corresponding to each user identifier. The target key is the key to be triggered shown to the user identified by the corresponding user identifier;
[0111] When the change parameter is the first preset value, for any target user identifier and its corresponding target user, determine the key operation state corresponding to the target user according to the key identifier of the target key corresponding to the target user identifier and the key operation information corresponding to the target user, and set the change parameter to the second preset value;
[0112] Send the key operation state corresponding to the target user to the game engine, so that the game engine can judge whether the target user has performed a key operation on the target key according to the key operation state, and adjust the display duration of the target key.
[0113] The memory 620 may mainly include a program storage area and a data storage area. Among them, the program storage area may store an operating system and application programs required for at least one function; the data storage area may store data created according to the use of the terminal, etc. In addition, the memory 620 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other non-volatile solid-state storage devices. In some instances, the memory 620 may further include a memory remotely set relative to the processor 610, and these remote memories may be connected to the electronic device through a network. Examples of the above network include but are not limited to the Internet, an enterprise intranet, a local area network, a mobile communication network, and combinations thereof.
[0114] Embodiment 4
[0115] Embodiment 4 of the present application further provides a storage medium containing computer-executable instructions. The computer-executable instructions are used to execute an interactive data processing method when executed by a computer processor. The method includes:
[0116] In the case of receiving the interactive data sent by the Bluetooth peripheral, parse out the key operation information corresponding to each user from the interactive data, and set the change parameter corresponding to each user to the first preset value. When the change parameter is set to the first preset value, it indicates that the key operation information of the user corresponding to the change parameter has changed;
[0117] Continuously receive the verification parameters fed back by the game engine at a preset frequency. Each time the verification parameters are received, determine whether the change parameter is the first preset value. The verification parameters include at least one user identifier and the key identifier of the target key corresponding to each user identifier. The target key is the key to be triggered shown to the user identified by the corresponding user identifier;
[0118] When the change parameter is the first preset value, for any target user identifier and its corresponding target user, according to the key identifier of the target key corresponding to the target user identifier and the key operation information corresponding to the target user, determine the key operation state corresponding to the target user, and set the change parameter to the second preset value;
[0119] Send the key operation state corresponding to the target user to the game engine, so that the game engine can judge whether the target user has performed a key operation on the target key according to the key operation state, and adjust the display duration of the target key.
[0120] Of course, a storage medium containing computer-executable instructions provided by an embodiment of the present application, the computer-executable instructions are not limited to the above method operations, and can also execute related operations in the interactive data processing method provided by any embodiment of the present application.
[0121] Through the above description of the embodiments, those skilled in the art can clearly understand that the present application can be implemented by means of software and necessary general hardware. Of course, it can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. The computer software product can be stored in a computer-readable storage medium, such as a floppy disk, a read-only memory (ROM), a random access memory (RAM), a flash memory (FLASH), a hard disk or an optical disc of a computer, etc., including several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods of various embodiments of the present application.
[0122] It should be noted that in the embodiments of the above search device, the various units and modules included are only divided according to functional logic, but are not limited to the above division, as long as the corresponding functions can be realized; in addition, the specific names of the functional units are only for the convenience of mutual distinction and do not limit the protection scope of the present application.
[0123] Note that the above is only a preferred embodiment of the present application and the applied technical principle. Those skilled in the art will understand that the present application is not limited to the specific embodiments here, and various obvious changes, re-adjustments and substitutions can be made by those skilled in the art without departing from the protection scope of the present application. Therefore, although the present application has been described in detail through the above embodiments, the present application is not limited to the above embodiments. Without departing from the concept of the present application, more other equivalent embodiments can be included, and the scope of the present application is determined by the scope of the appended claims.
Claims
1. An interactive data processing method, characterized in that, An application for an embedded game engine, where the game engine is used to control game modules in the running state of the application. The method includes: When receiving interaction data sent by a Bluetooth peripheral, parsing out the key operation information corresponding to each user from the interaction data, and setting the change parameter corresponding to each user to a first preset value. When the change parameter is set to the first preset value, it indicates that the key operation information of the user corresponding to the change parameter has changed; Continuously receiving the verification parameters fed back by the game engine at a preset frequency. Each time the verification parameters are received, determining whether the change parameter is the first preset value. The verification parameters include at least one user identifier and the key identifiers of the target keys corresponding to each user identifier. The target key is the key to be triggered shown to the user identified by the corresponding user identifier; When the change parameter is the first preset value, for any target user identifier and its corresponding target user, determining the key operation state corresponding to the target user according to the key identifier of the target key corresponding to the target user identifier and the key operation information corresponding to the target user, and setting the change parameter to a second preset value; The key operation state includes an operation determination value and an operation speed value. When the operation determination value is a first determination value, it indicates that the target user has performed a key operation on the target key. When the operation determination value is a second determination value, it indicates that the target user has not performed a key operation on the target key. The operation speed value is used to represent the number of operations of the target user per unit time; Sending the key operation state corresponding to the target user to the game engine, so that the game engine can judge whether the target user has performed a key operation on the target key according to the key operation state and adjust the display duration of the target key.
2. The method according to claim 1, characterized in that, The interaction data is a string array, and the string array includes multiple elements; The parsing out the key operation information corresponding to each user from the interaction data includes: For any target user among all users, obtaining the target element position corresponding to the target user according to the preset mapping relationship between the user and the positions of the elements in the string array; Extracting the target element corresponding to the target element position in the string array and generating the key operation information corresponding to the target user according to the target element.
3. The method according to claim 2, characterized in that, The obtaining the target element position corresponding to the target user according to the preset mapping relationship between the user and the positions of the elements in the string array includes: Obtaining the user identifier n of the target user, where n = 1, 2, 3,..., N, and N is the maximum number of users supported by the Bluetooth peripheral for joint operation; Determining the product of the user identifier n and the element m as the target element position corresponding to the target user n, where m = 1, 2, 3,..., M, and M is the total number of elements corresponding to each user.
4. The method according to claim 1, characterized in that, Determining the key operation state corresponding to the target user according to the key identifier of the target key corresponding to the target user identifier and the key operation information corresponding to the target user includes: Judging whether the key identifier of the target key corresponding to the target user identifier matches the key operation information corresponding to the target user, obtaining a judgment result, and determining an operation judgment value corresponding to the target user according to the judgment result; Obtaining a reference time and a comparison time for parsing the key operation information corresponding to the target user this time, where the comparison time includes: a first comparison time for parsing the key operation information corresponding to the target user last time, or a second comparison time for determining the operation judgment value this time; Determining an operation speed value corresponding to the target user according to the reference time and the comparison time; Encapsulating the operation judgment value and the operation speed value into the key operation state corresponding to the target user.
5. The method according to claim 4, characterized in that, Determining the operation judgment value according to the judgment result includes: If the key identifier of the target key corresponding to the target user identifier matches the key operation information corresponding to the target user, setting the operation judgment value to a first judgment value, where the first judgment value indicates that the target user has performed a key operation on the target key; If the key identifier of the target key corresponding to the target user identifier does not match the key operation information corresponding to the target user, setting the operation judgment value to a second judgment value, where the second judgment value indicates that the target user has not performed a key operation on the target key.
6. The method according to claim 4, wherein Determining the operation speed value according to the reference time and any one of the comparison times includes: Determining the time difference between the reference time and any one of the comparison times, and determining the reciprocal of the time difference as the operation speed value corresponding to the target user, where the operation speed value is used to represent the number of operations per unit time of the target user.
7. The method according to claim 1, wherein The key operation state corresponding to the target user includes the operation speed value corresponding to the target user; The game engine adjusts the display duration of the target key according to the key operation state, including: The game engine judges the target speed interval in which the operation speed value is located based on a preset speed interval table; The game engine determines the target display duration corresponding to the target speed interval according to the mapping relationship between the preset speed interval and the display duration; The game engine adjusts the display duration of the target key to the target display duration.
8. The method according to claim 7, characterized in that, The key operation state includes an operation judgment value, and the method further includes: When the display duration of the current target key reaches the target display duration, the game engine triggers the display of the next target key; Or, within the target display duration, receiving the key operation state corresponding to the target user, and when the operation judgment value in the key operation state is the first judgment value, the game engine triggers the display of the next target key, where the first judgment value indicates that the target user has performed a key operation on the target key.
9. An interactive data processing device, characterized in that, The device includes: A parsing module, configured to, when receiving interaction data sent by a Bluetooth peripheral, parse out the key operation information corresponding to each user from the interaction data, and set the change parameter corresponding to each user to a first preset value. When the change parameter is set to the first preset value, it indicates that the key operation information of the user corresponding to the change parameter has changed; A judgment module, configured to continuously receive verification parameters fed back by a game engine at a preset frequency. Each time the verification parameters are received, it is judged whether the change parameter is the first preset value. The verification parameters include at least one user identifier and the key identifier of the target key corresponding to each user identifier. The target key is the key to be triggered displayed to the user identified by the corresponding user identifier; A key operation state determination module, configured to, when the change parameter is the first preset value, for any target user identifier and its corresponding target user, determine the key operation state corresponding to the target user according to the key identifier of the target key corresponding to the target user identifier and the key operation information corresponding to the target user, and set the change parameter to a second preset value; the key operation state includes an operation determination value and an operation speed value. When the operation determination value is a first determination value, it indicates that the target user has performed a key operation on the target key. When the operation determination value is a second determination value, it indicates that the target user has not performed a key operation on the target key. The operation speed value is used to represent the number of operations performed by the target user per unit time; A sending module, configured to send the key operation state corresponding to the target user to the game engine, so that the game engine judges whether the target user has performed a key operation on the target key according to the key operation state, and adjusts the display duration of the target key.
10. An electronic device, characterized in that, Comprising: One or more processors; A storage device, configured to store one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the interaction data processing method according to any one of claims 1-8.
11. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by a processor, it implements the interaction data processing method according to any one of claims 1-8.
Citation Information
Patent Citations
Intelligent non-player roles implementing method in interactive game and system
CN101158897A
Interactive operation prompting method and device, storage medium and electronic equipment
CN113891138A