End-to-end communication method, device, equipment, storage medium and program product

Through end-to-end communication methods, interactive operation and transmissibility between clients is realized, solving the problem of extended development period caused by collaborative development between front-end and back-end, and improving iteration speed.

CN114827164BActive Publication Date: 2024-12-03GUANGZHOU HUYA TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202210389524.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-13
Publication Date
2024-12-03
Estimated Expiration
2042-04-13

AI Technical Summary

Technical Problem

During the development of interactive games, front-end developers need to work together with back-end developers, resulting in an extended development period and a reduced iteration speed.

Method used

Provide an end-to-end communication method, which sends first and second data to the server through the first client, and forwards the server to the second client according to the second data, so as to realize the client's Interactions between operations and transmission are transmitted to reduce the collaborative needs of back-end developers.

Benefits of technology

Make front-end developers focus on front-end business development, reduce dependence on the back-end during the development process, shorten development construction period, and improve iteration speed.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114827164B_ABST
    Figure CN114827164B_ABST
Patent Text Reader

Abstract

The embodiment of the present application provides an end-to-end communication method and related equipment, which relate to the field of communication. The method is applied to a first client, a second client and a server. In the first client: if the first client initiates an interactive operation, the second type of data describing the interactive client in the interactive operation and the first type of data describing the interactive content and the interactive number of the interactive operation are transmitted to the server, so that the server forwards the first type of data to the second client according to the second type of data; if a notification message sent by the server is received, the first type of data carried in the notification message is parsed, and the client processes the task according to the first type of data in response to the instruction of the interactive operation. The client shown in the embodiment of the present application only needs to provide the second type of data to the server according to each interactive operation, so that the server can assist in transparently transmitting the first type of data and realize the interaction between clients.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of communications, and in particular, to an end-to-end communication method, device, electronic device, computer-readable storage medium, and computer program product. Background Art

[0002] Due to the convenience of mobile terminals, more and more users are using mobile terminals. Users are accustomed to using a mobile device to meet various needs. For example, they can add more fun to their lives and meet the need for communication through an interactive game.

[0003] At present, in the field of interactive game development, front-end developers are responsible for the development of front-end pages and logic, while tasks such as interactive game status statistics and interface definition between terminals belong to back-end development tasks. Therefore, the development of an interactive game involves the collaboration of multiple departments. If the front-end developer needs to make some adjustments to the interactive game, the collaboration of the back-end developer will be required. The collaborative development of multiple departments is likely to extend the development period. Summary of the invention

[0004] The embodiment of the present application aims to solve one of the above-mentioned technical problems.

[0005] According to a first aspect of an embodiment of the present application, there is provided an end-to-end communication method, which is applied to a first client; the first client is a controller of an interaction process, and the method includes:

[0006] In response to the first interactive operation, a first interactive request carrying the first category of data and the second category of data is sent to the server, so that the server can transparently transmit the first category of data to the second client based on the second category of data; in response to the first notification message sent by the server, the first notification message is parsed to obtain the first category of data corresponding to the second interactive operation; the first notification message is a message fed back by the server based on the first category of data and the second category of data carried in the second interactive request sent by the second client in response to the second interactive operation.

[0007] The first type of data includes the interaction number and other interaction contents describing any interaction operation; the second type of data includes the information describing the interaction client of any interaction operation.

[0008] According to a second aspect of an embodiment of the present application, there is provided an end-to-end communication method, which is applied to a second client that receives an invitation to participate in an interaction process; the method comprises:

[0009] In response to a second notification message sent by the server, the second notification message is parsed to obtain the first category data corresponding to the first interactive operation; the second notification message is a message fed back by the server based on the first category data and the second category data carried in the first interactive request sent by the first client in response to the first interactive operation; in response to the determined second interactive operation, a second interactive request carrying the first category data and the second category data is sent to the server, so that the server can transparently transmit the first category data to the first client based on the second category data.

[0010] The first type of data includes the interaction number and other interaction contents describing any interaction operation, and the second type of data includes the information describing the interaction client of any interaction operation.

[0011] According to a third aspect of an embodiment of the present application, there is provided an end-to-end communication method, which is applied to a server, and the server is used to forward communication data involved in an interactive operation between a first client and a second client; the method includes:

[0012] An interaction request carrying first-category data and second-category data is received from a preset channel from any client, where the first-category data includes an interaction number and other interaction content describing any interaction operation, and the second-category data includes information describing the interaction client of any interaction operation; a client to be interacted with is determined based on the second-category data, and a notification message carrying the first-category data is sent to the client to be interacted with.

[0013] According to a fourth aspect of an embodiment of the present application, there is provided an end-to-end communication device, which is applied to a first client; the first client is a controller of an interaction process, and the device includes:

[0014] The first transceiver module is used to send a first interaction request carrying first category data and second category data to the server in response to the first interaction operation, so that the server can transparently transmit the first category data to the second client according to the second category data; the first processing module is used to respond to the first notification message sent by the server, parse the first notification message, and obtain the first category data corresponding to the second interaction operation; the first notification message is a message fed back by the server according to the first category data and the second category data carried in the second interaction request sent by the second client in response to the second interaction operation.

[0015] The first type of data includes the interaction number and other interaction contents describing any interaction operation; the second type of data includes the information describing the interaction client of any interaction operation.

[0016] According to a fifth aspect of an embodiment of the present application, there is provided an end-to-end communication device, which is applied to a second client that receives an invitation to participate in an interaction process; the device includes:

[0017] The second processing module is used to parse the second notification message in response to the second notification message sent by the server to obtain the first category data corresponding to the first interactive operation; the second notification message is a message fed back by the server based on the first category data and the second category data carried in the first interactive request sent by the first client in response to the first interactive operation; the second transceiver module is used to send a second interactive request carrying the first category data and the second category data to the server in response to the determined second interactive operation, so that the server can transparently transmit the first category data to the first client based on the second category data.

[0018] The first type of data includes the interaction number and other interaction contents describing any interaction operation, and the second type of data includes the information describing the interaction client of any interaction operation.

[0019] According to a sixth aspect of an embodiment of the present application, there is provided an end-to-end communication device, which is applied to a server, and the server is used to forward communication data involved in an interactive operation between a first client and a second client; the device includes:

[0020] The third receiving module is used to receive an interaction request carrying first-category data and second-category data sent by any client from a preset channel, the first-category data includes an interaction number and other interaction content describing any interaction operation, and the second-category data includes information describing the interaction client of any interaction operation; the third processing module is used to determine the client to be interacted with based on the second-category data, and send a notification message carrying the first-category data to the client to be interacted with through the transceiver module.

[0021] According to the seventh aspect of the embodiments of the present application, an electronic device is provided, which includes: a memory, a processor and a computer program stored in the memory, and the processor executes the computer program to implement the steps of the method shown in any one of the first aspect, the second aspect, and the third aspect above.

[0022] According to an eighth aspect of an embodiment of the present application, a computer-readable storage medium is provided, and when a computer program is executed by a processor, the steps of the method shown in any one of the first aspect, the second aspect, and the third aspect are implemented.

[0023] According to a ninth aspect of an embodiment of the present application, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the steps of the method shown in any one of the first, second, and third aspects above.

[0024] The beneficial effects of the technical solution provided by the embodiment of the present application are:

