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

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

Info

Publication number
CN114827164A
CN114827164A CN202210389524.9A CN202210389524A CN114827164A CN 114827164 A CN114827164 A CN 114827164A CN 202210389524 A CN202210389524 A CN 202210389524A CN 114827164 A CN114827164 A CN 114827164A
Authority
CN
China
Prior art keywords
interactive
data
client
type
interaction
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210389524.9A
Other languages
Chinese (zh)
Inventor
郑伟成
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangzhou Huya Technology Co Ltd
Original Assignee
Guangzhou Huya Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangzhou Huya Technology Co Ltd filed Critical Guangzhou Huya Technology Co Ltd
Priority to CN202210389524.9A priority Critical patent/CN114827164A/en
Publication of CN114827164A publication Critical patent/CN114827164A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/104Peer-to-peer [P2P] networks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/22Parsing or analysis of headers

Abstract

The embodiment of the application provides an end-to-end communication method and related equipment, and relates to the field of communication. The method is applied to a first client, a second client and a server, wherein in the first client: if the first client initiates the interactive operation, transmitting second-class data describing the interactive client in the interactive operation, and first-class data describing interactive contents and interactive numbers of the interactive operation to the server, so that the server forwards the first-class data to the second client according to the second-class data; and if receiving a notification message sent by the server, analyzing the first type of data carried in the notification message, and processing the task by the client according to the first type of data in response to the instruction of interactive operation. The client terminal shown in the embodiment of the application can enable the server terminal to assist in the transparent transmission of the first type of data only by providing the second type of data to the server terminal according to each interactive operation, so that the interaction between the client terminals is realized.

Description

End-to-end communication method, device, equipment, storage medium and program product
Technical Field
The present application relates to the field of communications, and in particular, to a peer-to-peer communication method, apparatus, electronic device, computer-readable storage medium, and computer program product.
Background
Due to the convenience of mobile terminals, users using mobile terminals are increasing, and users are accustomed to satisfying various needs through one mobile device, for example, increasing more interest in life through one interactive game and satisfying communication needs.
At present, in the development field of interactive games, a front-end developer is responsible for the development of front-end pages, logics and the like, and tasks such as state statistics of the interactive games, interface definition between terminals and the like belong to rear-end development tasks, so that the development of the interactive games relates to the cooperation of multiple departments. If the front-end developer needs to make some adjustments to the interactive game, the cooperation of the back-end developer will be needed. And the cooperative development of multiple departments easily results in the prolongation of the development period.
Disclosure of Invention
The embodiment of the present application aims to solve one of the above technical problems.
According to a first aspect of the embodiments 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 management and control party of the interactive process, and the method comprises the following steps:
responding to the first interactive operation, sending a first interactive request carrying first-class data and second-class data to the server, so that the server can conveniently transmit the first-class data to the second client according to the second-class data; responding to a first notification message sent by a server, analyzing the first notification message to obtain first-class 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.
The first type of data comprises an interaction number and other interaction contents for describing any interaction operation; the second type of data includes information describing the interactive client of any interactive operation.
According to a second aspect of the embodiments of the present application, there is provided an end-to-end communication method, applied to a second client that receives an invitation to participate in an interactive process; the method comprises the following steps:
responding to a second notification message sent by the server, and analyzing the second notification message to obtain first type data corresponding to the first interactive operation; the second 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 first interaction request sent by the first client in response to the first interaction operation; and responding to the determined 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 can transmit the first type of data to the first client according to the second type of data.
The first type of data comprises an interaction number and other interaction contents for describing any interaction operation, and the second type of data comprises information for describing an interaction client of any interaction operation.
According to a third aspect of the embodiments of the present application, an end-to-end communication method is provided, which is applied to a server, where the server is configured to forward communication data related to an interactive operation between a first client and a second client; the method comprises the following steps:
receiving an interaction request carrying first-class data and second-class data sent by any client from a preset channel, wherein the first-class data comprises an interaction number and other interaction contents for describing any interaction operation, and the second-class data comprises information for describing the interaction client of any interaction operation; and determining the client to be interacted according to the second type of data, and sending a notification message carrying the first type of data to the client to be interacted.
According to a fourth aspect of the embodiments of the present application, there is provided an end-to-end communication apparatus, which is applied to a first client; the first client is a management and control party of the interaction process, and the device comprises:
the first transceiver module is used for responding to the first interactive operation and sending a first interactive request carrying the first type of data and the second type of data to the server so that the server can transmit the first type of data to the second client according to the second type of data conveniently; the first processing module is used for responding to a first notification message sent by the server and analyzing the first notification message to obtain first-class 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.
The first type of data comprises an interaction number and other interaction contents which describe any interaction operation; the second type of data includes information describing the interactive client of any interactive operation.
According to a fifth aspect of the embodiments of the present application, there is provided an end-to-end communication apparatus, which is applied to a second client that receives an invitation to participate in an interactive process; the device includes:
the second processing module is used for responding to a second notification message sent by the server and analyzing the second notification message to obtain first type data corresponding to the first interactive operation; the second 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 first interaction request sent by the first client in response to the first interaction operation; and the second transceiver module is used for responding to the determined second interactive operation, and sending a second interactive request carrying the first type of data and the second type of data to the server so that the server can transmit the first type of data to the first client according to the second type of data.
The first type of data comprises an interaction number and other interaction contents for describing any interaction operation, and the second type of data comprises information for describing an interaction client of any interaction operation.
According to a sixth aspect of the embodiments of the present application, an end-to-end communication device is provided, which is applied to a server, where the server is configured to forward communication data related to an interactive operation between a first client and a second client; the device includes:
a third receiving module, configured to receive, from a preset channel, an interaction request that is sent by any client and carries first-class data and second-class data, where the first-class data includes an interaction number and other interaction contents that describe any interaction operation, and the second-class data includes information that describes an interaction client of any interaction operation; and the third processing module is used for determining the client to be interacted according to the second type of data and sending a notification message carrying the first type of data to the client to be interacted through the transceiving module.
According to a seventh aspect of embodiments of the present application, there is provided an electronic apparatus, including: a memory, a processor and a computer program stored on the memory, the processor executing the computer program to implement the steps of the method according to any of the first, second and third aspects.
According to an eighth aspect of embodiments of the present application, there is provided a computer-readable storage medium, wherein the computer program is configured to, when executed by a processor, implement the steps of the method according to any one of the first, second, and third aspects.
According to a ninth aspect of embodiments of the present application, there is provided a computer program product comprising a computer program which, when executed by a processor, implements the steps of the method according to any one of the first, second, and third aspects.
The technical scheme provided by the embodiment of the application has the following beneficial effects:
the embodiment of the 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 comprises the following steps: if the first client initiates the interactive operation, transmitting second-class data describing the interactive client in the interactive operation, and first-class data describing interactive contents and interactive numbers of the interactive operation to the server, so that the server forwards the first-class data to the second client according to the second-class data; and if receiving a notification message sent by the server, analyzing the first type of data carried in the notification message. Therefore, the client only needs to provide the second type of data to the server according to the information of the interactive client in each interactive operation, so that the server can assist in the transparent transmission of the first type of data, and the interaction between the clients is realized. The communication method provided by the embodiment of the application can enable front-end developers to concentrate on the development of front-end services, reduce the collaborative requirements on rear-end developers in the development process, shorten the development period and further improve the iteration speed.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings used in the description of the embodiments of the present application will be briefly described below.
Fig. 1 is a schematic flowchart of an end-to-end communication method according to an embodiment of the present application;
fig. 2 is a schematic flowchart of another end-to-end communication method according to an embodiment of the present application;
fig. 3 is a schematic flowchart of another end-to-end communication method according to an embodiment of the present application;
fig. 4a is a schematic flowchart of an interaction between a first client and a second client according to an embodiment of the present application;
FIG. 4b is a schematic flowchart of the process of starting the interactive game A according to the embodiment of the present application;
fig. 4c is a schematic flow chart of switching the interactive game a to the interactive game B according to the embodiment of the present application;
fig. 5 is a schematic structural diagram of an end-to-end communication device according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of another end-to-end communication device according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of another peer-to-peer communication device according to an embodiment of the present application;
fig. 8 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
Embodiments of the present application are described below in conjunction with the drawings in the present application. It should be understood that the embodiments set forth below in connection with the drawings are exemplary descriptions for explaining technical solutions of the embodiments of the present application, and do not limit the technical solutions of the embodiments of the present application.
As used herein, the singular forms "a", "an", "the" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should be further understood that the terms "comprises" and/or "comprising," when used in this specification in connection with embodiments of the present application, specify the presence of stated features, information, data, steps, operations, elements, and/or components, but do not preclude the presence or addition of other features, information, data, steps, operations, elements, components, and/or groups thereof, as embodied in the art. It will be understood that when an element is referred to as being "connected" or "coupled" to another element, it can be directly connected or coupled to the other element or intervening elements may be present. Further, "connected" or "coupled" as used herein may include wirelessly connected or wirelessly coupled. The term "and/or" as used herein indicates at least one of the items defined by the term, e.g., "a and/or B" may be implemented as "a", or as "B", or as "a and B".
To make the objects, technical solutions and advantages of the present application more clear, embodiments of the present application will be described in further detail below with reference to the accompanying drawings.
The technical solutions of the embodiments of the present application and the technical effects produced by the technical solutions of the present application will be described below through descriptions of several exemplary embodiments. It should be noted that the following embodiments may be referred to, referred to or combined with each other, and the description of the same terms, similar features, similar implementation steps and the like in different embodiments is not repeated.
In the prior art, a manager of an interactive game is generally a server, that is, the server performs state statistics of the interactive game, and unifies interface definitions of interaction between a client and the server. However, this method depends on the server during the development process, and therefore the front-end developer needs the cooperation of the developer at the server when performing function iteration on the interactive game, which prolongs the development period and further reduces the iteration speed of the front-end product.
The embodiments of the present application provide an end-to-end communication method, apparatus, electronic device, computer-readable storage medium, and computer program product, which are used to solve the above technical problems. The method is respectively applied to a first client, a second client and a server. The method is characterized in that a first client initiating the interactive game is used as a management party of the interactive game and is mainly used for managing state statistics of the interactive game and sending some instructions for controlling the progress of the interactive game, so that the uniqueness of the game state is ensured.
Specifically, the first client is a client initiating an interaction process; the second client is a client related to the interactive process, for example, a client invited to participate in the interactive process; the server is configured to forward communication data involved in an interactive operation between the first client and the second client, for example, the first type data in the following embodiments.
The first client and the second client are the same application program configured on different terminals, and the terminals can be mobile terminal devices such as a mobile phone, an ipad and an intelligent watch, and can also be computer devices such as a desktop computer and a notebook computer.
In a live wheat-connected scene, any player can organize a plurality of players into a room in a wheat-connected mode to play interactive games together. The first client is configured by the player of the house owner who initiates the interactive game, and the second client is configured by the player of the house owner who is invited to participate in the interactive game. The number of the host players is 1, and the number of the tenant players is determined according to the limit of the interactive game on the number of the players. For example, if the number of players in the interactive game is limited to: 5 to 7, then the number of tenant players is 4-6.
Referring to fig. 1, an embodiment of the present application provides an end-to-end communication method, which is applied to a first client. The method includes steps S110 to S120.
S110, responding to the first interactive operation, sending a first interactive request carrying the first type of data and the second type of data to the server, so that the server can transmit the first type of data to the second client according to the second type of data.
S120, responding to a first notification message sent by the server, analyzing the first notification message to obtain first-class data corresponding to a 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.
And if the operation type of the first interactive operation is the control type, the second interactive operation is the feedback operation aiming at the first interactive operation.
Specifically, if the operation type of the first interactive operation is the control type, the second client performs a processing operation according to the interaction number and other interactive contents in the first type of data after receiving the first type of data, and initiates a second interactive operation after obtaining a processing result, where the second interactive operation is also the control type of operation. If the operation type of the first interactive operation is a non-control type, the second client may or may not perform feedback after obtaining the processing result.
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 result 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 the authentication operation according to the first type of data and feeds back the processing result of the authentication operation. If the first interactive operation is an operation of adding an animation effect to the second client, after the second interactive operation is sent to the second client, the second client shows a corresponding effect according to the received first type of data, and the purpose is achieved.
The embodiment of the application provides an end-to-end communication method from the perspective of a first client, which comprises the following steps: if the first client initiates the interactive operation, transmitting second data describing the interactive client in the interactive operation, and first data describing interactive contents and interactive numbers of the interactive operation to the server, so that the server can forward the first data to the second client according to the second data; and if receiving a notification message sent by the server, analyzing the first type of data carried in the notification message. Therefore, the client only needs to provide the second type of data to the server according to the information of the interactive client in each interactive operation, so that the server can assist in the transparent transmission of the first type of data, and the interaction between the clients is realized. Therefore, the first type of data corresponding to the interactive operation is set, so that front-end developers can concentrate on the development of the interactive operation belonging to the front-end business, the collaborative requirement on rear-end developers in the development process is reduced, the development period is shortened, and the iteration speed is further improved.
In a possible implementation manner, sending a first interaction request carrying the first type of data and the second type of data to the server may specifically include:
determining second type data according to the information of the second client interacted by the first interaction operation; determining first-class data according to the first interactive operation, wherein the first-class data comprises an interactive number of the first interactive operation; and sending the first interaction request carrying the first type of data and the second type of data to a server through a preset channel.
Specifically, the first type of data includes an interaction number and other interaction content describing any interaction operation; the second type of data includes information describing the interactive client of any interactive operation. The information of the interactive client may specifically include: the identity of the first client and the identity of the second client are interacted, and the information of the network session where the first client and the second client are located is obtained. Among other interactive contents, other interactive contents may include: the operation type of the interactive operation, and the like, and the unique identification of the interactive process.
The determining of the first type of data according to the first interactive operation may specifically include: creating an interaction number of a first interaction operation according to the first interaction operation, obtaining an operation type of the first interaction operation, and determining a parameter required to be carried by the operation type, where the parameter may include: unique identification of the interactive process.
Since the interactive process is essentially a network communication process, the network communication process has a network delay problem. And setting an interaction number for each interaction operation for marking, and obtaining the interaction number in the received first-class data when the first client receives the first-class data, so as to determine whether a corresponding relation exists between a second interaction operation corresponding to the received interaction number and the first interaction operation, namely the first client determines whether the second client has feedback. Therefore, the problem caused by network delay can be avoided by setting the interaction number for the interaction operation.
In one example, the interactive process is an interactive game a. The first type of data is data of a first type of structure body, and the first type of structure body at least comprises the following attributes: the operation type of the interactive operation, the data of the third type 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 the interactive game a). The second type of data is data of a second type of structure, and the second type of structure at least comprises the following attributes: the identifier of the sender, the identifier of the receiver, the identifier of the session in which the initiated interactive game a is located, and the play mode of the first notification message (for example, when the number of receivers is a single number, the play mode is a unicast mode, and when the number of receivers is a plurality, the play mode is a multicast mode). The third type of structure includes at least the following attributes: data provided by the server of interactive game a, other attributes (e.g., game identification of interactive game a).
Specifically, the client may send the first interaction request to the server through a negotiated interface between the server and the client as the preset channel.
In one possible implementation, the process of creating the interaction number of the first interaction operation includes:
and establishing an interaction number of the first interaction operation according to a preset mode, wherein the numerical value of the interaction number of the first interaction operation is larger than the numerical value of the maximum historical interaction number.
Specifically, the number of the interaction of the previous interaction operation is incremented by a preset value, for example, if the number of the interaction of the previous interaction operation is 10, the number of the interaction is incremented by 1, and a first interaction number 11 is obtained. Or acquiring a timestamp of receiving the first interactive operation, and taking the timestamp as a first interactive number.
Specifically, the types of interactive operations include a control type and a non-control type. The interactive operation corresponding to the control type is generally related to the whole progress or the whole state of the interactive process, and for example, the interactive operation may be: the client end is invited to carry out authentication operation on the interactive game, the client end is invited to carry out pre-starting/closing operation aiming at the interactive process, and the client end is invited to switch the current interactive process into the operation of other interactive processes.
No matter which way the interaction number of the first interaction operation is created, the interaction number of the first interaction operation can be made to be the largest, and when the second client receives the interaction number of the first interaction operation, the current interaction process is determined to be in which state according to the interaction number of the first interaction operation, and then the second client rapidly enters the state. However, when the first client receives the interactive operation of the feedback of the second client, the feedback time is not expected due to the problem of network delay, and the feedback cannot be effective. For example, a first client initiates an invitation operation to a second client, and receives feedback from the second client after 5 minutes due to the network delay, and the number of invited second clients meets the limit of the number of people who start the interactive game, so that the interactive game has already started, and the feedback is obviously invalid.
In a possible implementation manner, 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.
Specifically, for an interactive operation of a non-control type, the interaction number thereof is not generally set, i.e., the state of the default value is maintained.
In a possible implementation manner, the first notification message is received at a first time after the first client sends the first interaction request, and after parsing the first notification message, the method further includes:
when the interaction number in the first type of data carried by the first notification message is determined to be 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 effective operation; and executing corresponding operation according to the first class of data carried by the first notification message by the instruction of the second interactive operation so as to determine the interactive result of the first interactive operation.
After the first type of data corresponding to the second interactive operation is obtained, whether the interaction number in the first type of data carried in the first notification message is the same as the value of the interaction number in the first type of data carried in the first interaction request needs to be compared, and if the comparison result is the same, it indicates that the second interactive operation initiated by the second client is a feedback for the first interactive operation initiated by the first client. Therefore, it is necessary to further determine whether the transmission time of the first notification message meets a preset condition.
Specifically, the interaction operation with the non-null interaction number also has a corresponding feedback time threshold. For example, the feedback time threshold value for the operation of the pre-start interactive game is 30s, and the feedback time threshold value for the authentication operation of the interactive game is 3 s.
In one example, the first interactive operation is an operation of pre-starting an interactive game, and the client participating in the interactive game comprises: the number of the first clients is 1, the number of the second clients is 4, and after 5 persons start the game, the game can be started. After the first client initiates the pre-starting operation, if receiving a feedback operation of successful starting sent by the second client, the first client determines whether the number of the clients which are successfully started at present is 5, and if not, the first client continues to wait. And if 5 clients which are successfully started currently exist, starting the interactive game.
In one possible implementation, the interactive process is an interactive game, and 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 authority for configuring the interactive game exists, determining whether the interactive game is configured on the first client; if the interactive game is configured, determining whether the first client side has the interactive game in operation; if no running interactive game exists, determining whether the function configured by the first client is exclusive to the interactive game; and if the authentication is successful, determining to initiate the first interactive operation.
In one possible implementation, at the stage of initializing the first client, the method includes:
and sending a subscription request to the server, wherein the subscription request carries the identity of the first client and a preset subscription identifier.
The acquisition process of the first notification message comprises the following steps: and if the notification carrying the preset subscription identifier is detected, acquiring a first notification message.
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 the notification message according to the subscription identifier, the client may receive a notification corresponding to the subscription identifier.
It should be noted that, in the embodiment of the present application, the subscription identifiers used when the first client and the second client subscribe to are the same. When the server sends the notification message, the server sends the notification message by combining the subscription identifier and the identity identifier of the client to be sent.
Referring to fig. 2, an embodiment of the present application provides an end-to-end communication method, which is applied to a client. The method includes S210-S220.
S210, responding to a second notification message sent by the server, analyzing the second notification message to obtain first type data corresponding to the first interactive operation; the second 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 first interaction request sent by the first client in response to the first interaction operation.
After the first type of data is obtained, the information of the first interactive operation is obtained according to the first type of data.
S220, responding 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 can transmit the first type of data to the first client according to the second type of data. The first type of data comprises an interaction number and other interaction contents for describing any interaction operation, and the second type of data comprises information for describing an interaction client of any interaction operation.
And if the operation type of the second interactive operation is the control type, the second interactive operation is a feedback operation aiming at the first interactive operation.
Specifically, if the operation type of the second interactive operation is the control type, since the first client is the manager of the interactive process, the second interactive operation can only be the 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 perform feedback after obtaining the processing result, or may not perform 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.
In one example, the interactive process is an interactive game. And if the second interactive operation is a feedback operation aiming at the authentication operation initiated by the first client, the second client feeds back the authentication processing result to the first client after the interactive game is authenticated. If the second interactive operation is the operation of adding the animation initiated by the first client, the second client performs corresponding animation processing according to the received first type of data, so that the purpose can be achieved, and the second client can feed back the processing result to the first client or can not feed back the processing result, which can not affect the progress of the interactive game.
The embodiment of the application provides an end-to-end communication method from the perspective of a second client, which comprises the following steps: if a notification message sent by a server is received, analyzing first type data carried in the notification message, and obtaining information of a first interactive operation; if the second client initiates the interactive operation, transmitting second-class data describing the interactive client in the interactive operation, and first-class data describing interactive contents and interactive numbers of the interactive operation to the server, so that the server can forward the first-class data to the first client according to the second-class data; and if receiving a notification message sent by the server, analyzing the first type of data carried in the notification message. Therefore, the client only needs to provide the second type of data to the server according to the information of the interactive client in each interactive operation, so that the server can assist in the transparent transmission of the first type of data, and interaction between the clients is realized. Therefore, the first type of data corresponding to the interactive operation is set, so that front-end developers can concentrate on the development of the interactive operation belonging to the front-end business, the collaborative requirement on rear-end developers in the development process is reduced, the development period is shortened, and the iteration speed is further improved.
In a possible implementation manner, the interactive process is an interactive game, the operation type of the second interactive operation is a control type, and after obtaining the first type of data corresponding to the first interactive operation, the method may further include:
comparing the interaction number in the first type of data corresponding to the first interaction operation with the historical interaction number with the maximum value; and if the comparison result is larger than the comparison result, caching the interaction number in the first type of data corresponding to the first interaction operation as the interaction number of the second interaction operation.
Specifically, when the operation type of the second interactive operation is the 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 interaction operation is substantially the interaction number of the first interaction operation, and the interaction number of the first interaction operation is stored as the interaction number of the second interaction operation, so that when a second interaction request is generated according to the second interaction operation, the first type of data carried by the second interaction request is determined according to the cached interaction number.
In a possible implementation manner, if the interactive process is an interactive game, the method may further include:
if the first interactive operation is the authentication operation aiming at the interactive game, the authentication operation is carried out according to the first type of data corresponding to the first interactive operation; if the first interactive operation is the operation of 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 the operation of starting the interactive game, starting the interactive game according to the first type of data corresponding to the first interactive operation; and if the first interactive operation is the operation of closing the interactive game, stopping the interactive game according to the first type of data corresponding to the first interactive operation.
The authentication operation aiming at the interactive game, the operation of pre-starting the interactive game, the operation of closing the interactive game and the operation of switching the interactive game all belong to control type operations.
In a possible implementation manner, sending a second interaction request carrying the first type of data and the second type of data to the server includes:
determining second class data according to the information of the first client; determining first-class data according to the second interactive operation, wherein the first-class data carries an interactive number of the second interactive operation; and sending a second interaction request carrying the first type of data and the second type of data to the server through a preset channel.
If the second interactive operation is a control type operation, the second interactive operation is a feedback operation aiming at the first interactive operation, and the interaction number of the second interactive operation is the cached interaction number of the first interactive operation; and if the second interactive operation is a non-control type operation, the interactive number of the second interactive operation is a default value.
In one possible implementation manner, the second interactive operation includes a feedback operation on the first interactive operation, and the initiating of the feedback operation on the first interactive operation includes:
if the triggering operation of accepting the invitation is acquired, the following authentication operations are sequentially carried out for the interactive game: determining whether the first client has the authority to configure the interactive game; if the authority for configuring the interactive game exists, determining whether the interactive game is configured on the first client; if the interactive game is configured, determining whether the first client side has the interactive game in operation; if no running interactive game exists, determining whether the function configured by the first client is exclusive to the interactive game;
wherein, if the authentication is successful, the method further comprises: a feedback operation to the first interaction operation is initiated.
In one possible implementation, at the stage of initializing the second client, the method includes:
and sending a subscription request to the server, wherein the subscription request carries the identity of the second client and a preset subscription identifier.
Wherein, the acquisition process of the second notification message comprises the following steps: and if the notification carrying the preset subscription identifier is detected, acquiring a second notification message.
In one possible implementation, the method further includes:
and responding to a third notification message sent by the server, analyzing the third notification message to obtain first-class data corresponding to the third interactive operation, wherein the third notification message is a message fed back by the server according to second-class data carried in a third interactive request sent by another second client in response to the third interactive operation.
And responding to the determined fourth interactive operation, sending a fourth interactive request carrying the first-class data and the second-class data to the server, so that the server can transmit the first-class data to another second client according to the second-class data.
Specifically, the second type of data carried in the third/fourth interactive requests may include the identifiers of the first client and the second client, or may only include the identifier of the second client. And the third interactive operation and the fourth interactive operation are non-control type operations, so that the interactive number carried in the first type of data and the interactive operation is null.
And the interaction numbers of the second interaction operation, the third interaction operation and the fourth interaction operation are null.
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.
Referring to fig. 3, an embodiment of the present application further provides an end-to-end communication method, which is applied to a server. The method includes steps S310 to S320.
S310, receiving an interaction request which is sent by any client and carries first-class data and second-class data from a preset channel, wherein the first-class data comprises interaction contents describing any interaction operation, and the second-class data comprises interaction client information describing any interaction operation.
S320, determining the client to be interacted according to the second type of data, and sending a notification message carrying the first type of data to the client to be interacted.
Specifically, the interactive request may be the first interactive request, the second interactive request, the third interactive request, and the fourth interactive request. The client to be interacted is a receiving client of the notification message, and can be determined according to the identity of the receiver carried in the second type of data.
In one possible implementation, in the phase of initializing the server, the method further includes:
and responding to a subscription request which is sent by any client and carries the identity identifier of the first client and a preset subscription identifier, and subscribing notification service corresponding to the preset subscription identifier for any client.
The end-to-end communication method provided by the embodiment of the application is suitable for an application scene containing a plurality of client-side interactions, communication data between an opposite end and an end are processed, and then an end-to-end interaction process can be realized through transparent transmission operation of a server side. In order to describe the method shown in the above embodiment more clearly, the embodiment of the present application also provides 3 examples to explain the method shown in the above embodiment in more detail.
Referring to fig. 4a for example, an embodiment of the present application provides a schematic process diagram of interaction between a first client and a second client. In the interaction process, the client and the server communicate through the end-to-end communication method. The process includes steps S1001 to S1009.
S1001: the first client initiates the operation of pre-starting the interactive game.
The method comprises the steps that a first client receives a trigger operation input by a user and asynchronously loads an interactive game; creating an interactive number of the pre-starting operation, and initiating the operation of the interactive game to other clients; a 30s countdown is started to set a time limit for the feedback of the second client.
S1002: the first client sends a first interaction request to the server.
The first interactive request carries the first type data and the second type data. Wherein the first type of data comprises the interaction number of the pre-starting operation and other interaction contents with the starting operation, such as game identification of the interactive game.
S1003: the server determines the notification message.
After receiving the first interactive request, the server acquires the first type of data and the second type of data carried in the first interactive request. And determining the identity of the second client in the second type of data, and creating a notification message according to each identity.
S1004: the server side distributes the notification message. And the server side sends the notification message to the corresponding second client side according to the created notification message.
S1005: the second client asynchronously loads the interactive game.
After receiving the first type of data carried in the notification message, the second client prestores 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.
The 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, and are not described in detail herein because the processing logics are similar.
In addition, after the second client receives the first type of data, the interaction numbers in the first type of data are cached as the interaction numbers of the feedback operation.
S1006: the second client sends a second interaction request.
And after the operation of asynchronously loading the interactive game is finished, the second client prepares to initiate a feedback operation aiming at the pre-starting 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, wherein the first type of data also carries the interaction number of the feedback operation.
The 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, and are not described in detail herein because the processing logics are similar.
S1007: and the server determines the notification message and sends the notification message.
And the server acquires the first type of data and the second type of data carried in the second interactive request after receiving the second interactive request each time, determines a notification message, and sends the notification message carrying the second type of data to the first client.
S1008: the first client judges whether the interactive game can be started.
After receiving the notification message every time, the first client acquires an interaction number in the second class data carried by the notification message, if the interaction number is the same as the interaction number of the pre-starting operation, whether the receiving time of the notification message is within 30s is continuously judged, and if the receiving time of the notification message is within 30s, the feedback operation is effective; if not within 30s, the feedback operation is disabled.
Further, based on the effective feedback operation, the processing result of the asynchronous loading interactive game of the corresponding second client is determined according to the first type of message, and the number of the second clients successful in the asynchronous loading interactive game is counted.
S1009: and starting the interactive game.
And if the number of the first client and the second client which are successful in the asynchronous loading of the interactive game is within the number range required by the interactive game, determining to start the interactive game.
Since the operation of starting the interactive game also belongs to the control type operation, the interaction process of the first client and the second client may refer to S1001 to S1009, and is not described again for simplicity and convenience of description.
The following description will take the application scenario as the interactive game a in the live broadcast and live broadcast scenarios as an example. The number of the players of the interactive game A is limited to 5-8, namely, the interactive game A comprises a homeowner player and 4-7 tenant players. The client configured by the tenant player may correspond to the first client, and the client configured by the tenant player may correspond to the second client.
In this example, it may be determined that the homeowner player and the tenant player communicate with each other through a preset communication protocol, which may refer to the peer-to-peer communication method shown in the embodiment of the present application.
See fig. 4b for example: and starting the process of the interactive game A, wherein the process comprises a pre-starting operation and a starting game operation.
S2001, the homeowner player initiates a pre-start operation for the interactive game A.
On one hand, the homeowner player pre-starts the interactive game a according to the UUID (corresponding to the game identifier in the above embodiment) of the interactive game a; on the other hand, a pre-starting operation for the interactive game A is initiated to all the tenant players according to a preset communication protocol. Before initiating the operation of the pre-starting game, an interaction number a101 corresponding to the pre-starting operation needs to be created. Wherein, the interaction number is obtained by adding 1 to the interaction number A100 of the previous operation.
Wherein, the server can send the notice message of the interactive game A to each tenant player to initiate the pre-starting operation: the terminal of the tenant player firstly sends first type data (including A101 and UUID of the interactive game A) and second type data to the server, the server determines the audience terminal (namely the terminal of the tenant player) of the notification message according to the identity of all the tenant players included in the second type data, and the first type data is transmitted to the terminal of the corresponding tenant player.
S2002, the tenant player pre-starts the interactive game A.
After any tenant player receives the notification message, firstly, an interaction number A101 of the pre-starting operation is obtained and cached as an interaction number of the feedback operation; and then, acquiring the UUID of the interactive game A, and asynchronously loading the interactive game A according to the UUID. If the loading is successful, initiating an operation of feeding back the success of the pre-starting game to the player of the house owner; and if the loading fails, feeding back the operation of the game failure of the pre-starting to the player of the house owner.
Wherein, the feedback operation can be initiated by the server side sending a notification message for feeding back the success/failure of the pre-start to the player of the homeowner. The terminal of the tenant player firstly sends first type data (carrying the cached A101 and the result of pre-starting success/failure) and second type data to the server, and the server determines the audience terminal (namely the terminal of the tenant player) of the notification message according to the second type data including the identity of the tenant player and transmits the first type data to the terminal of the corresponding tenant player.
In one example, the process of the terminal pre-starting the game may include: and running the environment or resource required by the interactive game A, and opening the small program corresponding to the interactive game A.
S2003, the homeowner player receives feedback from the visitor player and counts the number of "pre-boot success".
And counting the number of the people who are successfully pre-started every time the player of the house owner receives the feedback of the player of the house owner, and judging whether the total number of the people meets the condition. If all the feedback is received, if the number of the tenant players with 'successful pre-starting' is not 3, ending the interactive game A; if the homeowner player fails to pre-start, ending the interactive game A; otherwise, S2004 is entered.
S2004, the homeowner player initiates an operation to start the game.
The homeowner player initiates a game start operation to all tenant players. Here, the interaction number of initiating the operation of starting the game is a 102. Wherein, the operation of starting the game can be initiated by the server side sending a notification message of starting the interactive game a to each tenant player.
S2005, the tenant player feeds back a success message to the homeowner player to start the game.
Wherein, the feedback operation can be initiated by the server side sending a notification message of the processing result of starting the game to the homeowner player.
Specifically, the operation of starting the game initiated by the player is essentially to call back the successful process of starting the interactive game a to the server of the interactive game a.
S2006, the homeowner player and the tenant player enter the interaction moment of the interactive game A.
To this end, the homeowner player and the tenant player may begin to enter the interactive game A for interaction.
See fig. 4c for an example: and switching the interactive game A into a process of the interactive game B, wherein the process comprises game stopping operation, authentication operation and switching operation. Wherein if the homeowner player and the guest player are in interactive game A
S3001, the homeowner player initiates an operation to stop the interactive game a.
After determining that the player needs to switch to the interactive game B, if the interactive game A is currently played, the homeowner player stops the running of the interactive game A and initiates game stopping operation to other players. Wherein, the server can send a notification message for starting the interactive game A to each tenant player to initiate the game operation stop.
Wherein, the interaction number for initiating the game stop operation is a 103.
S3002, the tenant player feeds back the result of the process of stopping the game to the homeowner player.
Each tenant player, after receiving the notification message, stops the execution of the interactive game a, and initiates an operation of feeding back the result of the processing of stopping the game to the homeowner player. Wherein, the server can send a notification message of the processing result of stopping the game to the player of the homeowner to feed back the processing result of stopping the game.
S3003, the homeowner player initiates an authentication operation.
On one hand, the homeowner player performs authentication operation on the interactive game B; on the other hand, the homeowner player also initiates an authentication operation with other tenant players. Specifically, the authentication operation may be initiated by a notification message for the authentication operation of the interactive game B sent by the server to each tenant player. The interaction number for initiating the authentication operation is a 104.
Wherein, when initiating the authentication operation to other tenant players, the 3s countdown operation can also be started.
S3004, the tenant player feeds back the processing result of the authentication operation.
The server side can send a notification message of the processing result of the authentication operation to the homeowner player to feed back the processing result of the authentication operation.
And S3005, the homeowner player counts the tenant player passing the authentication.
And after the homeowner player receives the notification message sent by the server, counting the processing result of the authentication operation fed back by each tenant player, and further determining the number of players meeting the conditions. Wherein, the players meeting the condition feedback the processing result as the authenticated tenant player and the authenticated homeowner player within 3 s. After determining that the number of eligible players meets the limit of the number of persons in the interactive game B, S3006 is performed.
S3006, the house owner player initiates the game switching operation.
The homeowner player initiates a switch game operation to the other tenant player. Specifically, the switching game operation may be initiated by the server sending a notification message for switching the interactive game a to the interactive game B to each tenant player. Wherein, the interaction number for initiating the authentication operation is a 105.
S3007, the tenant player feeds back the processing result of the switching game operation.
The server can send a notification message of the processing result of the switching game to the homeowner player to feed back the processing result of the switching game operation.
S3008, the homeowner player counts the feedback of the switching game operation.
And after receiving the notification message sent by the server, the homeowner player counts the processing results of the game switching operation of all the users and determines whether to enter the interactive game B.
At this point, the process of switching the interactive game a to the interactive game B is finished.
Referring to fig. 5, an embodiment of the present application further provides an end-to-end communication apparatus 500, where the apparatus 500 may be applied to a first client, and the first client is a controller of an interaction process; the device includes:
the first transceiver module 510 is configured to send, in response to the first interactive operation, a first 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 second client according to the second type of data;
the first processing module 520 is configured to respond to a first notification message sent by the server, and analyze the first notification message to obtain first type 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 a second interaction request sent by the second client in response to the second interaction operation;
the first type of data comprises an interaction number and other interaction contents for describing any interaction operation; the second type of data includes information describing the interactive client of any interactive operation.
In a possible implementation manner, 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 is specifically configured to, in sending a first interactive request carrying the first type of data and the second type of data to the server,:
determining second type data according to a second client corresponding to the first interactive operation; determining first-class data according to the first interactive operation, wherein the first-class data comprises an interactive number of the first interactive operation; and sending the first interaction request carrying the first type of data and the second type of data to a server through a preset channel.
In one possible implementation, the process of creating the interaction number of the first interaction operation includes:
and establishing an interaction number according to a preset mode, wherein the numerical value of the interaction number is larger than the maximum numerical value of the historical interaction number.
In a possible implementation manner, the first notification message is received at a first time after the first client sends the first interaction request, and after parsing the first notification message, the first processing module 520 is further configured to:
when the interaction number in the first type of data carried by the first notification message is determined to be 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 effective operation; and executing corresponding operation according to the first class of data carried by the first notification message by the instruction of the second interactive operation so as to determine the interactive result of the first interactive operation.
In one possible implementation, the interactive process is an interactive game, and 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 authority for configuring the interactive game exists, determining whether the interactive game is configured on the first client; if the interactive game is configured, determining whether the first client side has the interactive game in operation; if no running interactive game exists, determining whether the function configured by the first client is exclusive to the interactive game; and if the authentication is successful, determining to initiate the first interactive operation.
In a possible implementation manner, in the stage of initializing the first client, the first transceiver module 510 is further configured to:
sending a subscription request to a server, wherein the subscription request carries the identity of the first client and a preset subscription identifier;
the acquisition process of the first notification message comprises the following steps: and if the notification carrying the preset subscription identifier is detected, acquiring a first notification message.
Referring to fig. 6, an embodiment of the present application further provides an end-to-end communication apparatus 600, which is applied to a second client that receives an invitation to participate in an interaction process; the device includes:
the second processing module 610, in response to the second notification message sent by the server, analyzes the second notification message to obtain first type data corresponding to the first interactive operation; the second 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 first interaction request sent by the first client in response to the first interaction operation.
The second transceiving 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.
The first type of data comprises an interaction number and other interaction contents for describing any interaction operation, and the second type of data comprises information for describing an interaction client of any interaction operation.
In a possible implementation manner, 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, and after the first type of data corresponding to the first interactive operation is obtained, the second processing module 610 may be configured to:
comparing the interaction number in the first type of data corresponding to the first interaction operation with the historical interaction number with the maximum value; and if the comparison result is larger than the comparison result, caching the interaction number in the first type of data corresponding to the first interaction operation as the interaction number of the second interaction operation.
In a possible implementation manner, the interaction process is an interactive game, and after obtaining the first type of data corresponding to the first interaction operation, the second processing module 610 may further be configured to:
if the first interactive operation is the authentication operation aiming at the interactive game, the authentication operation is carried out according to the first type of data corresponding to the first interactive operation; if the first interactive operation is the operation of 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 the operation of starting the interactive game, starting the interactive game according to the first type of data corresponding to the first interactive operation; and if the first interactive operation is the operation of closing the interactive game, stopping the interactive game according to the first type of data corresponding to the first interactive operation.
In a possible implementation manner, 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:
determining second class data according to the information of the first client; determining first type data according to the second interactive operation, wherein the first type data carries an interactive number of the second interactive operation; and sending a second interaction request carrying the first type of data and the second type of data to the server through a preset channel.
In a possible implementation manner, the second processing module 610, in performing an authentication operation according to the first type of data, is specifically configured to:
if the triggering operation of accepting the invitation is acquired, the following authentication operations are sequentially carried out for the interactive game: determining whether the second client has the authority to configure the interactive game; if the authority for configuring the interactive game exists, determining whether the interactive game is configured on the second client; if the interactive game is configured, determining whether the second client side has the interactive game in operation; if no running interactive game exists, determining whether the function configured by the second client is exclusive to the interactive game;
wherein, if the authentication is successful, the second processing module 610 is further configured to: a feedback operation to the first interaction operation is initiated.
In a possible implementation manner, in the stage of initializing the second client, the second transceiver module 620 is configured to:
sending a subscription request to the server, wherein the subscription request carries the identity of the second client and a preset subscription identifier; wherein, the acquisition process of the second notification message comprises the following steps: and if the notification carrying the preset subscription identifier is detected, acquiring a second notification message.
In one possible implementation manner, the second transceiver module 620 is further configured to:
responding to a third notification message sent by the server, analyzing the third notification message to obtain first type data corresponding to a third interactive operation, wherein the third notification message is a message fed back by the server according to second type data carried in a third interactive request sent by another second client in response to the third interactive operation;
and responding to the determined fourth interactive operation, sending a fourth interactive request carrying the first-class data and the second-class data to the server, so that the server can transmit the first-class data to another client according to the second-class data.
Referring to fig. 7, an end-to-end communication apparatus 700 is further provided in the embodiment of the present application, and is applied to a server, where the server is configured to forward communication data related to an interactive operation between a first client and a second client; the apparatus 700 comprises:
a third transceiver module 710, configured to receive, from a preset channel, an interaction request that is sent by any client and carries first-class data and second-class data, where the first-class data includes an interaction number and other interaction contents that describe any interaction operation, and the second-class data includes information that describes an interaction client of any interaction operation;
the third processing module 720 is configured to determine the client to be interacted according to the second type of data, and send a notification message carrying the first type of data to the client to be interacted through the third transceiver module 710.
The apparatus of the embodiment of the present application may execute the method provided by the embodiment of the present application, and the implementation principle is similar, the actions executed by the modules in the apparatus of the embodiments of the present application correspond to the steps in the method of the embodiments of the present application, and for the detailed functional description of the modules of the apparatus, reference may be specifically made to the description in the corresponding method shown in the foregoing, and details are not repeated here.
The embodiment of the present application provides an electronic device, which includes a memory, a processor, and a computer program stored on the memory, where the processor executes the computer program to implement the steps of the peer-to-peer communication method shown in the embodiment of the present application, and compared with the related art, the electronic device may implement: the client side only needs to provide the second type of data to the server side according to the information of the interactive client side of each interactive operation, so that the server side can assist in transmitting the first type of data describing the interactive content of the interactive operation, and interaction between the client sides is achieved. The communication method provided by the embodiment of the application can enable front-end developers to concentrate on the development of front-end services, reduce the collaborative requirements on rear-end developers in the development process, shorten the development period and further improve the iteration speed.
In an alternative embodiment, an electronic device is provided, as shown in FIG. 8, the electronic device 8000 shown in FIG. 8 including: a processor 8001 and memory 8003. Processor 8001 is coupled to memory 8003, such as via bus 8002. Optionally, the electronic device 8000 may further include a transceiver 8004, and the transceiver 8004 may be used for data interaction between the electronic device and other electronic devices, such as transmission of data and/or reception of data. In addition, the transceiver 8004 is not limited to one in practical applications, and the structure of the electronic device 8000 does not limit the embodiment of the present application.
Processor 8001 may be a CPU (Central Processing Unit), general purpose Processor, DSP (Digital Signal Processor), ASIC (Application Specific Integrated Circuit), FPGA (Field Programmable Gate Array), or other Programmable logic device, transistor logic device, hardware component, or any combination thereof. Which may implement or perform the various illustrative logical blocks, modules, and circuits described in connection with the disclosure. Processor 8001 may also be a combination that implements computing functionality, e.g., comprising one or more microprocessor combinations, DSP and microprocessor combinations, and so forth.
Bus 8002 may include a path to transfer information between the aforementioned components. The bus 8002 may be a PCI (Peripheral Component Interconnect) bus, an EISA (Extended Industry Standard Architecture) bus, or the like. The bus 8002 may be divided into an address bus, a data bus, a control bus, and the like. For ease of illustration, only one thick line is shown in FIG. 8, but this is not intended to represent only one bus or type of bus.
The Memory 8003 may 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, an EEPROM (Electrically Erasable Programmable Read Only Memory), a CD-ROM (Compact Disc Read Only Memory) or other optical Disc storage, optical Disc storage (including Compact Disc, laser Disc, optical Disc, digital versatile Disc, blu-ray Disc, etc.), a magnetic Disc storage medium, other magnetic storage devices, or any other medium that can be used to carry or store a computer program and that can be Read by a computer, without limitation.
The memory 8003 is used to store computer programs for executing the embodiments of the present application, and is controlled by the processor 8001 to execute the programs. The processor 8001 is used to execute computer programs stored in the memory 8003 to implement the steps shown in the foregoing method embodiments.
Embodiments of the present application provide a computer-readable storage medium, on which a computer program is stored, and when being executed by a processor, the computer program may implement the steps and corresponding contents of the foregoing method embodiments.
Embodiments of the present application further provide a computer program product, which includes a computer program, and when the computer program is executed by a processor, the steps and corresponding contents of the foregoing method embodiments can be implemented.
The terms "first," "second," "third," "fourth," "1," "2," and the like in the description and in the claims of the present application and in the above-described drawings (if any) are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It should be understood that the data so used are interchangeable under appropriate circumstances such that the embodiments of the application described herein are capable of operation in other sequences than illustrated or otherwise described herein.
It should be understood that, although each operation step is indicated by an arrow in the flowchart of the embodiment of the present application, the implementation order of the steps is not limited to the order indicated by the arrow. In some implementation scenarios of the embodiments of the present application, the implementation steps in the flowcharts may be performed in other sequences as desired, unless explicitly stated otherwise herein. In addition, some or all of the steps in each flowchart may include multiple sub-steps or multiple stages based on an actual implementation scenario. Some or all of these sub-steps or stages may be performed at the same time, or each of these sub-steps or stages may be performed at different times, respectively. In a scenario where execution times are different, an execution sequence of the sub-steps or the phases may be flexibly configured according to requirements, which is not limited in the embodiment of the present application.
The foregoing is only an optional implementation manner of a part of implementation scenarios in this application, and it should be noted that, for those skilled in the art, other similar implementation means based on the technical idea of this application are also within the protection scope of the embodiments of this application without departing from the technical idea of this application.

