CN112354189A - Game data object matching method, device, equipment and storage medium - Google Patents

Game data object matching method, device, equipment and storage medium Download PDF

Info

Publication number
CN112354189A
CN112354189A CN202011321852.2A CN202011321852A CN112354189A CN 112354189 A CN112354189 A CN 112354189A CN 202011321852 A CN202011321852 A CN 202011321852A CN 112354189 A CN112354189 A CN 112354189A
Authority
CN
China
Prior art keywords
data object
data
identifier
matching
object identifier
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.)
Granted
Application number
CN202011321852.2A
Other languages
Chinese (zh)
Other versions
CN112354189B (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.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN202011321852.2A priority Critical patent/CN112354189B/en
Publication of CN112354189A publication Critical patent/CN112354189A/en
Application granted granted Critical
Publication of CN112354189B publication Critical patent/CN112354189B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/60Generating or modifying game content before or while executing the game program, e.g. authoring tools specially adapted for game development or game-integrated level editor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5011Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
    • G06F9/5016Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals the resource being the memory

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Multimedia (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The invention relates to the technical field of games, in particular to a game data object matching method, a device, equipment and a storage medium, wherein the method comprises the following steps: responding to a matching instruction aiming at a data object, and determining a first data object and a second data object to be matched corresponding to the matching instruction; acquiring a first object identifier of the first data object and a second object identifier of the second data object; matching the first object identification with the second object identification to obtain a first matching result; if the first matching result is that the first object identifier is inconsistent with the second object identifier, calling a preset comparison function to match the first data object with the second data object to obtain a second matching result; and correcting the first object identifier and the second object identifier according to the second matching result. The method of the invention can reduce the consumption of the CPU, reduce the memory occupation and improve the performance of the game server.

Description

Game data object matching method, device, equipment and storage medium
Technical Field
The present invention relates to the field of game technologies, and in particular, to a method, an apparatus, a device, and a storage medium for matching game data objects.
Background
With the rapid development of network technology, network games (also called online games, generally electronic games in which multiple players play interactive entertainment through the internet of a computer) are increasingly popular with people. Among the numerous classifications of Online games, Massively Multiplayer Online Role-Playing games (MMORPGs) are the mainstream type.
MMORPGs allow a large number of people to share a virtual experience together by allowing players to interact with each other in smaller and larger groups, and MMORPG players can play one or more virtual characters and control the activity and behavior of the virtual character in a computer-generated virtual (or game) world so that the virtual character can interact with other virtual characters and computer-generated non-player characters. Because of the complex playing method, the large number of players, the various playing methods and the complex logic in the MMORPG game, the game server needs to have high performance characteristics in order to ensure the smooth game experience of the players. In actual game play, two game data objects are often compared, which may be of Megabit (MB) size, and if the comparison is made directly, a large amount of CPU (Central Processing Unit) performance is consumed.
The prior art generally provides a comparison function for each game data object, and compares the data members of the game data object by calling the comparison function. However, only when the data members in the game data object are all common integer data, the CPU performance consumed by calling the comparison function is low; when character string data is included in a game data object, a large amount of CPU performance is consumed since the comparison of character string data is byte-level comparison. Even if the game data object does not contain character string data, when the game data object is large, the prior art still needs to compare each data member in the game data object one by one, and still occupies a large amount of CPU resources. In addition, for two identical game data objects, the prior art may store the two identical game data objects in a plurality of playing methods respectively, and a large amount of memory space is consumed.
Disclosure of Invention
In view of the foregoing problems in the prior art, an object of the present invention is to provide a method, an apparatus, a device and a storage medium for matching game data objects, which can reduce CPU consumption, reduce memory usage and improve game server performance.
In order to solve the above problems, the present invention provides a game data object matching method, comprising:
responding to a matching instruction aiming at a data object, and determining a first data object and a second data object to be matched corresponding to the matching instruction;
acquiring a first object identifier of the first data object and a second object identifier of the second data object;
matching the first object identification with the second object identification to obtain a first matching result;
if the first matching result is that the first object identifier is inconsistent with the second object identifier, calling a preset comparison function to match the first data object with the second data object to obtain a second matching result;
and correcting the first object identifier and the second object identifier according to the second matching result.
Another aspect of the present invention provides a game data object matching apparatus, including:
the device comprises a determining module, a matching module and a matching module, wherein the determining module is used for responding to a matching instruction aiming at a data object, and determining a first data object and a second data object to be matched, which correspond to the matching instruction;
an obtaining module, configured to obtain a first object identifier of the first data object and a second object identifier of the second data object;
the first matching module is used for matching the first object identifier with the second object identifier to obtain a first matching result;
the second matching module is used for calling a preset comparison function to match the first data object with the second data object to obtain a second matching result if the first matching result is that the first object identifier is inconsistent with the second object identifier;
and the first correcting module is used for correcting the first object identifier and the second object identifier according to the second matching result.
Another aspect of the present invention provides an electronic device, including a processor and a memory, where the memory stores at least one instruction or at least one program, and the at least one instruction or the at least one program is loaded and executed by the processor to implement the game data object matching method described above.
Another aspect of the present invention provides a computer-readable storage medium, in which at least one instruction or at least one program is stored, the at least one instruction or the at least one program being loaded and executed by a processor to implement the game data object matching method as described above.
Another aspect of the invention provides a computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the game data object matching method.
Due to the technical scheme, the invention has the following beneficial effects:
according to the game data object matching method, the object identification is set for each game data object, the object identification of the data object to be matched is matched firstly in the object matching process, and the data object is matched by calling the comparison function when the identification is inconsistent, so that the consumption of a CPU (Central processing Unit) can be reduced in a scene that the data objects are frequent, the performance of a game server is obviously improved, and the phenomenon that the byte-by-byte matching occupies excessive CPU performance is avoided.
The game data object matching method provides an identifier merging scheme, and when the same data object occupies a plurality of object identifiers, the object identifiers are corrected, so that the same data object shares one object identifier, and the memory occupation can be reduced. In addition, the game data object matching method realizes the sharing of the data object through reference counting, realizes the sharing of one data object in a plurality of game playing methods, and further reduces the use of the memory.
Drawings
In order to more clearly illustrate the technical solution of the present invention, the drawings used in the description of the embodiment or the prior art will be briefly described below. It is obvious that the drawings in the following description are only some embodiments of the invention, and that for a person skilled in the art, other drawings can be derived from them without inventive effort.
FIG. 1 is a schematic illustration of an implementation environment provided by an embodiment of the invention;
FIG. 2 is a flow diagram of a method for game data object matching provided by one embodiment of the present invention;
FIG. 3 is a schematic structural diagram of an object identifier according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of generating an object identifier according to an embodiment of the present invention;
FIG. 5 is a flow chart of a method of game data object matching provided by another embodiment of the present invention;
FIG. 6 is a schematic diagram of data object sharing provided by one embodiment of the present invention;
FIG. 7 is a schematic structural diagram of a game data object matching apparatus according to an embodiment of the present invention;
FIG. 8 is a schematic structural diagram of a game data object matching apparatus according to another embodiment of the present invention;
fig. 9 is a schematic diagram of a server provided by an embodiment of the invention.
Detailed Description
In order to make the technical solutions of the present invention better understood, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be obtained by a person skilled in the art without any inventive step based on the embodiments of the present invention, are within the scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, apparatus, article, or device that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or device.
Referring to the description fig. 1, a schematic diagram of an implementation environment provided by an embodiment of the invention is shown, which may include at least a game terminal 110 and a game server 120, as shown in fig. 1. The game terminal 110 and the game server 120 may be directly or indirectly connected through wired or wireless communication, which is not limited in this embodiment of the present invention.
A game client is operated in the game terminal 110. The gaming terminal 110 may include, but is not limited to, a smart phone, a tablet computer, an e-book reader, a laptop portable computer, a desktop computer, and the like. The game client can be a webpage provided for the user by some service providers and can also be an application provided for the user by the service providers.
The game server 120 may be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, or a cloud server providing basic cloud computing services such as a cloud service, a cloud database, cloud computing, a cloud function, cloud storage, a network service, cloud communication, a middleware service, a domain name service, a security service, a Content Delivery Network (CDN), a big data and artificial intelligence platform, and the like. The game server 120 may include a network communication unit, a processor, and memory, among others.
In practical applications, the game client may be an MMORPG game client, when a user logs in the game client to play a game, a matching instruction for a data object may be generated in a scene that a game object needs to be queried or compared, for example, when querying a charm chart of game clothing or querying help data, and the game terminal 110 sends the matching instruction to the game server 120. The matching instruction may be generated when the user plays the game through the game client, or may be generated by the game client at a fixed time, for example, generated when the game object index is merged at 23:00 a night every day, which is not limited in the embodiment of the present invention.
A device for implementing the game data object matching method provided by the embodiment of the present invention may be disposed in the game server 120. The game server 120 recognizes the matching instruction sent by the game terminal 110, matches the data object corresponding to the matching instruction by using the game data object matching method provided by the embodiment of the present invention, and corrects the data object according to the matching result.
It should be noted that fig. 1 is only an example.
Referring to the description, fig. 2 illustrates a flow of a game data object matching method according to an embodiment of the present invention, which can be applied to the game server in fig. 1. The game data object may be used to describe characteristics of certain game data, and the game data object may include various types of data stored in a memory during the running process of a game program, such as character information, group information, and the like. As shown in fig. 2, the method may include the steps of:
s210: and responding to a matching instruction aiming at the data object, and determining a first data object and a second data object to be matched corresponding to the matching instruction.
In the embodiment of the invention, when a user logs in a game client in the game terminal to play a game, a matching instruction can be generated; when a user uses a game client to play a game, a matching instruction is generated when the user needs to perform game object query/comparison (for example, search according to names), or the matching instruction is generated within a certain fixed time period; when a certain game application is provided with a function of performing data object matching at regular time, a matching instruction is generated in a fixed time period even if the user does not use the game application. After the game client generates the matching instruction, the game terminal sends the matching instruction to the game server, so that the game server can receive the matching instruction.
In an embodiment of the present invention, the matching instruction includes a first data object and a second data object to be matched, the first data object and the second data object may be game data objects in the same game play or game data objects in different game plays, and the first data object and the second data object are data objects of the same type, for example, both are a game garment, a game character, or a group name. For example, when a user queries a leaderboard of clothing fascination, the first data object and the second data object may be the same clothing of different players on the leaderboard, which is a game data object in the same game play; in addition, in two group plays, one is group play performance of group war, and the other is group play performance of group tournament, when the player inquires group play performance, the first data object and the second data object can be data objects of the same group name in group play performance of the two plays, which are game data objects in different game plays.
S220: a first object identification of the first data object and a second object identification of the second data object are obtained.
In the embodiment of the present invention, each data object is configured with an object identifier for uniquely determining the data object, the object identifier of the data object may include a type identifier segment and a sequence number, the type identifier segment is used to indicate the type of the data object, and the object identifier may be allocated when the data object is created.
Illustratively, as shown in fig. 3, the object id may be an unsigned 64-bit integer, the first 16 bits are a type id segment for describing the type of the data object, and the remaining 48 bits are a sequence number. Where 16 bits may represent 65535 data types and 48 bits may represent 280 trillion objects, a number of objects sufficient to handle all scenes. As shown in fig. 4, the object identifier may apply for the identifier assignor when the data object is created, and the identifier assignor ensures that the identifier is automatically added by 1 through an atomicity auto-increment operation, so as to ensure the uniqueness of the identifier, ensure the data security under high concurrency, and not generate two identical object identifiers.
S230: and matching the first object identification and the second object identification to obtain a first matching result.
In this embodiment of the present invention, when matching the first object identifier and the second object identifier, the type identifier segment and the sequence number of the first object identifier and the second object identifier may be respectively matched, if the type identifier segment and the sequence number are the same, the first matching result is that the first object identifier and the second object identifier are identical, and if the type identifier segment is not the same or the sequence number is not the same, the first matching result is that the first object identifier and the second object identifier are not identical.
S240: and if the first matching result is that the first object identifier is inconsistent with the second object identifier, calling a preset comparison function to match the first data object with the second data object to obtain a second matching result.
In this embodiment of the present invention, if the first matching result is that the first object identifier and the second object identifier are consistent, it may be determined that the first data object and the second data object are the same data object, and the first data object and the second data object do not need to be corrected. In the embodiment of the invention, if the object identifications are the same, the two data objects can be considered to be consistent without calling the comparison function of the data objects, thereby avoiding the increase of CPU consumption caused by the calling of the comparison function.
In this embodiment of the present invention, since the first data object and the second data object are data objects of the same type, the type identifier segments of the first object identifier and the second object identifier should be the same. If the type identifier segments of the first object identifier and the second object identifier are not the same, it may be determined that the first data object and the second data object are different data objects, and no modification is required to the first data object and the second data object. At this time, a warning message may also be generated and sent to the game maintainer.
In the embodiment of the present invention, the preset comparison function corresponds to the type of the data object. If the serial numbers of the first object identifier and the second object identifier are not consistent, each data member of the first data object and the second data object can be matched by using a comparison function, and a second matching result is obtained.
Specifically, the data object comprises at least one data member; the calling a preset comparison function to match the first data object with the second data object, and obtaining a second matching result may include:
calling a preset comparison function to match each data member of the first data object with each data member of the second data object;
if each data member of the first data object and each data member of the second data object are successfully matched, judging that the first data object is consistent with the second data object;
and if at least one data member in the first data object or the second data object is not successfully matched, judging that the first data object is inconsistent with the second data object.
In practical applications, each data member of the first data object and the second data object includes a data identifier and a corresponding data value, and the data member may be integer data or character string data. When the first data object and the second data object are matched, the data identifiers of the data members may be obtained first, and the data identifiers of the data members of the first data object are matched with the data identifiers of the data members of the second data object to obtain three types of data members, where the first type of data member is a data member only in the first data object, the second type of data member is a data member only in the second data object, and the third type of data member is a data member in the first data object and the second data object and having the same data identifier.
After the three types of data members are obtained through matching, whether the number of the first type of data members and the number of the second type of data members are zero or not can be judged, if the number of the first type of data members or the number of the second type of data members is not zero, at least one data member in the first data object or the second data object can be directly judged to be not successfully matched, and the first data object and the second data object can be judged to be inconsistent. If the number of the first class data members and the number of the second class data members are both zero, that is, only the third class data members exist, the comparison function may be used to compare the data values of the third class data members in the first data object and the second data object, and if the data values of all the third class data members in the first data object and the second data object are the same, it may be determined that each data member of the first data object and each data member of the second data object are successfully matched, that is, it may be determined that the first data object and the second data object are consistent; if at least one third type data member has different data values in the first data object and the second data object, it may be determined that at least one data member in the first data object or the second data object has not been successfully matched, that is, it may be determined that the first data object and the second data object are not consistent.
S250: and correcting the first object identifier and the second object identifier according to the second matching result.
In this embodiment of the present invention, if the second matching result is that the first data object and the second data object are not consistent, it is determined that the first data object and the second data object are different data objects, and the first data object and the second data object do not need to be corrected. If the second matching result is that the first data object and the second data object are consistent, it is determined that the first data object and the second data object are the same data object, and at this time, because the same data object uses different object identifiers, the first object identifier and the second object identifier may be corrected.
In a possible embodiment, the modifying the first object id and the second object id according to the second matching result may include:
if the second matching result is that the first data object is consistent with the second data object, determining a third object identifier according to the first object identifier and the second object identifier;
and modifying the first object identifier and the second object identifier into the third object identifier.
Specifically, the determining a third object identifier according to the first object identifier and the second object identifier may include:
acquiring a first serial number of the first object identifier and a second serial number of the second object identifier;
using a smaller sequence number of the first sequence number and the second sequence number as a third sequence number, and using a first type identification segment of the first object identification or a second type identification segment of the second object identification as a third type identification segment;
and determining a third object identifier according to the third type identifier segment and the third sequence number.
In practical applications, if the first data object and the second data object are consistent, the object identifiers of the two data objects may be modified to be the same object identifier, for example, the object identifiers of the two data objects may be modified to be an object identifier with a smaller sequence number (i.e., a third object identifier) of the first object identifier and the second object identifier, and merging of the object identifiers is completed, so that the object identifiers of the two data objects are consistent. It should be noted that, in some possible embodiments, the third object identifier may also be different from both the first object identifier and the second object identifier, for example, a new object identifier generated by an identifier generator may be used, which is not limited in this embodiment of the present invention.
In one possible embodiment, as shown in fig. 5, the method may further include the steps of:
s260: and correcting the reference count of the first data object and the reference count of the second data object according to the second matching result.
Specifically, the correcting the reference count of the first data object and the reference count of the second data object according to the second matching result may include:
if the second matching result is that the first data object is consistent with the second data object, acquiring a first reference count of the first data object and a second reference count of the second data object;
increasing or decreasing the first reference count and the second reference count according to a preset rule;
and destroying the data object with the reference count of zero, and releasing the space occupied by the data object with the reference count of zero.
Wherein the increasing or decreasing the first reference count and the second reference count according to a preset rule may include:
acquiring a first serial number of the first object identifier and a second serial number of the second object identifier;
increasing a reference count of a data object corresponding to a smaller one of the first sequence number and the second sequence number;
decreasing a reference count of a data object corresponding to a larger one of the first sequence number and the second sequence number.
In practical applications, the safe destruction of the game data object can be ensured through reference counting, and with reference to fig. 6 in the specification, after the game data object is created, different game plays can use each data object in a general reference mode, each time one game play refers to a certain data object, the reference counting of the data object is increased by 1, and after the game play is used up, the reference counting of the data object is decreased by 1. In addition, different data objects can be referenced, when a certain data object is referenced by other data objects, the reference count of the data object is increased by 1, and when an upper-layer object referencing the certain data object is destroyed, the reference count of the data object is decreased by 1. The reference count can ensure the safe destruction of the data object, and if the reference count of a certain data object is 0, the data object can be safely destroyed.
In this embodiment of the present invention, after the object identifier is modified, 1 may be added to the reference count of the data object with the smaller sequence number in the first data object and the second data object, and 1 may be subtracted from the reference count of the data object with the larger sequence number in the first data object and the second data object. If the reference count of the data object with the larger original serial number is changed into 0 after the correction, the data object can be destroyed, and the memory space occupied by the data object is released, so that the memory occupation can be reduced, and only one same data object is ensured to be stored in the memory, and the data object can be shared under different game scenes.
In summary, according to the game data object matching method of the present invention, by setting an object identifier for each game data object, in the process of object matching, the object identifiers of the data objects to be matched are matched first, and when the identifiers are inconsistent, the data objects are matched by calling a comparison function, so that in a scenario where the data objects are frequent, the consumption of the CPU can be reduced, the performance of the game server can be significantly improved, and the excessive CPU performance occupied by byte-by-byte matching can be avoided.
The game data object matching method provides an identifier merging scheme, and when the same data object occupies a plurality of object identifiers, the object identifiers are corrected, so that the same data object shares one object identifier, and the memory occupation can be reduced. In addition, the game data object matching method realizes the sharing of the data object through reference counting, realizes the sharing of one data object in a plurality of game playing methods, and further reduces the use of the memory.
Referring to the specification, fig. 7 shows a structure of a game data object matching apparatus according to an embodiment of the present invention. As shown in fig. 7, the apparatus may include:
a determining module 710, configured to determine, in response to a matching instruction for a data object, a first data object and a second data object to be matched, which correspond to the matching instruction;
an obtaining module 720, configured to obtain a first object identifier of the first data object and a second object identifier of the second data object;
a first matching module 730, configured to match the first object identifier with the second object identifier to obtain a first matching result;
a second matching module 740, configured to, if the first matching result is that the first object identifier is inconsistent with the second object identifier, invoke a preset comparison function to match the first data object with the second data object, so as to obtain a second matching result;
and a first modification module 750, configured to modify the first object identifier and the second object identifier according to the second matching result.
In one possible embodiment, as shown in fig. 8, the apparatus may further include:
a second modification module 760, configured to modify the reference count of the first data object and the reference count of the second data object according to the second matching result.
In one possible embodiment, the first modification module 750 may include:
an identifier determining unit, configured to determine a third object identifier according to the first object identifier and the second object identifier when the second matching result is that the first data object and the second data object are consistent;
and the mark correction unit is used for correcting the first object mark and the second object mark into the third object mark.
In one possible embodiment, the second modification module 760 may include:
a reference count acquisition unit, configured to acquire a first reference count of the first data object and a second reference count of the second data object when the second matching result is that the first data object and the second data object are consistent;
a reference count increasing and decreasing unit, configured to increase and decrease the first reference count and the second reference count according to a preset rule;
and the destroying unit is used for destroying the data object with the reference count of zero and releasing the space occupied by the data object with the reference count of zero.
It should be noted that, when the apparatus provided in the foregoing embodiment implements the functions thereof, only the division of the functional modules is illustrated, and in practical applications, the functions may be distributed by different functional modules according to needs, that is, the internal structure of the apparatus may be divided into different functional modules to implement all or part of the functions described above. In addition, the apparatus provided in the above embodiments and the corresponding method embodiments belong to the same concept, and specific implementation processes thereof are detailed in the corresponding method embodiments and are not described herein again.
An embodiment of the present invention further provides an electronic device, which includes a processor and a memory, where the memory stores at least one instruction or at least one program, and the at least one instruction or the at least one program is loaded and executed by the processor to implement the game data object matching method provided by the above method embodiment.
The memory may be used to store software programs and modules, and the processor may execute various functional applications and data processing by operating the software programs and modules stored in the memory. The memory can mainly comprise a program storage area and a data storage area, wherein the program storage area can store an operating system, application programs needed by functions and the like; the storage data area may store data created according to use of the apparatus, and the like. Further, the memory may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device. Accordingly, the memory may also include a memory controller to provide the processor access to the memory.
The method embodiments provided by the embodiments of the present invention may be executed in a terminal, a server, or a similar computing device, that is, the electronic device may include a terminal, a server, or a similar computing device. Taking the example of running on a server, as shown in fig. 9, it shows a schematic structural diagram of a server running the game data object matching method provided by the embodiment of the present invention. The server 900 may vary widely in configuration or performance, and may include one or more Central Processing Units (CPUs) 910 (e.g., one or more processors) and memory 930, one or more storage media 920 (e.g., one or more mass storage devices) storing applications 923 or data 922. Memory 930 and storage media 920 may be, among other things, transient or persistent storage. The program stored in the storage medium 920 may include one or more modules, each of which may include a series of instruction operations in a server. Still further, the central processor 910 may be configured to communicate with the storage medium 920, and execute a series of instruction operations in the storage medium 920 on the server 900. The server 900 may also include one or more power supplies 960, one or more wired or wireless network interfaces 950, one or more input-output interfaces 940, and/or one or more operating systems 921, such as Windows Server, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, and so forth.
The input/output interface 940 may be used to receive or transmit data via a network. Specific examples of the network described above may include a wireless network provided by a communication provider of the server 900. In one example, the input/output Interface 940 includes a Network adapter (NIC) that can be connected to other Network devices through a base station to communicate with the internet. In one example, the input/output interface 940 may be a Radio Frequency (RF) module for communicating with the internet in a wireless manner, and the wireless communication may use any communication standard or protocol, including but not limited to Global System for mobile communication (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Long Term Evolution (LTE), email, Short Message Service (SMS), and the like.
It will be appreciated by those of ordinary skill in the art that the configuration shown in fig. 9 is merely illustrative and that the server 900 may include more or fewer components than shown in fig. 9 or have a different configuration than shown in fig. 9.
An embodiment of the present invention further provides a computer-readable storage medium, which may be disposed in an electronic device to store at least one instruction or at least one program for implementing a game data object matching method, where the at least one instruction or the at least one program is loaded and executed by the processor to implement the game data object matching method provided by the foregoing method embodiment.
Optionally, in an embodiment of the present invention, the storage medium may include, but is not limited to: a U-disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic disk, or an optical disk, which can store program codes.
An embodiment of the invention also provides a computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the game data object matching method provided in the above-described various alternative embodiments.
It should be noted that: the precedence order of the above embodiments of the present invention is only for description, and does not represent the merits of the embodiments. And specific embodiments thereof have been described above. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims may be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing may also be possible or may be advantageous.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, as for the apparatus embodiment, since it is substantially similar to the method embodiment, the description is relatively simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, where the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like that fall within the spirit and principle of the present invention are intended to be included therein.

Claims (10)

1. A game data object matching method, comprising:
responding to a matching instruction aiming at a data object, and determining a first data object and a second data object to be matched corresponding to the matching instruction;
acquiring a first object identifier of the first data object and a second object identifier of the second data object;
matching the first object identification with the second object identification to obtain a first matching result;
if the first matching result is that the first object identifier is inconsistent with the second object identifier, calling a preset comparison function to match the first data object with the second data object to obtain a second matching result;
and correcting the first object identifier and the second object identifier according to the second matching result.
2. The method of claim 1, wherein the modifying the first object identifier and the second object identifier according to the second matching result comprises:
if the second matching result is that the first data object is consistent with the second data object, determining a third object identifier according to the first object identifier and the second object identifier;
and modifying the first object identifier and the second object identifier into the third object identifier.
3. The method of claim 2, wherein the object id of the data object comprises a type id segment and a sequence number, and wherein the type id segment is used to indicate the type of the data object;
the determining a third object identifier according to the first object identifier and the second object identifier comprises:
acquiring a first serial number of the first object identifier and a second serial number of the second object identifier;
using a smaller sequence number of the first sequence number and the second sequence number as a third sequence number, and using a first type identification segment of the first object identification or a second type identification segment of the second object identification as a third type identification segment;
and determining a third object identifier according to the third type identifier segment and the third sequence number.
4. The method according to claim 1 or 2, characterized in that the method further comprises:
correcting the reference count of the first data object and the reference count of the second data object according to the second matching result, including:
if the second matching result is that the first data object is consistent with the second data object, acquiring a first reference count of the first data object and a second reference count of the second data object;
increasing or decreasing the first reference count and the second reference count according to a preset rule;
and destroying the data object with the reference count of zero, and releasing the space occupied by the data object with the reference count of zero.
5. The method of claim 4, wherein the object id of the data object comprises a type id segment and a sequence number, and wherein the type id segment is used to indicate the type of the data object;
the increasing or decreasing the first reference count and the second reference count according to a preset rule includes:
acquiring a first serial number of the first object identifier and a second serial number of the second object identifier;
increasing a reference count of a data object corresponding to a smaller one of the first sequence number and the second sequence number;
decreasing a reference count of a data object corresponding to a larger one of the first sequence number and the second sequence number.
6. The method of claim 1 or 2, wherein the data object comprises at least one data member; the calling a preset comparison function to match the first data object with the second data object, and obtaining a second matching result includes:
calling a preset comparison function to match each data member of the first data object with each data member of the second data object;
if each data member of the first data object and each data member of the second data object are successfully matched, judging that the first data object is consistent with the second data object;
and if at least one data member in the first data object or the second data object is not successfully matched, judging that the first data object is inconsistent with the second data object.
7. The method according to claim 1 or 2, characterized in that the method further comprises:
if the first matching result is that the first object identifier is consistent with the second object identifier, determining that the first data object and the second data object are the same data object;
if the second matching result is that the first data object and the second data object are consistent, determining that the first data object and the second data object are the same data object;
and if the second matching result is that the first data object and the second data object are not consistent, determining that the first data object and the second data object are different data objects.
8. A game data object matching apparatus, comprising:
the device comprises a determining module, a matching module and a matching module, wherein the determining module is used for responding to a matching instruction aiming at a data object, and determining a first data object and a second data object to be matched, which correspond to the matching instruction;
an obtaining module, configured to obtain a first object identifier of the first data object and a second object identifier of the second data object;
the first matching module is used for matching the first object identifier with the second object identifier to obtain a first matching result;
the second matching module is used for calling a preset comparison function to match the first data object with the second data object to obtain a second matching result if the first matching result is that the first object identifier is inconsistent with the second object identifier;
and the first correcting module is used for correcting the first object identifier and the second object identifier according to the second matching result.
9. An electronic device, comprising a processor and a memory, wherein at least one instruction or at least one program is stored in the memory, and the at least one instruction or the at least one program is loaded and executed by the processor to implement the game data object matching method according to any one of claims 1 to 7.
10. A computer-readable storage medium, in which at least one instruction or at least one program is stored, the at least one instruction or the at least one program being loaded and executed by a processor to implement the game data object matching method according to any one of claims 1 to 7.
CN202011321852.2A 2020-11-23 2020-11-23 Game data object matching method, device, equipment and storage medium Active CN112354189B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011321852.2A CN112354189B (en) 2020-11-23 2020-11-23 Game data object matching method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011321852.2A CN112354189B (en) 2020-11-23 2020-11-23 Game data object matching method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN112354189A true CN112354189A (en) 2021-02-12
CN112354189B CN112354189B (en) 2022-05-20

Family

ID=74533114

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011321852.2A Active CN112354189B (en) 2020-11-23 2020-11-23 Game data object matching method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112354189B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117093408A (en) * 2023-10-20 2023-11-21 恒生电子股份有限公司 Data processing method and device

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101295318A (en) * 2008-06-24 2008-10-29 北京金山软件有限公司 Data searching method and device
JP2012209894A (en) * 2011-03-30 2012-10-25 Fujitsu Ltd Information processing unit and program
CN106033452A (en) * 2015-03-17 2016-10-19 阿里巴巴集团控股有限公司 Method and device for updating data
CN109697036A (en) * 2018-12-29 2019-04-30 北京金山安全软件有限公司 Information processing method and device
CN109800240A (en) * 2018-12-13 2019-05-24 平安科技(深圳)有限公司 SQL statement classifying method, device, computer equipment and storage medium
CN110045949A (en) * 2019-05-10 2019-07-23 上海紫翊网络科技有限公司 The prefabricated component merging method and device of a kind of same project difference branch engineering
CN111126002A (en) * 2019-10-01 2020-05-08 武汉数元网络技术有限公司 Method and system for generating data global uniqueness identifier id
CN111367502A (en) * 2020-03-04 2020-07-03 深圳市腾讯信息技术有限公司 Numerical value processing method and device

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101295318A (en) * 2008-06-24 2008-10-29 北京金山软件有限公司 Data searching method and device
JP2012209894A (en) * 2011-03-30 2012-10-25 Fujitsu Ltd Information processing unit and program
CN106033452A (en) * 2015-03-17 2016-10-19 阿里巴巴集团控股有限公司 Method and device for updating data
CN109800240A (en) * 2018-12-13 2019-05-24 平安科技(深圳)有限公司 SQL statement classifying method, device, computer equipment and storage medium
CN109697036A (en) * 2018-12-29 2019-04-30 北京金山安全软件有限公司 Information processing method and device
CN110045949A (en) * 2019-05-10 2019-07-23 上海紫翊网络科技有限公司 The prefabricated component merging method and device of a kind of same project difference branch engineering
CN111126002A (en) * 2019-10-01 2020-05-08 武汉数元网络技术有限公司 Method and system for generating data global uniqueness identifier id
CN111367502A (en) * 2020-03-04 2020-07-03 深圳市腾讯信息技术有限公司 Numerical value processing method and device

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117093408A (en) * 2023-10-20 2023-11-21 恒生电子股份有限公司 Data processing method and device
CN117093408B (en) * 2023-10-20 2024-01-23 恒生电子股份有限公司 Data processing method and device

Also Published As

Publication number Publication date
CN112354189B (en) 2022-05-20

Similar Documents

Publication Publication Date Title
CN112076464B (en) Data request processing method and device, computer equipment and storage medium
US8147327B2 (en) Method for updating a multiplayer game session on a mobile device
US9898700B2 (en) Method, apparatus, and artificial intelligence server for determining artificial intelligence behavior
CN106823376A (en) A kind of method and device for realizing user's matching
CN109224435B (en) Online game acceleration method and device, electronic equipment and storage medium
CN111659126B (en) Distribution method, device, server, terminal and storage medium of matching process
CN112354189B (en) Game data object matching method, device, equipment and storage medium
CN112337090A (en) Event message broadcasting method and device, storage medium and electronic device
CN112087487A (en) Model training task scheduling method and device, electronic equipment and storage medium
CN111265870A (en) Control method and device of virtual operation object and storage medium
CN111522673A (en) Memory data access method and device, computer equipment and storage medium
WO2020018686A1 (en) System and method for dynamic matchmaking in client applications
CN110113414B (en) Method, device, server and storage medium for managing copies
CN112619146B (en) Virtual resource allocation method and device, storage medium and electronic device
CN112121441B (en) Virtual object pairing method and device and storage medium
CN102223449A (en) Cell phone competition game system and method
KR101398088B1 (en) Method for managing data in online game, a game server including data management system, and recording medium
US9149725B2 (en) Method and server for PVP team matching in computer games
WO2023103571A1 (en) Game management method and apparatus, and device and computer-readable storage medium
CN112156475B (en) Business data processing method and device, electronic equipment and storage medium
CN113713392B (en) Virtual character control method and device, storage medium and electronic equipment
CN111298432B (en) Virtual object information acquisition method and device, server and readable storage medium
CN112698956B (en) Data object processing method, device, equipment and storage medium
CN110124306B (en) Resource configuration information recommendation method, device, equipment and medium
CN113398597B (en) Resource distribution configuration method and device and computer storage medium

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