Method, system, device and medium for real-time short-connection card battle

By changing the storage method of interactive data in real-time card battle games, reducing the polling requests from clients to the server, solving the problem of excessive server load caused by short HTTP connections, and achieving lower server pressure.

CN114432694BActive Publication Date: 2025-02-28XIAMEN YOUDONG NETWORK TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210011183.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-01-06
Publication Date
2025-02-28
Estimated Expiration
2042-01-06

AI Technical Summary

Technical Problem

Card real-time battle games based on HTTP short connections have caused excessive server load, and the existing technology has not yet proposed an effective solution.

Method used

By changing the storage method of interactive data between the two parties, the battle situation is written to the respective data storage areas of both parties after playing cards, reducing the polling requests from the client to the server.

Benefits of technology

Reduces the number of times that need to be polled in the card function, reduces the pressure on the server, and solves the problem of excessive server load caused by short HTTP connections.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114432694B_ABST
    Figure CN114432694B_ABST
Patent Text Reader

Abstract

The present application relates to a method, system, device and medium for real-time short-connection card battles, wherein the method includes: starting a game and entering the card-playing stage, when the first terminal has played cards and the second terminal has not played cards, polling the game information from the server through the first terminal to determine whether the second terminal has played cards within a preset time period; if the cards have been played, then synchronously storing the game information to the data storage areas of the first terminal and the second terminal respectively, and judging whether the game has ended based on the game information, if not, continuing to enter the card-playing stage to start a new round of games until the game ends; if the cards have not been played, the game ends. Through this application, the problem of excessive server load caused by data transmission based on HTTP short connections is solved, and it is achieved that the number of polling times required in the card function is reduced by changing the storage method of user interaction data without changing the short connection communication framework of the HTTP protocol.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of games, and in particular to a method, system, device and medium for real-time short-link card battles. Background Art

[0002] Currently, real-time card battle games mainly rely on the HTTP protocol for data transmission, and the HTTP protocol is a stateless connection-oriented protocol, that is, the protocol has no memory capability for transaction processing, and the server does not know the status of the client.

[0003] For real-time card battle games that use the HTTP short connection framework, each player's operation in the game will establish an HTTP session connection with the server, and the connection will be terminated once the task is completed. Therefore, when there is an interaction with high real-time requirements, the client needs to continuously poll in various scenarios, which can easily cause excessive server load.

[0004] Currently, no effective solution has been proposed for the problem that data transmission based on HTTP short connections in related technologies causes excessive server load. Summary of the invention

[0005] The embodiments of the present application provide a method, system, device and medium for real-time card battles using short connections, so as to at least solve the problem in the related art that data transmission based on HTTP short connections causes excessive server load.

[0006] In a first aspect, an embodiment of the present application provides a method for real-time battle of short-connection cards, the method comprising:

[0007] Start the game and enter the card-playing phase;

[0008] In the case where the first terminal has played a card and the second terminal has not played a card, querying the server for game information through the first terminal to determine whether the second terminal has played a card within a preset time period;

[0009] If the cards have been played, the game information is synchronously stored in the data storage areas of the first terminal and the second terminal, and it is determined whether the game has ended according to the game information. If not, a new round of game will be started at the card-playing stage until the game ends;

[0010] If no cards are played, the battle ends.

[0011] In some embodiments, before querying the server for game information through the first terminal, the method further includes:

[0012] The card-playing information of the first terminal is stored in the data storage area of ​​the second terminal through the second terminal.

[0013] In some embodiments, determining whether the game has ended according to the game information includes:

[0014] It is determined based on the game information whether the actual number of game rounds is equal to the preset number of game rounds. If so, the game ends. If not, the game continues to enter the card-playing phase to start a new round of game. The game information includes game settlement information and the actual number of game rounds.

[0015] In some embodiments, querying the server for game information through the first terminal includes:

[0016] The first terminal polls the server for game information once every preset time.

[0017] In some embodiments, after the battle ends, the method includes:

[0018] The result of the battle between the first terminal and the second terminal is determined according to the settlement information of each round of the game.

[0019] In a second aspect, an embodiment of the present application provides a system for real-time battles with short-connected cards, the system comprising a battle preparation module and a battle execution module;

[0020] The battle preparation module starts the game and enters the card-playing stage;

[0021] The battle execution module polls the server for game information through the first terminal to determine whether the second terminal has played a card within a preset time period when the first terminal has played a card but the second terminal has not played a card;

[0022] If the cards have been played, the battle execution module synchronously stores the game information in the data storage areas of the first terminal and the second terminal respectively, and determines whether the game has ended according to the game information. If not, it continues to enter the card playing stage to start a new round of game until the game ends;

[0023] If no cards are played, the battle ends.

[0024] In some embodiments, before the battle execution module polls the server for game information through the first terminal, the method further includes:

[0025] The battle execution module stores the card-playing information of the first terminal in the data storage area of ​​the second terminal through the second terminal.

[0026] In some embodiments, the battle execution module determines whether the battle has ended according to the game information, including:

[0027] The battle execution module determines whether the actual number of game rounds is equal to the preset number of game rounds based on the game information. If so, the game ends; if not, the game continues to enter the card-playing stage to start a new round of game, wherein the game information includes game settlement information and the actual number of game rounds.

[0028] In a third aspect, an embodiment of the present application provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the method for real-time short-connection card battle as described in the first aspect above is implemented.

[0029] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method for real-time short-connection card battle as described in the first aspect above.

[0030] Compared with the related art, the embodiment of the present application provides a method, system, device and medium for real-time short-connection card battles. When the game starts and enters the card-playing stage, when the first terminal has played cards and the second terminal has not played cards, the first terminal polls the server for game information to determine whether the second terminal has played cards within a preset time period; if cards have been played, the game information is synchronously stored in the data storage areas of the first terminal and the second terminal respectively, and it is determined whether the game has ended based on the game information. If not, a new round of game will be started in the card-playing stage until the game ends; if cards have not been played, the game ends. The problem of excessive server load caused by data transmission based on HTTP short connections is solved, and the number of polling times required in the card function is reduced by changing the storage method of user interaction data without changing the short connection communication framework of the HTTP protocol, thereby reducing the server pressure. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0032] Figure 1 is a flowchart of the steps of the short connection card real-time battle method according to an embodiment of the present application;

[0033] Figure 2 It is a flowchart of a short connection card real-time battle method according to a specific embodiment of the present application;

[0034] Figure 3 It is a structural block diagram of a short connection card real-time battle method according to an embodiment of the present application;

[0035] Figure 4It is a schematic diagram of the internal structure of an electronic device according to an embodiment of the present application.

[0036] Description of the accompanying drawings: 31. Battle preparation module; 32. Battle execution module. DETAILED DESCRIPTION

[0037] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application is described and illustrated below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application. Based on the embodiments provided in the present application, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present application.

[0038] Obviously, the drawings described below are only some examples or embodiments of the present application. For ordinary technicians in this field, the present application can also be applied to other similar scenarios based on these drawings without creative work. In addition, it can also be understood that although the efforts made in this development process may be complicated and lengthy, for ordinary technicians in this field related to the content disclosed in this application, some changes in design, manufacturing or production based on the technical content disclosed in this application are just conventional technical means, and should not be understood as the content disclosed in this application is insufficient.

[0039] Reference to "embodiments" in this application means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those of ordinary skill in the art that the embodiments described in this application may be combined with other embodiments without conflict.

[0040] Unless otherwise defined, the technical terms or scientific terms involved in this application should be understood by people with ordinary skills in the technical field to which this application belongs. The words "one", "a", "a", "the" and the like involved in this application do not indicate a quantitative limitation, and may represent the singular or plural. The terms "include", "comprise", "have" and any of their variations involved in this application are intended to cover non-exclusive inclusions; for example, a process, method, system, product or device that includes a series of steps or modules (units) is not limited to the listed steps or units, but may also include steps or units that are not listed, or may also include other steps or units inherent to these processes, methods, products or devices. The words "connect", "connected", "coupled" and the like involved in this application are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. The "multiple" involved in this application refers to two or more. "And / or" describes the association relationship of associated objects, indicating that there may be three relationships, for example, "A and / or B" can represent: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the objects before and after are in an "or" relationship. The terms "first", "second", "third", etc. involved in this application are only used to distinguish similar objects and do not represent a specific ordering of the objects.

[0041] In the prior art, the implementation of a card battle game based on short connection communication of HTTP protocol mainly includes the following steps:

[0042] Step 1: Start the game and enter the card-playing stage;

[0043] Step 2: The clients of both parties need to poll the server for game information (to obtain the current game status) to update the interface;

[0044] Step 3: The server responds to the client's request and completes the corresponding calculation. The result is saved in a temporary data table in the public data area and encrypted and transmitted to the client via the JOSN protocol.

[0045] It can be seen that in the prior art, when there is an interaction with high real-time requirements, the client needs to continuously poll the server in various scenarios, which easily leads to the problem of excessive server load.

[0046] Therefore, the present invention proposes a short-connection card real-time battle method, by changing the storage mode of interactive data between the two parties, that is, the battle information is not stored in the public data area of ​​the server, and the battle situation will be written into the data storage area of ​​each party after the cards are played; in the card-playing stage, the party who has not played a card pays attention to its own card-playing time and the opponent's card-playing information, and the party who has played a card pays attention to the opponent's card-playing information. Therefore, since the party who has not played a card has not played a card, there is no need to send a polling request to the server (the card-playing information of the party who has played a card is stored in the data storage area of ​​the party who has not played a card), which reduces the number of polling times required in the card function and alleviates the pressure on the server.

