CN111162880B - Data transmission method, device, equipment and storage medium - Google Patents

Data transmission method, device, equipment and storage medium Download PDF

Info

Publication number
CN111162880B
CN111162880B CN201911369315.2A CN201911369315A CN111162880B CN 111162880 B CN111162880 B CN 111162880B CN 201911369315 A CN201911369315 A CN 201911369315A CN 111162880 B CN111162880 B CN 111162880B
Authority
CN
China
Prior art keywords
target
message number
response message
data
server
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.)
Active
Application number
CN201911369315.2A
Other languages
Chinese (zh)
Other versions
CN111162880A (en
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.)
Shanghai Mihoyo Tianming Technology Co Ltd
Original Assignee
Shanghai Mihoyo Tianming 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 Shanghai Mihoyo Tianming Technology Co Ltd filed Critical Shanghai Mihoyo Tianming Technology Co Ltd
Priority to CN201911369315.2A priority Critical patent/CN111162880B/en
Publication of CN111162880A publication Critical patent/CN111162880A/en
Application granted granted Critical
Publication of CN111162880B publication Critical patent/CN111162880B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/12Arrangements for detecting or preventing errors in the information received by using return channel
    • H04L1/16Arrangements for detecting or preventing errors in the information received by using return channel in which the return channel carries supervisory signals, e.g. repetition request signals
    • H04L1/1607Details of the supervisory signal
    • H04L1/1621Group acknowledgement, i.e. the acknowledgement message defining a range of identifiers, e.g. of sequence numbers
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/12Arrangements for detecting or preventing errors in the information received by using return channel
    • H04L1/16Arrangements for detecting or preventing errors in the information received by using return channel in which the return channel carries supervisory signals, e.g. repetition request signals
    • H04L1/18Automatic repetition systems, e.g. Van Duuren systems
    • H04L1/1867Arrangements specially adapted for the transmitter end
    • 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/131Protocols for games, networked simulations or virtual reality
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The embodiment of the invention discloses a data transmission method, a data transmission device, data transmission equipment and a storage medium. The method is applied to the client and comprises the following steps: responding to the click operation of a user on a target game, and sending a group of target data corresponding to the click operation to a server; each target data carries a local message number and a corresponding expected response message number; receiving a group of target response messages corresponding to the target data returned by the server; each target response message carries a target response message number; comparing the target response message numbers carried in all the target response messages with the expected response message numbers carried in all the target data; and if the comparison result is inconsistent, resending the target data matched with the local message number corresponding to the missing expected response message number to the server. The technical scheme of the embodiment of the invention realizes the targeted retransmission of the lost data and prevents the loss of important information under the condition of not influencing the communication efficiency.

Description

