Identifier mapping method, device and equipment of virtual item and storage medium
By establishing mapping table association identifiers and attributes for virtual props, the complexity problem when adding new attributes to virtual props is solved, seamless compatibility and efficient attribute management are achieved, and the flexibility and scalability of the system are improved.
Patent Information
- Application Number
- CN202410078750.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-18
- Publication Date
- 2025-07-18
AI Technical Summary
When adding attributes to virtual props in the prior art, it is necessary to modify the database table structure and business code, resulting in a complicated implementation process.
When adding attributes to virtual props, a mapping table is established to associate the first identifier of the virtual prop, the second identifier of the virtual prop and the first attribute of the virtual props are extended, so as to avoid adding new fields in the original data table, and only add mapping code to the business code to achieve attribute compatibility.
It simplifies the implementation process of adding properties to virtual props, avoids modification of database table structure, reduces the impact on business code, and improves the flexibility and scalability of the system.
Smart Images

Figure CN120324908A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of database technology, and particularly to a method, apparatus, device, and storage medium for identity mapping of virtual items. Background Art
[0002] In an application that supports a virtual environment, virtual items are provided for use by a user's virtual character. In the data table related to the application, the identity of the virtual item is involved, such as the identity document number (Identity Document, ID) of the virtual item.
[0003] To improve the user experience, virtual items may have certain attributes. For example, wearable equipment has attributes such as durability and materials. When adding attributes that the virtual item originally does not have to obtain an extended virtual item, it is necessary to add fields related to the newly added attributes of the virtual item in the data table used to store the virtual item, so as to establish an association relationship between the extended virtual item and the newly added attributes, thereby realizing adding attributes to the virtual item. The virtual item (extended virtual item) after adding attributes can be regarded as a different virtual item from the virtual item before adding attributes.
[0004] When adding attributes to a virtual item through the above solution, it will cause the table structure of the database to change, and the relevant business code also needs to be modified accordingly. The implementation process of adding attributes to the virtual item is relatively complex. Summary of the Invention
[0005] This application provides a method, apparatus, device, and storage medium for identity mapping of virtual items, which can simplify the implementation process of adding attributes to virtual items. The technical solutions are as follows:
[0006] According to one aspect of this application, a method for identity mapping of virtual items is provided. The method includes:
[0007] Obtain a first identity of a virtual item;
[0008] Obtain an extended virtual item by adding a first attribute to the virtual item;
[0009] Obtain a second identity of the extended virtual item;
[0010] Associate and store the first identity of the virtual item, the second identity of the extended virtual item, and the first attribute in a mapping table.
[0011] According to another aspect of this application, an apparatus for identity mapping of virtual items is provided. The apparatus includes:
[0012] An obtaining module, configured to obtain a first identity of a virtual item;
[0013] A new module is used to obtain an extended virtual item by adding a first attribute to the virtual item;
[0014] The obtaining module is further configured to obtain a second identifier of the extended virtual item;
[0015] A storage module is used to associatively store the first identifier of the virtual item, the second identifier of the extended virtual item, and the first attribute in a mapping table.
[0016] In an alternative design, each extended virtual item has a value of one of the first attributes, and the values of the first attributes of different extended virtual items are different; the obtaining module is configured to obtain the second identifier corresponding to each extended virtual item; the storage module is configured to associatively store the first identifier of the virtual item, the second identifier of the extended virtual item, and the value of the extended virtual item in the first attribute in the mapping table.
[0017] In an alternative design, the obtaining module is configured to, when the value of the first attribute of the extended virtual item is not the default value of the first attribute, obtain the second identifier of the extended virtual item by generating a first auto-incrementing identifier, and the first auto-incrementing identifier is globally unique in the mapping table.
[0018] In an alternative design, the virtual item has a value of one of the second attributes, the first identifier is the initial identifier of the virtual item, and the initial identifier is set for the virtual item when no attribute is set for the virtual item; the obtaining module is configured to obtain a third identifier of the virtual item by generating a second auto-incrementing identifier, and the second auto-incrementing identifier is globally unique in the mapping table; the storage module is configured to associatively store the initial identifier of the virtual item, the third identifier of the virtual item, and the value of the virtual item in the second attribute in the mapping table.
[0019] In an alternative design, the obtaining module is configured to, when the value of the first attribute of the extended virtual item is the default value of the first attribute, determine the third identifier of the virtual item as the second identifier of the extended virtual item.
[0020] In an alternative design, the device further includes a receiving module, configured to receive a listing request for the extended virtual item, where the listing request carries a first identifier of the virtual item and a first attribute value in the first attributes; a determining module, configured to determine a first matching identifier from the second identifiers recorded in the mapping table according to the listing request, where the first matching identifier has an association relationship with the first identifier and the first attribute value; and a storage module, configured to store the first matching identifier in a data table of the listed virtual items.
[0021] In an alternative design, the device further includes a receiving module, configured to receive a query request for the listed virtual item, where the query request carries a first identifier of the virtual item and a second attribute value in the first attributes; a determining module, configured to determine a second matching identifier from the second identifiers recorded in the mapping table according to the query request, where the second matching identifier has an association relationship with the first identifier and the second attribute value; and a query module, configured to query data in the data table of the listed virtual items through the second matching identifier.
[0022] In an alternative design, the device further includes a receiving module, configured to receive a purchase request for the listed virtual item, where the purchase request carries a first identifier of the virtual item and a third attribute value in the first attributes; a determining module, configured to determine a third matching identifier from the second identifiers recorded in the mapping table according to the purchase request, where the third matching identifier has an association relationship with the first identifier and the third attribute value; and a processing module, configured to process purchase data associated with the third matching identifier in the data table of the listed virtual items according to the purchase request.
[0023] In an alternative design, the device further includes a receiving module, configured to receive an identifier query request for the mapping table, where the identifier query request carries a first identifier of the virtual item and a fourth attribute value in the first attributes; a splicing module, configured to splice the first identifier of the virtual item and the fourth attribute value to obtain a query key; and a query module, configured to query a query result of the identifier query request in the mapping table through the query key.
[0024] In an alternative design, the device further includes a receiving module, configured to receive an attribute query request for the mapping table, where the attribute query request carries a second identifier of the extended virtual item; a determining module, configured to determine the second identifier of the extended virtual item as a query key; and a query module, configured to query a query result of the attribute query request in the mapping table through the query key.
[0025] In an alternative design, the obtaining module is configured to obtain a first identifier of the virtual item in the client; and the storage module is configured to associatively store the first identifier of the virtual item, a second identifier of the extended virtual item, and the first attribute in a mapping table on the server side.
[0026] According to another aspect of the present application, there is provided a computer device, which includes a processor and a memory. At least one program is stored in the memory, and the at least one program is loaded and executed by the processor to implement the identifier mapping method of the virtual item as described in the above aspect.
[0027] According to another aspect of the present application, there is provided a computer-readable storage medium, in which at least one program is stored, and the at least one program is loaded and executed by a processor to implement the identifier mapping method of the virtual item as described in the above aspect.
[0028] According to another aspect of the present application, there is provided a computer program product or a computer program, which includes 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 identifier mapping method of the virtual item provided in various alternative implementations of the above aspect.
[0029] The beneficial effects brought by the technical solution provided in the present application at least include:
[0030] In the process of adding a first attribute to a virtual item, by obtaining a second identifier of the extended virtual item obtained by adding the first attribute, and associatively storing the first identifier of the virtual item, the added first attribute, and the second identifier of the extended virtual item, the mapping relationship between the virtual item before adding the first attribute, the added first attribute, and the extended virtual item after adding the first attribute can be established, thereby completing the addition of attributes to the virtual item. In this process, since there is no need to add a new field to the original data table for storing information of the virtual item to store the new attribute, but to implement the addition of the new attribute by establishing an additional mapping relationship, that is, a mapping table, it is possible to avoid modifying the table structure of the database. Moreover, when using the mapping table to manage the extended virtual item, only a section of mapping code for calling the mapping table needs to be added to the business code to implement compatibility with the added attribute, and the impact on the business code is also small. Therefore, the implementation process of adding attributes to the virtual item can be simplified. Description of the Drawings
[0031] To more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the accompanying drawings required for the description of the embodiments. Obviously, the accompanying drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other accompanying drawings can be obtained based on these drawings.
[0032] Figure 1 It is a structural block diagram of a computer system provided by an exemplary embodiment of the present application;
[0033] Figure 2 It is a schematic diagram of the identification mapping process of virtual props provided by an exemplary embodiment of the present application;
[0034] Figure 3 It is a schematic flowchart of the identification mapping method of virtual props provided by an exemplary embodiment of the present application;
[0035] Figure 4 It is a schematic flowchart of the identification mapping method of virtual props provided by an exemplary embodiment of the present application;
[0036] Figure 5 It is a schematic diagram of the identification query process provided by an exemplary embodiment of the present application;
[0037] Figure 6 It is a schematic diagram of the attribute query process provided by an exemplary embodiment of the present application;
[0038] Figure 7 It is a structural schematic diagram of the identification mapping device of virtual props provided by an exemplary embodiment of the present application;
[0039] Figure 8 It is a structural schematic diagram of the identification mapping device of virtual props provided by an exemplary embodiment of the present application;
[0040] Figure 9 It is a structural schematic diagram of the identification mapping device of virtual props provided by an exemplary embodiment of the present application;
[0041] Figure 10 It is a structural schematic diagram of the identification mapping device of virtual props provided by an exemplary embodiment of the present application;
[0042] Figure 11 It is a structural schematic diagram of the identification mapping device of virtual props provided by an exemplary embodiment of the present application;
[0043] Figure 12 It is a structural schematic diagram of a computer device provided by an exemplary embodiment of the present application.
[0044] The accompanying drawings here are incorporated into the specification and form a part of this specification, showing embodiments in line with this application, and are used together with the specification to explain the principles of this application. Detailed implementation manners
[0045] To make the objectives, technical solutions, and advantages of this application clearer, the following will further describe the embodiments of this application in detail with reference to the accompanying drawings.
[0046] First, introduce the nouns involved in the embodiments of this application:
[0047] Virtual environment: It is a virtual environment displayed (or provided) when an application runs on a terminal. This virtual environment can be a simulation environment of the real world, a semi-simulated and semi-fictional environment, or a purely fictional environment. The virtual environment can be any one of a two-dimensional virtual environment, a 2.5D virtual environment, and a three-dimensional virtual environment. The embodiments of this application do not limit this.
[0048] Virtual character: A virtual character refers to an active object in a virtual environment. This active object can be a virtual person, a virtual animal, an anime character, etc. For example: a person displayed in a three-dimensional virtual environment. Optionally, a virtual character is a three-dimensional solid model created based on animation skeleton technology. Each virtual character has its own shape and volume in the three-dimensional virtual world and occupies a part of the space in the three-dimensional virtual world.
[0049] Virtual prop: A virtual prop refers to a prop that a virtual character can use, such as a prop and / or equipment that a virtual character can use in a virtual environment. Exemplarily, virtual props can be divided into wearable props, attack props, consumable props, and other props, etc. In some embodiments, the virtual props in this application are obtained by simulating entities existing in the real world and have the same attributes as the entities in the real world. For example, a helmet in virtual props is obtained by simulating a helmet in the real world and can have an attribute such as material, for example, including materials such as stainless steel, aluminum alloy, and carbon fiber.
[0050] User Interface (UI) control: It refers to any visible control or element that can be seen on the user interface of an application. For example, controls such as pictures, input boxes, text boxes, buttons, labels, etc., and some of these UI controls respond to user operations.
[0051] Auto-increment identifier: The auto-increment identifier is globally unique in the data table. When generating an auto-increment identifier for the data in the data table each time, the auto-increment identifier generated this time will increment compared to the auto-increment identifier generated last time. For example, the auto-increment identifier will increment by 1 each time it is generated.
[0052] The method provided in this application can be applied to the server corresponding to the application that supports the virtual environment or the server side in the server. Exemplarily, the application that supports the virtual environment is an application in which the user can control the behavior of the virtual character in the virtual environment. Exemplarily, the applications that support the virtual environment include: Virtual Reality (VR) applications, Augmented Reality (AR) applications, social applications, interactive entertainment applications, metaverse applications, three-dimensional map programs, VR games, AR games, Shooting Game (STG), First-Person Shooting Game (FPS), Third-Personal Shooting Game (TPS), Fight Technology Game (FTG), Action Game (ACT), Multiplayer Online Battle Arena (MOBA) games, Real-Time Strategy Game (RTS), Massive / Massively Multiplayer Online Game (MMOG), arcade games, Simulation Game (SLG), party games, and any one of the programs mentioned above.
[0053] Exemplarily, the game in the virtual environment is composed of the maps of one or more game worlds. The virtual environment in the game can simulate the scenes of the real world. The user can control the virtual character in the game to perform actions such as walking, running, jumping, shooting, fighting, driving, etc. in the virtual environment, and can also control the virtual vehicle to drive in the virtual environment. The interactivity is relatively strong, and multiple users can form teams online to play competitive games.
[0054] In some embodiments, the client of the above application can support at least one of the operating systems such as Windows operating system, Android operating system, IOS operating system, and LINUX operating system, and the clients of different operating systems can communicate with each other. In some embodiments, the above client is a program applicable to a mobile terminal with a touch screen. In some embodiments, the above client is an application developed based on a three-dimensional engine. For example, the three-dimensional engine is the Unity engine.
[0055] Figure 1It is a block diagram of the structure of a computer system provided by an exemplary embodiment of the present application. The computer system 100 includes: a first terminal 110, a second terminal 120, and a server cluster 130.
[0056] The first terminal 110 installs and runs an application 111 that supports a virtual environment. The application 111 can be a client that supports a virtual environment. When the first terminal 110 runs the application 111, the user interface of the application 111 is displayed on the screen of the first terminal 110. The application 111 can be any one of games such as FPS games, TPS games, MOBA games, competitive games, SLG games, racing games, car racing games, and party games. The first terminal 110 is a terminal used by the first user 112, and the first user 112 uses the first terminal 110 to control the behavior of the first virtual character located in the virtual environment.
[0057] The second terminal 120 installs and runs an application 121 that supports a virtual environment. The application 121 can be a client that supports a virtual environment. When the second terminal 120 runs the application 121, the user interface of the application 121 is displayed on the screen of the second terminal 120. The application 121 can be any one of games such as FPS games, TPS games, MOBA games, competitive games, SLG games, racing games, car racing games, and party games. Optionally, the application 111 and the application 121 are exactly the same, or are the same application under different operating systems, or are different versions of the same application. The second terminal 120 is a terminal used by the second user 122, and the second user 122 uses the second terminal 120 to control the behavior of the second virtual character located in the virtual environment. In some embodiments, in a shooting game, the second virtual character and the first virtual character belong to the same camp or different camps. When they belong to the same camp, there is at least one third virtual character in the virtual environment, and the third virtual character is controlled by a third user of an application on a third terminal, and the third virtual character belongs to the enemy camp of the first virtual character.
[0058] The device types of the first terminal 110 and the second terminal 120 include at least one of a smart phone, a tablet computer, an e-book reader, an MP3 player, an MP1 player, a laptop computer, and a desktop computer.
[0059] Figure 1Only two terminals are shown, but there are multiple other terminals 140 in different embodiments. In some embodiments, there is at least one other terminal 140 that is the terminal corresponding to the developer. A development and editing platform for the client of the virtual environment is installed on the other terminal 140. The developer can edit and update the client on the other terminal 140, and transmit the updated client installation package to the server cluster 130 through a wired or wireless network. The first terminal 110 and the second terminal 120 can download the client installation package from the server cluster 130 to update the client.
[0060] The first terminal 110, the second terminal 120, and the other terminals 140 are connected to the server cluster 130 through a wireless network or a wired network.
[0061] The server cluster 130 includes at least one of a server, multiple servers, a cloud computing platform, and a virtualization center. The server cluster 130 is used to provide background services for the client that supports the virtual environment. Optionally, the server cluster 130 undertakes the main computing work, and the terminal undertakes the secondary computing work; or, the server cluster 130 undertakes the secondary computing work, and the terminal undertakes the main computing work; or, a distributed computing architecture is adopted between the server cluster 130 and the terminal for collaborative computing.
[0062] Optionally, the above terminals and servers are all computer devices.
[0063] In a schematic example, the server cluster 130 includes a server 131 and a server 136. The server 131 includes a processor 132, a user account database 133, a game service module 134, and a user-oriented input / output interface (I / O interface) 135. Among them, the processor 132 is used to load the instructions stored in the server 131 and process the data in the user account database 133 and the game service module 134; the user account database 133 is used to store the data of the user accounts used by the first terminal 110, the second terminal 120, and the other terminals 140, such as the avatars of the user accounts, the nicknames of the user accounts, the virtual items owned by the user accounts, and the service areas where the user accounts are located; the game service module 134 is used to provide services for the games carried out by virtual characters in different camps; the user-oriented I / O interface 135 is used to establish communication with the first terminal 110 through a wireless network or a wired network to exchange data.
[0064] Combined with the above introduction to the virtual environment and the description of the implementation environment, the identification mapping method of the virtual item provided by the embodiment of the present application will be described below.
[0065] Figure 2It is a schematic diagram of the identification mapping process of virtual props provided by an exemplary embodiment of the present application. As Figure 2 shown, the virtual prop corresponds to a first identifier 201, and the first identifier 201 is the initial identifier (original prop ID) of the virtual prop. In some embodiments, the initial identifier is the identifier set for the virtual prop without setting attributes for the virtual prop. For example, the first identifier 201 of the "recruit helmet" is "11010001002". In the case of adding a first attribute 204 to the virtual prop, the computer device can obtain an extended virtual prop. Among them, each extended virtual prop has an attribute value in the first attribute, and the attribute values of different extended virtual props in the first attribute are different. After that, the computer device will obtain the second identifier (mapped prop ID) 202 of each extended virtual prop, and associate and store the first identifier 201 of the virtual prop, the second identifier 202 of the extended virtual prop, and the attribute value of the extended virtual prop in the first attribute 204 in the mapping table 205, so as to establish Figure 2 the mapping relationship shown in (including the mapping relationship with the second attribute 203, which will be specifically introduced below), and realize adding the first attribute 204 to the virtual prop. In some embodiments, the virtual props mentioned above are virtual props that have been released and launched. Before the virtual props are released and launched, an attribute value in the second attribute 203 can also be set for the virtual props. The computer device will obtain the third identifier of the virtual props at this time, and associate and store the first identifier 201 of the virtual props, the third identifier, and the attribute value of the virtual props in the second attribute 203 in the mapping table 205, so as to establish the mapping relationship. For example, after setting the attribute "durability" for the "recruit helmet", the third identifier of the "recruit helmet - durability 1" is "9911010000001".
[0066] For the process of obtaining the second identifier 202 of the extended virtual item: In some embodiments, when the attribute value of the extended virtual item in the first attribute 204 is the default value in the first attribute 204, the computer device determines the third identifier of the virtual item as the second identifier 202 of the extended virtual item. For example, when adding the attribute "material" to "Recruit Helmet - Durability 1" and the default value of this attribute is "0,1", the computer device determines the third identifier "9911010000001" of "Recruit Helmet - Durability 1" as the second identifier 202 of "Recruit Helmet - Durability 1 - Material 0,1". In some embodiments, when the attribute value of the extended virtual item in the first attribute 204 is not the default value in the first attribute 204, the computer device generates a first auto - increment identifier to obtain the second identifier 202 of the extended virtual item, and the first auto - increment identifier is globally unique in the mapping table 205. For example, when adding the attribute "material" to "Recruit Helmet - Durability 1" and the attribute value of this attribute is "2", the first auto - increment identifier generated by the computer device for "Recruit Helmet - Durability 1 - Material 2" is "9911010000010".
[0067] After completing the addition of the first attribute 204 to the virtual item to obtain the extended virtual item, the computer device can receive a listing request for the extended virtual item. The listing request carries the first identifier 201 of the virtual item and the attribute values of the attributes (the first attribute 204, the second attribute 203) corresponding to the extended virtual item. By combining the above information with the mapping table 205, a matching second identifier 202 can be determined from the second identifiers 202 recorded in the mapping table 205, and then stored in the data table of the listed virtual item, realizing the listing of the extended virtual item. For the listed virtual item, functions such as query and purchase can also be provided. During this process, the computer device will obtain the corresponding second identifier 202 through the mapping table 205 to perform relevant operations. Moreover, for the mapping table 205, functions such as identifier query and attribute query can also be provided. During this process, the computer device will also obtain the corresponding second identifier 202 through the mapping table 205 to perform relevant operations.
[0068] In the process of adding a first attribute to a virtual item, by obtaining the second identifier of the extended virtual item obtained from the added first attribute and associatively storing the first identifier of the virtual item, the added first attribute, and the second identifier of the extended virtual item, the mapping relationship between the virtual item before adding the attribute, the added first attribute, and the extended virtual item after adding the first attribute can be established, thus completing the addition of an attribute to the virtual item. In this process, since there is no need to add a new field to the original data table for storing virtual item information to store the new attribute, but to implement the addition of the attribute by establishing an additional mapping relationship, i.e., a mapping table, it is possible to avoid modifying the table structure of the database. Moreover, when using the mapping table to manage extended virtual items, only a section of mapping code for calling the mapping table needs to be added to the business code to achieve compatibility with the added attribute, and the impact on the business code is also small. Therefore, the implementation process of adding an attribute to a virtual item can be simplified.
[0069] Figure 3 It is a schematic flowchart of an identification mapping method for virtual items provided by an exemplary embodiment of the present application. This method can be used in a computer device, such as for Figure 1 the server shown or the server-side in the server. As Figure 3 shown, this method includes:
[0070] Step 302: Obtain the first identifier of the virtual item.
[0071] A virtual item refers to an item that a virtual character can use, such as an item and / or equipment that a virtual character can use in a virtual environment. Exemplarily, virtual items can be classified into wearable items, attack items, consumable items, and other items, etc. Among them, wearable items are virtual items that play a role by being worn on a virtual character, such as including virtual helmets, armors, bulletproof vests, etc. Attack items are used to enhance the attack ability of a virtual character, such as including virtual shooting items used when a virtual character shoots, virtual knives, swords, daggers, clubs, etc. used when a virtual character strikes. Consumable items include virtual items that are consumed when used by a virtual character, such as including virtual medicines, medical kits, energy drinks, etc. Other items include virtual items other than wearable items, attack items, and consumable items, such as including virtual land vehicles, aerial vehicles, water vehicles, etc. It should be noted that the above-mentioned virtual items are only used as examples and are not limitations on the method provided by the present application. It can be understood that in addition to the above-exemplified virtual items, the virtual items in the present application can also include other virtual items.
[0072] In some embodiments, the virtual items in the present application are obtained by simulating entities existing in the real world and have the same attributes as the entities in the real world. For example, the helmet in the virtual item is obtained by simulating the helmet in the real world and can have the attribute of material, such as materials including stainless steel, aluminum alloy, carbon fiber, etc.
[0073] The above virtual environment can be a simulation environment of the real world, a semi-simulation and semi-fictional environment, or a purely fictional environment. The above virtual character refers to an active object in the virtual environment, and the active object can be a virtual person, a virtual animal, an anime character, etc., such as a person displayed in a three-dimensional virtual environment.
[0074] The first identifier is used to identify the virtual item. Optionally, the first identifier is set for the virtual item when no attributes are set for the virtual item, and the first identifier can be referred to as the initial identifier of the virtual item. After the attributes are set for the virtual item, the virtual items with different attributes are independent of each other and can be regarded as different virtual items, but all have a corresponding relationship with the first identifier. In some embodiments, the first identifier is manually set, and the first identifier of each virtual item is unique.
[0075] Step 304: Obtain an extended virtual item by adding a first attribute to the virtual item.
[0076] In some embodiments, the attributes that the virtual item can have include attributes in terms of appearance, material, function, performance, etc. The embodiments of the present application do not limit the specific content of the attributes of the virtual item. The first attribute is an attribute that has not been set for the virtual item before adding the attribute to the virtual item this time. After adding the first attribute to the virtual item, an extended virtual item with the first attribute can be obtained. The virtual item before adding the first attribute and the extended virtual item can be regarded as different virtual items. In some embodiments, after adding an attribute to the virtual item each time, the computer device will no longer use the virtual item before adding the attribute this time to avoid data confusion.
[0077] Optionally, the first attribute includes at least one attribute value, and the attribute value is used to reflect the characteristics of the virtual item in the first attribute. Different attribute values represent different characteristics in the first attribute. For example, the first attribute is material, and each attribute value is used to indicate a specific material. For example, attribute value 1 represents stainless steel, attribute value 2 represents aluminum alloy, and attribute value 3 represents carbon fiber. When adding the first attribute to the virtual item, each time one of the at least one attribute values is added to the virtual item, an extended virtual item can be obtained. Each extended virtual item has one attribute value in the first attribute, and different extended virtual items have different attribute values in the first attribute. After the virtual item adds different attribute values in the first attribute, the extended virtual items with different attribute values are independent of each other and can be regarded as different virtual items. In some embodiments, the first attribute and the attribute values in the first attribute are manually set.
[0078] Step 306: Obtain the second identifier of the extended virtual item.
[0079] The second identifier is used to uniquely identify the extended virtual item.
[0080] Optionally, the computer device generates an incrementing identifier for the extended virtual item and its corresponding first attribute, so as to obtain the second identifier of the extended virtual item. Among them, the incrementing identifier is globally unique in the mapping table, and the specific content of the mapping table can refer to the relevant description in the following text. The incrementing identifier is an identifier that increments each time it is generated. For example, it increments by 1 each time it is generated. That is, when the incrementing identifier is generated for the i-th time, the generated incrementing identifier is x, and when the incrementing identifier is generated for the (i + 1)-th time, the generated incrementing identifier is x + 1, where i is a positive integer. Or, before adding the first attribute to the virtual item, if the virtual item already has other attributes, then before adding the first attribute to the virtual item, for the virtual item with other attributes, an incrementing identifier may have been generated in the above manner. The computer device can also determine this identifier as the second identifier of the extended virtual item. The computer device will use the extended virtual item with the first attribute and other attributes to replace the virtual item with other attributes. The process of generating an incrementing identifier for the virtual item and its corresponding attributes can be called the identifier mapping process, that is, the identifier obtained in the identifier mapping process of the virtual item before adding the first attribute can be used as the second identifier of the extended virtual item.
[0081] In the case where the extended virtual item is obtained by adding one attribute value in the first attribute and there are multiple extended virtual items, the computer device will obtain the second identifier corresponding to each extended virtual item.
[0082] Step 308: Associatively store the first identifier of the virtual item, the second identifier of the extended virtual item, and the first attribute in the mapping table.
[0083] After associatively storing the first identifier, the second identifier, and the first attribute, there is an association relationship among the first identifier, the second identifier, and the first attribute stored in the mapping table. For example, the first identifier, the second identifier, and the first attribute are stored in the same row of the mapping table. It should be noted that this application does not limit the specific format of the mapping table. After associatively storing the first identifier, the second identifier, and the first attribute, the mapping relationship among the virtual item before adding the first attribute, the newly added first attribute, and the extended virtual item after adding the first attribute can be established, thus completing the addition of the first attribute to the virtual item.
[0084] In the case where the extended virtual item is obtained by adding an attribute value in the first attribute and there are multiple extended virtual items, the computer device will obtain the second identifier corresponding to each extended virtual item, and associatively store the first identifier of the virtual item, the second identifier of the extended virtual item, and the attribute value of the extended virtual item in the first attribute in the mapping table.
[0085] In summary, in the process of adding the first attribute to the virtual item, the method provided in this embodiment can establish the mapping relationship among the virtual item before adding the first attribute, the newly added first attribute, and the extended virtual item after adding the first attribute by obtaining the second identifier of the extended virtual item obtained by adding the first attribute and associatively storing the first identifier of the virtual item, the newly added first attribute, and the second identifier of the extended virtual item, thus completing the addition of the attribute to the virtual item. In this process, since there is no need to add a new field to the original data table for storing the information of the virtual item to store the new attribute, but to implement the addition of the attribute by establishing an additional mapping relationship, that is, the mapping table, it is possible to avoid modifying the table structure of the database. And when using the mapping table to manage the extended virtual items, only a section of mapping code for calling the mapping table needs to be added in the business code to achieve compatibility with the newly added attribute, and the impact on the business code is also small. Therefore, the implementation process of adding attributes to the virtual item can be simplified.
[0086] Figure 4 It is a schematic flowchart of an identifier mapping method for virtual items provided by an exemplary embodiment of this application. This method can be used in a computer device, such as for Figure 1 the server or the server-side in the server shown. As Figure 4 shown, this method includes:
[0087] Step 402: Obtain the first identifier of the virtual item.
[0088] A virtual item refers to an item that a virtual character can use, such as an item and / or equipment that a virtual character can use in a virtual environment. By way of example, virtual items can be classified into wearable items, attack items, consumable items, and other items, etc. The above virtual environment can be a simulation environment of the real world, a semi-simulation and semi-fictional environment, or a purely fictional environment. The above virtual character refers to a movable object in the virtual environment, and the movable object can be a virtual person, a virtual animal, an anime character, etc., such as a person displayed in a three-dimensional virtual environment.
[0089] The first identifier is used to identify a virtual item. Optionally, the first identifier is set for the virtual item when no attributes are set for the virtual item. Or, the first identifier is set for the virtual item when the virtual item only has basic default attributes. The first identifier can be referred to as the initial identifier of the virtual item. In some embodiments, the first identifier is set manually, and the first identifier of each virtual item is unique. By way of example, Table 1 shows the first identifiers of virtual items.
[0090] Table 1
[0091] Original Prop ID Prop Name 11010001002 Recruit Helmet 11010002003 Standard Helmet 11050006003 Standard Bulletproof Vest
[0092] As shown in Table 1, the virtual items of the armor category include a recruit helmet, a standard helmet, and a standard bulletproof vest, and each corresponds to a first identifier, namely the original item ID. The original item ID is set when no attributes are set for the recruit helmet, the standard helmet, and the standard bulletproof vest.
[0093] Step 404: Obtain an extended virtual item by adding a first attribute to the virtual item.
[0094] After adding a first attribute to a virtual item, an extended virtual item with the first attribute can be obtained. Optionally, the first attribute includes at least one attribute value. In some embodiments, the first attribute added to the virtual item and the attribute values in the first attribute are manually set, for example, by a system administrator or an operator. Before adding the first attribute, the virtual item in the system does not have the first attribute. By way of example, the first attribute is material, and each attribute value in the material is used to indicate a specific material. For example, attribute value 1 represents stainless steel, attribute value 2 represents aluminum alloy, and attribute value 3 represents carbon fiber. When adding the first attribute to the virtual item, each time an attribute value in the at least one attribute value is added to the virtual item, an extended virtual item can be obtained. Each extended virtual item has an attribute value in the first attribute, and the attribute values of different extended virtual items in the first attribute are different. After different attribute values in the first attribute are added to the virtual item, the extended virtual items with different attribute values in the first attribute are independent of each other and can be regarded as different virtual items. In some embodiments, the first attribute and the attribute values in the first attribute are manually set.
[0095] Step 406: Obtain a second identifier of the extended virtual item.
[0096] In the case where the extended virtual item is obtained by adding an attribute value in the first attribute and there are multiple extended virtual items, the computer device obtains a second identifier corresponding to each extended virtual item.
[0097] In some embodiments, in the case where the attribute value of the extended virtual item in the first attribute is not the default value in the first attribute, the computer device can obtain the second identifier of the extended virtual item by generating a first auto-incrementing identifier. Among them, the first auto-incrementing identifier is globally unique in the mapping table, and the default value in the first attribute is manually set. For example, an extended virtual item with the default value in the first attribute is used to replace the virtual item before adding the first attribute. When adding the first attribute to an online virtual item, the extended virtual item obtained by adding the default value in the first attribute to the online virtual item can be used to replace the online virtual item, and new virtual items can be obtained by adding attribute values other than the default value in the first attribute to the online virtual item. For example, there is a helmet already online in the game. When adding the attribute of material to the helmet, stainless steel in the material can be used as the default value. After adding the attribute to the helmet, the virtual item "helmet - stainless steel" will replace the online helmet, and "helmet - aluminum alloy" and "helmet - carbon fiber" can be used as newly online virtual items. The online of a virtual item means providing the virtual item to users.
[0098] In some embodiments, before adding a first attribute to a virtual item, the virtual item already has an attribute value of a second attribute. Optionally, when adding the first attribute to the virtual item, the virtual item has already been launched. When setting the second attribute for the virtual item, the virtual item has not been launched yet. That is, setting attributes for a virtual item is performed on a virtual item that has not been launched, and adding attributes to a virtual item is performed on a virtual item that has already been launched. The difference between the two is that when setting attributes for a virtual item, there will be no default value in the set attributes. In some embodiments, the second attribute set for the virtual item is the last attribute set for the virtual item before it is launched. The computer device can obtain a third identifier of the virtual item by generating a second auto-increment identifier for the virtual item that has an attribute value of the second attribute, and the second auto-increment identifier is globally unique in the mapping table. After that, the computer device will associate and store the initial identifier of the virtual item, the third identifier of the virtual item, and the attribute value of the virtual item in the second attribute in the mapping table.
[0099] In some embodiments, before setting the second attribute, other attributes can also be set for the virtual item, and the auto-increment identifier is generated for identification. Before the virtual item is launched, the auto-increment identifier generated each time an attribute is set can identify one or more attributes that the virtual item currently has. For example, before the virtual item is launched, two attributes, durability and color, are set for the virtual item. At this time, the auto-increment identifier corresponding to the virtual item has a corresponding relationship with the attribute values in durability and the attribute values in color.
[0100] Exemplarily, Table 2 shows the third identifier of the virtual item.
[0101] Table 2
[0102] Mapped Prop ID Original Prop ID Durability [1, 3] 9911010000001 11010001002 1 9911010000002 11010001002 2 9911010000003 11010001002 3 9911010000004 11010002003 1 9911010000005 11010002003 2 9911010000006 11010002003 3 9911010000007 11050006003 1 9911010000008 11050006003 2 9911010000009 11050006003 3
[0103] As shown in Table 2, the original item ID 11010001002 represents the recruit helmet in Table 1. After setting the attribute of durability for the recruit helmet, recruit helmet - durability 1, recruit helmet - durability 2, and recruit helmet - durability 3 can be obtained. The computer device will generate auto-increment identifiers 9911010000001, 9911010000002, and 9911010000003 for these 3 virtual items respectively, and associate and store the generated auto-increment identifiers with the original item ID and the corresponding attribute values 1, 2, and 3 in durability in the mapping table. The above virtual item can be any one of these 3 virtual items.
[0104] In some embodiments, when the attribute value of the extended virtual item in the first attribute is the default value in the first attribute, the computer device may use the increment identifier corresponding to the virtual item before adding the first attribute as the second identifier of the extended virtual item, thereby reducing the number of generated increment identifiers. In some embodiments, the first attribute added to the virtual item is the first attribute added to the virtual item for the first time after the virtual item goes online. When the attribute value of the extended virtual item in the first attribute is the default value in the first attribute, the computer device may determine the third identifier of the virtual item as the second identifier of the extended virtual item. In some embodiments, when the first attribute added to the virtual item is not the first attribute added to the virtual item after the virtual item goes online, and when the attribute value of the extended virtual item in the first attribute is the default value in the first attribute, the computer device may determine the increment identifier when the virtual item was previously added with an attribute as the second identifier of the extended virtual item.
[0105] Exemplarily, Table 3 shows the second identifier of the virtual item.
[0106] Table 3
[0107] Mapped Prop ID Original Prop ID Durability [1, 3] Material [1, 9] 9911010000001 11010001002 1 0,1 9911010000002 11010001002 2 0,1 9911010000003 11010001002 3 0,1 9911010000004 11010002003 1 0,1 9911010000005 11010002003 2 0,1 9911010000006 11010002003 3 0,1 9911010000007 11050006003 1 0,1 9911010000008 11050006003 2 0,1 9911010000009 11050006003 3 0,1 9911010000010 11010001002 1 2 9911010000011 11010001002 1 3 9911010000012 11010001002 1 4 9911010000013 11010001002 1 5
[0108] As shown in Table 3, the recruit helmet (corresponding to the original item ID 11010001002) was set with a durability attribute before going online. When adding an attribute material for the online recruit helmet - durability 1 and the attribute value is the default value 0,1 in the material, the computer device determines the identifier 9911010000001 corresponding to the recruit helmet - durability 1 as the identifier of the recruit helmet - durability 1 - material 0,1. When adding an attribute material for the online recruit helmet - durability 1 and the attribute value is not the default value in the material, the computer device will generate increment identifiers 9911010000010, 9911010000011, 9911010000012, and 9911010000013 for the recruit helmet - durability 1 - material 2, the recruit helmet - durability 1 - material 3, the recruit helmet - durability 1 - material 4, and the recruit helmet - durability 1 - material 5 respectively. It can be seen that the increment identifier increments by 1 each time it is generated.
[0109] Step 408: Associatively store the first identifier of the virtual item, the second identifier of the extended virtual item, and the first attribute in the mapping table.
[0110] When the extended virtual item is obtained by adding an attribute value in the first attribute and there are multiple extended virtual items, the computer device will obtain the second identifier corresponding to each extended virtual item, and associate and store the first identifier of the virtual item, the second identifier of the extended virtual item, and the attribute value of the extended virtual item in the first attribute in a mapping table. After associatively storing the first identifier, the second identifier, and the attribute value in the first attribute, there is an association relationship among the first identifier, the second identifier, and the attribute value in the first attribute stored in the mapping table. For example, the first identifier, the second identifier, and the attribute value in the first attribute are stored in the same row of the mapping table.
[0111] After associatively storing the first identifier, the second identifier, and the attribute value in the first attribute, an association relationship will be automatically established with other attributes that the extended virtual item already has, such as the attribute value in the second attribute. Exemplarily, continuing to refer to Table 2 and Table 3, Table 2 and Table 3 can be regarded as part of the mapping table. When adding the attribute material 2 to the recruit helmet with durability 1, a mapped item ID 9911010000010 can be generated for the recruit helmet - durability 1 - material 2, and this mapped item ID has an association relationship with both durability 1 and material 2. Moreover, when storing the mapped item ID of the recruit helmet - durability x - material y in the mapping table, the generated mapped item ID of the recruit helmet - durability x - material y will be used to replace the mapped item ID of the recruit helmet - durability x.
[0112] In some embodiments, the client represents a virtual item by the first identifier of the virtual item and the attribute values of each attribute that the virtual item has. For example, what the computer obtains is the first identifier of the virtual item in the client. The server represents a virtual item with attribute values of different attributes by the second identifier. For example, the server will associatively store the first identifier of the virtual item, the second identifier of the extended virtual item, and the first attribute in the mapping table of the server.
[0113] Step 410: Receive a listing request for an extended virtual item.
[0114] The listing request carries the first identifier of the virtual item and the first attribute value in the first attribute. Optionally, when the extended virtual item also has attributes other than the first attribute, the listing request also carries the attribute value in each other attribute that the extended virtual item has. The listing request is used to request to list the extended virtual item for users to purchase. In some embodiments, the listing request is issued by the system or triggered by the user through a control in the user interface.
[0115] Step 412: Determine a first matching identifier among the second identifiers recorded in the mapping table according to the listing request.
[0116] The first matching identifier has an associated relationship with the first identifier and the first attribute value. By way of example, continuing to refer to Table 3, the listing request carries the original prop ID 11010001002 of the recruit helmet, as well as the attribute value 1 of the attribute durability and the attribute value 2 of the attribute material. According to the mapping table shown in Table 3, the computer device can determine the matching mapped prop ID 9911010000010, that is, the prop ID of the recruit helmet - durability 1 - material 2.
[0117] Step 414: Store the first matching identifier in the data table of the listed virtual props.
[0118] After obtaining the first matching identifier of the extended virtual prop to be listed in the listing request, by storing the first matching identifier in the data table of the listed virtual props, the extended virtual prop can be listed as a listed virtual prop. In the user interface related to the listed virtual props on the client side, the listed extended virtual props will be displayed, and the user can perform operations such as purchasing on them. By way of example, Table 4 shows the data table of the listed virtual props.
[0119] Table 4
[0120]
[0121] As shown in Table 4, listing_id represents the ID of the order, and each listed virtual prop corresponds to an order. prop_id represents the ID of the virtual prop sold in this order. For example, prop_id 9911010000002 means that the virtual prop recruit helmet - durability 2 has been listed. amount represents the quantity of this virtual prop sold in the order. currency_type represents the type of currency required to pay for the virtual prop in this order. currency_amount represents the quantity of currency required to pay for the virtual prop in this order. expire_at represents the expiration time of this order. amount_left represents how many of the virtual props in this order are left for sale, that is, the remaining quantity.
[0122] After listing the extended virtual prop, the computer device can also receive a query request for the listed virtual prop. The query request carries the first identifier of the virtual prop and the second attribute value in the first attribute. Optionally, in the case where the extended virtual prop also has attributes other than the first attribute, the query request also carries the attribute values in each other attribute that the extended virtual prop has. Then the computer device determines a second matching identifier among the second identifiers recorded in the mapping table according to the listing request. The second matching identifier has an associated relationship with the first identifier and the second attribute value. Then, data is queried in the data table of the listed virtual props through the second matching identifier.
[0123] Exemplarily, the query request carries the original item ID of the recruit helmet and the durability 2. By combining with the mapping table shown in Table 2, the mapped item ID 9911010000002 of the recruit helmet - durability 2 can be determined. By combining the query conditions (such as price, remaining quantity) in the query request and 9911010000002, data can be queried in the data table of the listed virtual items shown in Table 4.
[0124] After listing the extended virtual item, the computer device can also receive a purchase request for the listed virtual item. The purchase request carries the first identifier of the virtual item and the third attribute value in the first attribute. Optionally, when the extended virtual item also has attributes other than the first attribute, the purchase request also carries the attribute values in each other attribute that the extended virtual item has. Then, the computer device determines a third matching identifier in the second identifiers recorded in the mapping table according to the purchase request. The third matching identifier has an association relationship with the first identifier and the third attribute value. Then, according to the purchase request, the purchase data associated with the third matching identifier is processed in the data table of the listed virtual item.
[0125] Exemplarily, the purchase request carries the original item ID of the recruit helmet and the durability 2. By combining with the mapping table shown in Table 2, the mapped item ID 9911010000002 of the recruit helmet - durability 2 can be determined. By combining the purchase information (such as purchasing all) in the purchase request and 9911010000002, all recruit helmets - durability 2 can be purchased in the data table of the listed virtual items shown in Table 4, and the corresponding remaining quantity is set to 0.
[0126] The computer device can also provide a query function for the data stored in the mapping table: Optionally, the computer device receives an identifier query request for the mapping table. The identifier query request carries the first identifier of the virtual item and the fourth attribute value in the first attribute. Then, the first identifier of the virtual item and the fourth attribute value are concatenated to obtain the query key. Thus, the query result of the identifier query request, that is, the second identifier of the corresponding extended virtual item, is queried in the mapping table. Optionally, when the virtual item (extended virtual item) also has attributes other than the first attribute, the identifier request also carries the attribute values in each other attribute that the virtual item has, and they will also be concatenated during the query process. It should be noted that the above first attribute value, second attribute value, third attribute value, and fourth attribute value may be exactly the same, partially the same, or completely different.
[0127] Exemplarily, Figure 5 is a schematic diagram of the identifier query process provided by an exemplary embodiment of the present application. As Figure 5As shown in the figure, in step A1, the computer device receives an identity query request and splices the key for query according to the information it carries. In step A2, the computer device queries the corresponding value in the mapping table by the query key. In step A3, the computer device determines whether a value is queried. In step A4, when a value is queried, that is, the mapped item ID is queried, the computer device returns it. In step A5, when no value is queried, the computer device determines that the return fails.
[0128] Optionally, the computer device receives an attribute query request for the mapping table, and the attribute query request carries the second identity of the extended virtual item. The computer device determines the second identity of the extended virtual item as the query key, and queries the query result of the attribute query request in the mapping table by the query key, that is, the attributes and attribute values of the extended virtual item corresponding to the second identity.
[0129] Exemplarily, Figure 6 is a schematic diagram of the attribute query process provided by an exemplary embodiment of the present application. As Figure 6 shown in the figure, in step B1, the computer device receives an attribute query request, determines the query key according to the information it carries, and queries the corresponding value in the mapping table by the query key, that is, the mapping rule, which is also the corresponding original item ID and the attribute values of each attribute. In step B2, the computer device determines whether a value is queried. In step B3, when a value is queried, that is, the corresponding original item ID and the attribute values of each attribute are queried, the computer device returns them. In step B4, when no value is queried, the computer device determines that the return fails.
[0130] In summary, in the process of adding a first attribute to a virtual item, the method provided in this embodiment can establish a mapping relationship between the virtual item before adding the first attribute, the added first attribute, and the extended virtual item after adding the first attribute by obtaining the second identity of the extended virtual item obtained by adding the first attribute and associatively storing the first identity of the virtual item, the added first attribute, and the second identity of the extended virtual item, thus completing the addition of attributes to the virtual item. In this process, since there is no need to add a new field to the original data table for storing virtual item information to store the new attribute, but to implement the addition of attributes by establishing an additional mapping relationship, that is, a mapping table, it is possible to avoid modifying the table structure of the database. And when using the mapping table to manage extended virtual items, only a section of mapping code for calling the mapping table needs to be added to the business code to achieve compatibility with the added attributes, and the impact on the business code is also small. Therefore, it can simplify the implementation process of adding attributes to virtual items.
[0131] The method provided in this embodiment also realizes the identification of virtual items with newly added different attribute values by obtaining the second identifier corresponding to each extended virtual item when adding different attribute values to the first attribute of the virtual item, and associatively storing it with the first identifier and the corresponding attribute values, so that the virtual items with newly added different attribute values can be managed separately through the identifiers.
[0132] The method provided in this embodiment also generates an auto-incrementing identifier for the extended virtual item to identify the extended virtual item, which can ensure the uniqueness of the identifier of the virtual item after adding attributes.
[0133] The method provided in this embodiment also generates an auto-incrementing identifier for the virtual item with the attribute value of the second attribute set, to identify the virtual items with different attribute values of the second attribute, which can ensure the uniqueness of the identifier of the virtual item after setting attributes.
[0134] The method provided in this embodiment also reduces the number of auto-incrementing identifiers used by reusing the generated auto-incrementing identifiers, which helps to increase the number of extensible attributes.
[0135] The method provided in this embodiment also processes the shelf request of the extended virtual item according to the mapping table, which can accurately and quickly find out the extended virtual item that needs a superior through the mapping table.
[0136] The method provided in this embodiment also processes the query request of the shelved virtual item according to the mapping table, which can accurately and quickly find out the information of the extended virtual item to be queried through the mapping table.
[0137] The method provided in this embodiment also processes the purchase request of the extended virtual item according to the mapping table, which can accurately and quickly find out the extended virtual item to be purchased through the mapping table, so as to process its related purchase data.
[0138] The method provided in this embodiment also splices the information carried by the identifier query request to query the virtual item identifier in the mapping table, providing an accurate and convenient way to query the identifier in the mapping table.
[0139] The method provided in this embodiment also queries the corresponding virtual item attribute in the mapping table according to the identifier carried by the attribute query request, providing an accurate and convenient way to query the attribute in the mapping table.
[0140] The method provided in this embodiment also separates the identifiers used for the same virtual item in the client and the server, realizing data isolation between the client and the server and avoiding data risks.
[0141] The method provided by the embodiments of this application can map a new item ID for virtual items with multi-dimensional attributes (such as the durability, material, color, etc. of virtual armor items) by establishing a mapping table (configuration table). This mapping mechanism enables adding new attributes to virtual items without changing the database table structure. Since all the identification mapping logics are completed in the mapping table, there is no need to modify the database table or make a large number of changes to the business code. Just adding a section of identification mapping conversion code in the business layer can achieve seamless compatibility with the new attributes. Moreover, due to the flexibility of the mapping table, new attributes can be conveniently added to virtual items, thereby improving the scalability of the game. This not only avoids making a large number of modifications to the database table but also reduces the changes to the business code, enhancing the flexibility and scalability of the system. Through the mapping table, a simple, efficient, and flexible method can be provided to manage virtual items with multi-dimensional attributes, thus better meeting the needs of players and improving the quality of the game and the players' gaming experience.
[0142] In a specific example, the scenario involved in the method provided by this application is introduced in combination with Table 1-4. There are several types of virtual armor items shown in Table 1 in the game. After introducing the first attribute of virtual armor items, durability (divided into 3 levels, with attribute values being 1, 2, and 3 respectively), self-incrementing identifiers can be generated for each virtual item with durability set, and they are stored in the manner shown in Table 2. In this way, the mapped item IDs shown in Table 2 can be used for subsequent listing, searching, and purchasing of virtual armor items.
[0143] For listing virtual items, now 2 recruit helmets with a durability of 2 (corresponding to 11010001002) and 3 standard helmets with a durability of 3 (corresponding to 11010002003) need to be listed. After listing, the listing records of the virtual items corresponding to the first 2 pieces of data in Table 2 can be seen in the listing order table shown in Table 4. The listing order table can maintain the original fields without any changes, so the business program can run normally without any changes. During the listing process, virtual armor items have one more step of item ID mapping conversion than other ordinary items, but the subsequent processes are the same. Moreover, the item ID mapping conversion here can be completed in nanoseconds, which has no impact on performance at all.
[0144] For searching in the listing order table, for ordinary items, the common search is which orders have a specified item ID and price range. For the above-mentioned virtual armor items, the durability attribute can be specified for querying, and there is only one more step of item ID mapping conversion. Use the "original item ID + durability level" to convert the "mapped item ID" through the mapping table as the prop_id in Table 4 for searching.
[0145] For the purchase of virtual items in the purchase and listing order form, the purchase will modify the amount_left field in Table 4. If you want to buy 2 "Recruit Helmets" in Order No. 1, set the amount_left of Order No. 1 to 0, and at the same time give the virtual item to the purchasing player to complete the purchase transaction. For the purchase of virtual armor items, it is also necessary to perform the operation of item ID mapping first and then execute the subsequent process. There is one more step of item ID mapping operation compared to the purchase of ordinary items, while the other processes are exactly the same.
[0146] For the seamless compatibility of adding new attributes to virtual armor items, if a virtual armor item needs to add an attribute such as "material", when the business program is running, there is still a lot of old data of virtual armor items in the database table shown in Table 4. Taking the "Recruit Helmet" with the ID "11010001002" as an example, before adding the attribute of "material", the 3 IDs 9911010000001, 9911010000002, and 9911010000003 in the database already represent recruit helmets with durability levels 1, 2, and 3 respectively, but these IDs cannot distinguish what material the recruit helmet is made of.
[0147] When adding the attribute values of several material attributes 1 (default value), 2, 3, 4, and 5 to the recruit helmet, in order to be compatible with the mapped item IDs shown in Table 2, those with material attribute values of 0 or 1 are considered default values. For the default values, the mapped item IDs 9911010000001, 9911010000002, and 9911010000003 that have not yet added the material attribute in Table 2 will still be used. In this way, these mapped item IDs are still valid IDs, and these IDs indicate that the material attribute values of the virtual items are all default values of 0 or 1. If the durability is 1 and the material attribute values are 2, 3, 4, and 5 respectively, the mapped item IDs 9911010000010, 9911010000011, 9911010000012, and 9911010000013 shown in Table 3 will be used. That is, after adding the material attribute values to the virtual items in Table 2, it becomes the result shown in Table 3. After adding 1 new attribute, the length of the item ID does not actually increase, and the original mapping rule remains unchanged. The item IDs with the new attribute will only increase sequentially by 1 (i.e., auto-increment). The value range of this item ID is very wide, which is sufficient to support the addition of multiple new attributes.
[0148] In this way, for the old data in the database, when looking up the mapping table shown in Table 3, it is possible to be compatible with the virtual items that did not have the material attribute value before, and it can also support the new attribute values of 2, 3, 4, and 5 for the material. At the same time, neither the business code nor the database table needs to be modified. Only when looking up the mapping relationship, it is necessary to add the material attribute value.
[0149] For querying the mapped item ID in the mapping table shown in Table 3 according to the attribute values, it is based on the original item ID, the value of Attribute 1, the value of Attribute 2... the value of Attribute n to find the corresponding mapped item ID in the mapping table. First, as shown in Table 3, {original item ID}_{durability value}_{material value} can be used as the key and the mapped item ID as the value, and store the mapping result in the mapping table as shown below:
[0150] {
[0151] "11010001002_1_0":9911010000001,
[0152] "11010001002_1_1":9911010000001,
[0153] "11010001002_2_0":9911010000002,
[0154] "11010001002_2_1":9911010000002,
[0155] "11010001002_3_0":9911010000003,
[0156] "11010001002_3_1":9911010000003,
[0157] ……
[0158] }
[0159] When querying the mapped item ID according to the original item ID + multiple attribute values, only two steps of operations are required: Step 1: First, use the original item ID and multiple attribute values to splice out a key in the format of "{original item ID}_{durability value}_{material value}". Step 2: In the mapping table, find the corresponding value according to the key, and this value is the mapped item ID.
[0160] When querying the corresponding attribute values according to the mapped item ID, according to the mapped item ID, it can be found in the mapping table which record the mapped item ID corresponds to, that is, what are the values of the original item ID, Attribute 1, Attribute 2... Attribute n respectively. Since the mapped item ID is unique in the whole table, it can also be searched in the way of the mapping table. At this time, the key for querying is the mapped item ID, and the value is the corresponding rule, including the original item ID and the attribute value of each attribute. As shown below:
[0161] {
[0162] "9911010000001": {9911010000001, 11010001002, 1, 0|1},
[0163] "9911010000002": {9911010000002, 11010001002, 2, 0|1},
[0164] "9911010000003": {9911010000003, 11010001002, 3, 0|1},
[0165] ……
[0166] }
[0167] For the query process: First step: Use the mapped item ID as the key to look up the corresponding rule in the mapping table of the program. Second step: If the rule is found, return the rule; if not, return failure. The business program can obtain the original virtual item corresponding to the mapped item ID and the attribute values of each attribute it has according to the returned rule.
[0168] As can be seen from the above introduction, the method provided by the embodiments of the present application makes very few changes to the business code. Since all mappings are completed in the mapping table, only a section of mapping code needs to be added at the business layer to seamlessly compatible with new attributes. This greatly reduces the development workload and reduces the risk of introducing errors. If new attributes need to be added in the future, only fields need to be added to the mapping table.
[0169] Moreover, the method provided by the embodiments of the present application can infinitely add attributes to virtual items, which provides great flexibility and scalability, enabling the system to better adapt to future demand changes. This method avoids the problem of poor scalability caused by the limited length of item IDs. It has no impact on the read and write performance of the database. Since there is no need to modify the database table, it has no negative impact on the read and write performance of the database. This helps to maintain the high-performance operation of the system.
[0170] In addition, the method provided by the embodiments of the present application can save database storage space. Since there is no need to add new fields to the database table to store new attributes, database storage space can be saved. This helps to reduce the operating cost of the system.
[0171] It should be noted that before collecting relevant data of the user and during the process of collecting relevant data of the user, this application can display a prompt interface, a pop-up window, or output a voice prompt message. The prompt interface, pop-up window, or voice prompt message is used to prompt the user that their relevant data is currently being collected, so that this application only starts to execute the relevant steps of obtaining the user's relevant data after obtaining the confirmation operation issued by the user for the prompt interface or the pop-up window. Otherwise (that is, when the confirmation operation issued by the user for the prompt interface or the pop-up window is not obtained), the relevant steps of obtaining the user's relevant data are ended, that is, the relevant data of the user is not obtained. In other words, all user data collected by this application is collected with the consent and authorization of the user, and the collection, use, and processing of relevant user data need to comply with relevant laws, regulations, and standards of relevant countries and regions.
[0172] It should be noted that the order of the method steps provided in the embodiments of this application can be appropriately adjusted, and the steps can also be increased or decreased accordingly according to the situation. Any person skilled in the art in the technical field disclosed in this application can easily think of a changed method within the technical scope disclosed in this application, and it should be covered within the protection scope of this application. Therefore, it will not be elaborated here.
[0173] Figure 7 It is a schematic structural diagram of an identification mapping device for virtual items provided by an exemplary embodiment of this application. As Figure 7 shown, the device includes:
[0174] An acquisition module 701, configured to acquire a first identifier of a virtual item;
[0175] A new addition module 702, configured to obtain an extended virtual item by adding a first attribute to the virtual item;
[0176] The acquisition module 701 is further configured to acquire a second identifier of the extended virtual item;
[0177] A storage module 703, configured to associatively store the first identifier of the virtual item, the second identifier of the extended virtual item, and the first attribute in a mapping table.
[0178] In an alternative design, each extended virtual item has an attribute value in the first attribute, and different extended virtual items have different attribute values in the first attribute; the acquisition module 701 is configured to acquire the second identifier corresponding to each extended virtual item; the storage module 703 is configured to associatively store the first identifier of the virtual item, the second identifier of the extended virtual item, and the attribute value of the extended virtual item in the first attribute in the mapping table.
[0179] In an alternative design, the obtaining module 701 is configured to, when the attribute value of the extended virtual item in the first attribute is not the default value in the first attribute, obtain the second identifier of the extended virtual item by generating a first auto-increment identifier, where the first auto-increment identifier is globally unique in the mapping table.
[0180] In an alternative design, the virtual item has an attribute value in a second attribute, the first identifier is the initial identifier of the virtual item, and the initial identifier is set for the virtual item when no attribute is set for the virtual item; the obtaining module 701 is configured to obtain the third identifier of the virtual item by generating a second auto-increment identifier, where the second auto-increment identifier is globally unique in the mapping table; the storage module 703 is configured to store the initial identifier of the virtual item, the third identifier of the virtual item, and the attribute value of the virtual item in the second attribute in the mapping table in an associated manner.
[0181] In an alternative design, the obtaining module 701 is configured to, when the attribute value of the extended virtual item in the first attribute is the default value in the first attribute, determine the third identifier of the virtual item as the second identifier of the extended virtual item.
[0182] In an alternative design, as Figure 8 shown, the apparatus further includes a receiving module 704, configured to receive a listing request for the extended virtual item, where the listing request carries the first identifier of the virtual item and the first attribute value in the first attribute; a determining module 705, configured to determine a first matching identifier from the second identifiers recorded in the mapping table according to the listing request, where the first matching identifier has an associated relationship with the first identifier and the first attribute value; and the storage module 703, configured to store the first matching identifier in a data table of listed virtual items.
[0183] In an alternative design, as Figure 9 shown, the apparatus further includes a receiving module 704, configured to receive a query request for the listed virtual item, where the query request carries the first identifier of the virtual item and the second attribute value in the first attribute; a determining module 705, configured to determine a second matching identifier from the second identifiers recorded in the mapping table according to the query request, where the second matching identifier has an associated relationship with the first identifier and the second attribute value; and a query module 706, configured to query data in the data table of listed virtual items through the second matching identifier.
[0184] In an alternative design, as Figure 10As shown, the device further includes a receiving module 704, configured to receive a purchase request for the virtual item on the shelf, where the purchase request carries a first identifier of the virtual item and a third attribute value in the first attribute; a determining module 705, configured to determine a third matching identifier from the second identifiers recorded in the mapping table according to the purchase request, where the third matching identifier has an association relationship with the first identifier and the third attribute value; and a processing module 707, configured to process purchase data associated with the third matching identifier in the data table of the virtual item on the shelf according to the purchase request.
[0185] In an alternative design, as Figure 11 shown, the device further includes a receiving module 704, configured to receive an identifier query request for the mapping table, where the identifier query request carries a first identifier of the virtual item and a fourth attribute value in the first attribute; a splicing module 708, configured to splice the first identifier of the virtual item and the fourth attribute value to obtain a query key; and a query module 706, configured to query a query result of the identifier query request in the mapping table through the query key.
[0186] In an alternative design, as Figure 9 shown, the device further includes a receiving module 704, configured to receive an attribute query request for the mapping table, where the attribute query request carries a second identifier of the extended virtual item; a determining module 705, configured to determine the second identifier of the extended virtual item as a query key; and a query module 706, configured to query a query result of the attribute query request in the mapping table through the query key.
[0187] In an alternative design, the obtaining module 701 is configured to obtain a first identifier of the virtual item in the client; and the storage module 702 is configured to store the first identifier of the virtual item, the second identifier of the extended virtual item, and the first attribute in an associated manner in a mapping table on the server.
[0188] It should be noted that: for the virtual item identifier mapping device provided in the above embodiments, only the above division of each functional module is used as an example for illustration. In actual applications, the above functions can be allocated to different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the virtual item identifier mapping device provided in the above embodiments and the embodiments of the virtual item identifier mapping method belong to the same concept, and the specific implementation process is detailed in the method embodiments, which will not be elaborated here.
[0189] Embodiments of the present application also provide a computer device, which includes a processor and a memory. At least one instruction, at least one program, a code set, or an instruction set is stored in the memory and is loaded and executed by the processor to implement the identification mapping method of virtual items provided in the above method embodiments.
[0190] Exemplarily, Figure 12 is a schematic structural diagram of a computer device provided by an exemplary embodiment of the present application.
[0191] The computer device 1200 includes a central processing unit (CPU) 1201, a system memory 1204 including a random access memory (RAM) 1202 and a read-only memory (ROM) 1203, and a system bus 1205 connecting the system memory 1204 and the central processing unit 1201. The computer device 1200 further includes a basic input / output system (Input / Output system, I / O system) 1206 for facilitating information transmission between various components within the computer device, and a mass storage device 1207 for storing an operating system 1213, application programs 1214, and other program modules 1215.
[0192] The basic input / output system 1206 includes a display 1208 for displaying information and input devices 1209 such as a mouse and a keyboard for user input. The display 1208 and the input devices 1209 are both connected to the central processing unit 1201 through an input / output controller 1210 connected to the system bus 1205. The basic input / output system 1206 may further include an input / output controller 1210 for receiving and processing inputs from multiple other devices such as a keyboard, a mouse, or an electronic stylus. Similarly, the input / output controller 1210 also provides output to a display screen, a printer, or other types of output devices.
[0193] The mass storage device 1207 is connected to the central processing unit 1201 through a mass storage controller (not shown) connected to the system bus 1205. The mass storage device 1207 and its associated computer-readable storage medium provide non-volatile storage for the computer device 1200. That is to say, the mass storage device 1207 may include a computer-readable storage medium (not shown) such as a hard disk or a compact disc read-only memory (CD-ROM) drive.
[0194] Without loss of generality, the computer-readable storage medium may include a computer storage medium and a communication medium. The computer storage medium includes volatile and non-volatile, removable and non-removable media implemented by any method or technology for storing information such as computer-readable storage instructions, data structures, program modules, or other data. The computer storage medium includes RAM, ROM, erasable programmable read-only registers (EPROM), electrically-erasable programmable read-only memory (EEPROM), flash memory or other solid-state storage devices, CD-ROM, digital versatile disc (DVD) or other optical storage, magnetic tape cartridges, tapes, disk storage or other magnetic storage devices. Of course, those skilled in the art will know that the computer storage medium is not limited to the above several types. The above-mentioned system memory 1204 and mass storage device 1207 can be collectively referred to as memory.
[0195] The memory stores one or more programs, and the one or more programs are configured to be executed by one or more central processing units 1201. The one or more programs include instructions for implementing the above method embodiments, and the central processing unit 1201 executes the one or more programs to implement the methods provided by the above respective method embodiments.
[0196] According to various embodiments of the present application, the computer device 1200 can also run by connecting to a remote computer device on the network through a network such as the Internet. That is, the computer device 1200 can be connected to the network 1212 through the network interface unit 1211 connected to the system bus 1205, or in other words, the network interface unit 1211 can also be used to connect to other types of networks or remote computer device systems (not shown).
[0197] The memory further includes one or more programs, and the one or more programs are stored in the memory. The one or more programs include steps for performing the method executed by the computer device provided in the embodiments of the present application.
[0198] An embodiment of the present application also provides a computer-readable storage medium. At least one instruction, at least one segment of program, code set or instruction set is stored in the computer-readable storage medium. When the at least one instruction, at least one segment of program, code set or instruction set is loaded and executed by a processor of the computer device, the identification mapping method of the virtual item provided by the above respective method embodiments is implemented.
[0199] The present application also provides a computer program product or a computer program. The computer program product or the computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. A processor of a 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 identification mapping method of virtual items provided in the above method embodiments.
[0200] Those of ordinary skill in the art can understand that all or part of the steps to implement the above embodiments can be completed by hardware, or can be completed by instructing relevant hardware through a program. The program can be stored in a computer-readable storage medium, and the above-mentioned computer-readable storage medium can be a read-only memory, a magnetic disk, an optical disc, or the like.
[0201] The above are only optional embodiments of the present application and are not intended to limit the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims
1. A method for identifying mapping of virtual props, characterized in that, The method includes: Obtaining a first identifier of a virtual item; Obtaining an extended virtual item by adding a first attribute to the virtual item; Obtaining a second identifier of the extended virtual item; Associatively storing the first identifier of the virtual item, the second identifier of the extended virtual item, and the first attribute in a mapping table.
2. The method according to claim 1, wherein Each extended virtual item has one attribute value in the first attribute, and different extended virtual items have different attribute values in the first attribute; The obtaining the second identifier of the extended virtual item includes: Obtaining the second identifier corresponding to each extended virtual item; The associatively storing the first identifier of the virtual item, the second identifier of the extended virtual item, and the first attribute in the mapping table includes: Associatively storing the first identifier of the virtual item, the second identifier of the extended virtual item, and the attribute value of the extended virtual item in the first attribute in the mapping table.
3. The method according to claim 2, wherein The obtaining the second identifier corresponding to each extended virtual item includes: When the attribute value of the extended virtual item in the first attribute is not the default value in the first attribute, obtaining the second identifier of the extended virtual item by generating a first auto-incrementing identifier, where the first auto-incrementing identifier is globally unique in the mapping table.
4. The method according to claim 2, characterized in that, The virtual item has one attribute value in a second attribute, the first identifier is the initial identifier of the virtual item, and the initial identifier is set for the virtual item when no attribute is set for the virtual item; The method further includes: Obtaining a third identifier of the virtual item by generating a second auto-incrementing identifier, where the second auto-incrementing identifier is globally unique in the mapping table; Associatively storing the initial identifier of the virtual item, the third identifier of the virtual item, and the attribute value of the virtual item in the second attribute in the mapping table.
5. The method according to claim 4, wherein The obtaining the second identifier corresponding to each extended virtual item includes: When the attribute value of the extended virtual item in the first attribute is the default value in the first attribute, determining the third identifier of the virtual item as the second identifier of the extended virtual item.
6. The method according to any one of claims 2 to 5, characterized in that The method further includes: Receiving a listing request for the extended virtual item, where the listing request carries the first identifier of the virtual item and the first attribute value in the first attribute; Determining a first matching identifier from the second identifiers recorded in the mapping table according to the listing request, where the first matching identifier has an association relationship with the first identifier and the first attribute value; Storing the first matching identifier in a data table of the listed virtual items.
7. The method according to claim 6, characterized in that, The method further includes: Receiving a query request for the listed virtual item, where the query request carries the first identifier of the virtual item and the second attribute value in the first attribute; Determining a second matching identifier from the second identifiers recorded in the mapping table according to the query request, where the second matching identifier has an association relationship with the first identifier and the second attribute value; Querying data in the data table of the listed virtual items through the second matching identifier.
8. The method according to claim 6, characterized in that, The method further includes: Receiving a purchase request for the virtual item on the shelf, where the purchase request carries a first identifier of the virtual item and a third attribute value in the first attribute; Determining a third matching identifier from the second identifiers recorded in the mapping table according to the purchase request, where the third matching identifier has an association relationship with the first identifier and the third attribute value; Processing purchase data associated with the third matching identifier in the data table of the virtual item on the shelf according to the purchase request.
9. The method according to any one of claims 2 to 5, characterized in that The method further includes: Receiving an identifier query request for the mapping table, where the identifier query request carries a first identifier of the virtual item and a fourth attribute value in the first attribute; Concatenating the first identifier of the virtual item and the fourth attribute value to obtain a query key; Querying a query result of the identifier query request in the mapping table through the query key.
10. The method according to any one of claims 2 to 5, characterized in that, The method further includes: Receiving an attribute query request for the mapping table, where the attribute query request carries a second identifier of the extended virtual item; Determining the second identifier of the extended virtual item as the query key; Querying a query result of the attribute query request in the mapping table through the query key.
11. According to the method described in any one of claims 1 to 5, characterized in that, The obtaining of the first identifier of the virtual item includes: Obtaining the first identifier of the virtual item in the client. The associatively storing the first identifier of the virtual item, the second identifier of the extended virtual item, and the first attribute in a mapping table includes: Associatively storing the first identifier of the virtual item, the second identifier of the extended virtual item, and the first attribute in a mapping table on the server side.
12. An identification mapping device for virtual items, characterized in that, The apparatus includes: An obtaining module, configured to obtain a first identifier of a virtual item; A new adding module, configured to obtain an extended virtual item by adding a first attribute to the virtual item; The obtaining module is further configured to obtain a second identifier of the extended virtual item; A storage module, configured to associatively store the first identifier of the virtual item, the second identifier of the extended virtual item, and the first attribute in a mapping table.
13. A computer device, characterized in that, The computer device includes a processor and a memory, where at least one program is stored in the memory, and the at least one program is loaded and executed by the processor to implement the identifier mapping method of the virtual item according to any one of claims 1 to 11.
14. A computer-readable storage medium, characterized in that, At least one program is stored in the computer-readable storage medium, and the at least one program is loaded and executed by a processor to implement the identifier mapping method of the virtual item according to any one of claims 1 to 11.
15. A computer program product, characterized in that, The computer program product includes computer instructions, the computer instructions are stored in a computer-readable storage medium, a processor of a 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 identifier mapping method of the virtual item according to any one of claims 1 to 11.