Claims (21)

1. An end-to-end communication method is applied to a first client; the first client is a management and control party of the interactive process, and the method comprises the following steps:
responding to a first interactive operation, sending a first interactive request carrying first-class data and second-class data to a server, so that the server can transmit the first-class data to a second client according to the second-class data;
responding to a first notification message sent by the server, and analyzing the first notification message to obtain first-class data corresponding to a second interactive operation; the first notification message is a message fed back by the server according to first-class data and second-class data carried in a second interaction request sent by a second client in response to the second interaction operation;
wherein the first type of data comprises an interaction number and other interaction contents which describe any interaction operation; the second type of data includes information describing the interactive client of any interactive operation.
2. The method according to claim 1, wherein 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, and the sending the first interactive request carrying the first type of data and the second type of data to the server includes:
determining the second type of data according to a second client corresponding to the first interactive operation;
determining the first type of data according to the first interactive operation, wherein the first type of data comprises an interactive number of the first interactive operation;
and sending the first interaction request carrying the first type of data and the second type of data to a server through a preset channel.
3. The method of claim 2, wherein creating the interaction number for the first interaction operation comprises:
and creating the interaction number of the first interaction operation according to a preset mode, wherein the numerical value of the interaction number of the first interaction operation is larger than the maximum numerical value of the historical interaction number.
4. The method of claim 2 or 3, wherein the first notification message is received a first time after the first client sends the first interactive request, and wherein after parsing the first notification message, the method further comprises:
determining a feedback time threshold corresponding to the first interactive 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 interactive request;
if the first time is within the feedback time threshold, determining that the second interactive operation is effective operation;
and executing corresponding operation according to the first class of data carried by the first notification message under the instruction of the second interactive operation so as to determine an interactive result of the first interactive operation.
5. The method of claim 2, wherein the interactive process is an interactive game, and prior to initiating the first interactive operation, the method comprises:
and aiming at the interactive game, sequentially carrying out the following authentication operations: determining whether the first client has the authority to configure the interactive game; if the authority for configuring the interactive game exists, determining whether the interactive game is configured on the first client; if the interactive game is configured, determining whether the first client side has the interactive game in operation; if no running interactive game exists, determining whether the function configured by the first client is exclusive to the interactive game;
and if the authentication is successful, determining to initiate the first interactive operation.
6. The method according to claim 1, characterized in that, at the stage of initializing said first client, it comprises:
sending a subscription request to the server, wherein the subscription request carries the identity of the first client and a preset subscription identifier;
wherein, the acquiring process of the first notification message comprises:
and if the notification carrying the preset subscription identifier is detected, acquiring the first notification message.
7. A method of peer-to-peer communication, the method being applied to a second client receiving an invitation to participate in an interactive process; the method comprises the following steps:
responding to a second notification message sent by a server, and analyzing the second notification message to obtain first type data corresponding to a first interactive operation; the second 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 a first interaction request sent by the first client in response to the first interaction operation;
responding to the determined 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 can transmit the first type of data to the first client according to the second type of data;
the first type of data comprises an interaction number and other interaction contents for describing any interaction operation, and the second type of data comprises information for describing an interaction client of any interaction operation.
8. The method of claim 7, wherein 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, and after obtaining the first type of data corresponding to the first interactive operation, the method further comprises:
comparing the interaction number in the first type of data corresponding to the first interaction operation with the historical interaction number with the maximum value;
and if the comparison result is greater than the comparison result, caching the interaction number in the first type of data corresponding to the first interaction operation as the interaction number of the second interaction operation.
9. The method of claim 8, wherein the interactive process is an interactive game, and after obtaining the first type of data corresponding to the first interactive operation, the method further comprises:
if the first interactive operation is the authentication operation aiming at the interactive game, performing the authentication operation according to the first type of data corresponding to the first interactive operation;
if the first interactive operation is the operation of 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 the operation of starting the interactive game, starting the interactive game according to the first type of data corresponding to the first interactive operation;
and if the first interactive operation is the operation of closing the interactive game, stopping the interactive game according to the first type of data corresponding to the first interactive operation.
10. The method according to claim 8 or 9, wherein the sending the second interaction request carrying the first type of data and the second type of data to the server comprises:
determining the second class of data according to the information of the first client;
determining the first type of data according to the second interactive operation, wherein the first type of data carries an interactive number of the second interactive operation;
and sending the second interaction request carrying the first type of data and the second type of data to the server through a preset channel.
11. The method of claim 9, wherein performing an authentication operation based on the first type of data comprises:
if the triggering operation of accepting the invitation is acquired, the following authentication operations are sequentially carried out for the interactive game: determining whether the second client has the authority to configure the interactive game; if the authority for configuring the interactive game exists, determining whether the interactive game is configured on the second client; if the interactive game is configured, determining whether the second client side has the interactive game in operation; if no running interactive game exists, determining whether the function configured by the second client is exclusive to the interactive game;
wherein, if the authentication is successful, the method further comprises: initiating a feedback operation for the first interaction operation.
12. The method according to claim 7, characterized in that, in the phase of initializing the second client, it comprises:
sending a subscription request to the server, wherein the subscription request carries the identity of the second client and a preset subscription identifier;
wherein the acquiring process of the second notification message comprises:
and if the notification carrying the preset subscription identifier is detected, acquiring the second notification message.
13. The method of claim 7, further comprising:
responding to a third notification message sent by a server, analyzing the third notification message to obtain first-class data corresponding to a third interactive operation, wherein the third notification message is a message fed back by the server according to second-class data carried in a third interactive request sent by another second client in response to the third interactive operation;
and responding to the determined fourth interactive operation, and sending a fourth interactive request carrying the first type of data and the second type of data to the server, so that the server can transmit the first type of data to the other second client according to the second type of data.
14. An end-to-end communication method is applied to a server, and the server is used for forwarding communication data related to interactive operation between a first client and a second client; the method comprises the following steps:
receiving an interaction request which is sent by any client and carries first-class data and second-class data from a preset channel, wherein the first-class data comprises an interaction number and other interaction contents for describing any interaction operation, and the second-class data comprises information for describing the interaction client of any interaction operation;
and determining a client to be interacted according to the second type of data, and sending a notification message carrying the first type of data to the client to be interacted.
15. The method of claim 14, wherein in initializing the server phase, the method further comprises:
and responding to a subscription request which is sent by any client and carries the identity identifier of the first client and a preset subscription identifier, and subscribing notification services corresponding to the preset subscription identifier for any client.
16. An end-to-end communication device is applied to a first client, wherein the first client is a controller of an interactive process; the device comprises:
the first transceiver module is used for responding to a first interactive operation and sending a first interactive request carrying first-class data and second-class data to a server so that the server can transmit the first-class data to a second client according to the second-class data;
the first processing module is used for responding to a first notification message sent by the server and analyzing the first notification message to obtain first-class data corresponding to a second interactive operation; the first notification message is a message fed back by the server according to first-class data and second-class data carried in a second interaction request sent by a second client in response to the second interaction operation;
wherein the first type of data comprises an interaction number and other interaction contents which describe any interaction operation; the second type of data includes information describing the interactive client of any interactive operation.
17. An end-to-end communication device, adapted to receive a second client having an invitation to participate in an interactive process; the device comprises:
the second processing module is used for responding to a second notification message sent by the server and analyzing the second notification message to obtain first type data corresponding to the first interactive operation; the second 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 a first interaction request sent by the first client in response to the first interaction operation;
the second transceiver module is configured to send a second interaction request carrying the first type of data and the second type of data to the server in response to the determined second interaction operation, 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 comprises an interaction number and other interaction contents for describing any interaction operation, and the second type of data comprises information for describing an interaction client of any interaction operation.
18. An end-to-end communication device is applied to a server, and the server is used for forwarding communication data related to interactive operation between a first client and a second client; the device comprises:
a third receiving module, configured to receive, from a preset channel, an interaction request that is sent by any client and carries first-class data and second-class data, where the first-class data includes an interaction number and other interaction contents describing any interaction operation, and the second-class data includes information describing an interaction client of any interaction operation;
and the third processing module is used for determining a client to be interacted according to the second type of data and sending a notification message carrying the first type of data to the client to be interacted through the transceiving module.
19. An electronic device comprising a memory, a processor and a computer program stored on the memory, characterized in that the processor executes the computer program to implement the steps of the method of any of claims 1-6, 7-13 or 14-15.
20. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 6, claims 7 to 13 or claims 14 to 15.
21. A computer program product comprising a computer program, characterized in that the computer program realizes the steps of the method of any of claims 1-6, claims 7-13 or claims 14-15 when executed by a processor.
CN202210389524.9A 2022-04-13 2022-04-13 End-to-end communication method, device, equipment, storage medium and program product Pending CN114827164A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210389524.9A CN114827164A (en) 2022-04-13 2022-04-13 End-to-end communication method, device, equipment, storage medium and program product

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210389524.9A CN114827164A (en) 2022-04-13 2022-04-13 End-to-end communication method, device, equipment, storage medium and program product