Data transmission method, device, equipment and storage medium
Technical Field
The embodiment of the invention relates to the technical field of computers, in particular to a data sending method, a data sending device, data sending equipment and a storage medium.
Background
At present, when a client interacts with a server, considering that if all game data need handshake authentication to confirm arrival and feedback, more bandwidth resources are consumed, and time is greatly consumed for authentication back and forth, which affects transmission efficiency, so that not all game data are subjected to arrival authentication, which may cause game data loss.
In the prior art, a wired network is generally stable, even if a network is disconnected to cause data loss, after the network is recovered to be normal, data can be guaranteed to arrive according to a Transmission Control Protocol (TCP) Protocol, so that the data loss is not easy to be discovered even if the data is lost.
Disclosure of Invention
Embodiments of the present invention provide a data transmission method, apparatus, device, and storage medium, so as to implement targeted retransmission of lost data and prevent loss of important information without affecting communication efficiency.
In a first aspect, an embodiment of the present invention provides a data sending method, applied to a client, including:
responding to the click operation of a user on a target game, and sending a group of target data corresponding to the click operation to a server; each target data carries a local message number and a corresponding expected response message number;
receiving a group of target response messages corresponding to the target data returned by the server; each target response message carries a target response message number;
comparing the target response message numbers carried in all the target response messages with the expected response message numbers carried in all the target data;
and if the comparison result is inconsistent, resending the target data matched with the local message number corresponding to the missing expected response message number to the server.
Optionally, before responding to a click operation of a user on a target game, sending a set of target data corresponding to the click operation to a server, the method further includes:
establishing a data coding rule and sending the data coding rule to a server; the data encoding rule is used to encode the transmitted data.
Optionally, sending a set of target data corresponding to the click operation to the server in response to the click operation of the user on the target game includes:
responding to the click operation of a user on the target game, and determining a group of target data corresponding to the click operation;
acquiring a current message number of a local label library according to a data coding rule, and taking the current message number as a local message number corresponding to current target data;
acquiring the maximum value of the expected response message number from the sent historical target data according to a data coding rule, and adding 1 to the maximum value to obtain the sum of the expected response message number corresponding to the local message number of the current target data;
and adding the local message number and the expected response message number into the current target data, updating the current target data, and repeatedly executing the operation of acquiring the current message number of the local label library until all the target data are added with the local message number and the expected response message number.
Optionally, before responding to a click operation of a user on the target game, sending a set of target data corresponding to the click operation to the server, the method further includes:
responding to the login operation of a user on a target game, and randomly determining an initial message number of a local label library;
and synchronizing the initial message number of the local label library to the server, and receiving the initial response message number returned by the server.
Optionally, the method further includes:
adding corresponding grade information in each target data in advance;
if the comparison result is inconsistent, the target data matched with the local message number corresponding to the missing expected response message number is retransmitted to the server, and the method comprises the following steps:
if the comparison result is inconsistent, acquiring target level information matched with the local message number corresponding to the missing expected response message number;
if the target level information is in a high level, pausing the target game, resending the target data matched with the local message number corresponding to the missing expected response message number to the server, and recovering the target game after receiving the response message returned by the server;
and if the target grade information is of a low grade, retransmitting the target data matched with the local message number corresponding to the missing expected response message number to the server.
In a second aspect, an embodiment of the present invention further provides a data sending method, applied to a server, including:
receiving a group of target data which is sent by a client and corresponds to the clicking operation of a user; each target data carries a local message number and a corresponding expected response message number;
generating a group of target response messages corresponding to the target data according to the data coding rule; each target response message carries a target response message number corresponding to the expected response message number;
and sending the target response message to the client.
In a third aspect, an embodiment of the present invention further provides a data sending apparatus, applied to a client, including:
the data sending module is used for responding to the click operation of the user on the target game and sending a group of target data corresponding to the click operation to the server; each target data carries a local message number and a corresponding expected response message number;
the response receiving module is used for receiving a group of target response messages which are returned by the server and correspond to the target data; the target response message carries a corresponding response message number;
the message comparison module is used for comparing the response message numbers carried in all the target response messages with the expected response message numbers carried in all the target data;
and the data retransmission module is used for retransmitting the target data matched with the local message number corresponding to the missing expected response message number to the server if the comparison result is inconsistent.
In a fourth aspect, an embodiment of the present invention further provides a data sending apparatus, which is applied to a server, and includes:
the receiving module is used for receiving a group of target data which is sent by the client and corresponds to the clicking operation of the user; each target data carries a local message number and a corresponding expected response message number;
the message generating module is used for generating a group of target response messages corresponding to the target data according to the data coding rule; each target response message carries a target response message number corresponding to the expected response message number;
and the sending module is used for sending the target response message to the client.
In a fifth aspect, an embodiment of the present invention further provides an apparatus, where the apparatus includes:
one or more processors;
a storage device for storing one or more programs,
when the one or more programs are executed by the one or more processors, the one or more processors are caused to implement the data transmission method as provided by any embodiment of the present invention.
In a sixth aspect, the embodiments of the present invention further provide a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the data transmission method according to any embodiment of the present invention.
According to the technical scheme of the embodiment of the invention, the client responds to the click operation of the user on the target game and sends a group of target data to the server; each target data carries a local message number and a corresponding expected response message number; receiving a group of target response messages corresponding to the target data returned by the server; each target response message carries a target response message number; comparing the target response message numbers carried in all the target response messages with the expected response message numbers carried in all the target data; if the comparison result is inconsistent, the target data matched with the local message number corresponding to the missing expected response message number is retransmitted to the server, so that the problem that the game data is lost when the client is disconnected in the prior art is solved, the lost game data is retransmitted in a targeted manner, and important information is prevented from being lost under the condition that the communication efficiency is not influenced.
Drawings
Fig. 1 is a flowchart of a data transmission method according to a first embodiment of the present invention;
fig. 2 is a flowchart of a data transmission method according to a second embodiment of the present invention;
fig. 3 is a schematic structural diagram of a data transmission apparatus according to a third embodiment of the present invention;
fig. 4 is a schematic structural diagram of a data transmission apparatus according to a fourth embodiment of the present invention;
fig. 5 is a schematic structural diagram of an apparatus in the fifth embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be further noted that, for the convenience of description, only some structures related to the present invention are shown in the drawings, not all of them.
Example one
Fig. 1 is a flowchart of a data transmission method in an embodiment of the present invention, and this embodiment is applicable to a case where a network is disconnected during data transmission and data retransmission is performed after a network is reconnected, where the method may be executed by a data transmission apparatus, and the apparatus may be implemented by software and/or hardware, and may be generally integrated in various devices providing data transmission services, such as a client, and used in cooperation with a server. With reference to fig. 1, the method specifically includes the following steps:
step 110, responding to the click operation of the user on the target game, and sending a group of target data corresponding to the click operation to the server.
In this embodiment, the click operation may refer to an operation of a user to click and purchase a game accessory in a target game, an operation of click replacement on a game skin, or another operation. The embodiment can be applied to a scenario in which a network drop occurs in a process of sending target data to a server, and in order to solve a problem of target data loss caused by the network drop, each target data carries a local message number and a corresponding expected response message number, where the local message number is used to record a number of current target data sent to the server in a process of running a game, and the expected response message number corresponding to the local message number is a number of a response message expected to be returned by the server for the target data, and is used to determine whether the target data is lost in a sending process or whether a response message returned by the server is lost.
Optionally, before responding to a click operation of a user on the target game, sending a set of target data corresponding to the click operation to the server, the method may further include: establishing a data coding rule and sending the data coding rule to a server; the data encoding rule is used to encode the transmitted data.
In this embodiment, in order to facilitate determining whether the target data sent to the server is lost, a data coding rule is pre-established for marking each sent target data, so as to record a local number of each target data and a corresponding number of a response message expected to be received back by the server, and simultaneously, the data coding rule is sent to the server, so that the server correspondingly numbers the response message according to the data coding rule.
In this embodiment, the data encoding rule may be: and acquiring the current message number of the local label library, taking the current message number as the local message number corresponding to the current target data, acquiring the maximum number of the response message received from the server in the current running process of the target game, and adding 1 to the maximum number as the expected response message number corresponding to the local message number of the current target data.
Optionally, sending a set of target data corresponding to the click operation to the server in response to the click operation of the user on the target game may include: responding to the click operation of a user on the target game, and determining a group of target data corresponding to the click operation; acquiring a current message number of a local label library according to a data coding rule, and taking the current message number as a local message number corresponding to current target data; acquiring the maximum value of the expected response message number from the sent historical target data according to a data coding rule, and taking the sum of the maximum value plus 1 as the expected response message number corresponding to the local message number of the current target data; and adding the local message number and the expected response message number into the current target data, updating the current target data, and repeatedly executing the operation of acquiring the current message number of the local label library until all the target data are added with the local message number and the expected response message number.
Illustratively, when a click purchase operation of a user on a commodity is detected, it is determined that the server is to transmit target data d1 and d2, at this time, d1 is taken as current target data, a current message number of a local label library is acquired as 9 according to a data encoding rule, a maximum number of a response message received from the server is acquired as 165, 9 is taken as a local message number, 166 is added to d1 as an expected response message number, and then d2 is taken as current target data, at this time, the local message number of d2 is 10, a corresponding expected response message number is 167, numbers 10 and 167 are added to d2, and d1 and d2 are transmitted to the server.
Optionally, before responding to a click operation of a user on the target game, sending a set of target data corresponding to the click operation to the server, the method may further include: responding to the login operation of a user on a target game, and randomly determining an initial message number of a local label library; and synchronizing the initial message number of the local label library to the server, and receiving the initial response message number returned by the server.
In this embodiment, when a user initially logs in a target game, a client establishes a communication link with a server, synchronizes an initial message number, for example, 23, of a randomly determined local label library to the server through the link, and receives an initial response message number, for example, 234, returned by the server, so that in this login, the local message number of the first target data sent to the server by the client is 23, and the corresponding expected response message number is 234.
And step 120, receiving a group of target response messages corresponding to the target data returned by the server.
In this embodiment, each received target response message carries a target response message number added by the server according to the data coding rule, and the target response number is the same as a value of an expected response message number added by the client in the target data, and is used for determining whether there is data loss.
Step 130, comparing the target response message numbers carried in all the target response messages with the expected response message numbers carried in all the target data.
In this embodiment, if a network drop occurs when the client sends the target data, or a network drop occurs after the target data is sent, part of the target data may not reach the server, or the target response message returned by the server may not reach the client, at this time, the target response message numbers carried in all the target response messages are compared with the expected response message numbers carried in all the target data, and if the two numbers are in one-to-one correspondence, it may be determined that no data is lost.
And 140, if the comparison result is inconsistent, resending the target data matched with the local message number corresponding to the missing expected response message number to the server.
In this embodiment, if the comparison result is consistent, it is determined that there is no data loss, and data retransmission is not required, and if the comparison result is inconsistent, it is determined that there is data loss, and at this time, only the local message number of the lost target data needs to be found, and the target data of the number is retransmitted after the network is recovered.
For example, assuming that a set of target data sent by the client is d1, d2, d3, the local message number of d1 is 9, the expected response message number is 166, the local message number of d2 is 10, the expected response message number is 167, the local message number of d3 is 11, the expected response message number is 168, the received set of target response messages is t1, t2, the target response message number of t1 is 166, and the target response message number of t2 is 168, it can be known through comparison that the target response message with the number 167 is not received, and further it is determined that the network is interrupted during sending the target data, the data d2 with the local message number of 10 is lost, and d2 needs to be resent to the server after the network is recovered.
Optionally, the method may further include: adding corresponding grade information in each target data in advance; the level information is used to indicate the importance of the target data, if missing, the processing operation that needs to be performed.
Optionally, if the comparison result is inconsistent, resending the target data matched with the local message number corresponding to the missing expected response message number to the server may include: if the comparison result is inconsistent, acquiring target level information matched with the local message number corresponding to the missing expected response message number; if the target level information is in a high level, pausing the target game, resending the target data matched with the local message number corresponding to the missing expected response message number to the server, and recovering the target game after receiving the response message returned by the server; and if the target grade information is of a low grade, retransmitting the target data matched with the local message number corresponding to the missing expected response unnumbered to the server.
In this embodiment, the loss of the high-level target data may impair the user's benefits, for example, when the user pays the amount of buying a commodity but does not obtain the commodity, the game may be suspended, the lost data is retransmitted to the server after the network is recovered, the event is processed by the server, and the game progress is recovered after the processing.
Optionally, after receiving the target response message returned by the server, the client further performs corresponding processing to the user, for example, a prompt box for successful commodity purchase pops up on the target game interface.
According to the technical scheme of the embodiment of the invention, the client responds to the click operation of the user on the target game and sends a group of target data to the server; each target data carries a local message number and a corresponding expected response message number; receiving a group of target response messages corresponding to the target data returned by the server; each target response message carries a target response message number; comparing the target response message numbers carried in all the target response messages with the expected response message numbers carried in all the target data; if the comparison result is inconsistent, the target data matched with the local message number corresponding to the missing expected response message number is retransmitted to the server, so that the problem that the game data is lost when the client is disconnected in the prior art is solved, the lost game data is retransmitted in a targeted manner, and important information is prevented from being lost under the condition that the communication efficiency is not influenced.
Example two
Fig. 2 is a flowchart of a data transmission method in a second embodiment of the present invention, and this embodiment is applicable to a case where a network is disconnected during data transmission and data retransmission is performed after the network is reconnected, where the method may be executed by a data transmission apparatus, and the apparatus may be implemented by software and/or hardware, and may be generally integrated in various devices providing data transmission services, such as a server, and used in cooperation with a client. With reference to fig. 2, the method specifically includes the following steps:
step 210, receiving a set of target data corresponding to the click operation of the user sent by the client.
In this embodiment, each target data carries a local message number and a corresponding expected response message number. The local message number is used for recording the number of the current target data sent to the server in the running process of the game, and the expected response message number corresponding to the local message number is the number of a response message expected to be returned by the server aiming at the target data, and is used for judging whether the target data is lost in the sending process or whether the response message returned by the server is lost.
Optionally, before receiving the target data, the server receives a data encoding rule sent by the client, where the data encoding rule is used to number a response message corresponding to the target data.
Step 220, generating a set of target response messages corresponding to the target data according to the data encoding rules.
In this embodiment, each target response message carries a target response message number corresponding to an expected response message number, and the target response number is the same as the value of the expected response message number added by the client to the target data, so that the client determines whether there is data loss, and retransmits the lost data, thereby achieving the effect of preventing important information from being lost without affecting communication efficiency.
Step 230, sending the target response message to the client.
In this embodiment, before sending the target response message to the client, the server performs corresponding processing on the received target data, for example, deducting the amount of coins spent by the user to purchase the goods, issuing the purchased goods, decreasing the number of goods in the store, and the like.
According to the technical scheme of the embodiment of the invention, a server receives a group of target data which is sent by a client and corresponds to the clicking operation of a user; each target data carries a local message number and a corresponding expected response message number; generating a group of target response messages corresponding to the target data according to the data coding rule; each target response message carries a target response message number corresponding to the expected response message number; the target response message is sent to the client, so that the client can retransmit the data after determining that the data is lost, the problem that the game data is lost when the client is disconnected in the prior art is solved, the retransmission of the lost game data in a targeted manner is realized, and important information is prevented from being lost under the condition that the communication efficiency is not influenced.
EXAMPLE III
Fig. 3 is a schematic structural diagram of a data transmitting apparatus according to a third embodiment of the present invention, which is applicable to a case where a network disconnection occurs during data transmission and data retransmission is performed after a network reconnection. As shown in fig. 3, the data transmission apparatus, applied to a client, includes:
the data sending module 310 is configured to send, in response to a click operation of a user on a target game, a set of target data corresponding to the click operation to a server; each target data carries a local message number and a corresponding expected response message number;
a response receiving module 320, configured to receive a set of target response messages corresponding to the target data returned by the server; the target response message carries a corresponding response message number;
a message comparison module 330, configured to compare response message numbers carried in all target response messages with expected response message numbers carried in all target data;
and the data retransmission module 340 is configured to, if the comparison result is inconsistent, retransmit the target data that matches the local message number corresponding to the missing expected response message number to the server.
According to the technical scheme of the embodiment of the invention, the client responds to the click operation of the user on the target game and sends a group of target data to the server; each target data carries a local message number and a corresponding expected response message number; receiving a group of target response messages corresponding to the target data returned by the server; each target response message carries a target response message number; comparing the target response message numbers carried in all the target response messages with the expected response message numbers carried in all the target data; if the comparison result is inconsistent, the target data matched with the local message number corresponding to the missing expected response message number is retransmitted to the server, so that the problem that the game data is lost when the client is disconnected in the prior art is solved, the lost game data is retransmitted in a targeted manner, and important information is prevented from being lost under the condition that the communication efficiency is not influenced.
Optionally, the data sending module 310 is further configured to: establishing a data coding rule before responding to the click operation of a user on a target game and sending a group of target data corresponding to the click operation to a server, and sending the data coding rule to the server; the data encoding rule is used to encode the transmitted data.
Optionally, the data sending module 310 is specifically configured to: responding to the click operation of a user on the target game, and determining a group of target data corresponding to the click operation; acquiring a current message number of a local label library according to a data coding rule, and taking the current message number as a local message number corresponding to current target data; acquiring the maximum value of the expected response message number from the sent historical target data according to a data coding rule, and adding 1 to the maximum value to obtain the sum of the expected response message number corresponding to the local message number of the current target data; and adding the local message number and the expected response message number into the current target data, updating the current target data, and repeatedly executing the operation of acquiring the current message number of the local label library until all the target data are added with the local message number and the expected response message number.
Optionally, the data sending module 310 is further configured to: responding to the login operation of the user on the target game and randomly determining the initial message number of the local label library before responding to the click operation of the user on the target game and sending a group of target data corresponding to the click operation to the server; and synchronizing the initial message number of the local label library to the server, and receiving the initial response message number returned by the server.
Optionally, the method further includes: the grade adding module is used for adding corresponding grade information in each target data in advance; the data retransmission module 340 is specifically configured to: if the comparison result is inconsistent, acquiring target level information matched with the local message number corresponding to the missing expected response message number; if the target level information is in a high level, pausing the target game, resending the target data matched with the local message number corresponding to the missing expected response message number to the server, and recovering the target game after receiving the response message returned by the server; and if the target grade information is of a low grade, retransmitting the target data matched with the local message number corresponding to the missing expected response message number to the server.
The data sending device provided by the embodiment of the invention can execute the data sending method applied to the client terminal provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method.
Example four
Fig. 4 is a schematic structural diagram of a data transmission apparatus according to a fourth embodiment of the present invention, and this embodiment is applicable to a case where a network is disconnected during data transmission and data retransmission is performed after the network is reconnected. As shown in fig. 4, the data transmission apparatus applied to a server includes:
a receiving module 410, configured to receive a set of target data sent by a client and corresponding to a click operation of a user; each target data carries a local message number and a corresponding expected response message number;
a message generating module 420, configured to generate a set of target response messages corresponding to the target data according to the data encoding rule; each target response message carries a target response message number corresponding to the expected response message number;
the sending module 430 is configured to send the target response message to the client.
According to the technical scheme of the embodiment of the invention, a server receives a group of target data which is sent by a client and corresponds to the clicking operation of a user; each target data carries a local message number and a corresponding expected response message number; generating a group of target response messages corresponding to the target data according to the data coding rule; each target response message carries a target response message number corresponding to the expected response message number; the target response message is sent to the client, so that the client can retransmit the data after determining that the data is lost, the problem that the game data is lost when the client is disconnected in the prior art is solved, the retransmission of the lost game data in a targeted manner is realized, and important information is prevented from being lost under the condition that the communication efficiency is not influenced.
EXAMPLE five
Fig. 5 is a schematic structural diagram of an apparatus in the fifth embodiment of the present invention. Fig. 5 illustrates a block diagram of an exemplary device 12 suitable for use in implementing embodiments of the present invention. The device 12 shown in fig. 5 is only an example and should not impose any limitation on the functionality and scope of use of embodiments of the present invention.
As shown in FIG. 5, device 12 is in the form of a general purpose computing device. The components of device 12 may include, but are not limited to: one or more processors or processing units 16, a system memory 28, and a bus 18 that couples various system components including the system memory 28 and the processing unit 16.
Bus 18 represents one or more of any of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, and a processor or local bus using any of a variety of bus architectures. By way of example, such architectures include, but are not limited to, Industry Standard Architecture (ISA) bus, micro-channel architecture (MAC) bus, enhanced ISA bus, Video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.
Device 12 typically includes a variety of computer system readable media. Such media may be any available media that is accessible by device 12 and includes both volatile and nonvolatile media, removable and non-removable media.
The system memory 28 may include computer system readable media in the form of volatile memory, such as Random Access Memory (RAM)30 and/or cache memory 32. The device 12 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, storage system 34 may be used to read from and write to non-removable, nonvolatile magnetic media (not shown in FIG. 5, and commonly referred to as a "hard drive"). Although not shown in FIG. 5, a magnetic disk drive for reading from and writing to a removable, nonvolatile magnetic disk (e.g., a "floppy disk") and an optical disk drive for reading from or writing to a removable, nonvolatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to bus 18 by one or more data media interfaces. Memory 28 may include at least one program product having a set (e.g., at least one) of program modules that are configured to carry out the functions of embodiments of the invention.
A program/utility 40 having a set (at least one) of program modules 42 may be stored, for example, in memory 28, such program modules 42 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which examples or some combination thereof may comprise an implementation of a network environment. Program modules 42 generally carry out the functions and/or methodologies of the described embodiments of the invention.
Device 12 may also communicate with one or more external devices 14 (e.g., keyboard, pointing device, display 24, etc.), with one or more devices that enable a user to interact with device 12, and/or with any devices (e.g., network card, modem, etc.) that enable device 12 to communicate with one or more other computing devices. Such communication may be through an input/output (I/O) interface 22. Also, the device 12 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network, such as the Internet) via the network adapter 20. As shown, the network adapter 20 communicates with the other modules of the device 12 via the bus 18. It should be understood that although not shown in the figures, other hardware and/or software modules may be used in conjunction with device 12, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
The processing unit 16 executes various functional applications and data processing, such as implementing a data transmission method provided by an embodiment of the present invention, by running a program stored in the system memory 28.
Namely: the data sending method is applied to a client and comprises the following steps:
responding to the click operation of a user on a target game, and sending a group of target data corresponding to the click operation to a server; each target data carries a local message number and a corresponding expected response message number;
receiving a group of target response messages corresponding to the target data returned by the server; each target response message carries a target response message number;
comparing the target response message numbers carried in all the target response messages with the expected response message numbers carried in all the target data;
and if the comparison result is inconsistent, resending the target data matched with the local message number corresponding to the missing expected response message number to the server.
Or, another data sending method is implemented, applied to a server, and includes:
receiving a group of target data which is sent by a client and corresponds to the clicking operation of a user; each target data carries a local message number and a corresponding expected response message number;
generating a group of target response messages corresponding to the target data according to the data coding rule; each target response message carries a target response message number corresponding to the expected response message number;
and sending the target response message to the client.
Example six
An embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, the program being configured to, when executed by a computer processor, perform a data transmission method.
Namely: the data sending method is applied to a client and comprises the following steps:
responding to the click operation of a user on a target game, and sending a group of target data corresponding to the click operation to a server; each target data carries a local message number and a corresponding expected response message number;
receiving a group of target response messages corresponding to the target data returned by the server; each target response message carries a target response message number;
comparing the target response message numbers carried in all the target response messages with the expected response message numbers carried in all the target data;
and if the comparison result is inconsistent, resending the target data matched with the local message number corresponding to the missing expected response message number to the server.
Or, another data transmission method is executed, applied to a server, and includes:
receiving a group of target data which is sent by a client and corresponds to the clicking operation of a user; each target data carries a local message number and a corresponding expected response message number;
generating a group of target response messages corresponding to the target data according to the data coding rule; each target response message carries a target response message number corresponding to the expected response message number;
and sending the target response message to the client.
Computer storage media for embodiments of the present invention may take the form of any combination of one or more computer-readable media. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
A computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. Those skilled in the art will appreciate that the present invention is not limited to the particular embodiments described herein, and that various obvious changes, rearrangements and substitutions will now be apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims (7)

1. A data transmission method is applied to a client and comprises the following steps:
responding to the click operation of a user on a target game, and sending a group of target data corresponding to the click operation to a server; each target data carries a local message number and a corresponding expected response message number;
receiving a group of target response messages corresponding to the target data returned by the server; each target response message carries a target response message number;
comparing the target response message numbers carried in all the target response messages with the expected response message numbers carried in all the target data;
if the comparison result is inconsistent, target data matched with the local message number corresponding to the missing expected response message number is retransmitted to the server;
the data transmission method further comprises the following steps:
adding corresponding grade information in each target data in advance;
if the comparison result is not consistent, the target data matched with the local message number corresponding to the missing expected response message number is retransmitted to the server, and the method comprises the following steps:
if the comparison result is inconsistent, acquiring target level information matched with the local message number corresponding to the missing expected response message number;
if the target level information is of a high level, pausing the target game, resending target data matched with a local message number corresponding to the missing expected response message number to the server, and recovering the target game after receiving a response message returned by the server;
and if the target grade information is of a low grade, resending the target data matched with the local message number corresponding to the missing expected response message number to the server.
2. The method of claim 1, before sending a set of target data corresponding to a click operation to a server in response to the click operation by a user to a target game, further comprising:
establishing a data coding rule and sending the data coding rule to a server; the data encoding rule is used for encoding the transmitted data.
3. The method of claim 2, wherein in response to a user clicking on a target game, sending a set of target data corresponding to the clicking to a server comprises:
responding to the click operation of a user on a target game, and determining a group of target data corresponding to the click operation;
acquiring the current message number of a local label library according to the data coding rule, and taking the current message number as the local message number corresponding to the current target data;
acquiring the maximum value of the expected response message number from the sent historical target data according to the data coding rule, and taking the sum of the maximum value and 1 as the expected response message number corresponding to the local message number of the current target data;
and adding the local message number and the expected response message number into the current target data, updating the current target data, and repeatedly executing the operation of acquiring the current message number of the local label library until all the target data are added with the local message number and the expected response message number.
4. The method of claim 1, before sending a set of target data corresponding to a click operation to a server in response to the click operation by a user to a target game, further comprising:
responding to the login operation of a user on a target game, and randomly determining an initial message number of a local label library;
and synchronizing the initial message number of the local label library to the server, and receiving an initial response message number returned by the server.
5. A data transmission apparatus, applied to a client, includes:
the data sending module is used for responding to the click operation of a user on a target game and sending a group of target data corresponding to the click operation to the server; each target data carries a local message number and a corresponding expected response message number;
a response receiving module, configured to receive a set of target response messages corresponding to the target data, where the target response messages are returned by the server; the target response message carries a corresponding response message number;
a message comparison module, configured to compare response message numbers carried in all the target response messages with expected response message numbers carried in all the target data;
the data retransmission module is used for retransmitting the target data matched with the local message number corresponding to the missing expected response message number to the server if the comparison result is inconsistent;
the grade adding module is used for adding corresponding grade information in each target data in advance;
the data retransmission module is specifically configured to: if the comparison result is inconsistent, acquiring target level information matched with the local message number corresponding to the missing expected response message number; if the target level information is in a high level, pausing the target game, resending the target data matched with the local message number corresponding to the missing expected response message number to the server, and recovering the target game after receiving the response message returned by the server; and if the target grade information is of a low grade, retransmitting the target data matched with the local message number corresponding to the missing expected response message number to the server.
6. An electronic device, characterized in that the device comprises:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement a data transmission method as recited in any of claims 1-4.
7. A computer-readable storage medium, on which a computer program is stored, which program, when being executed by a processor, is adapted to carry out the data transmission method according to any one of claims 1 to 4.
CN201911369315.2A 2019-12-26 2019-12-26 Data transmission method, device, equipment and storage medium Active CN111162880B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911369315.2A CN111162880B (en) 2019-12-26 2019-12-26 Data transmission method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911369315.2A CN111162880B (en) 2019-12-26 2019-12-26 Data transmission method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN111162880A CN111162880A (en) 2020-05-15
CN111162880B true CN111162880B (en) 2022-09-09

Family

ID=70558524

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911369315.2A Active CN111162880B (en) 2019-12-26 2019-12-26 Data transmission method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111162880B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113965580A (en) * 2020-06-29 2022-01-21 北京字节跳动网络技术有限公司 Method and device for synchronizing messages
CN111901341B (en) * 2020-07-28 2022-05-24 北京字节跳动网络技术有限公司 State synchronization method and device
CN112039753B (en) * 2020-08-31 2024-08-20 北京百度网讯科技有限公司 Message packaging and receiving method, device, electronic equipment and medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105471911A (en) * 2015-12-31 2016-04-06 广州多益网络科技有限公司 Method and system for enhancing stability of network hand-tour game
CN106161190A (en) * 2015-04-02 2016-11-23 北大方正集团有限公司 Point-to-point instant communicating method
CN107147562A (en) * 2017-04-27 2017-09-08 腾讯科技(深圳)有限公司 Message treatment method and device
CN107491356A (en) * 2017-08-28 2017-12-19 广州市百果园信息技术有限公司 Message treatment method, terminal device and server based on sequence number
CN109714352A (en) * 2018-12-29 2019-05-03 北京金山安全软件有限公司 Network data transmission method and device and electronic equipment

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106161190A (en) * 2015-04-02 2016-11-23 北大方正集团有限公司 Point-to-point instant communicating method
CN105471911A (en) * 2015-12-31 2016-04-06 广州多益网络科技有限公司 Method and system for enhancing stability of network hand-tour game
CN107147562A (en) * 2017-04-27 2017-09-08 腾讯科技(深圳)有限公司 Message treatment method and device
CN107491356A (en) * 2017-08-28 2017-12-19 广州市百果园信息技术有限公司 Message treatment method, terminal device and server based on sequence number
CN109714352A (en) * 2018-12-29 2019-05-03 北京金山安全软件有限公司 Network data transmission method and device and electronic equipment

Also Published As

Publication number Publication date
CN111162880A (en) 2020-05-15

Similar Documents

Publication Publication Date Title
CN111162880B (en) Data transmission method, device, equipment and storage medium
JP5656799B2 (en) Appropriate alert delivery method, system and computer program
CN108696589B (en) Block chain data transmission method, device, equipment and storage medium
US20090019123A1 (en) Session Management Enhancements for Instant Messaging Applications
CN101406004A (en) Methods and arrangements to detect a failure in a communication network including bundled adapters
CN105809817B (en) A kind of ATM failure monitoring method and device
CN104199654A (en) Open platform calling method and device
CN110868276A (en) Data transmission method and system for Internet of things equipment and electronic equipment
CN107817962B (en) Remote control method, device, control server and storage medium
US8412844B2 (en) Validating download success
CN109600722B (en) Short message receiving verification method and device, electronic equipment and storage medium
CN114257632B (en) Method and device for reconnecting broken wire, electronic equipment and readable storage medium
CN115333851A (en) Automatic driving data transmission method and device and electronic equipment
CN110798398A (en) Group message management method, device, equipment and medium
CN111013157A (en) Game loading method, device, equipment and storage medium
CN111338642A (en) Method, device, terminal and storage medium for determining application downloading path
CN111552907A (en) Message processing method, device, equipment and storage medium
CN114584556B (en) File transmission method and device
CN110011767B (en) Method and apparatus for TCP connection backup
CN115002183B (en) Information generation method, device, electronic equipment, medium and program product
CN117118876B (en) Heartbeat connection detection method and device, electronic equipment and storage medium
CN110266580B (en) Card message security guarantee method, device, medium and electronic equipment
CN112882838B (en) Method and apparatus for vacating resource instances
CN113988797A (en) Method and device for processing request, storage medium and electronic equipment
CN116866005A (en) Sale terminal host updating method, sub-host updating method and related devices

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
GR01 Patent grant
GR01 Patent grant