[0025] The embodiment of the present application provides an end-to-end communication method, which is applied to a first client, a second client and a server, wherein the method applied to the first client includes: if the first client initiates an interactive operation, the second type of data describing the interactive client in the interactive operation and the first type of data describing the interactive content and the interactive number of the interactive operation are transmitted to the server, whereby the server forwards the first type of data to the second client according to the second type of data; if a notification message sent by the server is received, the first type of data carried in the notification message is parsed. Therefore, the client only needs to provide the second type of data to the server according to the information of the interactive client of each interactive operation, so that the server can assist in the transparent transmission of the first type of data and realize the interaction between clients. The communication method provided by the embodiment of the present application can enable front-end developers to focus on the development of front-end business, reduce the need for collaboration with back-end developers during the development process, shorten the development period, and thus increase the iteration speed. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in describing the embodiments of the present application are briefly introduced below.

[0027] Figure 1 A schematic diagram of a process flow of an end-to-end communication method provided in an embodiment of the present application;

[0028] Figure 2 A schematic diagram of a flow chart of another end-to-end communication method provided in an embodiment of the present application;

[0029] Figure 3 A schematic diagram of a flow chart of another end-to-end communication method provided in an embodiment of the present application;

[0030] Figure 4a A schematic diagram of a flow chart of interaction between a first client and a second client provided in an embodiment of the present application;

[0031] Figure 4b A schematic diagram of a process for starting an interactive game A provided in an embodiment of the present application;

[0032] Figure 4c A schematic diagram of a process of switching interactive game A to interactive game B provided in an embodiment of the present application;

[0033] Figure 5 A schematic diagram of the structure of a peer-to-peer communication device provided in an embodiment of the present application;

[0034] Figure 6 A schematic diagram of the structure of another end-to-end communication device provided in an embodiment of the present application;

[0035] Figure 7A schematic diagram of the structure of another end-to-end communication device provided in an embodiment of the present application;

[0036] Figure 8 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0037] The embodiments of the present application are described below in conjunction with the drawings in the present application. It should be understood that the implementation methods described below in conjunction with the drawings are exemplary descriptions for explaining the technical solutions of the embodiments of the present application and do not constitute a limitation on the technical solutions of the embodiments of the present application.

[0038] It will be understood by those skilled in the art that, unless specifically stated, the singular forms "one", "said", and "the" used herein may also include plural forms. It should be further understood that the terms "including" and "comprising" used in the embodiments of the present application refer to that the corresponding features can be implemented as the presented features, information, data, steps, operations, elements and / or components, but do not exclude the implementation as other features, information, data, steps, operations, elements, components and / or combinations thereof supported by the technical field. It should be understood that when we say that an element is "connected" or "coupled" to another element, the one element may be directly connected or coupled to the other element, or it may refer to that the one element and the other element establish a connection relationship through an intermediate element. In addition, the "connection" or "coupling" used herein may include wireless connection or wireless coupling. The term "and / or" used herein indicates at least one of the items defined by the term, for example, "A and / or B" may be implemented as "A", or as "B", or as "A and B".

[0039] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.

[0040] The following describes several exemplary embodiments to illustrate the technical solutions of the embodiments of the present application and the technical effects produced by the technical solutions of the present application. It should be noted that the following embodiments can refer to, draw on or combine with each other, and the same terms, similar features and similar implementation steps in different embodiments will not be described repeatedly.

[0041] In the prior art, the management of interactive games is generally the server, that is, the server does the status statistics of the interactive games and unifies the interface definition between the client and the server. However, in the development process, this method is more dependent on the server, so when the front-end developers iterate the functions of the interactive games, they need the cooperation of the server developers, which will extend the development period and reduce the iteration speed of the front-end products.

[0042] In the embodiments of the present application, an end-to-end communication method, device, electronic device, computer-readable storage medium and computer program product are provided to solve the above technical problems. The method is applied to the first client, the second client and the server respectively. Interactive games are a common interactive process. The method uses the first client that initiates the interactive game as the manager of the interactive game, which is mainly used to manage the status statistics of the interactive game and send some instructions to control the progress of the interactive game, thereby ensuring the uniqueness of the game status.

[0043] Specifically, the first client is a client that initiates an interaction process; the second client is a client related to the interaction process, for example, a client invited to participate in the interaction process; the server is used to forward communication data involved in the interactive operation between the first client and the second client, such as the first category of data in the following embodiments.

[0044] The first client and the second client are the same application configured on different terminals, which can be mobile terminal devices such as mobile phones, iPads, smart watches, etc., or computer devices such as desktop computers and laptops.

[0045] In a live broadcast and microphone connection scenario, any player can organize multiple players into a room through microphone connection to play interactive games together. Among them, the first client is the client configured by the host player who initiated the interactive game, and the second client is the client configured by the guest player who was invited to participate in the interactive game. The number of host players is 1, and the number of guest players is determined according to the limit on the number of players in the interactive game. For example, if the number of players in the interactive game is limited to 5 to 7, then the number of guest players is 4 to 6.

[0046] See also Figure 1 The embodiment of the present application provides a peer-to-peer communication method, which is applied to a first client. The method includes steps S110 to S120.

[0047] S110, in response to the first interactive operation, sending a first interactive request carrying first-category data and second-category data to the server, so that the server transparently transmits the first-category data to the second client according to the second-category data.

[0048] S120, in response to the first notification message sent by the server, parse the first notification message to obtain the first category data corresponding to the second interactive operation; the first notification message is a message fed back by the server according to the first category data and the second category data carried in the second interactive request sent by the second client in response to the second interactive operation.

[0049] If the operation type of the first interactive operation is a control type, the second interactive operation is a feedback operation for the first interactive operation.

[0050] Specifically, if the operation type of the first interactive operation is a control type, after receiving the first type of data, the second client performs a processing operation according to the interaction number and other interactive content in the first type of data, and after obtaining the processing result, initiates a second interactive operation, which is also a control type operation. If the operation type of the first interactive operation is a non-control type, the second client may provide feedback after obtaining the processing result, or may not provide feedback.

[0051] In one example, the interactive process is an interactive game. If the first interactive operation is to initiate an authentication operation for the interactive game, the first client needs to count the authentication results of the second client in order to determine which clients can participate in the interactive game. That is, after receiving the first type of data, the second client performs an authentication operation based on the first type of data and feeds back the processing result of the authentication operation. If the first interactive operation is to add an animation effect to the second client, after sending the second interactive operation to the second client, the second client displays the corresponding effect based on the received first type of data, and the purpose is achieved. The second client can feed back the processing result to the first client, or it may not, and these will not affect the progress of the interactive game.

[0052] The embodiment of the present application provides an end-to-end communication method from the perspective of the first client, including: if the first client initiates an interactive operation, the second type of data describing the interactive client in the interactive operation, and the first type of data describing the interactive content and interactive number of the interactive operation are transmitted to the server, so that the server can forward the first type of data to the second client according to the second type of data; if a notification message sent by the server is received, the first type of data carried in the notification message is parsed. Therefore, the client only needs to provide the second type of data to the server according to the information of the interactive client of each interactive operation, so that the server can assist in the transparent transmission of the first type of data to realize the interaction between clients. Therefore, setting the first type of data corresponding to the interactive operation can enable the front-end developers to focus on the development of interactive operations belonging to the front-end business, reduce the need for collaboration with the back-end developers during the development process, shorten the development period, and thus increase the iteration speed.

[0053] In a possible implementation, sending a first interaction request carrying the first type of data and the second type of data to the server may specifically include:

[0054] Determine the second category of data based on the information of the second client interacted with by the first interactive operation; determine the first category of data based on the first interactive operation, the first category of data including the interaction number of the first interactive operation; and send the first interaction request carrying the first category of data and the second category of data to the server through a preset channel.