Publications (1)

Publication Number Publication Date
CN114827164A true CN114827164A (en) 2022-07-29

Family

ID=82536712

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210389524.9A Pending CN114827164A (en) 2022-04-13 2022-04-13 End-to-end communication method, device, equipment, storage medium and program product

Country Status (1)

Country Link
CN (1) CN114827164A (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111491214A (en) * 2020-04-09 2020-08-04 网易(杭州)网络有限公司 Live broadcast interaction method and system based on cloud game, electronic device and storage medium
CN111643894A (en) * 2019-03-04 2020-09-11 北京柏林互动科技有限公司 Data inter-transmission method, device, equipment and computer readable storage medium

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111643894A (en) * 2019-03-04 2020-09-11 北京柏林互动科技有限公司 Data inter-transmission method, device, equipment and computer readable storage medium
CN111491214A (en) * 2020-04-09 2020-08-04 网易(杭州)网络有限公司 Live broadcast interaction method and system based on cloud game, electronic device and storage medium

Similar Documents

Publication Publication Date Title
US9374682B2 (en) Method and system for managing real-time audio broadcasts among a group of users
CN112235121B (en) Method, device, equipment and storage medium for realizing online conference
EP2122922B1 (en) Remote control using instant messaging
EP4203478A1 (en) Multi-user live streaming method and apparatus, terminal, server, and storage medium
US7433344B2 (en) Mobile communication system and method for providing real time messenger service among mobile communication terminals
WO2017172654A1 (en) Making a dialogue available to an autonomous software agent
WO2017172651A1 (en) Selecting an autonomous software agent
WO2014043274A2 (en) Systems and methods for generating electronic meeting invitations in video communications and other services
CN111385666B (en) Communication link establishing method, device, equipment and storage medium
US7593988B2 (en) Systems and methods for multiparty session invite
CN113157466A (en) Message pushing method, device, system, electronic equipment and storage medium
CN111880865A (en) Multimedia data pushing method and device, electronic equipment and storage medium
US20230051868A1 (en) Livestreaming Interaction Method And Apparatus, Electronic Device, And Computer Readable Storage Medium
US20240106772A1 (en) Real time chat system and apparatus, device, and storage medium
CN111277544B (en) Communication method, system and related equipment
US20220021715A1 (en) Live streaming method and apparatus, device and computer readable storage medium
CN114827164A (en) End-to-end communication method, device, equipment, storage medium and program product
CN108989404B (en) Barrage message issuing method, server, system and storage medium
CN107995201B (en) Data transmission method and device, server and storage medium
CN108635862B (en) Operation control method, device and storage medium
US11924288B2 (en) Methods and systems for transferring a user session between devices
CN112511884B (en) Mixed flow control method, system and storage medium for audio and video flow
CN114095615A (en) Session establishment method, device, equipment and storage medium
KR20020022564A (en) Method and system for communicating the voice in user group by means of internet broadcasting
CN101305623A (en) Method and apparatus for determining PT server having controlling function

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination