CN113680046A - Grid data storage method and device, electronic equipment and storage medium - Google Patents

Grid data storage method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN113680046A
CN113680046A CN202110796764.6A CN202110796764A CN113680046A CN 113680046 A CN113680046 A CN 113680046A CN 202110796764 A CN202110796764 A CN 202110796764A CN 113680046 A CN113680046 A CN 113680046A
Authority
CN
China
Prior art keywords
data
map
binary
attribute
grid
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110796764.6A
Other languages
Chinese (zh)
Inventor
黎秋成
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangzhou Fanxing Huyu IT Co Ltd
Original Assignee
Guangzhou Fanxing Huyu IT Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangzhou Fanxing Huyu IT Co Ltd filed Critical Guangzhou Fanxing Huyu IT Co Ltd
Priority to CN202110796764.6A priority Critical patent/CN113680046A/en
Publication of CN113680046A publication Critical patent/CN113680046A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/20Input arrangements for video game devices
    • A63F13/21Input arrangements for video game devices characterised by their sensors, purposes or types
    • A63F13/213Input arrangements for video game devices characterised by their sensors, purposes or types comprising photodetecting means, e.g. cameras, photodiodes or infrared cells
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/50Controlling the output signals based on the game progress
    • A63F13/52Controlling the output signals based on the game progress involving aspects of the displayed game scene
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/60Generating or modifying game content before or while executing the game program, e.g. authoring tools specially adapted for game development or game-integrated level editor
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/70Game security or game management aspects
    • A63F13/77Game security or game management aspects involving data related to game devices or game servers, e.g. configuration data, software version or amount of memory
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F2300/00Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game
    • A63F2300/20Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game characterised by details of the game platform
    • A63F2300/209Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game characterised by details of the game platform characterized by low level software layer, relating to hardware management, e.g. Operating System, Application Programming Interface
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F2300/00Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game
    • A63F2300/50Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game characterized by details of game servers
    • A63F2300/55Details of game data or player data management
    • A63F2300/5526Game data structure

Abstract

The invention discloses a method, a device, electronic equipment and a storage medium for storing grid data, which are characterized in that after current map data of a client is acquired, attributes and a value range of the map data are identified, the map data are converted based on the attributes and the value range to obtain data character strings, all bits in the map data are spliced according to a preset data splicing rule to obtain new data character strings, then the new data character strings are converted into decimal data to obtain the values of the map data, and the values are stored according to the storage format of the preset map data in a database. By the storage mode, grid games can be developed at low cost, map development cost is saved, decimal storage is convenient for expansion and subsequent data reading, running speed is improved, and game experience of players is improved.

Description

