Game task transfer method and related equipment
By transferring tasks to equipment with better performance in multi-player competitive games, the problem of poor gaming experience caused by insufficient equipment performance is solved, and the fairness and smoothness of game results are achieved.
Patent Information
- Application Number
- CN202410038869.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-09
- Publication Date
- 2025-07-11
AI Technical Summary
In multi-player competitive games, insufficient equipment performance will affect the player's game level and game results, resulting in an unfair gaming experience.
By transferring game tasks in game scenarios, using better performance devices to perform game tasks with insufficient performance devices, ensuring fairness of game results and player gaming experience.
It effectively alleviates the gaming pressure caused by insufficient equipment performance, improves the gaming experience, and ensures the fairness and smoothness of game results.
Smart Images

Figure CN120285540A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of terminals, and in particular, to a game task transfer method and related devices. Background Art
[0002] Currently, competitive games for multiple players have attracted many player groups. For such games, multiple players need to enter the same application through their respective terminals to play the game. In real life, the terminals corresponding to each player are not necessarily the same. If a player's terminal has poor performance, then the player's gaming level may be limited, which will affect the game result. Summary of the Invention
[0003] Embodiments of this application provide a game task transfer method and related devices, which are used to avoid affecting the game result due to insufficient device performance and improve the game experience.
[0004] In a first aspect, a game task transfer method is provided. This method can be applied to a first device, and the first device is currently in a game scenario. For example, the first device receives a trigger operation, and the trigger operation is used to trigger a game task of the first device in the game scenario. The first device sends a task transfer request, and the task transfer request is used to request other devices in the game scenario to execute the game task. The other devices are other devices in the game scenario except the first device.
[0005] In the embodiments of this application, when a user uses the first device to play a game (for example, play a game through a game application or a web page), the first device can transfer a game task to other devices in the same game scenario. In this way, the pressure on the first device can be relieved. For example, when the performance of the first device is insufficient (for example, the load is large), the game task can be transferred to other devices. In this way, it is possible to minimize the impact on the game result of the first device and ensure that the game experience of the user of the first device is not reduced.
[0006] In a possible design, the first device being currently in a game scenario may include: the first device displays a game screen. Taking a game application as an example, the first device being currently in a game scenario may include: the first device is currently running a game application, and the game application is running in the foreground.
[0007] In a possible design, the game scenario may be a game room. That is, the first device and the second device are playing games in the same game room.
[0008] In a possible design, before the first device sends a task transfer request, it may also determine that at least one of the following conditions is met: the game task is a preset task, the current running frame rate of the first device is lower than a first threshold, the current CPU usage rate of the first device is higher than a second threshold, and the current storage space occupancy rate of the first device is higher than a third threshold.
[0009] In the embodiments of the present application, when the first device triggers a certain game task, it may determine whether the conditions are met. If the conditions are met, the game task may be transferred to the second device in the same game scenario. If the conditions are not met, the first device may execute the game task by itself. In this way, it is possible to prevent the first device from randomly transferring tasks to other devices, which may impose a burden on other devices.
[0010] In a possible design, the first device sending a task transfer request includes: the first device sending the task transfer request to a host device, where the host device includes the management device of the game scenario.
[0011] In the embodiments of the present application, the host device is used to manage other devices in the game scenario. When a device needs to transfer a task, it may send a task transfer request to the host device. Unified management by the host device is convenient and efficient.
[0012] In a possible design, the host device may be the creator of the game room.
[0013] In a possible design, the first device sending a task transfer request includes: the first device sending the task transfer request to a second device, where the second device is a device elected by the first device from among M devices based on at least one of the device performance, game status, game character, and geographical location of the M devices. The M devices are other devices in the game scenario except the first device, and M is an integer and M≥2.
[0014] In the embodiments of the present application, when the first device needs to transfer a task, it may elect a device (i.e., the second device) by itself and transfer the task to the elected device. Since the elected second device is a device with better performance, having the second device execute the task of the first device can ensure the game result of the first device and has little impact on the second device.
[0015] In a possible design, the second device meets at least one of the following conditions:
[0016] The second device is a device among the M devices with a current running frame rate higher than a fourth threshold; or,
[0017] The second device is a device among the M devices with a current CPU usage rate lower than the fifth threshold; or,
[0018] The second device is a device among the M devices with a current storage space occupancy rate lower than the sixth threshold; or,
[0019] The second device is a device among the M devices that is currently in the spectator state; or,
[0020] The second device is a device among the M devices that is currently in the dead state; or,
[0021] The second device is the device corresponding to the specified game character among the M devices; or;
[0022] The second device is a device among the M devices with a distance from the first device less than the first distance.
[0023] It should be noted that the above is the way to elect the second device. In practical applications, it can also be elected by other means, which is not limited in the embodiments of this application.
[0024] In a possible design, the method further includes: before the first device sends a task transfer request to the second device, the current running frame rate of the first device is the first frame rate; after the first device sends a task transfer request to the second device, the current running frame rate of the first device is the second frame rate; the difference between the first frame rate and the second frame rate is less than a preset value.
[0025] In the embodiments of this application, after the first device transfers the game task to the second device, since the first device does not need to execute the game task anymore, the current running frame rate of the first device will not decrease too much. This can ensure the game experience of the first device.
[0026] In a possible design, the preset value includes: an estimated value of the frame rate decrease caused by executing the game task. For example, if executing a certain game task is expected to reduce the frame rate by 10fps, then the preset value is 10fps.
[0027] In a possible design, the task transfer request includes a task identifier of the game task. In the embodiments of this application, if the task transfer request sent by the first device to the second device carries the task identifier, the second device can determine which task needs to be executed according to the task identifier, improving the accuracy.
[0028] In a possible design, the task transfer request includes information about the game character corresponding to the first device, and the information includes at least one of the name, level, and position in the game scene of the game character. Of course, other information may also be carried in the task transfer request, and the embodiments of the present application will not list them one by one.
[0029] In a possible design, the first device and the second device belong to the same team in the game scene. That is to say, within the same team (for example, our team), one device can transfer a task to another device. For example, if the performance of a device within the team is insufficient, the task can be transferred to other devices within the team. This can avoid affecting the overall game result of the team due to the insufficient performance of a certain device and improve the game experience.
[0030] In a possible design, the first device and the second device are currently in the same local area network. It should be noted that when multiple devices play games in the same local area network, each device needs to bear its own game tasks. Therefore, for a device with insufficient performance, its tasks can be transferred to other devices to ensure the game experience of that device.
[0031] In a possible design, the method further includes: the first device receives a task execution result, and the task execution result is used to indicate whether the execution of the game task is successful or not. Taking the game task of skill release as an example, the first device transfers the task to the second device. After the second device finishes executing the task, it can return an indication message to the first device to indicate that the task execution is successful. Of course, in some cases, the second device may fail to execute the task, then the second device can return an indication message indicating task execution failure to the first device.
[0032] In a second aspect, a game task transfer method is further provided. This method can be applied to the second device, and the second device is currently in the game scene. For example, the second device receives a task transfer request, and the task transfer request is used to request the execution of a game task, and the game task is a task generated by the first device in the game scene; the second device executes the game task.
[0033] In the embodiments of the present application, in the same game scene, the second device can help the first device execute game tasks. In this way, the pressure on the first device can be relieved. For example, when the performance of the first device is insufficient (such as a large load), the game task can be transferred to the second device, so as to minimize the impact on the game result of the first device and ensure that the game experience of the user of the first device is not reduced.
[0034] In a possible design, the second device is currently in a game scenario, which may include: the second device displays a game screen; or, after the second device displays the game screen, the game screen switches to the background of the second device. Taking a game application as an example, when the second device is currently in a game scenario, it may include: the second device is currently running the game application, which may be running the game application in the foreground or background.
[0035] In a possible design, the second device receives a task transfer request, including: the second device receives the task transfer request from the first device or the host device, and the host device includes a management device for the game scenario.
[0036] In the embodiments of the present application, the host device is used to manage other devices in the game scenario. When the first device needs to transfer a task, it may send a task transfer request to the host device, and the host device sends the task transfer request to the second device. This is convenient for unified management. Of course, the first device can also directly send a task transfer request to the second device to improve efficiency.
[0037] In a possible design, before the second device executes the game task, the method further includes: the second device determines that at least one of the following conditions is met:
[0038] The current running frame rate is higher than the seventh threshold; or,
[0039] The current CPU usage rate is lower than the eighth threshold; or,
[0040] The current storage space occupancy rate is lower than the ninth threshold; or,
[0041] The current is in a spectator state; or,
[0042] The current is in a dead state; or,
[0043] The corresponding game character is a specified game character.
[0044] In the embodiments of the present application, when the second device receives a task transferred from the first device, it may determine whether the second device can execute it. If so, it will execute, avoiding bringing too much burden to the second device.
[0045] In a possible design, the game scenario includes a third device. Before receiving the task transfer request, the second device is in a spectator state. After receiving the task transfer request and before executing the game task, the second device switches to a participating state, then the second device sends the task transfer request to the third device.
[0046] In a possible design, a third device is further included in the game scenario, and the method further includes: when the second device determines that the condition is not satisfied, sending the task transfer request to the third device.
[0047] In an embodiment of the present application, when the second device receives a task transferred from the first device, it can determine whether the second device can execute it. If not, the task is transferred to the third device, avoiding placing too much burden on the second device.
[0048] In a possible design, in addition to the first device and the second device, the game scenario further includes P devices, where P is an integer and P≥2, and the third device is a device elected by the second device from the P devices according to at least one of the device performance, game state, game character, and geographical location of the P devices.
[0049] In an embodiment of the present application, when the second device receives a task transferred from the first device, it can determine whether the second device can execute it. If not, it elects a third device and transfers the task to the third device, avoiding placing too much burden on the second device.
[0050] In a possible design, the third device satisfies at least one of the following conditions:
[0051] The third device is a device among the P devices with a current running frame rate higher than the tenth threshold; or,
[0052] The third device is a device among the P devices with a current CPU usage rate lower than the eleventh threshold; or,
[0053] The third device is a device among the P devices with a current storage space occupancy rate lower than the twelfth threshold; or,
[0054] The third device is a device among the P devices that is currently in a spectator state; or,
[0055] The third device is a device among the P devices that is currently in a dead state; or,
[0056] The third device is the device corresponding to the specified game character among the P devices; or;
[0057] The third device is a device among the P devices with a distance less than the third distance from the second device.
[0058] It should be noted that the above are examples of several ways to elect the third device. In actual applications, other ways can also be used for election, and the embodiments of the present application do not list them one by one.
[0059] In a possible design, the method further includes: before the second device executes the preset task, the current running frame rate of the second device is the third frame rate; after the second device executes the preset task, the current running frame rate of the second device is the fourth frame rate; the fourth frame rate is lower than the third frame rate, and the difference between the third frame rate and the fourth frame rate is greater than or equal to a preset value.
[0060] In the embodiments of the present application, since the second device needs to additionally execute the game task of the first device, the current running frame rate of the second device will decrease. However, since the second device is the elected device, the decrease in the frame rate of the second device has little impact on the game experience of the second device, and the game experience of the first device can be guaranteed.
[0061] In a possible design, the preset value includes: an estimated value of the frame rate decrease caused by executing the game task. For example, if executing a certain game task is expected to reduce the frame rate by 10fps, then the preset value is 10fps.
[0062] In a possible design, the task transfer request includes the task identifier of the game task.
[0063] In a possible design, the task transfer request includes information about the game character corresponding to the first device, and the information includes at least one of the name, level, and position in the game scene of the game character.
[0064] In a possible design, the first device and the second device belong to the same team in the game scene.
[0065] In a possible design, the first device and the second device are currently in the same local area network.
[0066] In a possible design, the method further includes: the second device sends and receives the task execution result, and the task execution result is used to indicate the success or failure of the execution of the game task.
[0067] In a possible design, the method further includes: the second device renders the execution effect of the game task in the game screen. In the embodiments of the present application, after the second device helps the first device execute the game task, the second device can render the execution effect in the game screen, such as the release effect of a bomb. In this way, the second device does not need to return the execution result to the first device, because the first device synchronizes the game screen of the second device, so the first device can know that the second device has executed the game task through the game screen. Moreover, since the first device does not need to render the task execution result, the pressure on the first device can be further relieved, and the game experience of the first device can be guaranteed.
[0068] In a third aspect, a game task transfer method is also provided. This method can be applied to a host device. The host device includes a management device for a game scenario. For example, the host device receives a task transfer request sent by a first device, where the task transfer request is used to request the execution of a game task generated by the first device. The host device sends the task transfer request to a second device, and both the first device and the second device are in the game scenario.
[0069] In an embodiment of the present application, the host device is used to manage other devices in the game scenario. When the first device needs to transfer a task, it can send a task transfer request to the host device, and the host device sends the task transfer request to the second device. This is convenient for unified management.
[0070] In a possible design, the first device and the second device being in the same game scenario may include: the first device and the second device being in the same game room.
[0071] In a possible design, in addition to the first device and the host device, there are K devices in the game scenario, where K is an integer and K≥2. Before the host device sends the task transfer request to the second device, the method further includes: the host device selects the second device from the K devices according to at least one of the device performance, game state, game character, and geographical location of the K devices.
[0072] In an embodiment of the present application, after the host device receives the task transfer request from the first device, it can select a device (i.e., the second device) and send the task transfer request to the second device. This is convenient for unified management, and moreover, since the selected device is a better device, it can ensure the game result of the first device and has little impact on the second device.
[0073] In a possible design, the second device satisfies at least one of the following conditions:
[0074] The second device is a device among the K devices with a current running frame rate higher than a thirteenth threshold; or,
[0075] The second device is a device among the K devices with a current CPU usage rate lower than a fourteenth threshold; or,
[0076] The second device is a device among the K devices with a current storage space occupancy rate lower than a fifteenth threshold; or,
[0077] The second device is a device among the K devices that is currently in a spectator state; or,
[0078] The second device is the device among the K devices that is currently in a dead state; or,
[0079] The second device is the device corresponding to the designated game character among the K devices; or;
[0080] The second device is the device among the K devices whose distance from the first device is less than a fourth distance.
[0081] In a possible design, the task transfer request includes the task identifier of the game task.
[0082] In a possible design, the task transfer request includes information about the game character corresponding to the first device, and the information includes at least one of the name, level, and position in the game scene of the game character.
[0083] In a possible design, the first device and the second device belong to the same team in the game scene.
[0084] In a possible design, the first device, the second device, and the host device belong to the same team in the game scene.
[0085] In a possible design, the first device, the second device, and the host device are in the same local area network.
[0086] In a possible design, the method further includes: the host device receives the task execution result sent by the second device, and the task execution result is used to indicate the success or failure of the execution of the game task; the host device sends the task execution result to the first device.
[0087] In a fourth aspect, a game task transfer method is further provided. This method is applicable to a communication system, and the communication system includes a first device and a second device. The first device and the second device run the same game application and are in the same game scene. For example, the first device receives a trigger operation, and the trigger operation is used to trigger a game task of the first device in the game scene; the first device sends a task transfer request to the second device, and the task transfer request is used to request the execution of the game task; the second device executes the game task.
[0088] In a possible design, the first device sending the task transfer request to the second device includes: the first device sends the task transfer request to the host device, and the host device includes the management device of the game scene; the host device sends the task transfer request to the second device.
[0089] In a possible design, in addition to the first device, there are Q devices in the game scenario, where Q is an integer and Q > 2, and the second device is a device elected from the Q devices according to at least one of the device performance, game state, game character, and geographical location of the Q devices.
[0090] In a possible design, the second device satisfies at least one of the following conditions:
[0091] The second device is a device among the Q devices with a current running frame rate higher than the sixteenth threshold; or,
[0092] The second device is a device among the Q devices with a current CPU usage rate lower than the seventeenth threshold; or,
[0093] The second device is a device among the Q devices with a current storage space occupancy rate lower than the eighteenth threshold; or,
[0094] The second device is a device among the Q devices that is currently in a spectator state; or,
[0095] The second device is a device among the Q devices that is currently in a dead state; or,
[0096] The second device is the device corresponding to the specified game character among the Q devices; or;
[0097] The second device is a device among the Q devices with a distance less than the fifth distance from the first device.
[0098] In a possible design, before the first device sends a task transfer request to the second device, the method further includes: the first device determines that at least one of the following conditions is met: the game task is a preset task, the current running frame rate of the first device is lower than the first threshold, the current CPU usage rate of the first device is higher than the second threshold, and the current storage space occupancy rate of the first device is higher than the third threshold.
[0099] In a possible design, before the second device executes the game task, the method further includes: the second device determines that at least one of the following conditions is met:
[0100] The current running frame rate is higher than the nineteenth threshold; or,
[0101] The current CPU usage rate is lower than the twentieth threshold; or,
[0102] The current storage space occupancy rate is lower than the twenty - first threshold; or,
[0103] The current is in a spectator state; or,
[0104] Currently in a dead state; or,
[0105] The corresponding game character is the designated game character.
[0106] In a possible design, the game scenario further includes a third device, and the method further includes:
[0107] When the second device determines that the condition is not met, it sends the task transfer request to the third device.
[0108] In a possible design, in addition to the first device and the second device, the game scenario further includes W devices, where W is an integer and W≥2, and the third device is the device elected by the second device from the W devices according to at least one of the device performance, game state, game character, and geographical location of the W devices.
[0109] In a possible design, the third device satisfies at least one of the following conditions:
[0110] The third device is the device among the W devices with a current frame rate higher than the twenty-second threshold; or,
[0111] The third device is the device among the W devices with a current CPU usage rate lower than the twenty-third threshold; or,
[0112] The third device is the device among the W devices with a current storage space occupancy rate lower than the twenty-fourth threshold; or,
[0113] The third device is the device among the W devices that is currently in a spectator state; or,
[0114] The third device is the device among the W devices that is currently in a dead state; or,
[0115] The third device is the device corresponding to the designated game character among the W devices; or;
[0116] The third device is the device among the W devices with a distance less than the seventh distance from the second device.
[0117] In a possible design, the task transfer request includes the task identifier of the game task.
[0118] In a possible design, the task transfer request includes information about the game character corresponding to the first device, and the information includes at least one of the name, level, and position in the game scenario of the game character.
[0119] In a possible design, the first device and the second device belong to the same team in the game scenario.
[0120] In a possible design, the first device and the second device are currently in the same local area network.
[0121] In a possible design, the method further includes: the second device sends a task execution result to the first device, and the task execution result is used to indicate whether the game task is successfully executed or not.
[0122] In a possible design, the method further includes: the second device renders the execution effect of the game task in the game screen.
[0123] In a fifth aspect, an electronic device is further provided, including:
[0124] a processor, a memory, and one or more programs;
[0125] wherein, the one or more programs are stored in the memory, and the one or more programs include instructions that, when executed by the processor, cause the electronic device to execute the method steps described in any one of the first aspect, the second aspect, the third aspect, or the fourth aspect above.
[0126] In a sixth aspect, a communication system is further provided, including: a first device and a second device;
[0127] The first device is configured to execute the method steps described in the first aspect above;
[0128] The second device is configured to execute the method steps described in the second aspect above.
[0129] In a possible design, the communication system further includes: a host device, and the host device is configured to execute the method described in the third aspect above.
[0130] In a seventh aspect, a computer-readable storage medium is further provided, and the computer-readable storage medium is used to store a computer program. When the computer program runs on a computer, the computer is caused to execute the method steps described in any one of the first aspect, the second aspect, the third aspect, or the fourth aspect above.
[0131] In an eighth aspect, a computer program product is provided, including a computer program. When the computer program runs on a computer, the computer is caused to execute the method steps described in any one of the first aspect, the second aspect, the third aspect, or the fourth aspect above.
[0132] In a ninth aspect, a chip system is further provided. The chip system is coupled to a memory in an electronic device and is configured to call a computer program stored in the memory and execute the technical solution provided in any one of the first, second, third, or fourth aspects of the embodiments of the present application. In the embodiments of the present application, "coupled" means that two components are directly or indirectly combined with each other.
[0133] For the technical effects that can be achieved in the second to ninth aspects described above, please refer to the description of the technical effects that can be achieved in the corresponding design solutions in the first aspect above. The present application will not repeat them here. BRIEF DESCRIPTION OF THE DRAWINGS
[0134] Figure 1 Schematic diagram of a game scene provided by an embodiment of the present application;
[0135] Figure 2 Schematic diagram of an electronic device provided by an embodiment of the present application;
[0136] Figure 3A Schematic flowchart of a game task transfer method provided by an embodiment of the present application;
[0137] Figures 3B to 3D Schematic diagram of a game screen provided by an embodiment of the present application;
[0138] Figure 4 Another schematic flowchart of a game task transfer method provided by an embodiment of the present application;
[0139] Figure 5 Schematic diagram of a game state change provided by an embodiment of the present application;
[0140] Figure 6 Another schematic flowchart of a game task transfer method provided by an embodiment of the present application;
[0141] Figure 7 Another schematic flowchart of a game task transfer method provided by an embodiment of the present application;
[0142] Figures 8A to 8B Schematic diagram of a task transfer service provided by an embodiment of the present application;
[0143] Figure 9 Schematic diagram of the software structure of an electronic device provided by an embodiment of the present application;
[0144] Figures 10 to 11 Schematic flowchart of a game team formation provided by an embodiment of the present application;
[0145] Figure 12 Schematic diagram of an electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0146] The following is an explanation of some terms in the embodiments of the present application to facilitate understanding by those skilled in the art.
[0147] The "at least one" involved in the embodiments of the present application includes one or more; among them, "a plurality" means greater than or equal to two. In addition, it should be understood that in the description of this specification, terms such as "first" and "second" are only used for the purpose of distinguishing descriptions, and cannot be understood as explicitly or implicitly indicating relative importance, nor can they be understood as explicitly or implicitly indicating an order. For example, the first device and the second device do not represent the importance level of the two or the order of the two, but are only for distinguishing descriptions. In the embodiments of the present application, "and / or" only describes the association relationship and means that three relationships can exist. For example, A and / or B can represent three situations: A exists alone, A and B exist simultaneously, and B exists alone. In addition, the character " / " in this article generally represents an "or" relationship between the associated objects before and after.
[0148] The reference to "an embodiment" or "some embodiments" etc. described in this specification means that a specific feature, structure, or characteristic described in combination with the embodiment is included in one or more embodiments of this specification. Thus, statements such as "in an embodiment", "in some embodiments", "in other some embodiments", "in still other embodiments" etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "comprise", "include", "have" and their variants all mean "including but not limited to", unless otherwise specifically emphasized in other ways.
[0149] As used in this specification, depending on the context, the term "when..." or "after when..." can be interpreted to mean "if...", "after...", "in response to determining...", or "in response to detecting...". Similarly, depending on the context, the phrase "when determining..." or "if detecting (the stated condition or event)" can be interpreted to mean "if determining...", "in response to determining...", "when detecting (the stated condition or event)", or "in response to detecting (the stated condition or event)".
[0150] The game task transfer method provided by the embodiments of the present application is applicable to game scenarios. A game scenario may include multiple devices. For example, a game scenario includes multiple players, and each player corresponds to one device. Optionally, the game scenario may be a scenario provided by a game application (APP). For example, multiple players enter the same game application through their respective devices and are in the same game scenario. The embodiments of the present application do not limit the type of the game application, and any competitive game application can be used.
[0151] It should be noted that the game task transfer method provided by the embodiments of the present application is applicable to game scenarios, but does not limit whether multiple devices in the game scenario are divided into teams. They can be divided into teams or not. If multiple devices are divided into different teams, the game task transfer method provided by the embodiments of the present application can be task transfer between different devices within the same team or task transfer between different teams. The embodiments of the present application do not make any limitations in this regard. For the convenience of understanding, this article mainly takes the task transfer within the same team in the game scenario as an example for illustration. For example, please refer to Figure 1 , which is a schematic diagram of a game scenario provided by an embodiment of the present application. The game scenario includes one or more teams, for example, our team and the enemy team. Taking our team as an example, our team includes N players, where N is an integer greater than or equal to 2. The N players correspond to N devices. In other words, each of the N players plays the game through their respective devices. Taking any one of the N devices as an example, the device can be a mobile phone, a tablet computer, a laptop computer, a game console, etc. The embodiments of the present application do not limit the specific type of the device.
[0152] In the embodiments of the present application, considering that within the same team (for example, Figure 1 our team in
[0153] Figure 2 ), the performance of the devices corresponding to each player is not necessarily exactly the same. For example, within our team, the performance of a certain device (for example, device 1) is relatively poor. Then, the game tasks generated by device 1 during the game (such as replay recording, special move release, etc.) can be transferred to other devices (for example, device 2) within the team (that is, our team) to avoid affecting the game result of the entire team due to the low performance of device 1. Figure 2As shown in the figure, the electronic device may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, a headphone jack 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. Among them, the sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, a barometric pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.
[0154] The processor 110 may include one or more processing units. For example, the processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Among them, different processing units may be independent devices or integrated in one or more processors. Among them, the controller may be the nerve center and command center of the electronic device. The controller may generate operation control signals according to the instruction operation code and timing signals to complete the control of fetching and executing instructions. A memory may also be provided in the processor 110 for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. This memory may store the instructions or data that the processor 110 has just used or recycled. If the processor 110 needs to use the instruction or data again, it can be directly called from the memory. This avoids repeated accesses, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.
[0155] Optionally, the game task transfer method provided in the embodiments of the present application may be executed by the processor 110.
[0156] In some embodiments, the processor 110 may include one or more interfaces. The interfaces may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.
[0157] The I2C interface is a bidirectional synchronous serial bus that includes a serial data line (SDA) and a serial clock line (SCL). In some embodiments, the processor 110 may include multiple groups of I2C buses. The processor 110 may be respectively coupled to the touch sensor 180K, the charger, the flashlight, the camera 193, etc. through different I2C bus interfaces. For example, the processor 110 may be coupled to the touch sensor 180K through the I2C interface, enabling the processor 110 and the touch sensor 180K to communicate through the I2C bus interface to implement the touch function of the electronic device 100.
[0158] The I2S interface can be used for audio communication. In some embodiments, the processor 110 may include multiple groups of I2S buses. The processor 110 may be coupled to the audio module 170 through the I2S bus to implement communication between the processor 110 and the audio module 170. In some embodiments, the audio module 170 may transmit an audio signal to the wireless communication module 160 through the I2S interface to implement the function of answering a call through a Bluetooth headset.
[0159] The PCM interface can also be used for audio communication to sample, quantize, and encode analog signals. In some embodiments, the audio module 170 and the wireless communication module 160 can be coupled through the PCM bus interface. In some embodiments, the audio module 170 can also transmit audio signals to the wireless communication module 160 through the PCM interface to implement the function of answering calls through a Bluetooth headset. Both the I2S interface and the PCM interface can be used for audio communication.
[0160] The UART interface is a general-purpose serial data bus for asynchronous communication. This bus can be a bidirectional communication bus. It converts the data to be transmitted between serial communication and parallel communication. In some embodiments, the UART interface is typically used to connect the processor 110 and the wireless communication module 160. For example, the processor 110 communicates with the Bluetooth module in the wireless communication module 160 through the UART interface to implement the Bluetooth function. In some embodiments, the audio module 170 can transmit audio signals to the wireless communication module 160 through the UART interface to implement the function of playing music through a Bluetooth headset.
[0161] The MIPI interface can be used to connect the processor 110 to peripheral devices such as the display screen 194 and the camera 193. The MIPI interface includes a camera serial interface (CSI), a display serial interface (DSI), etc. In some embodiments, the processor 110 and the camera 193 communicate through the CSI interface to implement the shooting function of the electronic device 100. The processor 110 and the display screen 194 communicate through the DSI interface to implement the display function of the electronic device 100.
[0162] The GPIO interface can be configured through software. The GPIO interface can be configured as a control signal or a data signal. In some embodiments, the GPIO interface can be used to connect the processor 110 to the camera 193, the display screen 194, the wireless communication module 160, the audio module 170, the sensor module 180, etc. The GPIO interface can also be configured as an I2C interface, an I2S interface, a UART interface, a MIPI interface, etc.
[0163] The USB interface 130 is an interface that complies with the USB standard specification, and can specifically be a Mini USB interface, a Micro USB interface, a USB Type C interface, etc. The USB interface 130 can be used to connect a charger to charge the electronic device 100, and can also be used for data transmission between the electronic device 100 and peripheral devices. It can also be used to connect a headset to play audio through the headset. This interface can also be used to connect other electronic devices, such as AR devices, etc.
[0164] It can be understood that the interface connection relationships among the modules illustrated in the embodiments of the present application are only illustrative descriptions and do not constitute a structural limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may also adopt different interface connection manners in the above embodiments, or a combination of multiple interface connection manners.
[0165] The wireless communication function of the electronic device can be implemented by antenna 1, antenna 2, the mobile communication module 150, the wireless communication module 160, the modulation and demodulation processor, and the baseband processor, etc. Antenna 1 and antenna 2 are used for transmitting and receiving electromagnetic wave signals. Each antenna in the electronic device can be used to cover a single or multiple communication frequency bands. Different antennas can also be multiplexed to improve the utilization rate of the antennas. For example: Antenna 1 can be multiplexed as the diversity antenna of the wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.
[0166] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G, etc. applied to the electronic device. The mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves by antenna 1, filter, amplify, etc. the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor and convert it into electromagnetic waves through antenna 1 for radiation. In some embodiments, at least some functional modules of the mobile communication module 150 can be disposed in the processor 110. In some embodiments, at least some functional modules of the mobile communication module 150 and at least some modules of the processor 110 can be disposed in the same device.
[0167] The wireless communication module 160 may provide solutions for wireless communications applied to an electronic device, including wireless local area networks (WLANs) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite systems (GNSSs), frequency modulation (FM), near field communication (NFC), infrared (IR), and the like. The wireless communication module 160 may be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, frequency-modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110. The wireless communication module 160 may also receive signals to be sent from the processor 110, frequency-modulate them, amplify them, and convert them into electromagnetic waves through the antenna 2 for radiation.
[0168] In some embodiments, the antenna 1 of the electronic device is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the electronic device can communicate with a network and other devices through wireless communication technologies.
[0169] The display screen 194 is used to display a display interface of an application, etc. The display screen 194 includes a display panel. In some embodiments, the electronic device may include one or more display screens 194.
[0170] The electronic device 100 may implement a shooting function through an ISP, the camera 193, a video codec, a GPU, the display screen 194, an application processor, and the like. Among them, the ISP is used to process data fed back by the camera 193.
[0171] The internal memory 121 may be used to store computer-executable program codes, and the executable program codes include instructions. The processor 110 executes various functional applications and data processing of the electronic device by running the instructions stored in the internal memory 121. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area may store an operating system and software codes of at least one application program, etc. The data storage area may store data generated during the use of the electronic device (such as images, videos, etc.). In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash memory, etc.
[0172] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device. The external memory card communicates with the processor 110 through the external memory interface 120 to implement the data storage function. For example, files such as pictures and videos are saved in the external memory card.
[0173] The electronic device can implement audio functions through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor, etc. For example, music playback, recording, etc.
[0174] The audio module 170 is used to convert digital audio information into an analog audio signal for output, and is also used to convert an analog audio input into a digital audio signal. The audio module 170 can also be used for encoding and decoding audio signals. In some embodiments, the audio module 170 can be disposed in the processor 110, or some functional modules of the audio module 170 can be disposed in the processor 110.
[0175] The speaker 170A, also known as the "loudspeaker", is used to convert an audio electrical signal into a sound signal. The electronic device 100 can listen to music or listen to hands-free calls and other external speaker scenarios through one or more speakers 170A.
[0176] The receiver 170B, also known as the "earpiece", can be one or more, and is used to convert an audio electrical signal into a sound signal. When the electronic device 100 answers a call or a voice message, the receiver 170B can be used to listen to the voice by bringing it close to the human ear.
[0177] The microphone 170C, also known as the "microphone", "transmitter", is used to convert a sound signal into an electrical signal.
[0178] The headphone jack 170D is used to connect a wired headphone.
[0179] The pressure sensor 180A is used to sense a pressure signal and can convert the pressure signal into an electrical signal. In some embodiments, the pressure sensor 180A can be disposed on the display screen 194.
[0180] The gyroscope sensor 180B can be used to determine the motion posture of the electronic device. In some embodiments, the angular velocity of the electronic device around three axes (i.e., the x, y, and z axes) can be determined through the gyroscope sensor 180B. The gyroscope sensor 180B can be used for anti-shake during shooting.
[0181] The barometric pressure sensor 180C is used to measure barometric pressure. In some embodiments, the electronic device calculates the altitude based on the barometric pressure value measured by the barometric pressure sensor 180C to assist in positioning and navigation.
[0182] A magnetic sensor 180D is used to sense a magnetic field, such as a Hall sensor. For example, an electronic device can use the magnetic sensor 180D to detect the opening and closing of a flip leather case. For another example, the electronic device can also use the Hall sensor to sense whether other devices are installed on the electronic device. Taking Figure 2 a mobile phone as an example of the electronic device, if there is a magnetic device on the mobile phone case that can generate a magnetic field. When the mobile phone case is installed on the mobile phone, the Hall sensor in the mobile phone can sense the magnetic field generated by the magnetic device on the mobile phone case. After that, the Hall sensor can send an instruction to the processor 110, and the instruction is used to indicate that the mobile phone case is in place. After receiving the instruction, the processor 110 can use the content display method provided in the embodiments of the present application to customize the display content of the electronic ink screen of the mobile phone case. Optionally, when the mobile phone case is removed, the Hall sensor in the mobile phone senses that the magnetic field disappears and can send another instruction to the processor 110, which is used to indicate that the mobile phone case is not in place or has been removed. The specific implementation process will be described later.
[0183] The acceleration sensor 180E can detect the magnitude of the acceleration of the electronic device in various directions (generally three axes). When the electronic device is stationary, the magnitude and direction of gravity can be detected.
[0184] The distance sensor 180F is used to measure distance. The electronic device can measure distance through infrared or laser.
[0185] The proximity light sensor 180G can include, for example, a light-emitting diode (LED) and a light detector, such as a photodiode. The light-emitting diode can be an infrared light-emitting diode. The electronic device emits infrared light outward through the light-emitting diode. The electronic device uses the photodiode to detect the infrared reflected light from nearby objects. When sufficient reflected light is detected, it can be determined that there is an object near the electronic device. When insufficient reflected light is detected, the electronic device can determine that there is no object near the electronic device.
[0186] The ambient light sensor 180L is used to sense the ambient light brightness. The electronic device can adaptively adjust the brightness of the display screen 194 according to the sensed ambient light brightness.
[0187] The fingerprint sensor 180H is used to collect fingerprints.
[0188] The temperature sensor 180J is used to detect temperature.
[0189] The touch sensor 180K, also known as the "touch panel". The touch sensor 180K can be disposed on the display screen 194, and the touch screen, also known as the "touch screen", is composed of the touch sensor 180K and the display screen 194. The touch sensor 180K is used to detect touch operations acting thereon or nearby. The touch sensor can transmit the detected touch operations to the application processor to determine the type of touch event.
[0190] The bone conduction sensor 180M can acquire vibration signals. In some embodiments, the bone conduction sensor 180M can acquire vibration signals of the vibrating bone mass of the human vocal part.
[0191] The button 190 includes a power-on button, volume buttons, etc. The button 190 can be a mechanical button or a touch button. The electronic device can receive button inputs and generate key signal inputs related to the user settings and function controls of the electronic device. The motor 191 can generate vibration prompts. The motor 191 can be used for incoming call vibration prompts and also for touch vibration feedback. The indicator 192 can be an indicator light, which can be used to indicate the charging state, power change, and can also be used to indicate messages, missed calls, notifications, etc. The SIM card interface 195 is used to connect the SIM card. The SIM card can be in contact with and separated from the electronic device by being inserted into or removed from the SIM card interface 195.
[0192] It can be understood that Figure 2 the components shown do not constitute specific limitations on the electronic device. The electronic device in the embodiments of the present application may include more or fewer components than Figure 2 those in. In addition, Figure 2 the combination / connection relationship between the components in
[0193] The technical solutions of the embodiments of the present application will be described below with reference to the accompanying drawings.
[0194] Continuing with Figure 1 the game scenario shown as an example, and taking Figure 1 the player's own team in
[0195] There are N players in the player's own team, corresponding to N devices. The same game application is installed on all N devices. Each player plays the game through the game application on their respective device.
[0196] Optionally, the same device may include at least one of the following: the same device manufacturer (for example, all are Huawei products), the same device type (for example, all are mobile phones or all are Huawei tablets), the same model (for example, all are Huawei Mate 40), the same system (for example, all are HarmonyOS), and the same version of the same system (for example, all are HarmonyOS 2.0 version).
[0197] Optionally, the different devices may include at least one of the following: different device manufacturers (for example, some of the N devices are Huawei products and the other part are non-Huawei products), different device types (for example, among the N devices, there are mobile phones and also tablet computers), different models (for example, among the N devices, there is a Huawei Mate 40 and also a Huawei Nova), different systems (for example, among the N devices, there is a HarmonyOS and also an Android system), and different versions of the same system (for example, among the N devices, there is a 2.0 version of HarmonyOS and also a 1.0 version of HarmonyOS).
[0198] In a possible scenario, N devices in our team are connected to the same local area network or the same hotspot to play games. For example, N players are in the same space and use Wi-Fi to connect to the same router or the same hotspot. In this case, the computing power generated by the N devices during the game is borne by each device itself. For example, the computing power of device 1 during the game is borne by device 1 itself, and the same applies to other devices. It can be understood that, with the same gaming experience of the players, the performance of the devices to a certain extent determines the outcome of the game. For example, when the performance of each device in our team is relatively good, the probability of the team winning is relatively high. If the performance of a certain player's device in our team is poor, the probability of the team winning will decrease. For example, assume that the performance of device 1 in our team is low. Then, when player 1 performs game operations (such as releasing a special move) on device 1, device 1 has a slow response speed due to insufficient performance (such as the CPU being unable to bear strong computing power), which affects the game result of the entire team.
[0199] In view of this, the embodiments of the present application provide a game task transfer method, which can be applied to game scenarios. Taking Figure 1 the game scenario shown as an example, and taking Figure 1 our team in
[0200] as an example, assuming that the performance of device 1 in our team is low, device 1 can transfer the game tasks during the game to other devices in the same team for execution, avoiding affecting the team game result due to the insufficient performance of device 1 and increasing the probability of the team winning. Figure 1 The following continues to take
[0201] The first solution
[0202] Please refer to Figure 3A , which is the first schematic diagram of the game task transfer method provided by an embodiment of the present application. Figure 3A It can be applied to game scenarios and can be understood as an information interaction process between two devices belonging to the same team in a game scenario. Taking Figure 1 the game scenario shown as an example,Figure 3A The devices 1 and 2 can be two devices in our team in the game scenario. For example, Figure 3A , the process includes:
[0203] S301. Devices 1 and 2 access the same local area network.
[0204] Optionally, S301 can be executed or not, so Figure 3A it is represented by a dashed line in []. If S301 is not executed, for example, devices 1 and 2 access the same hotspot, or devices 1 and 2 both use data traffic, etc.
[0205] S302. Devices 1 and 2 start the same game application.
[0206] S303. Devices 1 and 2 play the game in a team.
[0207] In some examples, devices 1 and 2 are in the same team. One possible way of forming a team is that one of devices 1 and 2 can create a room, and the other device joins the room, then these two devices can form a team. In other words, devices 1 and 2 are in the same game room. Taking device 2 creating a room as an example, for example, as Figure 3B (a) is the game interface of device 2, and this interface includes a button for creating a room. When device 2 receives an operation on the button for creating a room, input boxes such as the room name and the number of players are displayed. The player of device 2 can set the room name and the number of players. When device 2 receives an operation on the OK button, the creation of the room is completed. After device 2 creates a room, device 1 can display an interface as shown in Figure 3B (b), and this interface includes information about the room created by device 2. When device 1 receives an operation on the button for joining the room, it joins this room. After device 1 joins the room, device 2 can display an interface as shown in Figure 3B (c), and this interface displays information about the players who have joined the room. After the game starts, device 2 or device 1 can display an interface as shown in Figure 3B (d).
[0208] Optionally, S303 can be executed or not, so Figure 3A it is represented by a dashed line in []. If S303 is not executed, for example, devices 1 and 2 are in different teams, or the game applications allowed by devices 1 and 2 do not require teaming up, etc.
[0209] S304. Device 1 receives a trigger operation, and the trigger operation is used to trigger a game task.
[0210] S305. Device 1 sends a task transfer request to device 2, and the task transfer request is used to request the execution of the game task.
[0211] Optionally, before S305, the device 1 may further perform the steps of determining that at least one of the following four conditions is satisfied:
[0212] (1) The game task triggered by the trigger operation is a preset task. The preset task can be understood as a task that can be transferred in the game application. A possible implementation is that the application package of the game application includes a task list, and the task list includes one or more task identifiers. The tasks indicated by the one or more task identifiers can be transferred, that is, the preset tasks. Therefore, after the device 1 receives the trigger operation, it can determine whether the task identifier of the game task triggered by the trigger operation is in the task list. If so, it is determined that the game task triggered by the trigger operation is a preset task; otherwise, it is determined that the task triggered by the trigger operation is not a preset task. Exemplarily, the preset task may include: playback recording, specific skill release (for example, ultimate skill release), etc., which are not limited in the embodiments of the present application.
[0213] (2) The current frame rate of the device 1 is lower than the preset frame rate. The current frame rate can be understood as the current image drawing rate of the graphics processing unit (GPU) in the device 1, that is, the number of frames of the display screen drawn in one second, which can reflect the current load of the GPU in the device 1. If the current frame rate of the device 1 is high, it means that the GPU load is small and it can undertake certain tasks, so there is no need to transfer tasks; on the contrary, if the current frame rate of the device 1 is low, it means that the GPU load is large and it cannot undertake too many tasks, and the tasks can be transferred to other devices for execution.
[0214] (3) The usage rate of the central processing unit (CPU) of the device 1 is higher than the preset CPU usage rate. The higher the usage rate of the CPU, the stronger the load of the CPU (for example, more applications are started in the background), and the weaker the computing power; on the contrary, the lower the usage rate of the CPU, the lower the load of the CPU (for example, fewer applications are started in the background), and the stronger the computing power. Therefore, if the CPU usage rate of the device 1 is small, it means that the device 1 has sufficient ability to execute tasks by itself, so there is no need to transfer tasks; on the contrary, if the CPU usage rate of the device 1 is large, it means that the device 1 does not have sufficient ability to execute tasks by itself, and the tasks can be transferred.
[0215] (4) The storage space occupancy rate of device 1 is higher than the preset storage space occupancy rate. The storage space occupancy rate can be the ratio of the occupied storage space in device 1 to all storage spaces. The smaller the storage space occupancy rate, the smoother the device runs; conversely, the larger the storage space occupancy rate, the more laggy the device runs. Therefore, if the storage space occupancy rate of device 1 is small, it can execute tasks by itself without task transfer; conversely, if the storage space occupancy rate of device 1 is large, in order to avoid the device running laggy, tasks can be transferred.
[0216] Optionally, the above (4) conditions can be used alone or in combination. For example, when device 1 determines that the triggered game task is a preset task, it may not need to consider the current running frame rate, CPU usage rate, memory occupancy rate, etc., and transfer the preset task to the second device. For another example, when device 1 determines that the triggered game task is a preset task, it can also judge whether device 1 can execute it by itself according to at least one of the current running frame rate, CPU usage rate, and memory occupancy rate. If it can, there is no need for transfer; if not, the preset task is transferred to the second device. For another example, when device 1 determines that the triggered game task is not a preset task, it can also judge whether device 1 can execute it by itself according to at least one of the current running frame rate, CPU usage rate, and memory occupancy rate. If not, the preset task is transferred to the second device.
[0217] Optionally, before S305, device 1 can also execute the step of determining device 2 among multiple devices. In some examples, device 2 can be a host device. The host device can be a management device of the game room. For example, it is the device that creates the game room. Device 1 is in this game room. For the process of creating the room, please refer to the previous text. In other examples, in addition to device 1 in the team, there can also be M devices (including device 2). M is a positive integer. For example, when M≥2, device 1 can randomly select a device or determine the device through election among the M devices, that is, device 2. For example, device 1 can elect device 2 among the M devices according to at least one of the device performance, game status, game character, and geographical location of the M devices. It can be understood that when M = 1, it means that in addition to device 1, there is only device 2, and no election is needed. It can be understood that the elected device can be a host device or not.
[0218] Optionally, device 2 can meet at least one of the following conditions:
[0219] (1) Device 2 is a device with a relatively high current running frame rate among the M devices. For example, device 2 can be the device with the highest current running frame rate among the M devices.
[0220] (2) Device 2 is the device with a relatively low current CPU usage rate among the M devices. For example, device 2 can be the device with the lowest current CPU usage rate among the M devices.
[0221] (3) Device 2 is the device with a relatively low current storage space occupancy rate among the M devices. Alternatively, device 2 can be the device with the lowest current storage space occupancy rate among the M devices.
[0222] (4) Device 2 is the device that is currently in the spectator state among the M devices.
[0223] (5) Device 2 is the device that is currently in the dead state among the M devices.
[0224] (6) Device 2 is the device corresponding to the specified game character among the M devices. For example, in the application package of the game application, there is indication information, and the indication information is used to indicate that the device corresponding to a certain game character (for example, the support) is the device that helps other devices execute tasks. In this case, when the devices corresponding to other game characters need to transfer tasks, they can transfer the tasks to the device corresponding to this game character (for example, the support).
[0225] (7) Device 2 is the device with a relatively short distance from device 1 among the M devices. For example, device 2 can be the device with the shortest distance from device 1 among the M devices. That is to say, device 1 transfers tasks to the nearest device 2, which can improve efficiency.
[0226] Optionally, the task transfer request may include the task identifier of the game task triggered by the trigger operation. The task identifier is used to uniquely identify the game task so that device 2 knows which task to execute.
[0227] Optionally, the task transfer request may also carry other information. For example, it carries the information of the game character corresponding to device 1, and the information may include the name, level, position in the game scene, etc. of the game character.
[0228] S306, Device 2 executes the game task.
[0229] Optionally, device 2 can determine which task to execute according to the task identifier carried in the task transfer request, and then execute the task.
[0230] S307, Device 2 returns the task execution result to device 1.
[0231] In some examples, the task execution result can be the content obtained from executing the task. Taking the game task of playback recording as an example, one possible implementation is that device 2 starts recording the game screen to obtain a video from the moment it receives the task transfer request. The recording duration can be a fixed duration, which is set in advance, or after device 2 starts recording, it stops recording when it receives the stop recording instruction sent by device 1. In this way, what device 2 obtains is a video, that is, the task execution result is a video. Device 2 can return this video to device 1. Another possible implementation is that device 2 starts recording the position information of each game character in the game screen from the moment it receives the task transfer request to obtain a file. This file is not a video but a file that records the position information of each game character at each moment. Therefore, the task execution result is a file. Device 2 can send this file to device 1. After device 1 obtains this file, it can generate the game screen based on this file and then play the game screen to complete the playback.
[0232] In other examples, the task execution result can be the success or failure of executing the task. For example, when the task execution is successful, the task execution result is an indication message used to indicate that the task execution is successful. When the task execution fails, the task execution result is another indication message used to indicate that the task execution fails. Taking the game task of skill release as an example, device 1 transfers this task to device 2. After device 2 executes this task, it can return an indication message to device 1 to indicate that the task execution is successful. Of course, in some cases, device 2 may fail to execute the task (the embodiments of this application do not limit the reasons for failure), then device 2 can return an indication message indicating that the task execution fails to device 1.
[0233] Taking the game task as the release of a specific skill as an example, device 2 can calculate the position of the explosion point based on the position of the game character corresponding to device 1 in the game scene. Therefore, device 2 needs to obtain the position of the game character corresponding to device 1 in the game scene. One possible way is that the task transfer request sent by device 1 to device 2 carries the position of the game character of device 1. Another possible way is that device 2 determines the position of the game character of device 1 in the game scene by itself. For example, the task transfer request includes the name of the game character corresponding to device 1, and device 2 can determine the position of the game character with this name in the game scene (i.e., the game screen). Therefore, device 2 can calculate the position of the explosion point based on the position of the game character corresponding to device 1 in the game scene. Optionally, after device 2 calculates the position of the explosion point, it can generate an explosion effect at the explosion point by itself, or return the position of the explosion point to device 1, and device 1 generates an explosion effect at the explosion point. Optionally, if device 2 generates an explosion effect at the explosion point by itself, device 2 needs to know the level of the game character corresponding to device 1 because different levels result in different explosion effects. One possible way is that the task transfer request sent by device 1 to device 2 carries the level of the game character of device 1. Another possible way is that device 2 determines the level of the game character of device 1 in the game scene by itself. For example, the task transfer request includes the name of the game character corresponding to device 1, and device 2 can determine the level of the game character with this name in the game scene because the level of each game character can be displayed in the game screen.
[0234] It should be noted that S307 can be executed or not, so it is represented by a dotted line in the figure. Taking the game task as the playback of a recording as an example, S307 needs to be executed. Taking the game task as the release of a specific skill as an example, device 2 has calculated the position of the explosion point and generated an explosion effect at the explosion point. Due to the game screen synchronization, the explosion effect will be displayed in the game screen of device 1. Therefore, device 1 can determine that the skill release has been successfully executed through the game screen, so device 2 may not return the task execution result to device 1.
[0235] It should be noted that taking the task of releasing a special move as an example, if the task of device 1 is not transferred to other devices and is executed by device 1 itself, the GPS load will increase when device 1 executes this task, so the current running frame rate of device 1 will be significantly reduced. For example, please refer to Figure 3C (a), which is the game interface before device 1 receives the trigger operation for releasing the special move. This interface includes the current running frame rate of device 1, such as 50fps. After device 1 receives the trigger operation for releasing the special move, since this task is executed by device 1 itself, the current running frame rate of device 1 drops from 50fps to 20fps, as shown in Figure 3C(b). The reduced 30fps is caused by executing the special move release task. In other words, the significant reduction in the frame rate of Device 1 will cause Device 1 to freeze, affecting the game result.
[0236] If Device 1 uses the technical solution provided in the embodiment of the present application to transfer the special move release task to Device 2 for execution, then the GPU load of Device 1 will not increase significantly. Therefore, the current running frame rate of Device 1 may remain unchanged or decrease slightly. For example, please refer to Figure 3D (a), which is the game interface before Device 1 receives the trigger operation for special move release. This interface includes the current running frame rate of Device 1, such as 50fps. After Device 1 receives the trigger operation for special move release, since this task is transferred to Device 2 for execution, the current running frame rate of Device 1 remains 50fps or slightly lower than 50fps, such as 45fps, as shown in Figure 3D (b). That is to say, after Device 1 transfers the task, the reduction value of the current running frame rate of Device 1 is less than 30fps (as mentioned above, 30fps is the frame rate reduction value caused by executing the special move release task).
[0237] It can be understood that since Device 2 undertakes the task of Device 1, the current running frame rate in the game interface of Device 2 will decrease. However, since Device 2 is the elected optimal device, the decrease in the current running frame rate of Device 2 has little impact on Device 2.
[0238] The second solution
[0239] In the first solution, within the same team, Device 2 executes the task transferred from Device 1. Different from the first solution, in the second solution, before Device 2 executes the task transferred from Device 1, it first determines whether the local device meets the conditions. If so, it executes the task; otherwise, it transfers the game task of Device 1 to other devices.
[0240] Please refer to Figure 4 , which is the second schematic diagram of the game task transfer method provided by an embodiment of the present application. Figure 4 The shown process can be applied to Figure 1 the game scenario. For example, Figure 4 Device 2, Device 1, and Device 3 in Figure 1 can be three devices in our team in the game scenario. As shown in Figure 4 , the process includes:
[0241] S401, Devices 1, 2, and 3 are connected to the same local area network.
[0242] S402, Devices 1, 2, and 3 start the same game application.
[0243] S403, Devices 1, 2, and 3 play a team game.
[0244] In some examples, Devices 1, 2, and 3 are in the same team. For example, Devices 1, 2, and 3 are in the same game room. Optionally, the game room can be created by any one of Devices 1, 2, and 3.
[0245] S404, Device 1 receives a trigger operation for triggering a game task.
[0246] Optionally, the implementation principles of S401 - S404 are the same as Figure 3A those of S301 - S304 in [reference], and will not be repeated here.
[0247] S405, Device 1 sends a task transfer request to Device 2, and the task transfer request is used to request the execution of the game task.
[0248] Optionally, before S405, Device 1 can also perform: determining that at least one of the following conditions is met:
[0249] (1) The game task triggered by the trigger operation is a preset task.
[0250] (2) The current running frame rate of Device 1 is lower than the preset frame rate.
[0251] (3) The current CPU usage rate of Device 1 is higher than the preset CPU usage rate.
[0252] (4) The current storage space occupancy rate of Device 1 is higher than the preset storage space occupancy rate.
[0253] S406, Device 2 determines whether the local device meets the conditions. If so, it executes S407 and S408. Otherwise, it executes S409 to S412.
[0254] In some examples, Device 2 can be the host device. In other examples, Device 2 can also be a device randomly selected by Device 1 or an elected device. For the election method, please refer to Figure 3A S305 in [reference].
[0255] Optionally, in S406, the conditions can include at least one of the following:
[0256] (1) The game character corresponding to Device 2 is in the spectator state. It should be noted that the game characters in the game application include three states: participating state, spectator state, and dead state. There are conversion relationships between these three states. For example, please refer to Figure 5, Assume that the game character corresponding to a device is currently in the combat state. If the game character dies, it enters the death state. After entering the death state, it can be restored to the combat state or enter the spectator state. After entering the spectator state, it can be restored to the combat state. In the embodiments of the present application, considering that the device corresponding to the game character currently in the spectator state is in an "idle" state, the device in the spectator state is used to share the game tasks of other devices in the same team (for example, the combat device). Therefore, if the game character corresponding to device 2 is currently in the spectator state, it is determined that device 2 meets the conditions.
[0257] (2) The game character corresponding to device 2 is in the death state. In the embodiments of the present application, considering that the device corresponding to the game character currently in the death state is in an "idle" state, the device in the death state is used to share the game tasks of other devices in the same team (for example, the combat device). Therefore, if the game character corresponding to device 2 is currently in the death state, it is determined that device 2 meets the conditions.
[0258] (3) The current running frame rate of device 2 is higher than the preset frame rate. As mentioned above, for a device with a relatively high current running frame rate, it indicates that the load on its GPU is relatively low. Therefore, in the embodiments of the present application, the device with a relatively high current running frame rate is used to share the game tasks of other devices in the same team (for example, the combat device). Therefore, if the current running frame rate of device 2 is higher than the preset frame rate, it is determined that device 2 meets the conditions.
[0259] (4) The current CPU usage rate of device 2 is lower than the preset CPU usage rate. As mentioned above, for a device with a relatively low CPU usage rate, it indicates that the CPU load is relatively low. Therefore, in the embodiments of the present application, the device with a relatively low CPU usage rate is used to share the game tasks of other devices in the same team (for example, the combat device). Therefore, if the CPU usage rate of device 2 is lower than the preset CPU usage rate, it is determined that device 2 meets the conditions.
[0260] (5) The current storage space occupancy rate of device 2 is lower than the preset storage space occupancy rate. As mentioned above, for a device with a relatively low storage space occupancy rate, the probability of running stutter is relatively low. Therefore, in the embodiments of the present application, the device with a relatively low storage space occupancy rate is used to share the game tasks of other devices in the same team (for example, the combat device). Therefore, if the storage space occupancy rate of device 2 is lower than the preset storage space occupancy rate, it is determined that device 2 meets the conditions.
[0261] (6) The game character corresponding to device 2 is a designated game character. That is to say, the device corresponding to the designated game character can undertake the tasks transferred from other devices, and the devices that are not the designated game characters can not undertake the tasks transferred from other devices.
[0262] S407, Device 2 executes the game task.
[0263] S408, Device 2 returns the task execution result to Device 1.
[0264] Optionally, the implementation principles of S407 and S408 are the same as Figure 3A S306 and S307 in, and will not be repeated here.
[0265] S409, Device 2 sends a task transfer request to Device 3, and the task transfer request is used to request the execution of the game task.
[0266] Optionally, before S409, Device 2 can determine Device 3 among multiple devices. For example, in addition to Device 1 and Device 2 in the team, there can also be P devices, where P is a positive integer. For example, when P≥2, Device 2 can randomly select a device or a device determined through an election among the P devices, that is, Device 3. For example, Device 2 can elect Device 3 among the P devices according to at least one of the device performance, game status, game character, and geographical location of the P devices. It can be understood that when P = 1, it means that in addition to Device 1 and Device 2, there is only Device 3, and no election is required.
[0267] Optionally, Device 3 can meet at least one of the following conditions:
[0268] (1) Device 3 is a device with a relatively high current running frame rate among the P devices. For example, Device 3 is the device with the highest current running frame rate among the P devices.
[0269] (2) Device 3 is a device with a relatively low current CPU usage rate among the P devices. For example, Device 3 is the device with the lowest current CPU usage rate among the P devices.
[0270] (3) Device 3 is a device with a relatively low current storage space occupancy rate among the P devices. For example, Device 3 is the device with the lowest current storage space occupancy rate among the P devices.
[0271] (4) Device 3 is a device currently in the spectator state among the P devices.
[0272] (5) Device 3 is a device currently in the dead state among the P devices.
[0273] (6) Device 3 is the device corresponding to the specified game character among the P devices.
[0274] (7) Device 3 is a device with a relatively short distance from Device 2 among the P devices.
[0275] S410, Device 3 determines that the local machine meets the conditions.
[0276] Optionally, in S410, the conditions include at least one of the following:
[0277] (1) The game character corresponding to device 3 is in a spectator state.
[0278] (2) The game character corresponding to device 3 is in a dead state.
[0279] (3) The current running frame rate of device 3 is higher than the preset frame rate.
[0280] (4) The current CPU usage rate of device 3 is lower than the preset CPU usage rate.
[0281] (5) The current storage space occupancy rate of device 3 is lower than the preset storage space occupancy rate.
[0282] (6) The game character corresponding to device 3 is a specified game character.
[0283] S411, Device 3 executes the game task.
[0284] S412, Device 3 returns the task execution result to device 1.
[0285] Optionally, in S412, when device 3 returns the task execution result to device 1, it may include: Device 3 directly returns the task execution result to device 1, or device 3 returns the task execution result to device 1 through device 2, that is, device 3 sends the task execution result to device 2, and device 2 sends the task execution result to device 1.
[0286] It should be noted that Figure 4In the above, after device 2 receives the task transfer request from device 1, it first determines whether the local device meets the conditions. If so, it executes the task; otherwise, it transfers the task to device 3. A possible situation is that there are only three devices, namely device 2, device 1, and device 3 in the same team. In this case, when the task is transferred from device 1 to device 2 and then from device 2 to device 3, since device 3 is the last device, device 3 can directly execute S411 without having to execute S410 (so it is represented by a dotted line in the figure). Optionally, a feasible way for device 3 to determine that it is the last device is that the task transfer request sent by device 1 to device 2 carries the identifier of device 1 or the identifier of the game character of device 1. The task transfer request sent by device 2 to device 3 not only carries the identifier of device 1 or the identifier of the game character of device 1, but also carries the identifier of device 2 or the identifier of the corresponding game character of device 2. In this way, after device 3 receives the task transfer request, it can know that the task transfer request has passed through device 2 and device 1, and since the number of devices in the team is 3 and is known, device 3 can determine that it is the last device. Another possible situation is that there are more than just device 2, device 1, and device 3 in the same team, and device 4 is also included. In this case, when the task is transferred from device 1 to device 2 and then from device 2 to device 3, device 3 can execute S410, that is, determine whether the local device meets the conditions. If it meets the conditions, it executes S411; otherwise, it can transfer the task to device 4. Since device 4 is the last device, it does not determine whether the local device meets the conditions and directly executes the task. The principle for device 4 to determine that it is the last device is as described above and will not be repeated here.
[0287] The third solution
[0288] In the second solution, within the same team, after device 2 receives the task transfer request from device 1, if device 2 cannot execute it, it transfers it to device 3. The difference from the second solution is that in the third solution, after device 2 receives the task transfer request from device 1, it can conduct device election to select the optimal device, and the optimal device executes the task. Therefore, in the third solution, the task of device 2 can be directly transferred to the elected optimal device without going through one-by-one transfer of devices.
[0289] Please refer to Figure 6 which is the third schematic diagram of the game task transfer method provided by an embodiment of the present application. As Figure 6 shown, the process includes:
[0290] S601, Devices 1, 2, and 3 are connected to the same local area network.
[0291] S602, Devices 1, 2, and 3 start the same game application.
[0292] S603. Devices 1, 2, and 3 play a team game.
[0293] S604. Device 1 receives a trigger operation for triggering a game task.
[0294] Optionally, the implementation principles of S601 - S604 are the same as Figure 3A those of S301 - S304 in [reference], and will not be repeated here.
[0295] S605. Device 1 sends a task transfer request to Device 2, and the task transfer request is used to request the execution of the game task.
[0296] Optionally, before S605, Device 1 can also perform the following steps: determine that at least one of the following conditions is met:
[0297] (1) The game task triggered by the trigger operation is a preset task.
[0298] (2) The current running frame rate of Device 1 is lower than the preset frame rate.
[0299] (3) The current CPU usage rate of Device 1 is higher than the preset CPU usage rate.
[0300] (4) The current storage space occupancy rate of Device 1 is greater than the preset storage space occupancy rate.
[0301] In some examples, Device 2 can be the host device. That is, when a non - host device needs to transfer a task, it sends a task transfer request to the host device. The host device conducts device election to determine the optimal device, and then transfers the task to the determined optimal device.
[0302] In other examples, Device 2 can also be the device corresponding to a specified game character. For example, in the application package of the game application, there is indication information for indicating the device corresponding to a certain game character to conduct device election. In this case, when other devices corresponding to game characters need to transfer tasks, they send task transfer requests to the device corresponding to the game character. This device conducts device election to determine the optimal device, and then transfers the task to the determined optimal device.
[0303] In other examples, Device 2 can also be a device randomly selected by Device 1, or a device elected by Device 1. For the election method, please refer to Figure 3A S305 in [reference].
[0304] S606. Device 2 conducts device election to determine the target device.
[0305] Optionally, Device 2 can participate or not participate in the device election. For example, when Device 2 is the host device, it can not participate in the election.
[0306] In some examples, in addition to device 1 and device 2, the team also includes K devices, where K is a positive integer. When K>2, device 2 can conduct device election among the K devices. It can be understood that when K = 1, election may not be required. For example, S606 may include: device 2 elects a target device among the K devices according to at least one of the device performance, game status, game character, and geographical location of each device among the K devices. The device performance may include at least one of the current running frame rate, the current CPU usage rate, and the current storage space occupancy rate. The game status may include a death state, a spectator state, or a participating state.
[0307] Optionally, S606 may include at least one of the following methods:
[0308] Method 1: Device 2 determines that the device currently in the death state among the K devices is the target device. It should be noted that for the device corresponding to the game character currently in the death state, since it is not participating in the battle, it is relatively "idle". Therefore, the tasks of device 1 can be transferred to the device corresponding to the game character currently in the death state for execution.
[0309] Method 2: Device 2 determines that the device currently in the spectator state among the K devices is the target device. It should be noted that for the device corresponding to the game character currently in the spectator state, since it is not participating in the battle, it is relatively "idle". Therefore, the tasks of device 1 can be transferred to the device corresponding to the game character currently in the spectator state for execution.
[0310] Method 3: Device 2 determines that the device with a relatively low current running frame rate among the K devices is the target device. For example, device 2 determines that the device with the lowest current running frame rate among the K devices is the target device.
[0311] Method 4: Device 2 determines that the device with a relatively low current CPU usage rate among the K devices is the target device. For example, device 2 determines that the device with the lowest current CPU usage rate among the K devices is the target device.
[0312] Method 5: Device 2 determines that the device with a relatively low current storage space occupancy rate among the K devices is the target device. For example, device 2 determines that the device with the lowest current storage space occupancy rate among the K devices is the target device.
[0313] Method 6: Device 2 determines that the device among the K devices whose game character is the designated game character is the target device. For example, in the application package of the game application, there is indication information, and the indication information is used to indicate that the device corresponding to a certain game character (for example, the support) is the device that helps other devices execute tasks. In this case, when device 2 conducts device election, it can elect the device corresponding to this game character (for example, the support) as the target device.
[0314] In Method 7, Device 2 determines the devices among the K devices that are closer to Device 2 as the target devices. For example, Device 2 determines the device among the K devices that is closest to Device 2 as the target device.
[0315] The above seven methods can be used alone or in combination, and the embodiments of the present application do not make any limitations. In some examples, there is a priority order among the above seven methods. For example, the priority order includes: Method 1 / Method 2, Method 3, Method 4, Method 5, Method 6, Method 7. For example, Device 2 preferentially uses Method 1 or Method 2. If the target device cannot be determined or multiple target devices are determined, Method 3 is used, and so on.
[0316] Optionally, Device 2 may or may not participate in device election.
[0317] S607, when the target device is Device 3, Device 2 sends a task transfer request to Device 3.
[0318] S608, Device 3 executes the game task.
[0319] S609, Device 3 returns the task execution result to Device 1.
[0320] Optionally, the implementation principles of S608 and S609 are the same as Figure 4 the implementation principles of S411 and S412 in
[0321] The fourth solution
[0322] The fourth solution can be understood as a combination of the second solution and the third solution. For example, in the fourth solution, after receiving the task transfer request from Device 1, Device 2 can first determine whether it can execute the task locally. If it can, Device 2 executes the task locally; otherwise, device election is performed to select the optimal device to execute the task of Device 1. It should be noted that device election takes a certain amount of time to complete. If Device 2 can execute the task of Device 1 locally, there is no need for device election, which can improve the processing speed.
[0323] Please refer to Figure 7 which is the fourth schematic diagram of the game task transfer method provided by an embodiment of the present application. As Figure 7 shown, the process includes:
[0324] S701, Device 1, Device 2, and Device 3 are connected to the same local area network.
[0325] S702, Device 1, Device 2, and Device 3 start the same game application.
[0326] S703, Device 1, Device 2, and Device 3 play the game in a team.
[0327] S704. The device 1 receives a trigger operation for triggering a game task.
[0328] Optionally, the implementation principles of S701 - S704 are the same as those of Figure 3A S301 - S304 in [reference], and will not be repeated here.
[0329] S705. The device 1 sends a task transfer request to the device 2, and the task transfer request is used to request the execution of the game task.
[0330] Optionally, before S705, the device 1 can also perform the steps of determining that at least one of the following conditions is met:
[0331] (1) The game task triggered by the trigger operation is a preset task.
[0332] (2) The current running frame rate of the device 1 is lower than the preset frame rate.
[0333] (3) The current CPU usage rate of the device 1 is higher than the preset CPU usage rate.
[0334] (4) The current storage space occupancy rate of the device 1 is higher than the preset storage space occupancy rate.
[0335] In some examples, the device 2 can be a host device. In other examples, the device 2 can also be the device corresponding to a specified game character. For example, in the application package of the game application, there is indication information for indicating the device corresponding to a certain game character for device election. In other examples, the device 2 can also be a device randomly selected by the device 1, or a device elected by the device 1. For the election method, please refer to Figure 3A S305 in [reference].
[0336] S706. The device 2 determines whether the local device meets the conditions.
[0337] Optionally, in S706, the conditions can include at least one of the following:
[0338] (1) The game character corresponding to the device 2 is in the spectator state.
[0339] (2) The game character corresponding to the device 2 is in the dead state.
[0340] (3) The current running frame rate of the device 2 is lower than the preset frame rate.
[0341] (4) The CPU usage rate of the device 2 is lower than the preset CPU usage rate.
[0342] (5) The storage space occupancy rate of the device 2 is lower than the preset storage space occupancy rate.
[0343] (6) The game character corresponding to device 2 is a designated game character.
[0344] S707, Device 2 executes the game task.
[0345] S708, Device 2 returns the task execution result to device 1.
[0346] Optionally, the implementation principles of S707 and S708 are the same as Figure 4 S407 and S408 in, not repeated here.
[0347] S709, Device 2 conducts device election to determine the target device.
[0348] Optionally, in this case, device 2 can participate or not participate in the device election.
[0349] S710, When the target device is device 3, device 2 sends a task transfer request to device 3.
[0350] S711, Device 3 determines that the conditions are met.
[0351] Optionally, the implementation principle of S711 is the same as Figure 4 S410 in, not repeated here.
[0352] S712, Device 3 executes the game task.
[0353] S713, Device 3 returns the task execution result to device 1.
[0354] Optionally, the implementation principles of S709 - S710 and S712 - S713 are the same as Figure 6 S606 to S609 in, not repeated here.
[0355] In the above embodiments, one device can transfer a game task to another device for execution. A possible implementation of the task transfer between two devices is that the same game application is installed on the two devices, and the application package of the game application includes a Software Development Kit (SDK), and the SDK includes a task transfer service (which can also have other names, such as a computing power transfer service) for implementing task transfer between different devices. For example, the task transfer service includes software code integrated for implementing task transfer. For example, the game developer has pre-compiled the software code, written the software code into the installation package of the game application, and then released the game application to the application mall, and each device downloads and installs the game application from the application mall. Taking Figure 7 the fourth solution shown as an example, device 1, device 2, and device 3 all include the application package of the game application, and the application package includes the task transfer service, asFigure 8A In this way, devices 1, 2, and 3 can perform task transfer through the task transfer service.
[0356] Please refer to Figure 8B , which is a schematic diagram of the task transfer service provided by an embodiment of the present application. Figure 8B In, taking the task transfer service in device 1 as an example, the task transfer service includes an interface module and a computing module. Among them, the interface module may include n interfaces, where n is a positive integer. The n interfaces are used to receive and / or send task transfer requests. The computing module includes a device election module and a task transfer module. Among them, the device election module is used to perform device election. The task transfer module is used to determine whether the current task (for example, the task triggered by the trigger operation) is a preset task. If so, a task transfer request is sent to other devices through the interface module.
[0357] Continuing with the example of device 1 triggering a preset task below, in combination with Figure 8B the task transfer process will be described. The process may include:
[0358] (1), Devices 1, 2, and 3 are connected to the same local area network.
[0359] (2), Devices 1, 2, and 3 start the same game application.
[0360] (3), Devices 1, 2, and 3 play the game in a team.
[0361] (4), Device 1 receives a trigger operation, and the trigger operation is used to trigger a game task.
[0362] (5), The task transfer module in the task transfer service in device 1 sends a task transfer request through the interface. Optionally, the task transfer request carries the task identifier of the task triggered by the trigger operation. A possible situation is that the task transfer module randomly determines an interface and then sends a task transfer request through this interface; or, the task transfer module sends a task transfer request through a specified interface. For example, each of the n interfaces corresponds to a task. Taking n = 2 as an example, task 1 and task 2 are tasks that can be transferred in the game application. Task 1 corresponds to interface 1, and task 2 corresponds to interface 2. Exemplarily, the interface identifier of interface 1 may be the same as the task identifier of task 1, and the interface identifier of interface 2 may be the same as the task identifier of task 2. Therefore, when device 1 triggers task 1, a task transfer request needs to be sent through interface 1, and the request carries the task identifier of task 1. Of course, if device 1 triggers task 2, a task transfer request can be sent through interface 2, and the request carries the task identifier of task 2.
[0363] (6), Device 2 receives the task transfer request.
[0364] (7), Device 2 calls the device election module through an interface for device election. A possible situation is that Device 2 randomly determines an interface and then calls the device election module through this interface; or, Device 2 calls the device election module through a specified interface. For example, each of the n interfaces corresponds to a task. Taking n = 2 as an example, Task 1 corresponds to Interface 1 and Task 2 corresponds to Interface 2. Therefore, if the task identifier carried in the task transfer request is the identifier of Task 1, the device election module is called through Interface 1. If the task identifier carried in the task transfer request is the identifier of Task 2, the device election module is called through Interface 2.
[0365] (8) The device election module in Device 2 conducts device election to determine the target device.
[0366] For the device election process, please refer to the previous description and will not be repeated here.
[0367] (9) After the device election module in Device 2 determines the target device, it sends a task transfer request to the target device through the task transfer module by calling an interface.
[0368] (10) The target device is Device 3, and Device 3 receives the task transfer request.
[0369] (11) Device 3 executes the task.
[0370] (12) Device 3 returns the task execution result to Device 2. A possible situation is that Device 3 randomly determines an interface and then sends the task execution result through this interface; or, Device 3 sends the task execution result through a specified interface. For example, each of the n interfaces corresponds to a task. Taking n = 2 as an example, Task 1 corresponds to Interface 1 and Task 2 corresponds to Interface 2. Therefore, if the task identifier carried in the task transfer request is the identifier of Task 1, the task execution result is sent through Interface 1. If the task identifier carried in the task transfer request is the identifier of Task 2, the task execution result is sent through Interface 2.
[0371] In the above embodiments, multiple devices can form a team to play games. In the embodiments of the present application, a method for multi-device team games can be provided, and this method can be applicable to Figure 1 the game scenarios shown. For the convenience of understanding, taking N devices in our team in the game scenario as an example, and taking it that all N devices in our team are of HarmonyOS as an example.
[0372] It should be noted that HarmonyOS includes a distributed soft bus, and the distributed soft bus can realize fast networking and connection of multiple devices. For example, please refer to Figure 9, which is a schematic diagram of a distributed soft bus. The distributed soft bus includes a discovery module, a connection module, a transmission module, etc. Among them, the discovery module is used to discover surrounding devices, the connection module is used to connect to surrounding devices, and the transmission module is used to transmit information to surrounding devices. The following takes N devices within the same team as an example, where each device has Figure 9 The distributed soft bus shown is used for illustration.
[0373] Please refer to Figure 10 , which is a schematic flowchart of a game teaming method provided by an embodiment of the present application. Figure 10 Taking the creation of a room by device 2 as an example for illustration. As Figure 10 , the process includes:
[0374] S1001, Devices 1, 2, and 3 are connected to the same local area network.
[0375] S1002, Devices 1, 2, and 3 enter the same game application.
[0376] S1003, Devices 1, 2, and 3 respectively start the discovery module in the distributed soft bus.
[0377] S1004, Device 2 broadcasts a message through the discovery module, and the message includes the device information of device 2; correspondingly, devices 1 and 3 receive the message through the discovery module. Therefore, S1004 includes S1004a and S1004b.
[0378] S1005, Devices 1, 2, and 3 call the distributed soft bus to establish a trust relationship.
[0379] Taking the establishment of a trust relationship between device 1 and device 2 as an example, a possible implementation is that the distributed soft bus in device 2 generates a networkId for device 2, and the networkId is carried in the message broadcast by device 2. After device 1 receives the message, it can obtain the networkId of device 2, and then device 1 requests to establish a trust relationship with device 2. Device 2 can request the user's consent through a pop-up window. If the user of device 2 agrees, device 2 indicates to device 1 to agree to establish a trust relationship. In this way, the establishment of the trust relationship between device 2 and device 1 is completed.
[0380] S1006, Device 2 creates a room.
[0381] Optionally, S1006 can also be executed before S1004, and the embodiments of the present application do not make limitations.
[0382] S1007, Device 2 sends room information to devices 1 and 3 respectively. Therefore, S1007 can include S1007a and S1007b.
[0383] S1008, Device 1 and Device 3 join the room respectively. Therefore, S1008 includes S1008a and S1008b.
[0384] S1009, Device 1 and Device 3 send connection requests to Device 2. Therefore, S1009 includes S1009a and S1009b.
[0385] S1010, Device 2 connects to Device 1 and Device 3 respectively.
[0386] S1011, Device 2, Device 1 and Device 3 synchronize the game screens.
[0387] Figure 10 Taking the case where multiple devices are all HarmonyOS as an example, there may be a situation where the systems of multiple devices are different. For example, some devices are Android systems and some devices are HarmonyOS. In this case, the teaming of multiple devices can be carried out through network protocols such as the User Datagram Protocol (UDP). Different from the distributed soft bus, in the UDP protocol, two devices are connected based on Udp and ip. For example, please refer to Figure 11 As shown, the process includes:
[0388] S1101, Device 1, Device 2 and Device 3 access the same local area network.
[0389] S1102, Device 1, Device 2 and Device 3 enter the same game application.
[0390] S1103, Device 1, Device 2 and Device 3 initialize the Udp module. Among them, the Udp module in each device can send and receive UDP packets.
[0391] S1104, Device 2 creates a room.
[0392] S1105, Device 2 sends UDP packets to Device 1 and Device 3 respectively. The UDP packets include room information and the room IP address. Therefore, S1105 can include S1105a and S1105b.
[0393] S1106, Device 1 and Device 3 join the room respectively. Therefore, S1106 includes S1106a and S1106b.
[0394] S1107, Device 1 and Device 3 send connection requests to Device 2 based on the room IP address. Therefore, S1107 includes S1107a and S1107b.
[0395] S1108, Device 2 connects to Device 1 and Device 3 respectively.
[0396] S1109, Device 1, Device 2, and Device 3 synchronize the game screen.
[0397] Figure 12 FIG. is a schematic structural diagram of the electronic device 1200 provided in an embodiment of the present application. The electronic device 1200 may be Device 1, Device 2, or Device 3 in the foregoing text. As Figure 12 shown, the electronic device 1200 may include: one or more processors 1201; one or more memories 1202; a communication interface 1203, and one or more computer programs 1204. The foregoing components may be connected through one or more communication buses 1205. Wherein the one or more computer programs 1204 are stored in the foregoing memory 1202 and configured to be executed by the one or more processors 1201. The one or more computer programs 1204 include instructions. For example, when the electronic device 1200 is Device 1 in the foregoing text, the instructions may be used to execute the relevant steps of Device 1 in the corresponding embodiment above. For example, Figure 3A , Figure 4 , Figure 6 , Figure 7 , Figure 10 , Figure 11 The steps of Device 1 in the embodiments shown in. For example, when the electronic device 1200 is Device 2 in the foregoing text, the instructions may be used to execute the relevant steps of Device 2 in the corresponding embodiment above. For example, Figure 3A , Figure 4 , Figure 6 , Figure 7 , Figure 10 , Figure 11 The relevant steps of Device 2 in the embodiments shown in. For example, when the electronic device 1200 is Device 3 in the foregoing text, the instructions may be used to execute the relevant steps of Device 3 in the corresponding embodiment above. For example, Figure 4 , Figure 6 , Figure 7 , Figure 10 , Figure 11 The relevant steps of Device 3 in the embodiments shown in. The communication interface 1203 is used to implement communication between the electronic device 1200 and other devices. For example, the communication interface may be a transceiver.
[0398] In the foregoing embodiments provided by the present application, the method provided by the embodiments of the present application is introduced from the perspective of an electronic device (for example, a mobile phone) as an execution subject. To implement each function in the method provided by the foregoing embodiments of the present application, the electronic device may include a hardware structure and / or a software module, and implement the foregoing functions in the form of a hardware structure, a software module, or a combination of a hardware structure and a software module. Whether a certain function among the foregoing functions is executed in the form of a hardware structure, a software module, or a combination of a hardware structure and a software module depends on the specific application and design constraint conditions of the technical solution.
[0399] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions described above according to the embodiments of the present invention are generated in whole or in part. The aforementioned computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The aforementioned computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by wire (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wirelessly (such as infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that includes one or more integrated available media. The available medium can be a magnetic medium (such as a floppy disk, hard disk, magnetic tape), an optical medium (such as a DVD), or a semiconductor medium (such as a solid state disk (SSD)). Without conflict, the solutions of the above embodiments can be combined.
[0400] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a system, or a computer program product. Therefore, the present application can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0401] The present application is described with reference to the flowcharts and / or block diagrams of methods, apparatuses (systems), and computer program products according to the present application. It should be understood that each process and / or block in the flowchart and / or block diagram, and the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to generate a machine, such that the instructions executed by the processor of the computer or other programmable data processing devices generate means for implementing the functions specified in Figure 1 one process or multiple processes and / or blocks Figure 1 one block or multiple blocks.
[0402] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to operate in a particular manner, such that the instructions stored in the computer-readable memory produce a manufacture including an instruction device that implements the functions specified in one or more of the processes Figure 1 one or more of the processes and / or blocks Figure 1 specified in the block or blocks.
[0403] These computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process, whereby the instructions executed on the computer or other programmable apparatus provide steps for implementing the functions specified in one or more of the processes Figure 1 one or more of the processes and / or blocks Figure 1 specified in the block or blocks.
[0404] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalent technologies, the present application is also intended to include these modifications and variations.
Claims
1. A game task transfer method, characterized in that, Applicable to a first device, the first device being currently in a game scenario, the method comprising: Receiving a trigger operation for triggering a game task of the first device in the game scenario; Sending a task transfer request for requesting another device in the game scenario to execute the game task, the other device being a device other than the first device in the game scenario.
2. The method according to claim 1, characterized in that, Before sending the task transfer request, the method further comprises: The first device determines that at least one of the following is satisfied: the game task is a preset task, the current running frame rate of the first device is lower than a first threshold, the current CPU usage rate of the first device is higher than a second threshold, and the current storage space occupancy rate of the first device is higher than a third threshold.
3. The method according to claim 1 or 2, characterized in that, The sending of the task transfer request comprises: Sending the task transfer request to a host device, the host device including a management device of the game scenario.
4. The method according to claim 1 or 2, characterized in that, The sending of the task transfer request comprises: Sending the task transfer request to a second device, the second device being a device elected by the first device from among M devices according to at least one of device performance, game state, game character, and geographical location of the M devices, the M devices being devices other than the first device in the game scenario, M being an integer and M≥2.
5. The method according to claim 4, wherein The second device satisfies at least one of the following conditions: The second device is a device in the M devices with a current running frame rate higher than a fourth threshold; or, The second device is a device in the M devices with a current CPU usage rate lower than a fifth threshold; or, The second device is a device in the M devices with a current storage space occupancy rate lower than a sixth threshold; or, The second device is a device in the M devices currently in a spectator state; or, The second device is a device in the M devices currently in a dead state; or, The second device is a device corresponding to a specified game character in the M devices; or; The second device is a device in the M devices with a distance from the first device less than a first distance.
6. The method according to any one of claims 1-5, characterized in that, The task transfer request includes a task identifier of the game task.
7. The method according to any one of claims 1-6, characterized in that, The first device and the second device belong to the same team in the game scenario.
8. A game task transfer method, characterized in that, Applicable to a second device, the second device being currently in a game scenario, the method comprising: Receiving a task transfer request for requesting to execute a game task, the game task being a task generated by a first device in the game scenario; Executing the game task.
9. The method according to claim 8, wherein The receiving of the task transfer request comprises: Receiving the task transfer request from the first device or the host device, the host device including a management device of the game scenario.
10. The method according to claim 8 or 9, characterized in that Before executing the game task, the method further comprises: the second device determines that at least one of the following conditions is satisfied: The current running frame rate is higher than a seventh threshold; or, The current CPU usage rate is lower than an eighth threshold; or, The current storage space occupancy rate is lower than a ninth threshold; or, Currently in a spectator state; or, Currently in a dead state; or, The corresponding game character is a specified game character.
11. The method according to claim 10, wherein The game scenario further includes a third device, and the method further includes: When the second device determines that the condition is not met, it sends the task transfer request to the third device.
12. The method according to claim 11, wherein In addition to the first device and the second device, the game scenario includes P devices, where P is an integer and P≥2, and the third device is a device elected by the second device from the P devices according to at least one of the device performance, game state, game character, and geographical location of the P devices.
13. The method according to claim 12, characterized in that, The third device meets at least one of the following conditions: The third device is a device among the P devices with a current running frame rate higher than the tenth threshold; or, The third device is a device among the P devices with a current CPU usage rate lower than the eleventh threshold; or, The third device is a device among the P devices with a current storage space occupancy rate lower than the twelfth threshold; or, The third device is a device among the P devices currently in a spectator state; or, The third device is a device among the P devices currently in a dead state; or, The third device is the device corresponding to the specified game character among the P devices; or; The third device is a device among the P devices with a distance less than the third distance from the second device.
14. The method according to any one of claims 8 - 13, characterized in that, The task transfer request includes the task identifier of the game task.
15. The method according to any one of claims 8-14, characterized in that, The first device and the second device belong to the same team in the game scenario.
16. The method according to any one of claims 8-15, characterized in that, The method further includes: Render the execution effect of the game task in the game screen.
17. A game task transfer method, characterized in that Applicable to a host device, the host device includes a management device for the game scenario, and the method includes: Receiving a task transfer request sent by a first device, the task transfer request being used to request the execution of a game task generated by the first device; Sending the task transfer request to a second device, where both the first device and the second device are in the game scenario.
18. The method according to claim 17, wherein In addition to the first device and the host device, the game scenario includes K devices, where K is an integer and K≥2. Before sending the task transfer request to the second device, the method further includes: Selecting the second device from the K devices according to at least one of the device performance, game state, game character, and geographical location of the K devices.
19. The method according to claim 18, wherein The second device meets at least one of the following conditions: The second device is a device among the K devices with a current running frame rate higher than the thirteenth threshold; or, The second device is a device among the K devices with a current CPU usage rate lower than the fourteenth threshold; or, The second device is a device among the K devices with a current storage space occupancy rate lower than the fifteenth threshold; or, The second device is a device among the K devices currently in a spectator state; or, The second device is a device among the K devices currently in a dead state; or, The second device is the device corresponding to the specified game character among the K devices; or; The second device is a device among the K devices whose distance from the first device is less than a fourth distance.
20. The method according to any one of claims 17-19, characterized in that, The task transfer request includes a task identifier of the game task.
21. The method according to any one of claims 17-20, characterized in that, The first device and the second device belong to the same team in the game scenario.
22. A game task transfer method, characterized in that, Applicable to a communication system, the communication system includes a first device and a second device, the first device and the second device are in the same game scenario, and the method includes: The first device receives a trigger operation, and the trigger operation is used to trigger a game task of the first device in the game scenario; The first device sends a task transfer request to the second device, and the task transfer request is used to request the execution of the game task; The second device executes the game task.
23. The method according to claim 22, wherein The first device sending the task transfer request to the second device includes: The first device sends the task transfer request to a host device, and the host device includes a management device of the game scenario; The host device sends the task transfer request to the second device.
24. The method according to claim 22 or 23, characterized in that, In addition to the first device in the game scenario, there are also Q devices, Q is an integer and Q > 2, and the second device is a device elected from the Q devices according to at least one of the device performance, game state, game character, and geographical location of the Q devices.
25. The method according to any one of claims 24, characterized in that The second device satisfies at least one of the following conditions: The second device is a device among the Q devices whose current running frame rate is higher than a sixteenth threshold; or, The second device is a device among the Q devices whose current CPU usage rate is lower than a seventeenth threshold; or, The second device is a device among the Q devices whose current storage space occupancy rate is lower than an eighteenth threshold; or, The second device is a device among the Q devices that is currently in a spectator state; or, The second device is a device among the Q devices that is currently in a dead state; or, The second device is a device corresponding to a specified game character among the Q devices; or; The second device is a device among the Q devices whose distance from the first device is less than a fifth distance.
26. The method according to any one of claims 22-25, characterized in that, Before the first device sends the task transfer request to the second device, the method further includes: The first device determines that it satisfies at least one of the following: the game task is a preset task, the current running frame rate of the first device is lower than a first threshold, the current CPU usage rate of the first device is higher than a second threshold, and the current storage space occupancy rate of the first device is higher than a third threshold.
27. An electronic device, characterized in that, Includes: A processor, a memory, and one or more programs; Wherein, the one or more programs are stored in the memory, and the one or more programs include instructions that, when executed by the processor, cause the electronic device to execute the method steps described in any one of claims 1 to 21.
28. A communication system, characterized in that, Includes: A first device and a second device; The first device is used to execute the method steps described in any one of claims 1 - 7; The second device is used to execute the method steps described in any one of claims 8 - 16.
29. The communication system according to claim 28, wherein The communication system further includes: a host device configured to execute the method according to any one of claims 17-21.
30. A computer-readable storage medium, characterized in that, The computer-readable storage medium is used to store a computer program, which, when running on a computer, causes the computer to execute the method according to any one of claims 1 to 26.