[0055] Specifically, the first type of data includes the interaction number and other interaction contents describing any interaction operation; the second type of data includes the information describing the interaction client of any interaction operation. The information of the interaction client may specifically include: the identity of the first client and the second client of the interaction, and the information of the network session where the first client and the second client are located. Among them, other interaction contents may include: the operation type of the interaction operation, etc., and the unique identifier of the interaction process.

[0056] Determining the first type of data according to the first interactive operation may specifically include: creating an interaction number of the first interactive operation according to the first interactive operation, obtaining an operation type of the first interactive operation, and determining parameters required to be carried by the operation type, for example, the parameters may include: a unique identifier of the interactive process.

[0057] Since the interaction process is essentially a network communication process, and the network communication process has the problem of network delay. An interaction number is set for each interaction operation to mark it, so that when the first client receives the first type of data, it obtains the interaction number in the received first type of data, thereby determining whether the second interaction operation corresponding to the received interaction number has a corresponding relationship with the first interaction operation, that is, the first client determines whether the second client has feedback. Therefore, setting an interaction number for the interaction operation can avoid problems caused by network delay.

[0058] In one example, the interaction process is an interactive game A. The first type of data is data of a first type of structure, and the first type of structure includes at least the following attributes: the operation type of the interactive operation, the data of the third type of structure corresponding to the operation type, the interactive version number (corresponding to the interactive number in the above embodiment), and other attributes (for example, the game identifier of interactive game A). The second type of data is data of a second type of structure, and the second type of structure includes at least the following attributes: the identity of the sender, the identity of the receiver, the session identifier of the session where the initiated interactive game A is located, and the play mode of the first notification message (for example, when the number of receivers is single, the play mode is unicast mode, and when the number of receivers is multiple, the play mode is multicast mode). The third type of structure includes at least the following attributes: data provided by the server of interactive game A, and other attributes (for example, the game identifier of interactive game A).

[0059] Specifically, an interface negotiated between the server and the client may be used as the preset channel, and the client sends the first interaction request to the server through the negotiated interface.

[0060] In a possible implementation, the process of creating an interaction number for the first interaction operation includes:

[0061] An interaction number of the first interaction operation is created according to a preset method, and a value of the interaction number of the first interaction operation is greater than a value of a maximum historical interaction number.

[0062] Specifically, based on the interaction number of the previous interaction operation, the interaction number is incremented by a preset value. For example, if the interaction number of the previous interaction operation is 10, the interaction number is incremented by 1, and the first interaction number is 11. Alternatively, the timestamp of receiving the first interaction operation is obtained, and the timestamp is used as the first interaction number.

[0063] Specifically, the types of interactive operations include control type and non-control type. Among them, the interactive operation corresponding to the control type is usually related to the entire progress or the entire state of the interactive process. For example, the interactive operation can be: inviting the client to authenticate the interactive game, inviting the client to pre-start / start / close the interactive process, and inviting the client to switch the current interactive process to another interactive process.

[0064] Regardless of the method used to create the interaction number of the first interactive operation, the interaction number of the first interactive operation can be maximized. When the second client receives the interaction number of the first interactive operation, it determines the state of the current interactive process based on the interaction number of the first interactive operation, and then quickly enters the state. However, when the first client receives the interactive operation feedback from the second client, the feedback time does not meet expectations due to network delays, and cannot be effective feedback. For example, the first client initiates an invitation operation to a second client, but due to network delays, the feedback from the second client is not received until 5 minutes later. Since the number of invited second clients meets the number limit for starting the interactive game, the interactive game has already started, and the feedback is obviously invalid.

[0065] In a possible implementation, if the operation type of the first interactive operation is a non-control type, the interaction number of the first interactive operation is a default value.

[0066] Specifically, for non-control type interactive operations, the interactive number is generally not set, that is, the default value is maintained.

[0067] In a possible implementation manner, the first notification message is received at the first time after the first client sends the first interaction request. After parsing the first notification message, the method further includes:

[0068] When it is determined that the interaction number in the first category data carried by the first notification message is the same as the interaction number in the first category data carried by the first interaction request, determine the feedback time threshold corresponding to the first interaction operation; if the first time is within the feedback time threshold, determine that the second interaction operation is a valid operation; in response to the instruction of the second interaction operation, perform a corresponding operation according to the first category data carried by the first notification message to determine the interaction result of the first interaction operation.

[0069] After obtaining the first type of data corresponding to the second interactive operation, it is necessary to compare whether the interaction number in the first type of data carried in the first notification message is the same as the interaction number in the first type of data carried in the first interactive request. If the comparison result is the same, it means that the second interactive operation initiated by the second client is a feedback to the first interactive operation initiated by the first client. Therefore, it is necessary to further determine whether the sending time of the first notification message meets the preset conditions.

[0070] Specifically, there is a corresponding feedback time threshold for the interactive operation with a non-empty interaction number. For example, the feedback time threshold for the operation of pre-starting an interactive game is 30 seconds, and the feedback time threshold for the authentication operation of the interactive game is 3 seconds.

[0071] In one example, the first interactive operation is an operation of pre-starting an interactive game. The clients participating in the interactive game include: the number of first clients is 1, the number of second clients is 4, and the game can be started after all 5 people start the game. After the first client initiates the pre-start operation, if the first client receives a feedback operation of successful start sent by the second client, the first client determines whether the number of clients that have successfully started is 5. If not, the first client continues to wait. If the number of clients that have successfully started is 5, the interactive game is started.

[0072] In a possible implementation, the interaction process is an interactive game, and before initiating the first interaction operation, the method includes:

[0073] The following authentication operations are performed in sequence for the interactive game: determining whether the first client has the authority to configure the interactive game; if it has the authority to configure the interactive game, determining whether the interactive game is configured on the first client; if the interactive game is configured, determining whether there is an interactive game running on the first client; if there is no interactive game running, determining whether the function configured by the first client is exclusive of the interactive game; wherein, if the authentication is successful, determining to initiate the first interactive operation.

[0074] In a possible implementation, at the stage of initializing the first client, the method includes:

[0075] A subscription request is sent to the server, where the subscription request carries the identity of the first client and a preset subscription identifier.

[0076] The process of obtaining the first notification message includes: if a notification carrying a preset subscription identifier is detected, obtaining the first notification message.

[0077] In an example, the preset subscription identifier may be a subscription identifier negotiated between the client and the server to identify a notification service of the server; after the server sends a notification message according to the subscription identifier, the client may receive a notification corresponding to the subscription identifier.

[0078] It should be noted that in the embodiment of the present application, the subscription identifier used by the first client and the second client when subscribing is the same. When sending a notification message, the server should send the notification message in combination with the subscription identifier and the identity identifier of the client to be sent.

[0079] See also Figure 2 The embodiment of the present application provides a peer-to-peer communication method, which is applied to a client. The method includes S210-S220.

[0080] S210, in response to the second notification message sent by the server, parse the second notification message to obtain the first category data corresponding to the first interactive operation; the second notification message is a message fed back by the server according to the first category data and the second category data carried in the first interactive request sent by the first client in response to the first interactive operation.

[0081] After the first type of data is obtained, information of the first interactive operation is obtained according to the first type of data.

[0082] S220, in response to the second interactive operation, sending a second interactive request carrying the first type of data and the second type of data to the server, so that the server transparently transmits the first type of data to the first client according to the second type of data. The first type of data includes an interactive number and other interactive content describing any interactive operation, and the second type of data includes information describing the interactive client of any interactive operation.

[0083] If the operation type of the second interactive operation is a control type, the second interactive operation is a feedback operation for the first interactive operation.

[0084] Specifically, if the operation type of the second interactive operation is a control type, since the first client is the controller of the interactive process, the second interactive operation can only be a feedback operation for the first interactive operation. If the operation type of the second interactive operation is a non-control type, the first client may provide feedback after obtaining the processing result, or may not provide feedback, that is, the second interactive operation may be feedback for the first interactive operation, or may be an operation actively initiated by the second interactive operation.

[0085] In one example, the interactive process is an interactive game. If the second interactive operation is a feedback operation for the authentication operation initiated by the first client, the second client will feed back the authentication processing result to the first client after performing the authentication processing on the interactive game. If the second interactive operation is an operation of adding animation initiated by the first client, the second client can perform corresponding animation processing according to the received first type of data to achieve the purpose. The second client can feed back the processing result to the first client or not, which will not affect the progress of the interactive game.

[0086] The embodiment of the present application provides an end-to-end communication method from the perspective of the second client, including: if a notification message sent by the server is received, the first type of data carried in the notification message is parsed, and the information of the first interactive operation is obtained; if the second client initiates an interactive operation, the second type of data describing the interactive client in the interactive operation and the first type of data describing the interactive content and interactive number of the interactive operation are transmitted to the server, so that the server can forward the first type of data to the first client according to the second type of data; if a notification message sent by the server is received, the first type of data carried in the notification message is parsed. Therefore, the client only needs to provide the second type of data to the server according to the information of the interactive client of each interactive operation, so that the server can assist in the transparent transmission of the first type of data, thereby realizing the interaction between clients. Therefore, setting the first type of data corresponding to the interactive operation can enable the front-end developers to focus on the development of interactive operations belonging to the front-end business, reduce the need for collaboration with the back-end developers during the development process, shorten the development period, and thus increase the iteration speed.

[0087] In a possible implementation, the interaction process is an interactive game, the operation type of the second interaction operation is a control type, and after obtaining the first type of data corresponding to the first interaction operation, the method may further include:

[0088] The interaction number in the first category data corresponding to the first interaction operation is compared with the historical interaction number with the largest value; if the comparison result is greater than, the interaction number in the first category data corresponding to the first interaction operation is cached as the interaction number of the second interaction operation.

[0089] Specifically, when the operation type of the second interactive operation is a control type, the second interactive operation is a feedback operation for the first interactive operation. The interaction number in the first type of data corresponding to the first interactive operation is substantially the interaction number of the first interactive operation, and the interaction number of the first interactive operation is stored as the interaction number of the second interactive operation, so that when a second interactive request is generated according to the second interactive operation, the first type of data carried by the second interactive request is determined according to the cached interaction number.

[0090] In a possible implementation, if the interactive process is an interactive game, the method may further include:

[0091] If the first interactive operation is an authentication operation for the interactive game, the authentication operation is performed according to the first category data corresponding to the first interactive operation; if the first interactive operation is an operation to pre-start the interactive game, the interactive game is asynchronously loaded according to the first category data corresponding to the first interactive operation; if the first interactive operation is an operation to start the interactive game, the interactive game is started according to the first category data corresponding to the first interactive operation; if the first interactive operation is an operation to close the interactive game, the interactive game is stopped according to the first category data corresponding to the first interactive operation.

[0092] Among them, authentication operations for interactive games, operations for pre-starting interactive games, operations for starting interactive games, operations for closing interactive games, and operations for switching interactive games all belong to control-type operations.

[0093] In a possible implementation, sending a second interaction request carrying the first type of data and the second type of data to the server includes:

[0094] Determine the second type of data according to the information of the first client; determine the first type of data according to the second interactive operation, the first type of data carries the interaction number of the second interactive operation; send the second interactive request carrying the first type of data and the second type of data to the server through a preset channel.

[0095] Among them, if the second interactive operation is a control type operation, the second interactive operation is a feedback operation for the first interactive operation, and the interaction number of the second interactive operation is the cached interaction number of the first interactive operation; if the second interactive operation is a non-control type operation, the interaction number of the second interactive operation is the default value.

[0096] In a possible implementation, the second interaction operation includes a feedback operation on the first interaction operation, and initiating the feedback operation on the first interaction operation includes:

[0097] If a trigger operation of accepting the invitation is obtained, the following authentication operations are performed in sequence for the interactive game: determining whether the first client has the authority to configure the interactive game; if it has the authority to configure the interactive game, determining whether the interactive game is configured on the first client; if the interactive game is configured, determining whether there is an interactive game running on the first client; if there is no interactive game running, determining whether the function configured on the first client is exclusive of the interactive game;

[0098] If the authentication is successful, the method further includes: initiating a feedback operation on the first interactive operation.

[0099] In a possible implementation, at the stage of initializing the second client, the method includes:

[0100] A subscription request is sent to the server, where the subscription request carries the identity of the second client and a preset subscription identifier.

[0101] The process of obtaining the second notification message includes: if a notification carrying a preset subscription identifier is detected, obtaining the second notification message.

[0102] In a possible implementation, the method further includes:

[0103] In response to a third notification message sent by the server, the third notification message is parsed to obtain first-category data corresponding to the third interactive operation. The third notification message is a message fed back by the server based on the second-category data carried in the third interactive request sent by another second client in response to the third interactive operation.

[0104] In response to the determined fourth interaction operation, a fourth interaction request carrying the first category data and the second category data is sent to the server, so that the server transparently transmits the first category data to another second client according to the second category data.

[0105] Specifically, the second type of data carried in the third interaction request / fourth interaction request may include the identity identifiers of the first client and the second client, or may only include the identity identifier of the second client. The third interaction operation and the fourth interaction operation are non-control type operations, so the interaction number with the interaction operation carried in the first type of data is empty.

[0106] Among them, the interaction numbers of the second interaction operation, the third interaction operation, and the fourth interaction operation are empty.

[0107] In one example, when the current second client initiates an operation of adding an animation to another second client, the other second client performs corresponding animation processing after receiving the notification message.

[0108] See also Figure 3The embodiment of the present application also provides a peer-to-peer communication method, which is applied to a server. The method includes steps S310 to S320.

[0109] S310, receiving an interaction request carrying first-category data and second-category data sent by any client from a preset channel, wherein the first-category data includes interaction content describing any interaction operation, and the second-category data includes interaction client information describing any interaction operation.

[0110] S320: Determine the client to be interacted with according to the second type of data, and send a notification message carrying the first type of data to the client to be interacted with.

[0111] Specifically, the interaction request may be the first interaction request, the second interaction request, the third interaction request, or the fourth interaction request. The client to be interacted with is a receiving client of the notification message, and may be determined according to the identity of the recipient carried in the second type of data.

[0112] In a possible implementation, during the server initialization phase, the method further includes:

[0113] In response to a subscription request sent by any client and carrying the identity identifier of the first client and a preset subscription identifier, any client is subscribed to a notification service corresponding to the preset subscription identifier.

[0114] The end-to-end communication method provided in the embodiment of the present application is suitable for application scenarios involving multiple client interactions. The communication data between the ends is processed, and then the end-to-end interaction process can be realized through the transparent transmission operation of the server. In order to more clearly describe the method shown in the above embodiment, the embodiment of the present application also provides 3 examples to explain the method shown in the above embodiment in more detail.

[0115] See for example Figure 4a , the embodiment of the present application provides a schematic diagram of the process of interaction between a first client and a second client. In the interaction process, the client and the server communicate with each other through the above-mentioned end-to-end communication method. The process includes steps S1001 to S1009.