Grid data storage method and device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of data processing technologies, and in particular, to a method and an apparatus for storing grid data, an electronic device, and a storage medium.
Background
With the development of the internet, grid games are gradually favored by players, and for example, mine sweeping, fun elimination and the like are more integrated into daily life. The current grid games are more based on map playing methods, game players interact and operate through customized maps, and for the display realization of information such as the maps, the interaction and the operation, the information needs to be stored in a memory unit through a server, and then a game terminal reads the information from the memory unit for display processing.
In the prior art, in order to facilitate reading and parsing of display, a binary system and an XML file are mainly used for storage, but the degree of freedom of operation of the storage is limited, so that data reading efficiency and parsing efficiency are not high, and especially for grid games with huge data volume, the display running speed of the game is reduced, and player experience is affected.
Disclosure of Invention
In order to solve the above problems, the present invention provides a method, an apparatus, an electronic device and a storage medium for storing grid-like data, and aims to solve the technical problem that the existing game data storage affects data reading and is inconvenient for expansibility, which results in a low game running speed.
Aiming at the problems, the invention adopts the following technical scheme:
in a first aspect, the present invention provides a method for storing grid-like data, where the method includes the following steps:
acquiring current map data of a client, identifying the attribute and the value range of the map data, and converting the map data based on the attribute and the value range to obtain a data character string;
splicing all the bits in the map data according to a preset data splicing rule to obtain a new data character string;
carrying out decimal conversion processing on the new data character string to obtain a value of the map data;
and storing the values of the map data into a database according to a preset map data storage format.
Optionally, the acquiring current map data of the client, identifying an attribute and a value range of the map data, and converting the map data based on the attribute and the value range to obtain a data character string includes:
acquiring current map data of a client, and carrying out meshing processing on the map data to obtain a plurality of grid map cells;
identifying attributes of each grid map cell;
identifying the number of grid map cells with the same attribute in all grid map cells according to the attributes, and determining the value range of the grid map cells under each attribute based on the number;
and determining the binary digit number of the grid map cell corresponding to each attribute according to the value range, and performing binary conversion on each grid map cell based on the binary digit number to obtain a binary character string.
Optionally, the binary conversion of each grid map cell based on the binary digit number to obtain a binary character string includes:
defining a blank binary string according to the binary digit number;
and configuring corresponding values for each bit in the blank binary character string according to the value range and the attributes to obtain the binary character string corresponding to each grid map cell.
Optionally, the data splicing rule includes a sorting order of the attribute bytes and a value size sorting of each attribute byte, and the splicing of each bit in the map data according to a preset data splicing rule to obtain a new data character string includes:
adjusting the sequence of each attribute byte in all the binary character strings according to the sequence of the attribute bytes to obtain a corresponding new binary character string;
and adjusting all the new binary character strings according to the value size sequence of the attribute bytes to obtain new data character strings.
Optionally, the adjusting the sequence of each attribute byte in all the binary character strings according to the sequence of the attribute bytes to obtain a corresponding new binary character string includes:
identifying the bit number of each attribute byte in each binary string;
and placing the attribute byte with the digit equal to 1 in each binary character string at the lowest position in the whole character string, and sequencing the attribute bytes with the digit greater than 1 according to the rule of less high-order ranking and more low-order ranking to obtain a corresponding new binary character string.
Optionally, after the bits in the map data are spliced according to a preset data splicing rule to obtain a new data character string, the method further includes:
detecting whether user operation information exists in each grid map cell;
if the new data character string exists, adding at least one operation attribute byte after the lowest bit of the new data character string;
and selecting a corresponding attribute bit from the at least one operation attribute byte according to the user operation information, and configuring a corresponding value to obtain a new binary character string.
Optionally, the map data storage format is one of a row-cell list and a row-column-cell list;
the storing the values of the map data into a database according to a preset map data storage format comprises:
respectively taking the highest byte and the second highest byte in the new binary string as row and column numbers;
storing all new binary character strings into a row-cell list or a row-column-cell table based on the row and column numbers to obtain a data storage table;
and sending the data storage table to a storage block of a database for storage.
In a second aspect, the present invention further provides a storage apparatus for grid class data, including:
the identification module is used for acquiring the current map data of the client, identifying the attribute and the value range of the map data, and converting the map data based on the attribute and the value range to obtain a data character string;
the splicing module is used for splicing all the bits in the map data according to a preset data splicing rule to obtain a new data character string;
the conversion module is used for carrying out decimal conversion processing on the new data character string to obtain a value of the map data;
and the storage module is used for storing the values of the map data into a database according to a preset map data storage format.
Optionally, the identification module includes:
the grid unit is used for acquiring the current map data of the client and carrying out grid processing on the map data to obtain a plurality of grid map cells;
an identifying unit for identifying the attribute of each grid map cell; identifying the number of grid map cells with the same attribute in all grid map cells according to the attribute;
the determining unit is used for determining the value range of the grid map cells under each attribute based on the quantity; determining the binary digit number of the grid map cell corresponding to each attribute according to the value range;
and the binary conversion unit is used for carrying out binary conversion on each grid map cell based on the binary digit number to obtain a binary character string.
Optionally, the binary conversion unit is specifically configured to:
defining a blank binary string according to the binary digit number;
and configuring corresponding values for each bit in the blank binary character string according to the value range and the attributes to obtain the binary character string corresponding to each grid map cell.
Optionally, the data splicing rule includes a sorting order of the attribute bytes and a value size sorting of each attribute byte, and the splicing module includes:
the first adjusting unit is used for adjusting the sequence of each attribute byte in all the binary character strings according to the sequence of the attribute bytes to obtain a corresponding new binary character string;
and the second adjusting unit is used for adjusting all the new binary character strings according to the value size sequence of the attribute bytes to obtain new data character strings.
Optionally, the first adjusting unit is specifically configured to:
identifying the bit number of each attribute byte in each binary string;
and placing the attribute byte with the digit equal to 1 in each binary character string at the lowest position in the whole character string, and sequencing the attribute bytes with the digit greater than 1 according to the rule of less high-order ranking and more low-order ranking to obtain a corresponding new binary character string.
Optionally, the storage device for grid-like data further includes an adding module, which is specifically configured to:
detecting whether user operation information exists in each grid map cell;
if the new data character string exists, adding at least one operation attribute byte after the lowest bit of the new data character string;
and selecting a corresponding attribute bit from the at least one operation attribute byte according to the user operation information, and configuring a corresponding value to obtain a new binary character string.
Optionally, the map data storage format is one of a row-cell list and a row-column-cell list; the memory module includes:
the extracting unit is used for taking the highest byte and the second highest byte in the new binary string as row and column numbers respectively;
the table generating unit is used for storing all the new binary character strings into a row-cell list or a row-column-cell list based on the row and column numbers to obtain a data storage table;
and the storage unit is used for sending the data storage table to a storage block of a database for storage.
A third aspect of the present invention provides an electronic device comprising: a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the method for storing grid-like data provided in the first aspect when executing the computer program.
A fourth aspect of the present invention provides a computer-readable storage medium, which stores a computer program that, when executed by a processor, implements the steps in the storage method of grid-like data provided by the first aspect described above.
Through the implementation of the technical scheme provided by the invention, the following beneficial effects are realized:
according to the embodiment of the invention, by configuring the map data storage format and the data splicing rule of the database, after the map data of the current game of the client is acquired, the attribute and the value range of the map data are identified, the map data are converted based on the attribute and the value range to obtain the data character string, the values of each bit in the data character string are spliced according to the data splicing rule to obtain a new data character string, then the new data character string is converted into decimal data to obtain the value of the map data, and the map data are stored according to the storage format of the map data in the database. By the storage mode, grid games can be developed at low cost, map development cost is saved, decimal storage is convenient for expansion and subsequent data reading, running speed is improved, and game experience of players is improved.
Drawings
FIG. 1 is a schematic diagram of an embodiment of a method for storing grid-like data according to the present invention;
FIG. 2 is a schematic diagram of another embodiment of a storage method of grid class data provided by the present invention;
FIG. 3 is a schematic diagram of a binary string structure according to the present invention;
FIG. 4 is a schematic diagram of a data storage table provided by the present invention;
FIG. 5 is a schematic diagram of an embodiment of a storage device for grid class data provided by the present invention;
FIG. 6 is a schematic diagram of another embodiment of a storage device for grid class data provided by the present invention;
fig. 7 is a schematic diagram of an embodiment of an electronic device provided in the present invention.
Detailed Description
Aiming at the problems that the grid game map cannot be flexibly stored in the prior art, the customization cost is high, the degree of freedom is limited, and the player experience is further influenced, a scheme for storing the grid game map in a decimal data mode is provided, specifically, a splicing rule of map data and a format of data conversion are configured, the obtained map data are converted and stored according to the format, the converted map data are spliced again according to the splicing rule, the spliced data are converted into decimal character strings, and finally the decimal character strings are stored according to a data storage format in a database.
The terms "first," "second," "third," "fourth," and the like in the description and in the claims, as well as in the drawings, if any, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It will be appreciated that the data so used may be interchanged under appropriate circumstances such that the embodiments described herein may be practiced otherwise than as specifically illustrated or described herein. Furthermore, the terms "comprises," "comprising," or "having," and any variations thereof, are intended to cover non-exclusive inclusions, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
For convenience of understanding, a specific flow of the embodiment of the present invention is described below, and referring to fig. 1, a first embodiment of a method for storing grid-like data according to the embodiment of the present invention includes:
101. acquiring current map data of a client, identifying the attribute and the value range of the map data, and converting the map data based on the attribute and the value range to obtain a data character string;
in this embodiment, the map data refers to map data of a grid-type game, and specifically includes environment data and object data of the map, and even further includes interactive operation data of a user on the map of the game. The data may be collected by a sensor disposed on the game terminal (e.g., a client), or an on-screen monitoring device or an infrared scanner, for example, the infrared scanner scans object information of a game map displayed on a display screen of the game terminal and coordinate information of the object in the map, so as to form map data.
Further, extracting corresponding object data from game background data based on map data, identifying all attributes of the objects according to the object data, simultaneously counting the number of the objects with the same attributes in the whole game map or a map currently displayed on a display screen, calculating a value range of the objects based on the number, converting the map data into a data form according with a data splicing rule according to the attributes and the value range to obtain a data character string, such as a binary character string, but obtaining the binary character string through the conversion, wherein the value includes all the attributes of the objects and values corresponding to the attributes, and the value is determined based on the value range, for example, when a plurality of identical objects exist in the game map, each object is numbered according to the value range, and the number is numbered according to the binary system, such as 001, 010, 011, 100. 101, 110, 111, etc., the binary number of bits of which is selected based on the value range.
In practical applications, the length of the data string specifically includes the sum of all attributes of the object, and each attribute has its own value range, and the sum of the value ranges of all attributes is the length of the data string.
102. Splicing all the bits in the map data according to a preset data splicing rule to obtain a new data character string;
in this embodiment, before the splicing, values of each bit in the data character string are identified, and then the bits are re-spliced according to a preset data splicing rule, where each attribute in the data character string corresponds to one attribute byte, and the number of bits of the attribute byte is determined according to a value range of the attribute.
Further, after obtaining the new data character string, the method also includes sorting the new data character string of the same object, wherein the sorting is performed according to the numbered bytes in the new data character string, and a character string set of all objects of the current game is obtained.
Further, the data splicing rule includes a sorting order of the attribute bytes and a value size sorting of each attribute byte, and the splicing according to the data splicing rule to obtain a new data character string includes:
adjusting the sequence of each attribute byte in all the binary character strings according to the sequence of the attribute bytes to obtain a corresponding new binary character string;
and adjusting all the new binary character strings according to the value size sequence of the attribute bytes to obtain new data character strings.
103. Carrying out decimal conversion processing on the new data character string to obtain a value of the map data;
in this step, the new data character string is specifically a binary character string, and the binary character string is converted into a decimal value according to a binary calculation method, and the decimal value is used as the value of the map data.
In practical applications, a map data may include data of a plurality of objects, and the data of each object is correspondingly converted into a decimal numeric value while a binary character string is correspondingly generated, and the map data of the objects are gridded to finally obtain a plurality of values of the map data.
104. And storing the values of the map data into a database according to a preset map data storage format.
In the step, the map data storage format is a data table, data in the data table is stored according to a row-column mode, the row-column mode respectively represents different major categories and minor categories of objects, all values (binary character strings) of the map data are classified based on the major categories and the minor categories and then are sent to a database one by one for storage, and specifically, each binary character string is firstly stored in the data table, and then the data table is sent to the storage value database.
In this embodiment, the step is specifically realized by the following steps:
respectively taking the highest byte and the second highest byte in the values of the map data as row and column numbers;
storing all values of the map data into a row-cell list or a row-column-cell table based on the row and column numbers to obtain a data storage table;
and sending the data storage table to a storage block of the database for storage.
In this embodiment, the data splicing rule and the map data storage format are specifically obtained by pre-configuration, that is, the map data storage format and the data splicing rule of the database are configured in the database of the game background according to the running requirement of the game;
in practical applications, the database may be a memory unit on the client, a cloud data server connected to the client, and the like. The map data storage format comprises one of a row-cell list and a row-column-cell list, and the data splicing rule is a splicing mode of different attribute fields when the map data is converted into character strings.
In practical applications, the map data storage format and the data splicing rule may be specifically configured according to storage requirements of different databases and data types of a game map, for example, an equipment in a game may be defined according to fields such as coordinate information of the equipment, a type of the equipment, and a serial number of the equipment.
In the implementation of the embodiment, after the map data are converted and spliced, the map data are converted into the decimal map data value, and the map data value is stored in the storage value database according to the preset map data storage format, so that the storage mode can bring low-cost and high-expansibility map support for grid games, accelerate the game development period and improve the experience of players.
Referring to fig. 2-4, a second embodiment of the method for storing grid-like data according to the embodiment of the present invention includes:
201. configuring a map data storage format and a data splicing rule of a database;
202. acquiring current map data of a client, and carrying out meshing processing on the map data to obtain a plurality of grid map cells;
in this step, the collected map data is composite data, which at least includes an object and an environment, preferably, the object is selected as the map data, and the collection process is as follows: the method comprises the steps of firstly acquiring all information in a game map displayed on a client, identifying information of an object from all information, marking, then collecting data of the marked position to obtain grid map cells, and forming a data set of the grid map cells until all the objects are collected.
203. Identifying attributes of each grid map cell;
in this step, the attributes include the type of the object, the label of the object, the grade of the object, the serial number of the object, and the like, and in practical applications, the attributes are specifically identified by analyzing the definition corresponding to each object in the map data.
204. Identifying the number of grid map cells with the same attribute in all grid map cells according to the attributes, and determining the value range of the grid map cells under each attribute based on the number;
in the step, all objects are classified based on attributes analyzed from map data, grid map cells with the same attributes are classified into one class, then the total number of grid map cells of each class is counted, and the value range of the attributes is calculated, as shown in fig. 4, for three kinds of belongings, namely, belongings a1, B1 and C1, and the value range of the attribute of the belongings is determined to be 0-3 according to the number.
205. Determining the binary digit number of grid map cells corresponding to each attribute according to the value range, and performing binary conversion on each grid map cell based on the binary digit number to obtain a binary character string;
in this embodiment, if the value range of the treasure is 0-3, it is indicated that two binary numbers are needed to express different types of treasures, binary conversion is performed on the attribute of the treasure in the value range, binary values with the attribute of the treasure on three grid map cells are obtained, and binary value configuration is performed on other attributes in the same conversion manner.
In this embodiment, the step of performing binary conversion on each grid map cell based on the binary digit number to obtain a binary character string is specifically:
defining a blank binary string according to the binary digit, wherein the blank binary string is preferably defined by a structure comprising at least six attribute bytes in practical application;
and configuring corresponding values for each bit in the blank binary character string according to the value range and the attributes to obtain the binary character string corresponding to each grid map cell.
In practical application, when a blank binary character string is defined, the blank binary character string is specifically defined according to grid map cells with the same attributes, that is, all attributes of the same grid map cells are the same, for example, attributes of a treasure include an inner line number, an inner column number, an element subtype, an element type, an element sequence number and the like, each attribute is configured with a corresponding binary digit number, digits of all attributes are added to obtain a binary total digit number of the grid map cell of the treasure, and the blank binary character string is defined based on the binary total digit number.
Further, after obtaining the blank binary character string, the method also comprises the step of adjusting the positions of the attributes in the character string, wherein the adjustment rule is to sort the attributes according to the value range, place the lowest bit on the attribute which can be identified by only one bit, and then splice the attributes according to the rule of less high-order ranking number and more low-order ranking number to obtain the blank binary character string.
206. Identifying the digit number and value of each attribute byte in each binary character string;
207. placing the attribute bytes with the digit equal to 1 in each binary character string at the lowest position in the whole character string, and sequencing the attribute bytes with the digit greater than 1 according to the rules of less high-order ranking and more low-order ranking to obtain a corresponding new binary character string;
in this embodiment, after obtaining the new binary string, the method further includes adding operation information, and since the game is experienced and operated by the user in real time, the operation needs to be displayed and embodied in the map, at this time, the storage of the operation information needs to be added for the storage of the game data, and the operation information only needs to be embodied by one-digit binary.
Optionally, detecting whether user operation information exists in each grid map cell;
if the new data character string exists, adding at least one operation attribute byte after the lowest bit of the new data character string;
and selecting a corresponding attribute bit from the at least one operation attribute byte according to the user operation information, and configuring a corresponding value to obtain a new binary character string.
For the generation of the new binary string, the treasure in fig. 4 is taken as an example for explanation, and the attributes of the treasure include an inner row number, an inner column number, an element subtype, an element type, an element sequence number and whether to click on, the three attributes of the inner line number, the inner column number and the element subtype obtained by the identification need two-digit binary numbers, the element type attribute needs four-digit binary numbers, the element sequence number attribute needs three-digit binary numbers, whether the click-on attribute needs one-digit binary numbers or not, the six attributes are sorted according to the rule that the attribute which can be identified by one bit is placed at the lowest position, the attribute which is more than one bit is placed at the lowest position, the high-order ranking number is less, and the low-order ranking number is more, finally the character string with the format shown in figure 3 is obtained, then, in the character string with the format shown in fig. 3, corresponding values are sequentially configured to obtain a new binary character string, that is, a character string of each grid map cell.
208. Converting the new binary character string into a decimal numeric value to obtain a decimal character string;
209. respectively taking the highest byte and the second highest byte in the binary character string corresponding to the decimal character string as row and column numbers;
210. storing all decimal character strings into a row-cell list or a row-column-cell table based on row and column numbers to obtain a data storage table;
in this embodiment, in the process of storing a value table for each decimal character string, the grid map cells are further classified and merged, as shown in fig. 4, for a treasure of the same type, a treasure a1 has three subtypes (namely, gold, silver and copper), the gold, silver and copper of the type treasure a1 are merged and stored in one row in the table, and simultaneously, the corresponding binary character string and the decimal character string are stored in the table.
211. And sending the data storage table to a storage block of the database for storage.
After the step, the method further comprises the following steps: if the map data on the client is detected to be changed, acquiring new map data, converting the new data according to the steps to obtain new binary character strings and decimal character strings, and inquiring records with the same attributes in the database by taking the attributes as indexes to update, thereby realizing the cyclic update of the game data, greatly reducing the problems of overlapping temporary resources of data amount and influencing the operation of the game,
in the embodiment of the invention, the binary digit number matched with the range is determined by identifying and defining the attribute and the value range of the grid map cells; according to the value range ordering attribute, placing the lowest order of the attribute which can be identified by only one order, and splicing the attributes according to the rule of less high order ranking number and more low order ranking number to obtain the definition of the cell; converting the attribute of each cell into a binary system according to the definition, and splicing according to rules to obtain a long string of binary systems; converting binary system into decimal system to obtain value of cell; storing the data into a database according to a row-cell value list format; by adopting the method, the grid games can be developed at low cost, and the map development cost is saved; map attributes and playing methods can be flexibly customized, and player experience is improved; the map information can be simplified, and the map storage cost can be saved.
With reference to fig. 5, the method for storing grid class data in the embodiment of the present invention is described above, and a storage apparatus for grid class data in the embodiment of the present invention is described below, where an embodiment of the storage apparatus for grid class data in the embodiment of the present invention includes:
the identifying module 501 is configured to collect current map data of a client, identify an attribute and a value range of the map data, and convert the map data based on the attribute and the value range to obtain a data character string;
a splicing module 502, configured to splice each bit in the map data according to a preset data splicing rule to obtain a new data character string;
a conversion module 503, configured to perform decimal conversion processing on the new data character string to obtain a value of the map data;
the storage module 504 is configured to store the value of the map data in a database according to a preset map data storage format.
The device provided by this embodiment is configured with a map data storage format and a data splicing rule of a database, acquires map data of a current game at a client, identifies attributes and value ranges of the map data, converts the map data based on the attributes and the value ranges to obtain data character strings, splices values of each bit in the data character strings according to the data splicing rule to obtain new data character strings, converts the new data character strings into decimal data to obtain values of the map data, and stores the values according to the storage format of the map data in the database. By the storage mode, grid games can be developed at low cost, map development cost is saved, decimal storage is convenient for expansion and subsequent data reading, running speed is improved, and game experience of players is improved.
Further, please refer to fig. 6, fig. 6 is a detailed diagram of each module of the storage device for grid-like data.
The identifying module 501 is configured to collect current map data of a client, identify an attribute and a value range of the map data, and convert the map data based on the attribute and the value range to obtain a data character string;
a splicing module 502, configured to splice each bit in the map data according to a preset data splicing rule to obtain a new data character string;
a conversion module 503, configured to perform decimal conversion processing on the new data character string to obtain a value of the map data;
the storage module 504 is configured to store the value of the map data in a database according to a preset map data storage format.
In this embodiment, the identifying module 501 includes:
the gridding unit 5011 is configured to acquire current map data of a client, and perform gridding processing on the map data to obtain a plurality of grid map cells;
an identifying unit 5012 for identifying an attribute of each grid map cell; identifying the number of grid map cells with the same attribute in all grid map cells according to the attribute;
a determining unit 5013, configured to determine a value range of the grid map cells under each attribute based on the number; determining the binary digit number of the grid map cell corresponding to each attribute according to the value range;
the binary conversion unit 5014 is configured to perform binary conversion on each grid map cell based on the binary digit number to obtain a binary string.
In this embodiment, the binary conversion unit 5014 is specifically configured to:
defining a blank binary string according to the binary digit number;
and configuring corresponding values for each bit in the blank binary character string according to the value range and the attributes to obtain the binary character string corresponding to each grid map cell.
In this embodiment, the data splicing rule includes a sorting order of the attribute bytes and a value size sorting of each attribute byte, and the splicing module 502 includes:
a first adjusting unit 5021, configured to adjust the order of each attribute byte in all the binary strings according to the sorting order of the attribute bytes, so as to obtain a corresponding new binary string;
a second adjusting unit 5022, configured to adjust all the new binary strings according to the value-size ordering of the attribute bytes, so as to obtain a new data string.
In this embodiment, the first adjusting unit 5021 is specifically configured to:
identifying the bit number of each attribute byte in each binary string;
and placing the attribute byte with the digit equal to 1 in each binary character string at the lowest position in the whole character string, and sequencing the attribute bytes with the digit greater than 1 according to the rule of less high-order ranking and more low-order ranking to obtain a corresponding new binary character string.
In this embodiment, the storage apparatus of the grid class data further includes an adding module 505, which is specifically configured to:
detecting whether user operation information exists in each grid map cell;
if the new data character string exists, adding at least one operation attribute byte after the lowest bit of the new data character string;
and selecting a corresponding attribute bit from the at least one operation attribute byte according to the user operation information, and configuring a corresponding value to obtain a new binary character string.
In the present embodiment, the map data storage format is one of a row-cell list and a row-column-cell list; the storage module 504 includes:
an extracting unit 5041, configured to take the highest byte and the second highest byte in the new binary string as row and column numbers, respectively;
a table generating unit 5042, configured to store all new binary strings into a row-cell list or a row-column-cell list based on the row and column numbers, so as to obtain a data storage table;
the storage unit 5043 is configured to send the data storage table to a storage block of the database for storage.
In the embodiment of the invention, the map data are converted into the decimal map data value after being converted and spliced, and the map data value is stored in the value database according to the map data storage format, so that the storage mode can bring low-cost and high-expansibility map support for grid games, accelerate the game development period and improve the experience of players.
Fig. 5 and fig. 6 describe the storage apparatus of the grid-like data in the embodiment of the present invention in detail from the perspective of the modular functional entity, and the electronic device in the embodiment of the present invention is described in detail from the perspective of the hardware processing.
Fig. 7 is a schematic structural diagram of an electronic device 700, which may have a relatively large difference due to different configurations or performances, and may include one or more processors (CPUs) 710 (e.g., one or more processors) and a memory 720, one or more storage media 730 (e.g., one or more mass storage devices) storing an application 733 or data 732. Memory 720 and storage medium 730 may be, among other things, transient storage or persistent storage. The program stored in the storage medium 730 may include one or more modules (not shown), each of which may include a sequence of instructions operating on the electronic device 700. Further, the processor 710 may be configured to communicate with the storage medium 730 to execute a series of instruction operations in the storage medium 730 on the electronic device 700. In actual practice, the application 733 may be divided into functions of the recognition module 501, the concatenation module 502, the conversion module 503, the storage module 504, and the addition module 505 (modules in the virtual device).
The electronic device 700 may also include one or more power supplies 740, one or more wired or wireless network interfaces 750, one or more input-output interfaces 760, and/or one or more operating systems 731, such as: windows Server, MacOSX, Unix, Linux, FreeBSD, etc. Those skilled in the art will appreciate that the electronic device structure shown in fig. 7 may also include more or fewer components than shown, or combine certain components, or a different arrangement of components.
The embodiment of the present invention also provides a computer-readable storage medium, which may be a non-volatile computer-readable storage medium, and may also be a volatile computer-readable storage medium, where instructions or a computer program are stored in the computer-readable storage medium, and when the instructions or the computer program are executed, the computer executes the steps of the storage method for grid-class data provided in the foregoing embodiment.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses, and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a read-only memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present invention, and not for limiting the same; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (10)