[0047] The present application embodiment provides a method for real-time battle of short-connection cards. Figure 1 is a flowchart of the steps of the short connection card real-time battle method according to an embodiment of the present application, such as Figure 1 As shown, the method comprises the following steps:

[0048] Step S102, starting the game and entering the card-playing stage;

[0049] Step S104, when the first terminal has played a card and the second terminal has not played a card, querying the server for game information through the first terminal to determine whether the second terminal has played a card within a preset time period;

[0050] Step S106, if the cards have been played, then synchronously store the game information in the data storage areas of the first terminal and the second terminal respectively, and determine whether the game has ended according to the game information. If not, continue to enter the card-playing stage to start a new round of game until the game ends;

[0051] Step S108: If no card is played, the game ends.

[0052] Through steps S102 to S108 in the embodiment of the present application, the problem of excessive server load caused by data transmission based on HTTP short connection is solved, and it is achieved that the number of polling times required in the card function is reduced by changing the storage method of user interaction data without changing the short connection communication framework of the HTTP protocol, thereby alleviating the server pressure.

[0053] In some embodiments, before querying the server for game information through the first terminal in step S104, the method further includes:

[0054] The card-playing information of the first terminal is stored in the data storage area of ​​the second terminal through the second terminal.

[0055] In some embodiments, step S106, determining whether the game has ended according to the game information, includes:

[0056] According to the game information, it is determined whether the actual number of game rounds is equal to the preset number of game rounds. If so, the game ends. If not, the game continues to enter the card-playing stage to start a new round of game. The game information includes game settlement information and the actual number of game rounds. Optionally, the preset number of game rounds can be set according to demand.

[0057] In some embodiments, step S104, querying the server for game information through the first terminal includes:

[0058] The first terminal polls the server for game information once every preset time. Optionally, the preset time can be set by comprehensively considering the real-time requirements and the server load.

[0059] In some embodiments, after the battle ends, the method includes:

[0060] The battle result between the first terminal and the second terminal is determined according to the game settlement information of each round.

[0061] The specific embodiment of the present application provides a method for real-time battle of short-connection cards. Figure 2 is a flow chart of a short connection card real-time battle method according to a specific embodiment of the present application, such as Figure 2 As shown, the following steps are included:

[0062] Step 1: After the two sides of the card battle are matched, the battle begins and the battle data is initialized ().

[0063] Step 2: Both parties play cards, and a round of game begins (with a card-playing countdown).

[0064] Step three: determine the card-playing status.

[0065] (1) After both players have played their cards, the game enters the card-playing settlement phase to determine whether the required number of rounds has been met. If not, a new round begins. If met, the duel ends.

[0066] (2) One party plays a card, and the party that plays the card determines whether the other party has played a card:

[0067] If the opponent has not played a card, the player who has played a card will start polling the server every 1 second for the game status until the opponent plays a card or times out (the player who has not played a card does not need to send a polling request to the server because he has not played a card. He only needs to synchronize the current result and continue the game after playing a card or timing out).

[0068] If the opponent has played a card, the game will enter the card settlement process to determine whether the number of rounds is met. If not, a new round will begin. If it is met, the duel will end.

[0069] (3) If neither player plays a card, the duel ends.

[0070] It should be noted that the steps shown in the above process or the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0071] The present application embodiment provides a system for real-time short-link card battles. Figure 3 is a structural block diagram of a short connection card real-time battle method according to an embodiment of the present application, such as Figure 3 As shown, the system includes a battle preparation module 31 and a battle execution module 32;

[0072] The battle preparation module 31 starts the game and enters the card-playing stage;

[0073] When the first terminal has played a card but the second terminal has not played a card, the battle execution module 32 polls the server for game information through the first terminal to determine whether the second terminal has played a card within a preset time period;

[0074] If the cards have been played, the battle execution module 32 will synchronously store the game information in the data storage areas of the first terminal and the second terminal, and determine whether the game has ended according to the game information. If not, it will continue to enter the card-playing stage to start a new round of game until the game ends;

[0075] If no cards are played, the battle ends.

[0076] In some embodiments, before the battle execution module 32 polls the server for game information through the first terminal, the following steps are also included:

[0077] The battle execution module 32 stores the card-playing information of the first terminal in the data storage area of ​​the second terminal through the second terminal.

[0078] In some embodiments, the battle execution module 32 determines whether the battle has ended according to the game information, including:

[0079] The battle execution module 32 determines whether the actual number of game rounds is equal to the preset number of game rounds based on the game information. If so, the game ends. If not, it continues to enter the card-playing stage to start a new round of game. The game information includes game settlement information and the actual number of game rounds.

[0080] It should be noted that the above modules can be functional modules or program modules, and can be implemented by software or hardware. For modules implemented by hardware, the above modules can be located in the same processor; or the above modules can be located in different processors in any combination.

[0081] This embodiment further provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0082] Optionally, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.

[0083] It should be noted that the specific examples in this embodiment can refer to the examples described in the above embodiments and optional implementation modes, and this embodiment will not be described in detail here.

[0084] In addition, in combination with the short-connection card real-time battle method in the above embodiment, the embodiment of the present application can provide a storage medium for implementation. The storage medium stores a computer program; when the computer program is executed by the processor, any of the short-connection card real-time battle methods in the above embodiment is implemented.

[0085] In one embodiment, a computer device is provided, which may be a terminal. The computer device includes a processor, a memory, a network interface, a display screen, and an input device connected via a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, a method for real-time battle of short-connected cards is implemented. The display screen of the computer device may be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device may be a touch layer covered on the display screen, or a key, trackball, or touchpad provided on the housing of the computer device, or an external keyboard, touchpad, or mouse, etc.

[0086] In one embodiment, Figure 4 is a schematic diagram of the internal structure of an electronic device according to an embodiment of the present application, such as Figure 4 As shown, an electronic device is provided, which may be a server, and its internal structure diagram may be as shown in Figure 4As shown. The electronic device includes a processor, a network interface, an internal memory and a non-volatile memory connected through an internal bus, wherein the non-volatile memory stores an operating system, a computer program and a database. The processor is used to provide computing and control capabilities, the network interface is used to communicate with an external terminal through a network connection, the internal memory is used to provide an environment for the operation of the operating system and the computer program, the computer program is executed by the processor to implement a short-connection card real-time battle method, and the database is used to store data.

[0087] Those skilled in the art will understand that Figure 4 The structure shown in the figure is merely a block diagram of a partial structure related to the scheme of the present application, and does not constitute a limitation on the electronic device to which the scheme of the present application is applied. The specific electronic device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.

[0088] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

[0089] Those skilled in the art should understand that the technical features of the above-described embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above-described embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0090] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.

Claims

1. A method for real-time short-connection card battle, characterized in that: The method comprises: Start the game and enter the card-playing phase; In the case where the first terminal has played a card and the second terminal has not played a card, the first terminal queries the server for game information to determine whether the second terminal has played a card within a preset time period, that is, whether the second terminal has played a card before the countdown for playing a card; If the cards have been played, the game information is synchronously stored in the data storage areas of the first terminal and the second terminal respectively, and it is determined whether the actual number of game rounds is equal to the preset number of game rounds according to the game information. If so, the game ends; if not, the game continues to enter the card-playing stage to start a new round until the game ends, wherein the game information includes game settlement information and the actual number of game rounds; If no cards are played, the battle ends.

2. The method according to claim 1, characterized in that Before querying the server for game information through the first terminal, the method further includes: The card-playing information of the first terminal is stored in the data storage area of ​​the second terminal through the second terminal.

3. The method according to claim 1, characterized in that Querying the server for game information through the first terminal includes: The first terminal polls the server for game information once every preset time.

4. The method according to any one of claims 1 to 3, characterized in that: After the battle is over, the method includes: The result of the battle between the first terminal and the second terminal is determined according to the settlement information of each round of the game.

5. A short-connection card real-time battle system, characterized in that: The system includes a battle preparation module and a battle execution module; The battle preparation module starts the game and enters the card-playing stage; The battle execution module, when the first terminal has played a card and the second terminal has not played a card, polls the server for game information through the first terminal to determine whether the second terminal has played a card within a preset time period, that is, whether the second terminal has played a card before the countdown for playing a card; If the cards have been played, the battle execution module synchronously stores the game information in the data storage areas of the first terminal and the second terminal respectively, and determines whether the actual number of game rounds is equal to the preset number of game rounds according to the game information. If so, the game ends; if not, the game continues to enter the card-playing stage to start a new round of game until the game ends, wherein the game information includes game settlement information and the actual number of game rounds; If no cards are played, the battle ends.

6. The system according to claim 5, characterized in that Before the battle execution module polls the server for game information through the first terminal, the method further includes: The battle execution module stores the card-playing information of the first terminal in the data storage area of ​​the second terminal through the second terminal.

7. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to run the computer program to execute the short-connection card real-time battle method according to any one of claims 1 to 4.

8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method for real-time short-connection card battle as described in any one of claims 1 to 4 is implemented.

Citation Information

Patent Citations

  • Data processing method and device for turn-based game, terminal and server

    CN109847356A

  • System and method for substantially removing chance from a mixed contest of chance and skill

    US20110124397A1