CN111939569A - Method and device for searching virtual article in game and terminal - Google Patents
Method and device for searching virtual article in game and terminal Download PDFInfo
- Publication number
- CN111939569A CN111939569A CN202010901160.9A CN202010901160A CN111939569A CN 111939569 A CN111939569 A CN 111939569A CN 202010901160 A CN202010901160 A CN 202010901160A CN 111939569 A CN111939569 A CN 111939569A
- Authority
- CN
- China
- Prior art keywords
- attribute
- virtual
- information
- attribute bit
- search
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 90
- 238000004590 computer program Methods 0.000 claims description 7
- 230000004044 response Effects 0.000 claims description 3
- 230000008569 process Effects 0.000 description 18
- 241000190070 Sarracenia purpurea Species 0.000 description 12
- 238000010586 diagram Methods 0.000 description 7
- 101100327917 Caenorhabditis elegans chup-1 gene Proteins 0.000 description 6
- 230000006870 function Effects 0.000 description 4
- 238000004891 communication Methods 0.000 description 3
- 230000008878 coupling Effects 0.000 description 3
- 238000010168 coupling process Methods 0.000 description 3
- 238000005859 coupling reaction Methods 0.000 description 3
- 230000000694 effects Effects 0.000 description 3
- 101150038956 cup-4 gene Proteins 0.000 description 2
- 238000004422 calculation algorithm Methods 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 239000003086 colorant Substances 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000012545 processing Methods 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Images
Classifications
-
- A—HUMAN NECESSITIES
- A63—SPORTS; GAMES; AMUSEMENTS
- A63F—CARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
- A63F13/00—Video games, i.e. games using an electronically generated display having two or more dimensions
- A63F13/85—Providing additional services to players
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/95—Retrieval from the web
- G06F16/953—Querying, e.g. by the use of web search engines
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Engineering & Computer Science (AREA)
- Databases & Information Systems (AREA)
- Multimedia (AREA)
- Theoretical Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The invention provides a method, a device and a terminal for searching virtual articles in a game, wherein the method comprises the following steps: acquiring an attribute bit identifier of a virtual item to be searched in a game; determining an attribute bit index character based on the search type information and the search attribute information of the virtual article carried in the virtual article search request; and determining a target virtual article which is consistent with the search type information and the search attribute information carried by the virtual article search request in the virtual article to be searched based on the attribute bit identifier and the attribute bit index of the virtual article to be searched. When the target virtual article is determined, the attribute bit index symbol and each attribute bit identifier are only needed to be calculated, so that the efficiency of searching the target virtual article which accords with the search type information and the search attribute information is improved, in addition, one attribute bit identifier in the invention can represent various attribute information of the corresponding virtual article to be searched, and the physical resource overhead is reduced.
Description
Technical Field
The invention relates to the technical field of information query, in particular to a method, a device and a terminal for searching virtual articles in games.
Background
At present, when virtual item search is performed in a game, the following two schemes are generally included: one is to go through all the virtual items according to the search attribute items selected by the player, and filter and screen the virtual items to be searched one by one. The scheme has the advantages of less used resources and simple method, and is suitable for the condition of very small data volume. When the commodity data volume is large, the calculation amount of the scheme is very large, and the user cannot be quickly responded; and the other method is that indexes are separately established for each item of the commodity in advance, a set which accords with each attribute is searched according to the attribute items selected by the user, and finally intersection is carried out. The scheme has high query speed, can meet the query requirement of real-time performance, but needs to independently establish an index set aiming at each attribute, and occupies large physical resources (such as a memory, a hard disk and the like).
In summary, the existing virtual article searching method has the technical problem that the searching efficiency and the resource overhead cannot be considered at the same time.
Disclosure of Invention
The invention aims to provide a method, a device and a terminal for searching virtual articles in a game, so as to solve the technical problem that the existing virtual article searching method cannot give consideration to both searching efficiency and resource overhead.
In a first aspect, an embodiment of the present invention provides a method for searching for a virtual item in a game, including: acquiring attribute bit identifiers of virtual articles to be searched in a game, wherein each attribute bit identifier is used for representing various attribute information of the corresponding virtual article to be searched; responding to a virtual article search request, and determining an attribute bit index character based on search type information and search attribute information of a virtual article carried in the virtual article search request; and determining a target virtual article which is consistent with the search type information and the search attribute information carried by the virtual article search request in the virtual article to be searched based on the attribute bit identifier and the attribute bit index of the virtual article to be searched.
Further, the obtaining of the attribute bit identifier of the virtual item to be searched in the game includes: classifying each virtual article to be searched in the game according to the type of the virtual article to obtain the virtual article to be searched corresponding to each type of the virtual article; acquiring an attribute bit table corresponding to each virtual article type, wherein the attribute bit table comprises position information of each attribute item in the attribute bit identifier and number information corresponding to each attribute value of each attribute item; and calculating the attribute bit identifier of each virtual item to be searched in the corresponding virtual item type based on the attribute bit table.
Further, calculating the attribute bit identifier of each virtual item to be searched in the corresponding virtual item type based on the attribute bit table includes: acquiring attribute information of the virtual article to be searched; determining number information corresponding to each attribute value in the attribute information of the virtual article to be searched according to the attribute information of the virtual article to be searched and the attribute bit table; and coding according to the number information corresponding to each attribute value in the attribute information and the position information of each attribute item in the attribute bit table in the attribute bit identifier to obtain the attribute bit identifier of each virtual article to be searched.
Further, encoding according to the number information corresponding to each attribute value in the attribute information and the position information of each attribute item in the attribute bit table in the attribute bit identifier includes: moving the number information corresponding to each attribute value in the attribute information in the same direction according to the position information of the attribute item corresponding to the number information in the attribute bit identifier to obtain the bit identifier corresponding to each attribute value in the attribute information; and performing OR operation on the bit identifiers corresponding to the attribute values in the attribute information to obtain the attribute bit identifiers of the virtual articles to be searched.
Further, determining the attribute bit index based on the search type information and the search attribute information of the virtual item carried in the virtual item search request includes: determining a target attribute bit table based on the search type information, wherein the target attribute bit table is an attribute bit table conforming to the search type information, and the target attribute bit table comprises position information of each attribute item in the attribute bit index character and number information corresponding to each attribute value of each attribute item; and determining the attribute bit index character according to the search attribute information and the target attribute bit table.
Further, determining the attribute bit index according to the search attribute information and the target attribute bit table includes: determining number information corresponding to each attribute value in the search attribute information according to the search attribute information and the target attribute bit table; moving the number information corresponding to each attribute value in the search attribute information in the same direction according to the position information of the attribute item corresponding to the number information in the attribute bit index symbol to obtain the bit identifier corresponding to each attribute value in the search attribute information; and performing OR operation on bit identifiers corresponding to the attribute values in the search attribute information to obtain the attribute bit index identifier.
Further, determining, based on the attribute bit identifier and the attribute bit index of the virtual item to be searched, a target virtual item that matches the search type information and the search attribute information carried by the virtual item search request in the virtual item to be searched includes: determining an attribute bit identifier of a target type virtual article in the attribute bit identifiers of the virtual articles to be searched, wherein the type of the target type virtual article is consistent with the search type information; determining the target virtual item in the target type virtual item based on the attribute bit identifier and the attribute bit indexer of the target type virtual item.
Further, when different bits in the attribute bit identifier represent different attribute information, determining the target virtual item in the target type virtual item based on the attribute bit identifier of the target type virtual item and the attribute bit index comprises: determining a first attribute bit identifier in the attribute bit identifiers of the target type virtual items, wherein the first attribute bit identifier is not less than the attribute bit index; performing AND operation on the first attribute bit identifier and the attribute bit index, and determining a second attribute bit identifier in the first attribute bit identifier according to an operation result; determining the target virtual item according to the second attribute bit identifier.
Further, when there are different bits in the attribute bit identifier that collectively represent the same attribute information, determining the target virtual item in the target type virtual item based on the attribute bit identifier of the target type virtual item and the attribute bit index comprises: determining a third attribute bit identifier in the attribute bit identifiers of the target type virtual items, wherein the third attribute bit identifier is not less than the attribute bit index; performing exclusive-or operation on the third attribute bit identifier and the attribute bit index identifier to obtain a fourth attribute bit identifier; performing non-operation on the fourth attribute bit identifier to obtain a fifth attribute bit identifier; performing and operation on the fifth attribute bit identifier and a search attribute item all-bit identifier, and determining a sixth attribute bit identifier in the third attribute bit identifier according to an operation result, wherein the search attribute item all-bit identifier is that an identifier of a target position in the attribute bit identifier is a first preset value, identifiers of other positions are second preset values, and the target position is a position of an attribute item corresponding to the search attribute information in the attribute bit identifier; determining the target virtual item from the sixth attribute bit identifier.
In a second aspect, an embodiment of the present invention further provides an apparatus for searching for a virtual item in a game, including: the system comprises an acquisition unit, a search unit and a search unit, wherein the acquisition unit is used for acquiring attribute bit identifiers of virtual articles to be searched in a game, and each attribute bit identifier is used for representing various kinds of attribute information of the corresponding virtual article to be searched; a first determining unit, configured to determine, in response to a virtual item search request, an attribute bit index based on search type information and search attribute information of a virtual item carried in the virtual item search request; and the second determining unit is used for determining a target virtual article which is consistent with the search type information and the search attribute information carried by the virtual article search request in the virtual article to be searched based on the attribute bit identifier and the attribute bit index of the virtual article to be searched.
In a third aspect, an embodiment of the present invention further provides a terminal, including a memory and a processor, where the memory stores a computer program operable on the processor, and the processor implements the steps of the method according to any one of the first aspect when executing the computer program.
In a fourth aspect, embodiments of the present invention also provide a computer-readable storage medium storing machine executable instructions, which, when invoked and executed by a processor, cause the processor to perform the method of any of the first aspects.
In an embodiment of the present invention, a method for searching for a virtual item in a game is provided, where the method includes: acquiring attribute bit identifiers of virtual articles to be searched in a game, wherein each attribute bit identifier is used for representing various attribute information of the corresponding virtual article to be searched; responding to a virtual article search request, and determining an attribute bit index character based on search type information and search attribute information of a virtual article carried in the virtual article search request; and determining a target virtual article which is consistent with the search type information and the search attribute information carried by the virtual article search request in the virtual article to be searched based on the attribute bit identifier and the attribute bit index of the virtual article to be searched. According to the description, on the basis that various attribute information of each virtual article to be searched is represented by one attribute bit identifier and the virtual article search request is represented by the attribute bit index, and finally the target virtual article corresponding to the search type information and the search attribute information carried by the virtual article search request is determined, the attribute bit index and each attribute bit identifier are only required to be calculated, all virtual articles do not need to be traversed according to the search attribute information, the efficiency of searching the target virtual article corresponding to the search type information and the search attribute information is improved, the requirement of real-time search can be met, in addition, compared with the traditional method that an index is required to be established independently for each attribute information, one attribute bit identifier in the invention can represent various attribute information of the corresponding virtual article to be searched, physical resource cost is reduced, namely the searching method of the virtual article in the game can give consideration to both searching efficiency and resource cost, and the technical problem that the searching efficiency and the resource cost cannot be given consideration to the existing searching method of the virtual article is solved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and other drawings can be obtained by those skilled in the art without creative efforts.
Fig. 1 is a schematic flowchart of a method for searching for a virtual object in a game according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating a method for obtaining an attribute bit identifier of a virtual item to be searched in a game according to an embodiment of the present invention;
FIG. 3 is a flowchart illustrating a method for determining an attribute bit index according to an embodiment of the present invention;
FIG. 4 is a flowchart illustrating a method for determining an attribute bit indicator according to search attribute information and a target attribute bit table according to an embodiment of the present invention;
fig. 5 is a flowchart illustrating a method for determining a target virtual item in a virtual item to be searched according to an embodiment of the present invention;
FIG. 6 is a schematic diagram of an apparatus for searching for a virtual object in a game according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of a computer device according to an embodiment of the present invention.
Detailed Description
The technical solutions of the present invention will be described clearly and completely with reference to the following embodiments, and it should be understood that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
At present, when a game player searches for a virtual item according to search attribute information in a game, search efficiency and resource overhead cannot be considered at the same time.
Based on this, the embodiment of the invention provides a method, a device and a terminal for searching virtual articles in a game, so as to solve the technical problem that the existing virtual article searching method cannot give consideration to both searching efficiency and resource overhead.
To facilitate understanding of the present embodiment, first, a method for searching for a virtual item in a game disclosed in the embodiment of the present invention is described in detail, referring to a flowchart of a method for searching for a virtual item in a game shown in fig. 1, where the method may be executed by a server and mainly includes the following steps:
step S102, acquiring an attribute bit identifier of a virtual item to be searched in the game.
Each attribute bit identifier is used for representing various attribute information of the corresponding virtual article to be searched;
in an actual process, the obtained attribute bit identifiers of the virtual articles to be searched are actually the attribute bit identifiers of the virtual articles classified according to the types of the virtual articles. For example, the obtained attribute bit identifiers of the virtual items to be searched include: an attribute bit identifier of each virtual item to be searched for of a cup type, an attribute bit identifier of each virtual item to be searched for of a shoe type, and the like.
Step S104, responding to the virtual article searching request, and determining an attribute bit index character based on the searching type information and the searching attribute information of the virtual article carried in the virtual article searching request.
The attribute bit index is an index for searching for a target virtual item.
And step S106, determining a target virtual article which is consistent with the search type information and the search attribute information carried by the virtual article search request in the virtual article to be searched based on the attribute bit identifier and the attribute bit index of the virtual article to be searched.
It should be noted that there may be one or more target virtual articles determined by the above process.
In an embodiment of the present invention, a method for searching for a virtual item in a game is provided, where the method includes: acquiring attribute bit identifiers of virtual articles to be searched in a game, wherein each attribute bit identifier is used for representing various attribute information of the corresponding virtual article to be searched; responding to a virtual article search request, and determining an attribute bit index character based on search type information and search attribute information of a virtual article carried in the virtual article search request; and determining a target virtual article which is consistent with the search type information and the search attribute information carried by the virtual article search request in the virtual article to be searched based on the attribute bit identifier and the attribute bit index of the virtual article to be searched. According to the description, on the basis that various attribute information of each virtual article to be searched is represented by one attribute bit identifier and the virtual article search request is represented by the attribute bit index, and finally the target virtual article corresponding to the search type information and the search attribute information carried by the virtual article search request is determined, the attribute bit index and each attribute bit identifier are only required to be calculated, all virtual articles do not need to be traversed according to the search attribute information, the efficiency of searching the target virtual article corresponding to the search type information and the search attribute information is improved, the requirement of real-time search can be met, in addition, compared with the traditional method that an index is required to be established independently for each attribute information, one attribute bit identifier in the invention can represent various attribute information of the corresponding virtual article to be searched, physical resource cost is reduced, namely the searching method of the virtual article in the game can give consideration to both searching efficiency and resource cost, and the technical problem that the searching efficiency and the resource cost cannot be given consideration to the existing searching method of the virtual article is solved.
The above description briefly describes a method for searching for a virtual object in a game according to the present invention, and the following description details the specific contents involved therein.
In an alternative embodiment of the present invention, referring to fig. 2, step S102, the step of obtaining the attribute bit identifier of the virtual item to be searched in the game includes the following steps:
step S201, classifying each virtual item to be searched in the game according to the virtual item type, to obtain a virtual item to be searched corresponding to each virtual item type.
In order to facilitate understanding of the scheme of the present invention, the method for searching for virtual items in a game according to the present invention is described below as an example in a specific real life.
Assuming that each virtual object to be searched in the game comprises a cup 1, a cup 2, a cup 3, a cup 4, a cup 5, a cup 6, a shoe 1, a shoe 2, a shoe 3, a shoe 4 and a shoe 5, classifying each virtual object to be searched according to the type of the virtual object, and obtaining the virtual object to be searched corresponding to the type of the cup comprising the cup 1, the cup 2, the cup 3, the cup 4, the cup 5 and the cup 6; the virtual items to be searched corresponding to the shoe types are shoes 1, shoes 2, shoes 3, shoes 4 and shoes 5.
Step S202, an attribute bit table corresponding to each virtual article type is obtained.
The attribute bit table includes the position information of each attribute item in the attribute bit identifier and the number information corresponding to each attribute value of each attribute item.
For example, the attribute bit table corresponding to the type of the cup is:
the attribute bit table corresponding to the type of the shoe is as follows:
the attribute bit table is obtained by self-definition, the bit length of the number information is determined by the size of the attribute value set of each attribute item, for example, for the color attribute item of the water cup, the attribute value set of the color attribute item is 4 (red, yellow, black and white respectively), the bit length of the corresponding number information is 2, that is, two numbers are used to represent each color; for the aperture attribute items of the water cup, the attribute value set of the aperture attribute items is 2 (two, 3 cm and 5 cm respectively), the bit length of the corresponding number information is 1, that is, one number is used to represent each aperture size. In addition, in the attribute bit table corresponding to the type of the water cup, the position information of the color attribute item is 0 bit, and the 0 th bit and the 1 st bit in the attribute bit identifier represent colors; the position information of the caliber attribute item is 2 bits, and the 2 nd bit in the attribute bit identifier represents the caliber; the position information bit of the height attribute item is 3 bits, and the 3 rd bit in the attribute bit identifier represents the height.
For example, if the attribute bit identifier of the cup 1 is 0010, it indicates that the attribute information of the cup 1 is: red, 5 cm caliber and 15 cm height.
It should be noted that, as can be seen from the attribute bit table, the attribute values include two types, one type is a character string type and the other type is an integer type, and for a character string type attribute value of a finite set and an integer type attribute value of a finite set, bits of a certain length can be used for representation, and then a plurality of bits are combined and compressed to form an attribute bit identifier. As above, each attribute value of the color and each attribute value of the caliber of the water cup can be represented by a bit with a certain length, and then a plurality of bits are combined and compressed to form an attribute bit identifier for representing various attribute information, and the attribute bit identifier can be independently established (namely, the index is independently established) for the character string type attribute value of an infinite set and the integer type attribute value of the infinite set.
Step S203, calculating an attribute bit identifier of each virtual item to be searched in the corresponding virtual item type based on the attribute bit table.
The method specifically comprises the following processes (1) to (3):
(1) and acquiring attribute information of the virtual article to be searched.
For example, the attribute information of the cup 2 is black, the caliber is 5 cm, and the height is 15 cm.
(2) And determining the number information corresponding to each attribute value in the attribute information of the virtual article to be searched according to the attribute information and the attribute bit table of the virtual article to be searched.
As shown in the above example (1), in combination with the attribute bit table of the cup, it can be determined that the number information corresponding to the black attribute value of the cup 2 is 10, the number information corresponding to the attribute value of 5 cm aperture of the cup 2 is 1, and the number information corresponding to the attribute value of 15 cm height of the cup 2 is 0.
(3) And coding according to the number information corresponding to each attribute value in the attribute information and the position information of each attribute item in the attribute bit table in the attribute bit identifier to obtain the attribute bit identifier of each virtual article to be searched.
The method specifically comprises the following steps:
(31) and moving the number information corresponding to each attribute value in the attribute information in the same direction according to the position information of the attribute item corresponding to the number information in the attribute bit identifier to obtain the bit identifier corresponding to each attribute value in the attribute information.
As an example in (2) above, the number information of the black attribute value is 10, and the bit identifier corresponding to the black attribute value obtained by shifting 10 by the position information (i.e., 0 bit) of the attribute item (i.e., color item) corresponding to the black attribute value in the attribute bit identifier, that is, shifting 10 to the right by 0 bit is 10;
the number information of the attribute value of the 5 cm caliber is 1, the 1 is moved in the same direction according to the position information (namely 2 bits) of the attribute item (namely the caliber item) corresponding to the 1 in the attribute bit identifier, namely the 1 is moved to the right in the same way and moved by 2 bits, and the bit identifier corresponding to the attribute value of the 5 cm caliber is 001;
the number information of the 15 cm height attribute value is 0, and 0 is moved in the same direction according to the position information (i.e. 3 bits) of the attribute item (i.e. height item) corresponding to the 0 in the attribute bit identifier, i.e. 0 is moved to the right similarly and is moved by 3 bits, and the obtained bit identifier corresponding to the 15 cm height attribute value is 0000.
The right movement may be a left movement, and the direction of the movement is not particularly limited in the embodiment of the present invention.
The process of obtaining the bit identifier corresponding to the attribute value is expressed by a bit motion algorithm, which can be expressed as: v [ i ] < position information corresponding to the attribute value, or v [ i ] > position information corresponding to the attribute value.
(32) And performing OR operation on the bit identifiers corresponding to the attribute values in the attribute information to obtain the attribute bit identifiers of the virtual articles to be searched.
As an example in (31), i.e. performing or operation on 10, 001 and 0000, the attribute bit identifier of the cup 2 is obtained as follows: 1010, the first two (i.e. 0 th and 1 st) 10 of the attributes represent black, the 2 nd 1 represents a 5 cm aperture, and the 3 rd 0 represents a 15 cm height, that is, the attribute information of the cup 2 is known to be: black, 5 cm caliber and 15 cm height.
The process of or operation is expressed algorithmically and can be expressed as: v | ═ v [ i ] (i ═ 0.. n), where v [ i ] denotes a bit identifier corresponding to each attribute value in the attribute information.
The above description describes the process of acquiring the attribute bit identifier of each virtual item to be searched in detail, and the following describes the process of determining the attribute bit identifier in detail.
In an optional embodiment of the present invention, referring to fig. 3, in step S104, determining the attribute bit index based on the search type information and the search attribute information of the virtual item carried in the virtual item search request includes the following steps:
in step S301, a target attribute bit table is determined based on the search type information.
The target attribute bit table is an attribute bit table corresponding to the search type information, and the target attribute bit table includes position information of each attribute item in the attribute bit index symbol and number information corresponding to each attribute value of each attribute item.
For example, if the search type information is a cup, the determined target attribute bit table is an attribute bit table of the cup:
step S302, determining an attribute bit index character according to the search attribute information and the target attribute bit table.
Referring to fig. 4, the following steps S3021 to S3023 are specifically included:
step S3021, determining number information corresponding to each attribute value in the search attribute information according to the search attribute information and the target attribute bit table.
Assume that the search attribute information is: the 3 cm caliber and the 25 cm height can determine that the serial number information corresponding to the 3 cm caliber attribute value in the attribute information is 0 and the serial number information corresponding to the 25 cm height attribute value in the attribute information is 1 according to the target attribute bit table.
Step S3022, the number information corresponding to each attribute value in the search attribute information is moved in the same direction according to the position information of the attribute item corresponding to the number information in the attribute bit index, and the bit identifier corresponding to each attribute value in the search attribute information is obtained.
As an example in the step S3021, the number information of the 3 cm aperture attribute value is 0, and 0 is moved in the same direction according to the position information (i.e., 2 bits) of the attribute item (i.e., aperture item) corresponding to the number information in the attribute bit index, that is, 0 is moved to the right in the same manner and 2 bits are moved, so that the bit identifier corresponding to the obtained 3 cm aperture attribute value is 000;
the number information of the 25 cm height attribute value is 1, and 1 is moved in the same direction according to the position information (namely 3 bits) of the attribute item (namely the height item) corresponding to the number information in the attribute bit index, namely 1 is moved to the right similarly and is moved by 3 bits, and the obtained bit identifier corresponding to the 25 cm height attribute value is 0001.
Here, the moving direction of the equidirectional movement is the same as the moving direction in the above-described acquisition of the attribute bit identifier of the virtual item to be searched.
Step S3023, perform an or operation on the bit identifier corresponding to each attribute value in the search attribute information to obtain an attribute bit index.
As an example in step S3022, the attribute bit index is obtained by performing an or operation on 000 and 0001: 0001.
the above description describes the process of determining the attribute bit index in detail, and the following description describes the process of determining the target virtual object in detail.
In an optional embodiment of the present invention, referring to fig. 5, determining, based on the attribute bit identifier and the attribute bit index of the virtual item to be searched, a target virtual item that matches the search type information and the search attribute information carried by the virtual item search request in the virtual item to be searched includes:
in step S501, an attribute bit identifier of a target type virtual item is determined among the attribute bit identifiers of the virtual items to be searched.
Wherein the type of the target type virtual item corresponds to the search type information.
Step S502, based on the attribute bit identifier and the attribute bit index of the target type virtual article, determining the target virtual article in the target type virtual article.
In the embodiment of the present invention, the process of step S502 is divided into two cases, where the first case is a case where a target virtual item is determined in a target type virtual item when different bits in the attribute bit identifier represent different attribute information; case two is a case where a target virtual item is determined in the target type virtual item when different bits are present in the attribute bit identifier to collectively represent the same attribute information. The above two cases are described below:
the first condition is as follows: when different bits in the attribute bit identifier represent different attribute information, the step of determining the target virtual item in the target type virtual item based on the attribute bit identifier and the attribute bit index of the target type virtual item includes:
1) a first attribute bit identifier is determined among the attribute bit identifiers of the target type virtual items.
Wherein the first attribute bit identifier is not less than the attribute bit index;
this case is described below as an example, when the attribute bit of the cup is shown in the following table (only when the number of attribute values of each attribute item is not more than 2, different bits in the attribute bit identifier can represent different attribute information):
if the search type information is a cup and the search attribute information is a 5 cm caliber, an attribute bit index character of 01 can be calculated according to the process of the content.
Assuming that the cup type virtual article-attribute information-attribute bit identifiers (calculated from the attribute information and the attribute bit table) are respectively: 1-red cup, 5 cm caliber and 15 cm height-010; 2-yellow water cup, 5 cm caliber and 15 cm height-110; a cup is 3-yellow, the caliber is 3 cm, and the height is 25 cm to 101; the cup is 4-yellow, the caliber is 3 cm, and the height is 15 cm to 100; a water cup is 5-red, and has a caliber of 3 cm and a height of 25 cm to 001; the cup is 6-red, 5 cm in caliber and 25 cm in height-011.
That is, the attribute bit identifier of the cup type virtual article includes: {010, 110, 101, 100, 001, 011}, arranged in descending order, the results obtained were: {001, 010, 011, 100, 101, 110}, and the attribute bit index is 01, the determined first attribute bit identifier (i.e., attribute bit identifier of not less than 01) includes: {010, 011, 100, 101, 110}.
2) And the first attribute bit identifier and the attribute bit index identifier are subjected to AND operation, and a second attribute bit identifier is determined in the first attribute bit identifier according to the operation result.
As an example of the above 1), the first attribute bit identifiers {010, 011, 100, 101, 110} are respectively and-operated with the attribute bit index 01, and the result obtained corresponds to {010, 010, 000, 001, 010}, and the result equal to the first attribute bit identifier {010, 011, 110} corresponding to the attribute bit index 01 is used as the second attribute bit identifier.
3) The target virtual item is determined based on the second attribute bit identifier.
As shown in the above example 2), the second attribute bit identifier is {010, 011, 110}, and as shown in the example 1), the corresponding target virtual object includes: a water cup 1, a water cup 6 and a water cup 2.
The process of determining the target virtual item in case one is described above can be expressed by the following expression: v > -v _ f and v & v _ f-v _ f, where v _ f denotes an attribute bit index and v denotes a second attribute bit identifier.
Case two: when different bits exist in the attribute bit identifier and represent the same attribute information together, the step of determining the target virtual article in the target type virtual article based on the attribute bit identifier and the attribute bit index of the target type virtual article comprises the following steps:
a) a third attribute bit identifier is determined among the attribute bit identifiers of the target type virtual items.
Wherein the third attribute bit identifier is not less than the attribute bit index;
this is described below as a specific example, when the attribute bit table of the cup is as shown in the following table (when there is one attribute item whose number of attribute values is greater than 2, there are different bits in the attribute bit identifier to collectively represent the same attribute information):
assuming that the search type information is a cup, the search attribute information is black, and the aperture of 5 cm, the attribute bit index symbol can be calculated to be 101 according to the above process.
Assuming that the cup type virtual article-attribute information-attribute bit identifiers (calculated from the attribute information and the attribute bit table) are respectively: 1-black cup, 5 cm caliber and 15 cm height-1010; 2-yellow water cup, 5 cm caliber and 15 cm height-0110; a cup is 3-yellow, the caliber of 3 cm and the height of 25 cm are 0101; the cup is 4-white, 3 cm in caliber and 15 cm in height-1100; a water cup is 5-red, the caliber of 3 cm and the height of 25 cm are-0001; the cup is 6-white, 5 cm in caliber and 25 cm in height-1111.
That is, the attribute bit identifier of the cup type virtual article includes: {1010, 0110, 0101, 1100, 0001, 1111}, which are arranged in order from small to large, the result is: {0001, 0101, 0110, 1010, 1100, 1111}, and the attribute bit index is 101, then the determined third attribute bit identifier (i.e., attribute bit identifier of not less than 101) includes: {1010, 1100, 1111}.
b) And carrying out exclusive OR operation on the third attribute bit identifier and the attribute bit index identifier to obtain a fourth attribute bit identifier.
As an example in a) above, the third attribute bit identifier {1010, 1100, 1111} is exclusive-ored with the attribute bit index 101 to obtain the fourth attribute bit identifier {0000, 0110, 0101 }.
c) And carrying out non-operation on the fourth attribute bit identifier to obtain a fifth attribute bit identifier.
As in the example of b) above, the fourth attribute bit identifier {0000, 0110, 0101} is negated to obtain the fifth attribute bit identifier {1111, 1001, 1010 }.
d) And performing AND operation on the fifth attribute bit identifier and the search attribute item all-bit identifier, and determining a sixth attribute bit identifier in the third attribute bit identifier according to the operation result.
The identifier of the target position in the attribute bit identifier is a first preset value, the identifiers of the rest positions are second preset values, and the target position is the position of the attribute item corresponding to the search attribute information in the attribute bit identifier;
specifically, the first preset value may be 1, and the second preset value may be 0.
As an example in a) above, the search attribute information is black and 5 cm aperture, and it can be known that the search attribute items include: color and caliber, and the corresponding search attribute term all-bit identifier is: 1110.
and respectively performing AND operation on the fifth attribute bit identifiers {1111, 1001 and 1010} in the c) and the search attribute item all-bit identifier 1110 to obtain results corresponding to {1110, 1000 and 1011}, and taking the third attribute bit identifier {1010} of which the results are equal to the search attribute item all-bit identifier 1110 as a sixth attribute bit identifier.
e) The target virtual item is determined from the sixth attribute bit identifier.
As shown in d), the sixth attribute bit identifier is {1010}, and as shown in a), the target virtual object corresponding to the sixth attribute bit identifier is: a water cup 1.
The process of determining the target virtual article in case two above can be expressed by the following expression: v > -v _ f and (v xor v _ f) & v _ m-v _ m, where v _ f denotes an attribute bit index, v denotes a sixth attribute bit identifier, xor denotes an exclusive or operation, and x denotes a non-operation, and v _ m denotes a search attribute term all-bit identifier.
The method for searching the virtual articles in the game can quickly search and obtain the set of the target virtual articles meeting the search attribute information according to the search attribute information selected by the game player, and can calculate the result in real time; the multiple attribute information is represented by one attribute bit identifier (namely, the attribute information of the compressed virtual article is combined, and the multiple attribute information shares the index field of one attribute bit identifier), so that the multiple attribute information corresponding to the multiple attribute bit identifiers (namely, multiple indexes) can be avoided, and the occupation of memory, hard disk resources and the like is reduced.
The embodiment of the present invention further provides a device for searching for a virtual item in a game, where the device for searching for a virtual item in a game is mainly used for executing the method for searching for a virtual item in a game provided in the above-mentioned content of the embodiment of the present invention, and the following describes the device for searching for a virtual item in a game provided in the embodiment of the present invention in detail.
Fig. 6 is a schematic diagram of an apparatus for searching for a virtual item in a game according to an embodiment of the present invention, and as shown in fig. 6, the apparatus for searching for a virtual item in a game mainly includes: an acquisition unit 10, a first determination unit 20 and a second determination unit 30, wherein:
the acquiring unit 10 is configured to acquire attribute bit identifiers of virtual items to be searched in a game, where each attribute bit identifier is used to represent multiple kinds of attribute information of a corresponding virtual item to be searched;
a first determining unit 20, configured to determine, in response to a virtual item search request, an attribute bit index based on search type information and search attribute information of a virtual item carried in the virtual item search request;
and the second determining unit 30 is configured to determine, based on the attribute bit identifier and the attribute bit index of the virtual item to be searched, a target virtual item that matches the search type information and the search attribute information carried by the virtual item search request, from among the virtual items to be searched.
In an embodiment of the present invention, a method for searching for a virtual item in a game is provided, where the method includes: acquiring attribute bit identifiers of virtual articles to be searched in a game, wherein each attribute bit identifier is used for representing various attribute information of the corresponding virtual article to be searched; responding to a virtual article search request, and determining an attribute bit index character based on search type information and search attribute information of a virtual article carried in the virtual article search request; and determining a target virtual article which is consistent with the search type information and the search attribute information carried by the virtual article search request in the virtual article to be searched based on the attribute bit identifier and the attribute bit index of the virtual article to be searched. According to the description, on the basis that various attribute information of each virtual article to be searched is represented by one attribute bit identifier and the virtual article search request is represented by the attribute bit index, and finally the target virtual article corresponding to the search type information and the search attribute information carried by the virtual article search request is determined, the attribute bit index and each attribute bit identifier are only required to be calculated, all virtual articles do not need to be traversed according to the search attribute information, the efficiency of searching the target virtual article corresponding to the search type information and the search attribute information is improved, the requirement of real-time search can be met, in addition, compared with the traditional method that an index is required to be established independently for each attribute information, one attribute bit identifier in the invention can represent various attribute information of the corresponding virtual article to be searched, physical resource cost is reduced, namely the searching method of the virtual article in the game can give consideration to both searching efficiency and resource cost, and the technical problem that the searching efficiency and the resource cost cannot be given consideration to the existing searching method of the virtual article is solved.
Optionally, the obtaining unit is further configured to: classifying each virtual article to be searched in the game according to the type of the virtual article to obtain the virtual article to be searched corresponding to each type of the virtual article; acquiring an attribute bit table corresponding to each virtual article type, wherein the attribute bit table comprises position information of each attribute item in an attribute bit identifier and number information corresponding to each attribute value of each attribute item; and calculating the attribute bit identifier of each virtual item to be searched in the corresponding virtual item type based on the attribute bit table.
Optionally, the obtaining unit is further configured to: acquiring attribute information of a virtual article to be searched; determining number information corresponding to each attribute value in the attribute information of the virtual article to be searched according to the attribute information and the attribute bit table of the virtual article to be searched; and coding according to the number information corresponding to each attribute value in the attribute information and the position information of each attribute item in the attribute bit table in the attribute bit identifier to obtain the attribute bit identifier of each virtual article to be searched.
Optionally, the obtaining unit is further configured to: moving the number information corresponding to each attribute value in the attribute information in the same direction according to the position information of the attribute item corresponding to the number information in the attribute bit identifier to obtain the bit identifier corresponding to each attribute value in the attribute information; and performing OR operation on the bit identifiers corresponding to the attribute values in the attribute information to obtain the attribute bit identifiers of the virtual articles to be searched.
Optionally, the first determining unit is further configured to: determining a target attribute bit table based on the search type information, wherein the target attribute bit table is an attribute bit table consistent with the search type information, and the target attribute bit table comprises position information of each attribute item in an attribute bit index symbol and number information corresponding to each attribute value of each attribute item; and determining an attribute bit index character according to the search attribute information and the target attribute bit table.
Optionally, the first determining unit is further configured to: determining number information corresponding to each attribute value in the search attribute information according to the search attribute information and the target attribute bit table; moving the number information corresponding to each attribute value in the search attribute information in the same direction according to the position information of the attribute item corresponding to the number information in the attribute bit index symbol to obtain a bit identifier corresponding to each attribute value in the search attribute information; and performing OR operation on the bit identifiers corresponding to the attribute values in the search attribute information to obtain attribute bit indexes.
Optionally, the second determining unit is further configured to: determining an attribute bit identifier of a target type virtual article in the attribute bit identifiers of the virtual articles to be searched, wherein the type of the target type virtual article is consistent with the search type information; and determining the target virtual article in the target type virtual article based on the attribute bit identifier and the attribute bit index of the target type virtual article.
Optionally, when different bits in the attribute bit identifier represent different attribute information, the second determining unit is further configured to: determining a first attribute bit identifier in the attribute bit identifiers of the target type virtual articles, wherein the first attribute bit identifier is not smaller than the attribute bit index; performing AND operation on the first attribute bit identifier and the attribute bit index, and determining a second attribute bit identifier in the first attribute bit identifier according to the operation result; the target virtual item is determined based on the second attribute bit identifier.
Optionally, when different bits in the attribute bit identifier collectively represent the same attribute information, the second determining unit is further configured to: determining a third attribute bit identifier in the attribute bit identifiers of the target type virtual articles, wherein the third attribute bit identifier is not smaller than the attribute bit index; performing exclusive-or operation on the third attribute bit identifier and the attribute bit index identifier to obtain a fourth attribute bit identifier; performing non-operation on the fourth attribute bit identifier to obtain a fifth attribute bit identifier; performing AND operation on the fifth attribute bit identifier and the search attribute item all-bit identifier, and determining a sixth attribute bit identifier in the third attribute bit identifier according to the operation result, wherein the search attribute item all-bit identifier is that the identifier of the target position in the attribute bit identifier is a first preset value, the identifiers of the rest positions are second preset values, and the target position is the position of the attribute item corresponding to the search attribute information in the attribute bit identifier; the target virtual item is determined from the sixth attribute bit identifier.
The device provided by the embodiment of the present invention has the same implementation principle and technical effect as the method embodiments, and for the sake of brief description, reference may be made to the corresponding contents in the method embodiments without reference to the device embodiments.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the foregoing systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again. The device for determining the booth in the game provided by the embodiment of the application has the same technical characteristics as the method for determining the booth in the game provided by the embodiment, so that the same technical problems can be solved, and the same technical effects are achieved.
The embodiment of the application further provides a terminal, and particularly, the terminal comprises a processor and a storage device; the storage means has stored thereon a computer program which, when executed by the processor, performs the method according to the above embodiments.
As an example, as shown in fig. 7, an embodiment of the present application provides a computer device 400, including: a processor 401, a memory 402 and a bus, the memory 402 storing machine-readable instructions executable by the processor 401, the processor 401 and the memory 402 communicating via the bus when the computer device is running, the processor 401 executing the machine-readable instructions to perform the steps of the method for searching for a virtual item in a game as described above.
Specifically, the memory 402 and the processor 401 can be general-purpose memory and processor, which are not limited to specific embodiments, and when the processor 401 runs the computer program stored in the memory 402, the method for searching for the virtual item in the game can be executed.
The computer device 400 may be used to execute the method for searching for a virtual item in a game shown in fig. 1, and in this case, the computer device 400 may be a development terminal.
Corresponding to the method for searching for the virtual item in the game, the embodiment of the application also provides a computer-readable storage medium, wherein the computer-readable storage medium stores machine executable instructions, and when the computer executable instructions are called and executed by a processor, the computer executable instructions cause the processor to execute the steps of the method for searching for the virtual item in the game.
The device for searching for a virtual item in a game provided by the embodiment of the application can be specific hardware on a device, or software or firmware installed on the device, and the like. The device provided by the embodiment of the present application has the same implementation principle and technical effect as the foregoing method embodiments, and for the sake of brief description, reference may be made to the corresponding contents in the foregoing method embodiments where no part of the device embodiments is mentioned. It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the foregoing systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one logical division, and there may be other divisions when actually implemented, and for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection of devices or units through some communication interfaces, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method can be implemented in other ways. The apparatus embodiments described above are merely illustrative, and for example, the flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
In addition, functional units in the embodiments provided in the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application or portions thereof that substantially contribute to the prior art may be embodied in the form of a software product stored in a storage medium and including instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the mobile control method according to the embodiments of the present application. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus once an item is defined in one figure, it need not be further defined and explained in subsequent figures, and moreover, the terms "first", "second", "third", etc. are used merely to distinguish one description from another and are not to be construed as indicating or implying relative importance.
Finally, it should be noted that: the above-mentioned embodiments are only specific embodiments of the present application, and are used for illustrating the technical solutions of the present application, but not limiting the same, and the scope of the present application is not limited thereto, and although the present application is described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: any person skilled in the art can modify or easily conceive the technical solutions described in the foregoing embodiments or equivalent substitutes for some technical features within the technical scope disclosed in the present application; the modifications, changes or substitutions do not cause the essence of the corresponding technical solutions to depart from the scope of the technical solutions of the embodiments of the present application, and all of the technical solutions are intended to be covered by the scope of the present application.
Claims (12)
1. A method for searching for a virtual item in a game, comprising:
acquiring attribute bit identifiers of virtual articles to be searched in a game, wherein each attribute bit identifier is used for representing various attribute information of the corresponding virtual article to be searched;
responding to a virtual article search request, and determining an attribute bit index character based on search type information and search attribute information of a virtual article carried in the virtual article search request;
and determining a target virtual article which is consistent with the search type information and the search attribute information carried by the virtual article search request in the virtual article to be searched based on the attribute bit identifier and the attribute bit index of the virtual article to be searched.
2. The method of claim 1, wherein obtaining an attribute bit identifier of a virtual item to be searched for in the game comprises:
classifying each virtual article to be searched in the game according to the type of the virtual article to obtain the virtual article to be searched corresponding to each type of the virtual article;
acquiring an attribute bit table corresponding to each virtual article type, wherein the attribute bit table comprises position information of each attribute item in the attribute bit identifier and number information corresponding to each attribute value of each attribute item;
and calculating the attribute bit identifier of each virtual item to be searched in the corresponding virtual item type based on the attribute bit table.
3. The method of claim 2, wherein calculating the attribute bit identifier of each virtual item to be searched in the corresponding virtual item type based on the attribute bit table comprises:
acquiring attribute information of the virtual article to be searched;
determining number information corresponding to each attribute value in the attribute information of the virtual article to be searched according to the attribute information of the virtual article to be searched and the attribute bit table;
and coding according to the number information corresponding to each attribute value in the attribute information and the position information of each attribute item in the attribute bit table in the attribute bit identifier to obtain the attribute bit identifier of each virtual article to be searched.
4. The method of claim 3, wherein encoding according to the number information corresponding to each attribute value in the attribute information and the position information of each attribute item in the attribute bit table in the attribute bit identifier comprises:
moving the number information corresponding to each attribute value in the attribute information in the same direction according to the position information of the attribute item corresponding to the number information in the attribute bit identifier to obtain the bit identifier corresponding to each attribute value in the attribute information;
and performing OR operation on the bit identifiers corresponding to the attribute values in the attribute information to obtain the attribute bit identifiers of the virtual articles to be searched.
5. The method of claim 1, wherein determining an attribute bit index based on search type information and search attribute information of a virtual item carried in the virtual item search request comprises:
determining a target attribute bit table based on the search type information, wherein the target attribute bit table is an attribute bit table conforming to the search type information, and the target attribute bit table comprises position information of each attribute item in the attribute bit index character and number information corresponding to each attribute value of each attribute item;
and determining the attribute bit index character according to the search attribute information and the target attribute bit table.
6. The method of claim 5, wherein determining the attribute bit index from the search attribute information and the target attribute bit table comprises:
determining number information corresponding to each attribute value in the search attribute information according to the search attribute information and the target attribute bit table;
moving the number information corresponding to each attribute value in the search attribute information in the same direction according to the position information of the attribute item corresponding to the number information in the attribute bit index symbol to obtain the bit identifier corresponding to each attribute value in the search attribute information;
and performing OR operation on bit identifiers corresponding to the attribute values in the search attribute information to obtain the attribute bit index identifier.
7. The method according to claim 1, wherein determining a target virtual item among the virtual items to be searched that matches the search type information and the search attribute information carried by the virtual item search request based on the attribute bit identifier and the attribute bit index of the virtual item to be searched comprises:
determining an attribute bit identifier of a target type virtual article in the attribute bit identifiers of the virtual articles to be searched, wherein the type of the target type virtual article is consistent with the search type information;
determining the target virtual item in the target type virtual item based on the attribute bit identifier and the attribute bit indexer of the target type virtual item.
8. The method of claim 7, wherein determining the target virtual item in the target type virtual item based on the attribute bit identifier of the target type virtual item and the attribute bit index when different bits in the attribute bit identifier represent different attribute information comprises:
determining a first attribute bit identifier in the attribute bit identifiers of the target type virtual items, wherein the first attribute bit identifier is not less than the attribute bit index;
performing AND operation on the first attribute bit identifier and the attribute bit index, and determining a second attribute bit identifier in the first attribute bit identifier according to an operation result;
determining the target virtual item according to the second attribute bit identifier.
9. The method of claim 7, wherein determining the target virtual item in the target type virtual item based on the attribute bit identifier of the target type virtual item and the attribute bit index when there are different bits in the attribute bit identifier that collectively represent the same attribute information comprises:
determining a third attribute bit identifier in the attribute bit identifiers of the target type virtual items, wherein the third attribute bit identifier is not less than the attribute bit index;
performing exclusive-or operation on the third attribute bit identifier and the attribute bit index identifier to obtain a fourth attribute bit identifier;
performing non-operation on the fourth attribute bit identifier to obtain a fifth attribute bit identifier;
performing and operation on the fifth attribute bit identifier and a search attribute item all-bit identifier, and determining a sixth attribute bit identifier in the third attribute bit identifier according to an operation result, wherein the search attribute item all-bit identifier is that an identifier of a target position in the attribute bit identifier is a first preset value, identifiers of other positions are second preset values, and the target position is a position of an attribute item corresponding to the search attribute information in the attribute bit identifier;
determining the target virtual item from the sixth attribute bit identifier.
10. An apparatus for searching for a virtual object in a game, comprising:
the system comprises an acquisition unit, a search unit and a search unit, wherein the acquisition unit is used for acquiring attribute bit identifiers of virtual articles to be searched in a game, and each attribute bit identifier is used for representing various kinds of attribute information of the corresponding virtual article to be searched;
a first determining unit, configured to determine, in response to a virtual item search request, an attribute bit index based on search type information and search attribute information of a virtual item carried in the virtual item search request;
and the second determining unit is used for determining a target virtual article which is consistent with the search type information and the search attribute information carried by the virtual article search request in the virtual article to be searched based on the attribute bit identifier and the attribute bit index of the virtual article to be searched.
11. A terminal comprising a memory, a processor, and a computer program stored in the memory and operable on the processor, wherein the processor, when executing the computer program, performs the steps of the method according to any of the preceding claims 1 to 9.
12. A computer readable storage medium having stored thereon machine executable instructions which, when invoked and executed by a processor, cause the processor to execute the method of any of claims 1 to 9.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010901160.9A CN111939569B (en) | 2020-08-31 | 2020-08-31 | Method, device and terminal for searching virtual articles in game |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010901160.9A CN111939569B (en) | 2020-08-31 | 2020-08-31 | Method, device and terminal for searching virtual articles in game |
Publications (2)
Publication Number | Publication Date |
---|---|
CN111939569A true CN111939569A (en) | 2020-11-17 |
CN111939569B CN111939569B (en) | 2024-02-09 |
Family
ID=73367904
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010901160.9A Active CN111939569B (en) | 2020-08-31 | 2020-08-31 | Method, device and terminal for searching virtual articles in game |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111939569B (en) |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2004102353A2 (en) * | 2003-05-12 | 2004-11-25 | Gtech Rhode Island Corporation | Method and system for authentication |
WO2009067683A2 (en) * | 2007-11-21 | 2009-05-28 | Kiz Toys, Inc. | Systems and methods for providing a virtual world commodity device |
CN107390875A (en) * | 2017-07-28 | 2017-11-24 | 腾讯科技(上海)有限公司 | Information processing method, device, terminal device and computer-readable recording medium |
CN108176054A (en) * | 2017-12-27 | 2018-06-19 | 网易(杭州)网络有限公司 | Virtual article trading method, apparatus, electronic equipment and storage medium |
CN108579090A (en) * | 2018-04-16 | 2018-09-28 | 腾讯科技(深圳)有限公司 | Article display method, apparatus in virtual scene and storage medium |
-
2020
- 2020-08-31 CN CN202010901160.9A patent/CN111939569B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2004102353A2 (en) * | 2003-05-12 | 2004-11-25 | Gtech Rhode Island Corporation | Method and system for authentication |
WO2009067683A2 (en) * | 2007-11-21 | 2009-05-28 | Kiz Toys, Inc. | Systems and methods for providing a virtual world commodity device |
CN107390875A (en) * | 2017-07-28 | 2017-11-24 | 腾讯科技(上海)有限公司 | Information processing method, device, terminal device and computer-readable recording medium |
CN108176054A (en) * | 2017-12-27 | 2018-06-19 | 网易(杭州)网络有限公司 | Virtual article trading method, apparatus, electronic equipment and storage medium |
CN108579090A (en) * | 2018-04-16 | 2018-09-28 | 腾讯科技(深圳)有限公司 | Article display method, apparatus in virtual scene and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN111939569B (en) | 2024-02-09 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN105528372B (en) | A kind of address search method and equipment | |
US10013438B2 (en) | Distributed image search | |
CN107895038B (en) | Link prediction relation recommendation method and device | |
EP3425493A1 (en) | Data processing method and apparatus | |
CN111966912B (en) | Recommendation method and device based on knowledge graph, computer equipment and storage medium | |
CN110020086B (en) | User portrait query method and device | |
CN108717407A (en) | Entity vector determines method and device, information retrieval method and device | |
CN105787126B (en) | K-d tree generation method and k-d tree generation device | |
KR102215299B1 (en) | Error correction method and device and computer readable medium | |
CN105528345B (en) | Terminal, server and character complementing method | |
CN113568940B (en) | Method, device, equipment and storage medium for data query | |
CN111177476A (en) | Data query method and device, electronic equipment and readable storage medium | |
CN112148217B (en) | Method, device and medium for caching deduplication metadata of full flash memory system | |
CN114817651B (en) | Data storage method, data query method, device and equipment | |
CN102930004B (en) | Hash value storage method, device and chip | |
CN102298618B (en) | Method for obtaining matching degree to execute corresponding operations and device and equipment | |
CN109254962B (en) | Index optimization method and device based on T-tree and storage medium | |
CN111939569A (en) | Method and device for searching virtual article in game and terminal | |
CN113918807A (en) | Data recommendation method and device, computing equipment and computer-readable storage medium | |
CN115918110A (en) | Spatial search using key-value store | |
CN111767287A (en) | Data import method, device, equipment and computer storage medium | |
CN117171161A (en) | Data query method and device | |
CN111752734A (en) | Abnormal data classification method, abnormal data analysis method, abnormal data classification device and abnormal data analysis device, and storage medium | |
CN106980673A (en) | Main memory database table index updating method and system | |
CN111414527A (en) | Similar item query method and device and 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 |