1. A storage method of grid-like data is characterized by comprising the following steps:
acquiring current map data of a client, identifying the attribute and the value range of the map data, and converting the map data based on the attribute and the value range to obtain a data character string;
splicing all the bits in the map data according to a preset data splicing rule to obtain a new data character string;
carrying out decimal conversion processing on the new data character string to obtain a value of the map data;
and storing the values of the map data into a database according to a preset map data storage format.
2. The method for storing grid data according to claim 1, wherein the acquiring current map data of a client, identifying attributes and value ranges of the map data, and converting the map data based on the attributes and the value ranges to obtain data strings comprises:
acquiring current map data of a client, and carrying out meshing processing on the map data to obtain a plurality of grid map cells;
identifying attributes of each grid map cell;
identifying the number of grid map cells with the same attribute in all grid map cells according to the attributes, and determining the value range of the grid map cells under each attribute based on the number;
and determining the binary digit number of the grid map cell corresponding to each attribute according to the value range, and performing binary conversion on each grid map cell based on the binary digit number to obtain a binary character string.
3. The method for storing grid-like data according to claim 2, wherein the binary converting each grid map cell based on the binary digit number to obtain a binary string comprises:
defining a blank binary string according to the binary digit number;
and configuring corresponding values for each bit in the blank binary character string according to the value range and the attributes to obtain the binary character string corresponding to each grid map cell.
4. The method for storing grid-like data according to claim 3, wherein the data splicing rule includes an ordering order of attribute bytes and a value size ordering of each attribute byte, and the splicing of each bit in the map data according to a preset data splicing rule to obtain a new data string includes:
adjusting the sequence of each attribute byte in all the binary character strings according to the sequence of the attribute bytes to obtain a corresponding new binary character string;
and adjusting all the new binary character strings according to the value size sequence of the attribute bytes to obtain new data character strings.
5. The method for storing grid-like data according to claim 4, wherein the adjusting the order of the attribute bytes in all the binary strings according to the ordering order of the attribute bytes to obtain a corresponding new binary string comprises:
identifying the bit number of each attribute byte in each binary string;
and placing the attribute byte with the digit equal to 1 in each binary character string at the lowest position in the whole character string, and sequencing the attribute bytes with the digit greater than 1 according to the rule of less high-order ranking and more low-order ranking to obtain a corresponding new binary character string.
6. The method for storing grid-like data according to claim 4, wherein after the bits in the map data are spliced according to a preset data splicing rule to obtain a new data character string, the method further comprises:
detecting whether user operation information exists in each grid map cell;
if the new data character string exists, adding at least one operation attribute byte after the lowest bit of the new data character string;
and selecting a corresponding attribute bit from the at least one operation attribute byte according to the user operation information, and configuring a corresponding value to obtain a new binary character string.
7. The method for storing mesh-like data according to claim 5 or 6, wherein the map data storage format is one of a row-cell list and a row-column-cell list;
the storing the values of the map data into a database according to a preset map data storage format comprises:
respectively taking the highest byte and the second highest byte in the new binary string as row and column numbers;
storing all new binary character strings into a row-cell list or a row-column-cell table based on the row and column numbers to obtain a data storage table;
and sending the data storage table to a storage block of a database for storage.
8. A storage device for grid class data, the storage device for grid class data comprising:
the identification module is used for acquiring the current map data of the client, identifying the attribute and the value range of the map data, and converting the map data based on the attribute and the value range to obtain a data character string;
the splicing module is used for splicing all the bits in the map data according to a preset data splicing rule to obtain a new data character string;
the conversion module is used for carrying out decimal conversion processing on the new data character string to obtain a value of the map data;
and the storage module is used for storing the values of the map data into a database according to a preset map data storage format.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, the processor implementing the steps in the method of storing grid-like data according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program which, when executed by a processor, implements the steps in the storage method of grid-like data according to any one of claims 1 to 7.
CN202110796764.6A 2021-07-14 2021-07-14 Grid data storage method and device, electronic equipment and storage medium Pending CN113680046A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110796764.6A CN113680046A (en) 2021-07-14 2021-07-14 Grid data storage method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110796764.6A CN113680046A (en) 2021-07-14 2021-07-14 Grid data storage method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN113680046A true CN113680046A (en) 2021-11-23