[0116] S1001: The first client initiates an operation of pre-starting an interactive game.

[0117] The first client receives the trigger operation input by the user and asynchronously loads the interactive game; creates an interaction number for the pre-start operation and initiates the operation of the interactive game to other clients; starts a 30s countdown and sets a time limit for the feedback of the second client.

[0118] S1002: The first client sends a first interaction request to the server.

[0119] The first interaction request carries first type data and second type data, wherein the first type data includes the interaction number of the pre-start operation and other interaction contents with the start operation, such as the game identifier of the interactive game.

[0120] S1003: The server confirms the notification message.

[0121] After receiving the first interaction request, the server obtains the first type of data and the second type of data carried in the first interaction request, determines the identity of the second client in the second type of data, and creates a notification message according to each identity.

[0122] S1004: The server distributes a notification message. The server sends the created notification message to the corresponding second client.

[0123] S1005: The second client asynchronously loads the interactive game.

[0124] After receiving the first type of data carried in the notification message, the second client pre-stores the interaction number in the first type of data, and starts the operation of asynchronously loading the interactive game according to the game identifier of the interactive game in the first type of data.

[0125] Among them, steps S1005-1, S1005-2, and S1005-N are specific steps respectively executed by the second client 1, the second client 2, and the second client N. Due to the similar processing logic, they are not introduced in detail here.

[0126] In addition, after receiving the first type of data, the second client caches the interaction number in the first type of data as the interaction number of the feedback operation.

[0127] S1006: The second client sends a second interaction request.

[0128] After the operation of asynchronously loading the interactive game is completed, the second client prepares to initiate a feedback operation for the pre-start operation to the first client. Specifically, the second type of data is encapsulated according to the first client, and the first type of data is encapsulated according to the asynchronous loading result, and the first type of data also carries the interaction number of the feedback operation.

[0129] Among them, steps S1006-1, S1006-2, and S1006-N are specific steps respectively executed by the second client 1, the second client 2, and the second client N. Due to the similar processing logic, they are not described in detail here.

[0130] S1007: The server determines the notification message and sends it.

[0131] After receiving the second interaction request each time, the server obtains the first category data and the second category data carried in the second interaction request, determines a notification message, and sends a notification message carrying the second category data to the first client.

[0132] S1008: The first client determines whether the interactive game can be started.

[0133] After receiving each notification message, the first client obtains the interaction number in the second type of data carried by the notification message. If the interaction number is the same as the interaction number of the pre-start operation, it continues to determine whether the reception time of the notification message is within 30 seconds. If it is within 30 seconds, the feedback operation is valid; if not within 30 seconds, the feedback operation is invalid.

[0134] Furthermore, based on effective feedback operations, the processing result of asynchronously loading the interactive game of the corresponding second client is determined according to the first type of message, and the number of second clients that have successfully asynchronously loaded the interactive game is counted.

[0135] S1009: Start the interactive game.

[0136] If the number of the first client and the second client that asynchronously load the interactive game successfully is within the range of the number of people required by the interactive game, it is determined that the interactive game is started.

[0137] Since the operation of starting the interactive game also belongs to the control type operation, the interaction process between the first client and the second client can refer to S1001 to S1009, which will not be repeated again for the sake of simplicity.

[0138] The following will take the interactive game A in the live broadcast and microphone connection scenario as an example for detailed description. Among them, the interactive game A limits the number of players to 5 to 8, including one host player and 4 to 7 tenant players. The client configured by the host player can correspond to the above-mentioned first client, and the client configured by the tenant player can correspond to the above-mentioned second client.

[0139] In this example, it can be determined that the host player and the guest player communicate with each other through a preset communication protocol, and the preset communication protocol can refer to the end-to-end communication method shown in the embodiment of the present application.

[0140] See for example Figure 4b : The process of starting the interactive game A includes pre-starting operation and starting the game operation.

[0141] S2001, the room host player initiates a pre-start operation for interactive game A.

[0142] On the one hand, the host player pre-starts the interactive game A according to the UUID of the interactive game A (corresponding to the game identifier in the above embodiment); on the other hand, the host player initiates the pre-start operation for the interactive game A to all the guest players according to the preset communication protocol. Before initiating the operation of pre-starting the game, it is also necessary to create an interaction number A101 corresponding to the pre-start operation. The interaction number is obtained by adding 1 to the interaction number A100 of the previous operation.

[0143] Among them, the pre-start operation can be initiated by sending a notification message for pre-starting interactive game A to each guest player through the server: the host player's terminal first sends the first type of data (including A101, and the UUID of interactive game A) and the second type of data to the server, and the server determines the recipient terminal of the notification message (i.e., the guest player's terminal) based on the identity identifiers of all guest players included in the second type of data, and transmits the first type of data to the corresponding guest player's terminal.

[0144] S2002, the tenant player pre-starts the interactive game A.

[0145] After receiving the notification message, any room player first obtains the interaction number A101 of the pre-start operation and caches it as the interaction number of the feedback operation; then obtains the UUID of the interactive game A and asynchronously loads the interactive game A according to the UUID. If the loading is successful, the room player is informed of the successful pre-start operation; if the loading fails, the room player is informed of the failure of the pre-start operation.

[0146] The feedback operation can be initiated by sending a notification message of pre-start success / failure to the host player through the server. The guest player's terminal first sends the first type of data (carrying the cached A101 and the result of pre-start success / failure) and the second type of data to the server. The server determines the recipient terminal of the notification message (i.e., the host player's terminal) based on the second type of data including the host player's identity, and transparently transmits the first type of data to the corresponding host player's terminal.

[0147] In one example, the process of pre-starting the game on the terminal may include: running the environment or resources required for the interactive game A, and opening the applet corresponding to the interactive game A.

[0148] S2003, the host player receives feedback from the guest players and counts the number of "pre-start successes".

[0149] Each time the host player receives feedback from the guest player, the host player counts the number of "pre-start successes" and determines whether the total number meets the conditions. If after receiving all the feedback, the number of "pre-start successes" of the guest player does not reach 3, the interactive game A is terminated; if the host player "pre-start fails", the interactive game A is terminated; otherwise, enter S2004.

[0150] S2004, the room owner player initiates an operation to start the game.

[0151] The host player initiates the operation of starting the game to all the tenant players. The interaction number for initiating the operation of starting the game is A102. The operation of starting the game can be initiated by sending a notification message of starting the interactive game A to each tenant player through the server.

[0152] S2005, the guest player feeds back a successful message of starting the game to the host player.

[0153] The feedback operation may be initiated by sending a notification message of the processing result of starting the game to the room owner player through the server.

[0154] Specifically, the operation initiated by the player to start the game is essentially a process of calling back the server of interactive game A to successfully start interactive game A.

[0155] S2006, the host player and the guest player enter the interactive game A interactive moment.

[0156] At this point, the host player and the guest player can begin to enter the interactive game A to interact.

[0157] See for example Figure 4c :The process of switching interactive game A to interactive game B, which includes stopping the game operation, authentication operation, and switching operation. Among them, if the host player and the tenant player are in interactive game A

[0158] S3001, the room host player initiates an operation to stop interactive game A.

[0159] After the host player determines to switch to interactive game B, if interactive game A is currently being played, the host player stops the interactive game A and initiates a stop game operation to other players. The stop game operation can be initiated by sending a notification message of starting interactive game A to each guest player through the server.

[0160] Among them, the interaction number for initiating the game stop operation is A103.

[0161] S3002, the guest player feeds back the result of stopping the game to the host player.

[0162] After receiving the notification message, each tenant player stops the interactive game A and initiates an operation of feeding back the processing result of stopping the game to the host player. The processing result of stopping the game can be fed back by sending a notification message of the processing result of stopping the game to the host player.

[0163] S3003, the room owner player initiates an authentication operation.

[0164] On the one hand, the host player performs authentication operation on interactive game B; on the other hand, the host player also initiates authentication operation to other tenant players. Specifically, the authentication operation can be initiated by sending a notification message of the authentication operation for interactive game B to each tenant player through the server. Among them, the interaction number for initiating the authentication operation is A104.

[0165] Among them, when initiating an authentication operation to other tenant players, a 3s countdown operation can also be started.

[0166] S3004, the tenant player feedbacks the processing result of the operation.

[0167] The processing result of the authentication operation can be fed back by sending a notification message of the processing result of the authentication operation to the room owner player through the server.

[0168] S3005, the host player counts the guest players who have passed the authentication.

[0169] After receiving the notification message sent by the server, the host player counts the processing results of the authentication operation fed back by each guest player, and then determines the number of qualified players. Among them, qualified players include guest players who fed back the processing result of authentication passing within 3 seconds, and host players who passed authentication. After determining that the number of qualified players meets the number limit of interactive game B, execute S3006.

[0170] S3006: The room host player initiates a game switching operation.

[0171] The room owner player initiates a game switching operation to other room guests. Specifically, the game switching operation can be initiated by sending a notification message of the switching operation of switching interactive game A to interactive game B to each room guest player through the server. Among them, the interaction number for initiating the authentication operation is A105.

[0172] S3007, the tenant player feedbacks the processing result of the game switching operation.

[0173] The server may send a notification message of the processing result of the game switching operation to the room host player to feedback the processing result of the game switching operation.

[0174] S3008, the room owner player collects feedback on the game switching operation.

[0175] After receiving the notification message sent by the server, the room host player counts the processing results of all users' game switching operations and determines whether to enter interactive game B.

[0176] At this point, the process of switching interactive game A to interactive game B is completed.

[0177] See also Figure 5 The embodiment of the present application further provides an end-to-end communication device 500, which can be applied to a first client, which is a controller of the interaction process; the device includes:

[0178] The first transceiver module 510 is used to send a first interaction request carrying the first type of data and the second type of data to the server in response to the first interaction operation, so that the server can transparently transmit the first type of data to the second client according to the second type of data;

[0179] The first processing module 520 is used to parse the first notification message in response to the first notification message sent by the server to obtain the first type of data corresponding to the second interactive operation; the first notification message is a message fed back by the server according to the first type of data and the second type of data carried in the second interactive request sent by the second client in response to the second interactive operation;

[0180] The first type of data includes the interaction number and other interaction contents describing any interaction operation; the second type of data includes the information describing the interaction client of any interaction operation.

[0181] In a possible implementation, if the operation type of the first interactive operation is a control type, and the second interactive operation is a feedback operation for the first interactive operation, the first transceiver module 510, in sending a first interactive request carrying the first type of data and the second type of data to the server, is specifically used to:

[0182] Determine the second category of data according to the second client corresponding to the first interactive operation; determine the first category of data according to the first interactive operation, the first category of data including the interaction number of the first interactive operation; send the first interaction request carrying the first category of data and the second category of data to the server through a preset channel.

[0183] In a possible implementation, the process of creating an interaction number for the first interaction operation includes:

[0184] An interaction number is created according to a preset method, and the value of the interaction number is greater than the value of the largest historical interaction number.

[0185] In a possible implementation, the first notification message is received at the first time after the first client sends the first interaction request. After parsing the first notification message, the first processing module 520 is further used to:

[0186] When it is determined that the interaction number in the first category data carried by the first notification message is the same as the interaction number in the first category data carried by the first interaction request, determine the feedback time threshold corresponding to the first interaction operation; if the first time is within the feedback time threshold, determine that the second interaction operation is a valid operation; in response to the instruction of the second interaction operation, perform a corresponding operation according to the first category data carried by the first notification message to determine the interaction result of the first interaction operation.

[0187] In a possible implementation, the interaction process is an interactive game, and before initiating the first interaction operation, the method includes:

[0188] The following authentication operations are performed in sequence for the interactive game: determining whether the first client has the authority to configure the interactive game; if it has the authority to configure the interactive game, determining whether the interactive game is configured on the first client; if the interactive game is configured, determining whether there is an interactive game running on the first client; if there is no interactive game running, determining whether the function configured by the first client is exclusive of the interactive game; wherein, if the authentication is successful, determining to initiate the first interactive operation.

[0189] In a possible implementation, in the stage of initializing the first client, the first transceiver module 510 is further used to:

[0190] Sending a subscription request to the server, where the subscription request carries the identity of the first client and a preset subscription identifier;

[0191] The process of obtaining the first notification message includes: if a notification carrying a preset subscription identifier is detected, obtaining the first notification message.

[0192] See also Figure 6 The embodiment of the present application further provides a peer-to-peer communication device 600, which is applied to a second client that receives an invitation to participate in an interaction process; the device includes:

[0193] The second processing module 610, in response to the second notification message sent by the server, parses the second notification message to obtain the first type of data corresponding to the first interactive operation; the second notification message is a message fed back by the server based on the first type of data and the second type of data carried in the first interactive request sent by the first client in response to the first interactive operation.

[0194] The second transceiver module 620, in response to the determined second interactive operation, sends a second interactive request carrying the first type of data and the second type of data to the server, so that the server transparently transmits the first type of data to the first client according to the second type of data.

[0195] The first type of data includes the interaction number and other interaction contents describing any interaction operation, and the second type of data includes the information describing the interaction client of any interaction operation.

[0196] In a possible implementation, if the operation type of the second interactive operation is a control type, and the second interactive operation is a feedback operation for the first interactive operation, after obtaining the first type of data corresponding to the first interactive operation, the second processing module 610 may be used to:

[0197] The interaction number in the first category data corresponding to the first interaction operation is compared with the historical interaction number with the largest value; if the comparison result is greater than, the interaction number in the first category data corresponding to the first interaction operation is cached as the interaction number of the second interaction operation.

[0198] In a possible implementation, the interaction process is an interactive game. After obtaining the first type of data corresponding to the first interaction operation, the second processing module 610 may also be used to:

[0199] If the first interactive operation is an authentication operation for the interactive game, the authentication operation is performed according to the first category data corresponding to the first interactive operation; if the first interactive operation is an operation to pre-start the interactive game, the interactive game is asynchronously loaded according to the first category data corresponding to the first interactive operation; if the first interactive operation is an operation to start the interactive game, the interactive game is started according to the first category data corresponding to the first interactive operation; if the first interactive operation is an operation to close the interactive game, the interactive game is stopped according to the first category data corresponding to the first interactive operation.

[0200] In a possible implementation, the second transceiver module 620, in sending the second interaction request carrying the first type of data and the second type of data to the server, is specifically configured to:

[0201] Determine the second type of data according to the information of the first client; determine the first type of data according to the second interactive operation, the first type of data carries the interaction number of the second interactive operation; send the second interactive request carrying the first type of data and the second type of data to the server through a preset channel.

[0202] In a possible implementation, the second processing module 610, in performing the authentication operation according to the first type of data, is specifically configured to:

[0203] If a trigger operation of accepting the invitation is obtained, the following authentication operations are performed in sequence for the interactive game: determining whether the second client has the authority to configure the interactive game; if it has the authority to configure the interactive game, determining whether the interactive game is configured on the second client; if the interactive game has been configured, determining whether there is an interactive game running on the second client; if there is no interactive game running, determining whether the function configured on the second client is exclusive of the interactive game;

[0204] If the authentication is successful, the second processing module 610 is further configured to initiate a feedback operation on the first interactive operation.

[0205] In a possible implementation, in the stage of initializing the second client, the second transceiver module 620 is used to:

[0206] A subscription request is sent to the server, where the subscription request carries the identity of the second client and a preset subscription identifier; wherein the process of obtaining the second notification message includes: if a notification carrying the preset subscription identifier is detected, obtaining the second notification message.

[0207] In a possible implementation, the second transceiver module 620 is further configured to:

[0208] In response to a third notification message sent by the server, the third notification message is parsed to obtain first-category data corresponding to the third interactive operation, where the third notification message is a message fed back by the server according to the second-category data carried in a third interactive request sent by another second client in response to the third interactive operation;

[0209] In response to the determined fourth interaction operation, a fourth interaction request carrying the first category data and the second category data is sent to the server, so that the server transparently transmits the first category data to another client according to the second category data.

[0210] See also Figure 7 The embodiment of the present application further provides an end-to-end communication device 700, which is applied to a server, and the server is used to forward communication data involved in an interactive operation between a first client and a second client; the device 700 includes:

[0211] The third transceiver module 710 is used to receive an interaction request carrying first-category data and second-category data sent by any client through a preset channel, wherein the first-category data includes an interaction number and other interaction contents describing any interaction operation, and the second-category data includes information describing an interaction client of any interaction operation;

[0212] The third processing module 720 is used to determine the client to be interacted with according to the second type of data, and send a notification message carrying the first type of data to the client to be interacted with through the third transceiver module 710.

[0213] The device of the embodiments of the present application can execute the method provided by the embodiments of the present application, and the implementation principles are similar. The actions performed by each module in the device of each embodiment of the present application correspond to the steps in the method of each embodiment of the present application. For the detailed functional description of each module of the device, please refer to the description in the corresponding method shown in the previous text, which will not be repeated here.

[0214] An electronic device is provided in an embodiment of the present application, including a memory, a processor, and a computer program stored in the memory, and the processor executes the above-mentioned computer program to implement the steps of an end-to-end communication method shown in an embodiment of the present application. Compared with the related art, it can be achieved that: the client only needs to provide the second type of data to the server according to the information of the interactive client of each interactive operation, so that the server can assist in the transparent transmission of the first type of data describing the interactive content of the interactive operation to realize the interaction between clients. The communication method provided in the embodiment of the present application can enable front-end developers to focus on the development of front-end business, reduce the need for collaboration with back-end developers during the development process, shorten the development period, and thus increase the iteration speed.

[0215] In an alternative embodiment, an electronic device is provided, such as Figure 8 As shown, Figure 8 The electronic device 8000 shown includes: a processor 8001 and a memory 8003. The processor 8001 and the memory 8003 are connected, such as through a bus 8002. Optionally, the electronic device 8000 may also include a transceiver 8004, which may be used for data interaction between the electronic device and other electronic devices, such as data transmission and / or data reception. It should be noted that in actual applications, the transceiver 8004 is not limited to one, and the structure of the electronic device 8000 does not constitute a limitation on the embodiments of the present application.

[0216] The processor 8001 may be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array) or other programmable logic devices, transistor logic devices, hardware components or any combination thereof. It may implement or execute various exemplary logic blocks, modules and circuits described in conjunction with the disclosure of this application. The processor 8001 may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, etc.

[0217] The bus 8002 may include a path to transmit information between the above components. The bus 8002 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus. The bus 8002 may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 8 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0218] The memory 8003 can be a ROM (Read Only Memory) or other types of static storage devices that can store static information and instructions, a RAM (Random Access Memory) or other types of dynamic storage devices that can store information and instructions, or an EEPROM (Electrically Erasable Programmable Read Only Memory), a CD-ROM (Compact Disc Read Only Memory) or other optical disk storage, optical disk storage (including compressed optical disk, laser disk, optical disk, digital versatile disk, Blu-ray disk, etc.), magnetic disk storage medium, other magnetic storage devices, or any other medium that can be used to carry or store computer programs and can be read by a computer, without limitation herein.

[0219] The memory 8003 is used to store the computer program for executing the embodiment of the present application, and the execution is controlled by the processor 8001. The processor 8001 is used to execute the computer program stored in the memory 8003 to implement the steps shown in the above method embodiment.

[0220] An embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps and corresponding contents of the aforementioned method embodiment can be implemented.

[0221] The embodiment of the present application also provides a computer program product, including a computer program, which can implement the steps and corresponding contents of the aforementioned method embodiment when executed by a processor.

[0222] The terms "first", "second", "third", "fourth", "1", "2", etc. (if any) in the specification and claims of this application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way can be interchanged where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than that shown or described in the drawings.

[0223] It should be understood that, although each operation step is indicated by arrows in the flowchart of the embodiment of the present application, the implementation order of these steps is not limited to the order indicated by the arrows. Unless clearly stated herein, in some implementation scenarios of the embodiment of the present application, the implementation steps in each flowchart can be performed in other orders according to demand. In addition, some or all of the steps in each flowchart may include multiple sub-steps or multiple stages based on actual implementation scenarios. Some or all of these sub-steps or stages may be executed at the same time, and each sub-step or stage in these sub-steps or stages may also be executed at different times respectively. In different scenarios of execution time, the execution order of these sub-steps or stages may be flexibly configured according to demand, and the embodiment of the present application does not limit this.

[0224] The above is only an optional implementation method for some implementation scenarios of the present application. It should be pointed out that for ordinary technicians in this technical field, without departing from the technical concept of the solution of the present application, other similar implementation methods based on the technical ideas of the present application are also within the protection scope of the embodiments of the present application.

Claims

1. A peer-to-peer communication method, characterized in that: applied to a first client; The first client is a controller of the interaction process, and the method includes: In response to a first interactive operation, the operation type of the first interactive operation is a control type, and second-type data is determined according to a second client corresponding to the first interactive operation; determining a first type of data according to the first interactive operation, wherein the first type of data includes an interaction number of the first interactive operation; Sending a first interaction request carrying the first category of data and the second category of data to the server through a preset channel, so that the server transparently transmits the first category of data to the second client according to the second category of data; In response to a first notification message sent by the server, the first notification message is received at the first time after the first client sends the first interaction request, the first notification message is parsed to obtain first-category data corresponding to a second interaction operation, where the second interaction operation is a feedback operation for the first interaction operation; the first notification message is a message fed back by the server according to the first-category data and the second-category data carried in the second interaction request sent by the second client in response to the second interaction operation; When it is determined that the interaction number in the first type of data carried by the first notification message is the same as the interaction number in the first type of data carried by the first interaction request, determining a feedback time threshold corresponding to the first interaction operation; If the first time is within the feedback time threshold, determining that the second interactive operation is a valid operation; In response to an instruction of the second interactive operation, performing a corresponding operation according to the first type of data carried by the first notification message to determine an interactive result of the first interactive operation; The first type of data includes the interaction number and other interaction contents describing any interaction operation; the second type of data includes the information describing the interaction client of any interaction operation.

2. The method according to claim 1, characterized in that: The process of creating the interaction number of the first interaction operation includes: An interaction number of the first interaction operation is created according to a preset method, and a value of the interaction number of the first interaction operation is greater than a value of a maximum historical interaction number.

3. The method according to claim 1, characterized in that The interactive process is an interactive game. Before initiating the first interactive operation, the method includes: The following authentication operations are performed in sequence for the interactive game: determining whether the first client has the authority to configure the interactive game; if the first client has the authority to configure the interactive game, determining whether the interactive game is configured on the first client; if the interactive game is configured, determining whether there is an interactive game running on the first client; if there is no interactive game running, determining whether the function configured on the first client is exclusive of the interactive game; If the authentication is successful, it is determined to initiate the first interactive operation.

4. The method according to claim 1, characterized in that: In the stage of initializing the first client, the method includes: Sending a subscription request to the server, wherein the subscription request carries the identity of the first client and a preset subscription identifier; The process of obtaining the first notification message includes: If a notification carrying the preset subscription identifier is detected, the first notification message is obtained.

5. A peer-to-peer communication method, characterized in that: The method is applied to a second client that receives an invitation to participate in an interactive process; the method comprises: In response to a second notification message sent by the server, the second notification message is parsed to obtain first-category data corresponding to the first interactive operation; the second notification message is a message fed back by the server according to the first-category data and the second-category data carried in the first interactive request sent by the first client in response to the first interactive operation; Comparing the interaction number in the first type of data corresponding to the first interaction operation with the historical interaction number with the largest value; If the comparison result is greater than, a second interactive operation is determined, the operation type of the second interactive operation is a control type, the second interactive operation is a feedback operation for the first interactive operation, and the interaction number in the first type of data corresponding to the first interactive operation is cached as the interaction number of the second interactive operation; determining the first type of data according to the interaction number of the cached second interaction operation, and creating a second interaction request according to the second interaction operation, wherein the second interaction request carries the first type of data; In response to the second interaction operation, sending a second interaction request carrying the first category of data and the second category of data to the server, so that the server transparently transmits the first category of data to the first client according to the second category of data; The first type of data includes the interaction number and other interaction contents describing any interaction operation, and the second type of data includes the information describing the interaction client of any interaction operation.

6. The method according to claim 5, characterized in that The interactive process is an interactive game. After obtaining the first type of data corresponding to the first interactive operation, the method further includes: If the first interactive operation is an authentication operation for the interactive game, performing an authentication operation according to the first type of data corresponding to the first interactive operation; If the first interactive operation is an operation for pre-starting the interactive game, asynchronously loading the interactive game according to the first type of data corresponding to the first interactive operation; If the first interactive operation is an operation of starting the interactive game, starting the interactive game according to the first type of data corresponding to the first interactive operation; If the first interactive operation is an operation of closing the interactive game, the interactive game is stopped according to the first type of data corresponding to the first interactive operation.

7. The method according to claim 5 or 6, characterized in that: The sending a second interaction request carrying the first type of data and the second type of data to the server includes: determining the second category of data according to the information of the first client; Determine the first type of data according to the second interactive operation, where the first type of data carries the interaction number of the second interactive operation; The second interaction request carrying the first category data and the second category data is sent to the server through a preset channel.

8. The method according to claim 6, characterized in that Performing an authentication operation according to the first type of data includes: If a trigger operation of accepting the invitation is obtained, the following authentication operations are performed in sequence for the interactive game: determining whether the second client has the authority to configure the interactive game; if it has the authority to configure the interactive game, determining whether the interactive game is configured on the second client; if the interactive game has been configured, determining whether there is an interactive game running on the second client; if there is no interactive game running, determining whether the function configured on the second client is exclusive of the interactive game; If the authentication is successful, the method further includes: initiating a feedback operation on the first interactive operation.

9. The method according to claim 5, characterized in that In the stage of initializing the second client, the method includes: Sending a subscription request to the server, wherein the subscription request carries the identity of the second client and a preset subscription identifier; The process of obtaining the second notification message includes: If a notification carrying the preset subscription identifier is detected, the second notification message is obtained.

10. The method according to claim 5, characterized in that The method further comprises: In response to a third notification message sent by the server, the third notification message is parsed to obtain first-category data corresponding to a third interactive operation, wherein the third notification message is a message fed back by the server according to the second-category data carried in a third interactive request sent by another second client in response to the third interactive operation; In response to the determined fourth interaction operation, a fourth interaction request carrying the first category of data and the second category of data is sent to the server, so that the server transparently transmits the first category of data to the other second client according to the second category of data.

11. A peer-to-peer communication device, characterized in that: Applied to a first client, the first client being the controller of the interaction process; The device comprises: A first transceiver module is configured to respond to a first interactive operation, where the operation type of the first interactive operation is a control type, and determine a second type of data according to a second client corresponding to the first interactive operation; determining a first type of data according to the first interactive operation, wherein the first type of data includes an interaction number of the first interactive operation; Sending a first interaction request carrying the first category of data and the second category of data to the server through a preset channel, so that the server transparently transmits the first category of data to the second client according to the second category of data; A first processing module is configured to respond to a first notification message sent by the server, the first notification message being received at the first time after the first client sends the first interaction request, parse the first notification message to obtain first-category data corresponding to a second interaction operation, and the second interaction operation is a feedback operation for the first interaction operation; the first notification message is a message fed back by the server according to the first-category data and the second-category data carried in the second interaction request sent by the second client in response to the second interaction operation; when it is determined that the interaction number in the first-category data carried by the first notification message is the same as the interaction number in the first-category data carried by the first interaction request, determine the feedback time threshold corresponding to the first interaction operation; if the first time is within the feedback time threshold, determine that the second interaction operation is a valid operation; and in response to the instruction of the second interaction operation, perform a corresponding operation according to the first-category data carried by the first notification message to determine the interaction result of the first interaction operation; The first type of data includes the interaction number and other interaction contents describing any interaction operation; the second type of data includes the information describing the interaction client of any interaction operation.

12. A peer-to-peer communication device, characterized in that: The device is applied to a second client that receives an invitation to participate in an interactive process; the device comprises: A second processing module is configured to respond to a second notification message sent by the server and parse the second notification message to obtain first-category data corresponding to the first interactive operation; the second notification message is a message fed back by the server according to the first-category data and the second-category data carried in the first interactive request sent by the first client in response to the first interactive operation; The second processing module is further used to compare the interaction number in the first type of data corresponding to the first interaction operation with the historical interaction number with the largest value; If the comparison result is greater than, determine a second interactive operation, the operation type of the second interactive operation is a control type, the second interactive operation is a feedback operation for the first interactive operation, and cache the interaction number in the first type of data corresponding to the first interactive operation as the interaction number of the second interactive operation; determine the first type of data according to the cached interaction number of the second interactive operation, and create a second interaction request according to the second interactive operation, the second interaction request carrying the first type of data; A second transceiver module is used to send a second interaction request carrying the first category of data and the second category of data to the server in response to the second interaction operation, so that the server transparently transmits the first category of data to the first client according to the second category of data; The first type of data includes the interaction number and other interaction contents describing any interaction operation, and the second type of data includes the information describing the interaction client of any interaction operation.

13. An electronic device comprising a memory, a processor and a computer program stored in the memory, characterized in that: The processor executes the computer program to implement the steps of the method according to any one of claims 1 to 4 and claims 5 to 10.

14. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 4 and claims 5 to 10 are implemented.

Citation Information

Patent Citations

  • Interaction method and device, electronic equipment and storage medium

    CN111464422A

  • Live broadcast interaction method and system based on cloud game, electronic equipment and storage medium

    CN111491214A

  • Data mutual transmission method and device, equipment and computer readable storage medium

    CN111643894A