Family

ID=78577046

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110796764.6A Pending CN113680046A (en) 2021-07-14 2021-07-14 Grid data storage method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113680046A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114567681A (en) * 2022-01-25 2022-05-31 浙江数秦科技有限公司 High-efficiency data transmission method for block chain network
CN116306391A (en) * 2023-02-28 2023-06-23 深圳市摩尔芯创科技有限公司 Character string processing system and method for integrated circuit design

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114567681A (en) * 2022-01-25 2022-05-31 浙江数秦科技有限公司 High-efficiency data transmission method for block chain network
CN114567681B (en) * 2022-01-25 2024-04-05 浙江数秦科技有限公司 Block chain network high-efficiency data transmission method
CN116306391A (en) * 2023-02-28 2023-06-23 深圳市摩尔芯创科技有限公司 Character string processing system and method for integrated circuit design
CN116306391B (en) * 2023-02-28 2024-01-02 师细会 Character string processing system and method for integrated circuit design

Similar Documents

Publication Publication Date Title
CN109918370B (en) WEB-based development method and system for configurable form application front end
CN113680046A (en) Grid data storage method and device, electronic equipment and storage medium
CN111708774B (en) Industry analytic system based on big data
CN110825805A (en) Data visualization method and device
CN111460011A (en) Page data display method and device, server and storage medium
CN107451429A (en) A kind of system of keyization analysis RNA data
CN113807062A (en) Online drawing method and device for combined density map and electronic equipment
CN114398560B (en) Marketing interface setting method, device, equipment and medium based on WEB platform
CN112506910A (en) Multi-source data acquisition method and device, electronic equipment and storage medium
CN115048382A (en) Hierarchical data searching method, device, equipment and storage medium based on binary tree
CN113900955A (en) Automatic testing method, device, equipment and storage medium
WO2019123703A1 (en) Data analysis assistance device, data analysis assistance method, and data analysis assistance program
CA2936485C (en) Optimized data condenser and method
CN114841165B (en) User data analysis and display method and device, electronic equipment and storage medium
CN113806492B (en) Record generation method, device, equipment and storage medium based on semantic recognition
CN110008448A (en) The method and apparatus that SQL code is automatically converted to Java code
CN112925774B (en) Method and device for cleaning address data, storage medium and computer equipment
CN111143554B (en) Data sampling method and device based on big data platform
CN114240560A (en) Product ranking method, device, equipment and storage medium based on multidimensional analysis
CN114518993A (en) System performance monitoring method, device, equipment and medium based on business characteristics
CN104408316B (en) Sino-U.S.'s Geotechnical Engineering classification of soils standard handovers device and method
CN113553341A (en) Multidimensional data analysis method, multidimensional data analysis device, multidimensional data analysis equipment and computer readable storage medium
CN113344023A (en) Code recommendation method, device and system
CN107577690B (en) Recommendation method and recommendation device for mass information data
JP2020166443A (en) Data processing method recommendation system, data processing method recommendation method, and data processing method recommendation program

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination