CN115237853A - Data query method and device, electronic equipment and storage medium - Google Patents

Data query method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN115237853A
CN115237853A CN202110437274.7A CN202110437274A CN115237853A CN 115237853 A CN115237853 A CN 115237853A CN 202110437274 A CN202110437274 A CN 202110437274A CN 115237853 A CN115237853 A CN 115237853A
Authority
CN
China
Prior art keywords
data
file
binary
target
row
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
CN202110437274.7A
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.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN202110437274.7A priority Critical patent/CN115237853A/en
Publication of CN115237853A publication Critical patent/CN115237853A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/13File access structures, e.g. distributed indices
    • 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
    • A63F13/63Generating 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 by the player, e.g. authoring using a level editor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/16File or folder operations, e.g. details of user interfaces specifically adapted to file systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2282Tablespace storage structures; Management thereof

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Software Systems (AREA)
  • Human Computer Interaction (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application relates to the technical field of computers, in particular to a method and a device for querying data, electronic equipment and a storage medium. The method comprises the following steps: acquiring a data query instruction; responding to a data query instruction, acquiring file index information, wherein the file index information comprises a corresponding relation between a file identifier and a data file, the data file comprises data description information and at least one binary data row, and the data description information is used for indicating the corresponding relation between the data identifier and a binary data field; reading a target data file corresponding to the file identifier to be inquired according to the file index information; and acquiring a target binary data field corresponding to the data identifier to be inquired from a target binary data row of the target data file according to the data description information of the target data file. The method can remove the structural information in the data table file, thereby reducing the volume of the data file and the occupation of the memory space, and accelerating the loading speed, the running speed and the efficiency.

Description

Data query method and device, electronic equipment and storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method and an apparatus for querying data, an electronic device, and a storage medium.
Background
With the rapid development of computer technology and mobile internet, electronic games have become an entertainment activity that people can play anytime and anywhere. Electronic games are typically developed and created using a game engine. The game engine refers to a core component of some edited electronic game system or some interactive real-time image application program. The game engine provides game designers with the various tools needed to write game programs so that game designers can easily and quickly make game programs without starting from zero.
Currently, game data in a game engine is usually formulated outside the engine, recorded in a data table file, and then the data table file is imported into the game engine for development of a corresponding data structure. And when the game program runs, loading and analyzing the data table, so as to obtain the game data in the data table.
However, in the current scheme, the process of loading the game data by the game program needs to load and analyze the whole data table file, the loading speed is slow, and the occupied memory space is large, which causes the system overhead to be large, and the operation speed and the operation efficiency to be low.
Disclosure of Invention
Based on the technical problem, the application provides a data query method to reduce the volume of data files, reduce the occupation of memory space, accelerate the loading speed, and improve the running speed and efficiency.
Other features and advantages of the present application will be apparent from the following detailed description, or may be learned by practice of the application.
According to an aspect of an embodiment of the present application, there is provided a method for querying data, including:
acquiring a data query instruction, wherein the data query instruction comprises a file identifier to be queried and a data identifier to be queried, which correspond to data to be queried;
responding to the data query instruction, acquiring file index information, wherein the file index information comprises a corresponding relation between a file identifier and a data file, the data file is generated after binary coding is carried out according to an original data file, the data file comprises data description information and at least one binary data row, the binary data row comprises at least one binary data field, and the data description information is used for indicating the corresponding relation between the data identifier and the binary data field;
reading a target data file corresponding to the file identifier to be inquired according to the file index information;
and acquiring a target binary data field corresponding to the data identifier to be inquired from a target binary data row of the target data file according to the data description information of the target data file.
According to an aspect of an embodiment of the present application, there is provided a data query apparatus including:
the instruction acquisition module is used for acquiring a data query instruction, wherein the data query instruction comprises a file identifier to be queried and a data identifier to be queried, which correspond to data to be queried;
an index information obtaining module, configured to obtain file index information in response to the data query instruction, where the file index information includes a correspondence between a file identifier and a data file, the data file is generated after binary coding is performed on an original data file, the data file includes data description information and at least one binary data row, the binary data row includes at least one binary data field, and the data description information is used to indicate a correspondence between the data identifier and the binary data field;
the file reading module is used for reading a target data file corresponding to the file identifier to be inquired according to the file index information;
and the field acquisition module is used for acquiring a target binary data field corresponding to the data identifier to be inquired from a target binary data row of the target data file according to the data description information of the target data file.
In some embodiments of the present application, based on the above technical solutions, the data query apparatus includes:
the device comprises an original file acquisition module, a data acquisition module and a data processing module, wherein the original file acquisition module is used for acquiring an original data file, and the original data file comprises header information and at least one original data line;
the binary system processing module is used for analyzing and binary system converting the data in the original data file to obtain an intermediate data file;
the file generation module is used for generating the target data file according to the data description information of the original data file and the intermediate data file;
and the index updating module is used for adding the index information of the target data file in the file index information.
In some embodiments of the present application, based on the above technical solution, the binary processing module includes:
an import instruction receiving unit for receiving a data import instruction through an editor;
the encoding unit is used for responding to the data import instruction, performing binary encoding on at least one original data row in the original data file to obtain at least one binary data row, wherein each original data row corresponds to one binary data row, and each data value in each original data row corresponds to one binary data field;
and the merging unit is used for merging the at least one binary data row to generate an intermediate data file.
In some embodiments of the present application, based on the above technical solution, the encoding unit includes:
a calculation subunit, configured to calculate, for each data value in the original data line, a data header of the data value according to a data type of the data value and a sequence order in the original data line;
a data encoding subunit, configured to perform binary encoding on the data header and the data value to obtain a binary data field;
a sequence combining subunit, configured to combine the binary data fields into a binary sequence according to the sequence order;
and the data row merging subunit is used for carrying out binary coding on the data length information of the binary sequence, merging the coding result with the binary sequence and generating a binary data row corresponding to the data value.
In some embodiments of the present application, based on the above technical solutions, the file generating module includes:
a generation instruction receiving unit configured to receive a description information generation instruction by the editor;
the analysis unit is used for responding to the description information generation instruction and analyzing the header information in the original data file to obtain at least one data identifier;
an address mapping determination unit, configured to determine address mapping information of a binary data row according to primary key data of the binary data row in the intermediate data file and a start address and a data length of the binary data row;
the data mapping determining unit is used for determining data mapping information of the binary data fields according to the mapping relation between the at least one data identifier and the binary data fields in the binary data rows;
and the file composition unit is used for generating the target data file according to the address mapping information, the data mapping information and the intermediate data file.
In some embodiments of the present application, based on the above technical solutions, the original file obtaining module includes:
an import instruction receiving unit for receiving a file import instruction through an editor;
the import instruction corresponding unit is used for responding to the file import instruction and acquiring a file to be processed according to a preset file list to be processed;
and the data table splitting unit is used for splitting the data table in the file to be processed to obtain an original data file.
In some embodiments of the present application, based on the above technical solution, the identifier of the data to be queried includes a main key to be queried and a field identifier to be queried; a field acquisition module comprising:
the searching unit is used for searching the initial address and the data length corresponding to the main key to be inquired from the data description information;
the reading unit is used for reading the target binary data row from the target data file according to the corresponding initial address and the data length of the main key to be inquired;
and the field acquisition unit is used for acquiring the target binary data field corresponding to the field identifier to be queried from the target binary data row according to the data description information of the target data file.
According to an aspect of an embodiment of the present application, there is provided an electronic device including: a processor; and a memory for storing executable instructions for the processor; wherein the processor is configured to execute the method of data query as in the above technical solution via executing the executable instructions.
According to an aspect of the embodiments of the present application, there is provided a computer-readable storage medium, on which a computer program is stored, which when executed by a processor implements a method of data query as in the above technical solutions.
According to an aspect of an embodiment of the present application, there is provided a computer program product or a computer program comprising computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions to cause the computer device to perform the method for providing data query in the above-mentioned various alternative implementations.
In the embodiment of the application, when game data, application data and structure data are inquired and inquired for data, a target data file which needs to be read is inquired from file index information according to a data inquiry instruction, and a binary data field is read from the target data file according to a data identifier. Because the data to be inquired is stored in a binary form, the structured information in the data table file is removed on the basis of saving the analysis process, so that the volume of the data file is reduced, the occupation of the memory space is reduced, the loading speed is increased, and the running speed and the running efficiency are improved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the application.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and together with the description, serve to explain the principles of the application. It is obvious that the drawings in the following description are only some embodiments of the application, and that for a person skilled in the art, other drawings can be derived from them without inventive effort.
In the drawings:
FIG. 1 schematically illustrates an exemplary system architecture diagram of the present application in one application scenario;
FIG. 2 is a flow chart illustrating a method of data query in an embodiment of the present application;
FIG. 3 is a diagram illustrating the content of an original data file according to an embodiment of the present application;
FIG. 4 is a schematic diagram of an editor interface in an embodiment of the application;
FIG. 5 is a diagram illustrating a structure of a target data file according to an embodiment of the present application;
FIG. 6 is an overall flowchart of data update in the embodiment of the present application;
FIG. 7 is a block diagram schematically illustrating the components of a data query device in an embodiment of the present application;
FIG. 8 illustrates a schematic structural diagram of a computer system suitable for use in implementing the electronic device of an embodiment of the present application.
Detailed Description
Example embodiments will now be described more fully with reference to the accompanying drawings. Example embodiments may, however, be embodied in many different forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of example embodiments to those skilled in the art.
Furthermore, the described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a thorough understanding of embodiments of the application. One skilled in the relevant art will recognize, however, that the embodiments of the present application can be practiced without one or more of the specific details, or with other methods, components, devices, steps, and so forth. In other instances, well-known methods, devices, implementations, or operations have not been shown or described in detail to avoid obscuring aspects of the application.
The block diagrams shown in the figures are functional entities only and do not necessarily correspond to physically separate entities. I.e. these functional entities may be implemented in the form of software, or in one or more hardware modules or integrated circuits, or in different networks and/or processor means and/or microcontroller means.
The flowcharts shown in the figures are illustrative only and do not necessarily include all of the contents and operations/steps, nor do they necessarily have to be performed in the order described. For example, some operations/steps may be decomposed, and some operations/steps may be combined or partially combined, so that the actual execution sequence may be changed according to the actual situation.
It should be understood that the solution of the present application may be applied to the context of a game application, and in particular to a game application in a game client or a game server. In such a scenario, the client or the server generally needs to acquire various game data related to the game content according to the game behavior of the user for displaying and calculating, so as to provide the user with the play behavior. For example, for a family construction game, a user browses attributes of various buildings on a client, such as information of the amount of the buildings, functions, output or construction conditions, and the client generally needs to obtain relevant data from a local server or a cloud for displaying when the user chooses to browse such data. In such a scenario, the scheme of the application may be used to query such data according to the operation requirement of the user or the client, so as to be used to subsequently show the relevant information to the user, or to perform calculation and update according to the operation of the user and the operation condition of the client, for example, to update the content of the user, such as cost and revenue according to the building selected and built by the user. The scheme of the application can also be applied to other kinds of application programs for inquiring application data, for example, attribute information of short videos can be inquired in short video applications, or communication history records can be inquired in communication applications. The scheme of the application can also be applied to a drawing or three-dimensional modeling scene, and is used for inquiring the structural data or the attribute information of the graph or the three-dimensional model, or reading the structural data or the attribute information when browsing and loading the graph or the three-dimensional model.
The application scene of the application can be a stand-alone program which only runs on one terminal device, an online program which runs on a plurality of terminal devices, a networking program which runs on a terminal and a server or a cloud game based on a cloud technology.
Cloud technology refers to a hosting technology for unifying series of resources such as hardware, software, and network in a wide area network or a local area network to realize calculation, storage, processing, and sharing of data.
The Cloud technology (Cloud technology) is based on the general names of network technology, information technology, integration technology, management platform technology, application technology and the like applied in a Cloud computing business model, can form a resource pool, can be used as required, and is flexible and convenient. Cloud computing technology will become an important support. Background services of technical network systems require a large amount of computing and storage resources, such as video websites, picture-like websites and more portal websites. With the high development and application of the internet industry, each article may have its own identification mark and needs to be transmitted to a background system for logic processing, data in different levels are processed separately, and various industrial data need strong system background support and can only be realized through cloud computing.
Cloud gaming (Cloud gaming), which may also be referred to as game on demand (gaming), is an online game technology based on Cloud computing technology. Cloud gaming technology enables light-end devices (thin clients) with relatively limited graphics processing and data computing capabilities to run high-quality games. In a cloud game scene, a game is not executed at a game terminal of a player, but is executed in a cloud server, the cloud server renders the game scene into a video and audio stream, and the video and audio stream is transmitted to the game terminal of the player through a network. The player game terminal does not need to have strong graphic operation and data processing capacity, and only needs to have basic streaming media playing capacity and capacity of acquiring player input instructions and sending the instructions to the cloud server.
The application program in the application scenario of the present application may also be a blockchain program that employs a blockchain technique, and the target data is queried from the data stored in the blockchain by the scheme of the present application. Specifically, the data in the blockchain may be processed by the scheme introduced in this application before the uplink. In use, the stored binary content is read from the blockchain and queried according to the scheme described herein.
The block chain is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, a consensus mechanism, an encryption algorithm and the like. A block chain (Blockchain), which is essentially a decentralized database, is a string of data blocks associated by using a cryptographic method, and each data block contains information of a batch of network transactions, which is used for verifying the validity (anti-counterfeiting) of the information and generating a next block. The blockchain may include a blockchain underlying platform, a platform product service layer, and an application service layer.
The block chain underlying platform can comprise processing modules such as user management, basic service, intelligent contract and operation monitoring. The user management module is responsible for identity information management of all blockchain participants, and comprises the steps of maintaining public and private key generation (account management), key management, user real identity and blockchain address corresponding relation maintenance (authority management) and the like, and under the authorized condition, supervising and auditing the transaction condition of some real identities, and providing rule configuration (wind control audit) of risk control; the basic service module is deployed on all block chain node point devices and used for verifying the effectiveness of the service request, recording the effective request after consensus is completed on storage, for a new service request, the basic service firstly performs interface adaptation analysis and authentication processing (interface adaptation), then encrypts service information (consensus management) through a consensus algorithm, transmits the encrypted service information to a shared account (network communication) completely and consistently, and performs recording and storage; the intelligent contract module is responsible for registering and issuing contracts, triggering the contracts and executing the contracts, developers can define contract logics through a certain programming language, issue the contract logics to a block chain (contract registration), call keys or other event triggering and executing according to the logics of contract clauses, complete the contract logics and simultaneously provide the function of canceling contract upgrading logout; the operation monitoring module is mainly responsible for deployment, configuration modification, contract setting, cloud adaptation in the product release process and visual output of real-time states in product operation, such as: alarm, monitoring network conditions, monitoring node equipment health status, and the like.
The platform product service layer provides basic capability and an implementation framework of typical application, and developers can complete block chain implementation of business logic based on the basic capability and the characteristics of the superposed business. The application service layer provides the application service based on the block chain scheme to the business participants for use.
For ease of understanding, the application of the scheme of the present application to a network game is described as an example. Referring to fig. 1, fig. 1 schematically shows an exemplary system architecture diagram of the present application in an application scenario.
As can be seen from fig. 1, the scenario includes a server, a terminal, a notebook computer, and other terminal devices. The client of the network game is executed on terminal equipment such as a terminal, a notebook computer, a mobile phone and the like, and is communicated with the server. The terminal equipment sends a data request to the server according to the operation of a user or the operation requirement of the client, and the server inquires related data according to the data request and sends data information to the terminal equipment. The terminal device can also obtain required data from the information locally stored in the terminal device according to the operation requirement of a user or the operation requirement of the client. For example, the user sends a request for purchasing a building to the server through the client on the mobile phone, and the server sends the data related to the request for purchasing the building and the calculation result to the client. The client terminal displays or calculates according to the received data information and continues playing the game. For a part of data with high frequency use, the client stores the data in a cache of the terminal device, and the client acquires the data from the cache directly when using the data next time without inquiring and acquiring the data from a hard disk or a server.
The server in fig. 1 may specifically be a single server, a server cluster, or a cloud server. The server is used for supporting game running on the client. In the present application, the client may also be a terminal for playing game production. The terminal runs a game engine, and a game developer imports and configures game data in the game engine after preparing the game data and publishes or updates the game after the game is completely prepared. During subsequent use by the user, the game client operates according to the game data.
The communication mode between the client and the server may be any wired or wireless communication mode, which is not limited in this application.
It is understood that the scenario shown in fig. 1 is only an example of a scenario to which the scheme of the present application is applied, and an actual application scenario may adopt other suitable network structures, for example, a proxy server and a multi-level network are added, which is not limited in this application.
The technical solutions provided in the present application are described in detail below with reference to specific embodiments.
Referring to fig. 2, fig. 2 is a flowchart illustrating a method for querying data in an embodiment of the present application, where the method of the present embodiment may be applied to the terminal device as described above and executed by the terminal device or a client in the terminal device. The method of the present embodiment may include steps S201 to S204 as follows:
step S201, a data query instruction is obtained, where the data query instruction includes a file identifier to be queried and a data identifier to be queried corresponding to the data to be queried.
The data query instruction is an instruction generated when related data needs to be acquired and is executed on the client or the server, and is used for acquiring specified data from a file storing the data. For example, in a game client, a user chooses to browse building information in the game, the client will query for such information and present the user with relevant data, such as how many buildings are present, the price of each building, etc. The process of querying the data may be performed solely by the terminal device, which is performed by the terminal device communicating with the server, and the specific apparatus concerned depends on the physical storage location of the file storing the relevant data, and may be performed solely by the terminal device when stored in the terminal device.
The data query instruction comprises a file identifier to be queried and a data identifier to be queried corresponding to the data to be queried. The file identifier to be queried is used to identify a file storing data to be queried, and specifically may be information such as a file name or a file path. The data identifier to be queried is used for identifying specific data in the data file. Data in a data file usually adopts a table organization form, the same type of data is stored in the same data file, and different data are distinguished through data identification, for example, the data identification may be a row number, a column number, a field name, and the like. Taking a card game as an example, if a user clicks and checks detailed information of a card named "king" in a client, the client generates a data query instruction, wherein the data query instruction comprises a file identifier to be queried, namely "card information", and the card name "king", so as to query the detailed data of the card.
Step S202, in response to the data query instruction, file index information is obtained, wherein the file index information includes a corresponding relation between a file identifier and a data file, the data file is generated after binary coding is performed according to an original data file, the data file includes data description information and at least one binary data row, the binary data row includes at least one binary data field, and the data description information is used for indicating the corresponding relation between the data identifier and the binary data field.
In this embodiment, after receiving the data query instruction, the client acquires the file index information. Specifically, the file index information may be stored in a predetermined file, or already loaded into the memory. The obtaining mode is correspondingly to read the preset file according to the preset file storage address, or directly obtain the relevant index information from the memory. The file index information may be in the form of a key-value pair, where the key-value pair includes a corresponding relationship between a file identifier and a data file, and specifically, the corresponding relationship may be a relationship between a file name and a storage address of the file, or may be a relationship between a file abbreviation or a number and a file address. All data files available for querying are typically covered in the file index information. The data file is generated by binary coding according to the original data file, and may specifically be generated by using a coding method of Protocol Buffers (Protocol Buffers). The data file comprises data description information and at least one binary data row, the binary data row comprises at least one binary data field, and the data description information is used for indicating the corresponding relation between the data identification and the binary data field. In particular, the format of the data File may vary depending on the particular implementation, for example in a fantasy Engine (Unreal Engine), the format in which the data File may be a fantasy Asset File (uasset).
Step S203, reading the target data file corresponding to the file identification to be inquired according to the file index information.
In this embodiment, the client reads the target data file corresponding to the file identifier to be queried according to the file index information. Specifically, the client queries the storage address of the data file in the file index information according to the file identifier to be queried, and searches and reads the corresponding data file on the terminal device according to the storage address. In one embodiment, the file index information contains a specific pre-loading identifier for a partial data file, and when the client is started, the client first checks the content recorded by the file index information and directly loads the data file with the specific pre-loading identifier into the memory. Under the condition, the client confirms that the file index information is loaded according to the file identifier to be inquired, and the target data file can be directly read from the memory.
The object data file comprises a file of specific data comprising data description information and at least one binary data line. The data description information is information for describing a specific meaning of actual data, is generally generated from column names and description information in a data table, and has a correspondence relationship with the actual data. In the data table of the object data file, there is primary key data for distinguishing each row of data, and in each data file, the primary key data can be used for uniquely identifying one binary data row. At least one binary data row is the actual data in the data file, which comprises at least one binary data field. For example, if the destination data file includes a column of data, the column name is time, and the actual data content is 300, then in the destination data file, the information of the column in the data description information is "time", and the corresponding binary data field in the binary data row may be "100101100". In one embodiment, the data in the binary data row may further be processed by using a compression conversion protocol, so as to compress the space occupied by the data, thereby further increasing the reading speed.
Step S204, according to the data description information of the target data file, a target binary data field corresponding to the data identifier to be inquired is obtained from the target binary data row of the target data file.
In this embodiment, the client acquires a target binary data field corresponding to the identifier of the data to be queried from a target binary data row of the target data file according to the data description information of the target data file. Specifically, the client may determine a target binary data row from the target data file according to the identification information in the data identifier to be queried, and then determine the data identifier to be queried and the data description information to obtain a target binary data field corresponding to the data identifier to be queried. For example, if the data identifier to be queried includes identification information for a data row of 100, the client may select a data row with a value of 100, for example, "001100100, 011001000, 100101100", from data columns predetermined to distinguish the data rows, and then obtain a target binary data field according to an identifier of the data column in the data identifier to be queried, for example, "level, number, unit price,", and data column identifier in the data identifier to be queried is "number", where the obtained target binary data field is "011001000". Depending on the form of data storage, the target data file may include only one row of data, in which case the identification of the data row is not needed, and the target binary data field can be obtained by using only the identification of the data column.
In the embodiment of the application, when game data are inquired, a target data file needing to be read is inquired from file index information according to a data inquiry instruction, and a binary data field is read from the target data file according to a data identifier. Because the game data are stored in a binary form, the structured information in the data table file is removed on the basis of omitting the analysis process, so that the volume of the data file is reduced, the occupation of the memory space is reduced, the loading speed is increased, and the running speed and the running efficiency are improved.
In an embodiment of the present application, in order to import new data in the client, the method of the present embodiment may include the following steps S301 to S304:
step S301, an original data file is obtained, where the original data file includes header information and at least one original data line.
In particular, the method of the present embodiment may be performed by a game development engine on a terminal device. After the data files are imported, the data files are packaged and released together with the client side, and other client sides acquire new data files after the client sides are installed or updated. Raw data files refer to files used by designers to edit and store data, typically in tabular form, which may be stored in the form of, for example, a markup language, spreadsheet, or comma-separated value files. The original data file comprises header information and at least one original data row, wherein the header information is used for introducing the contents of the name, the data type, the specific meaning and the like of the data of each data column, and the original data row comprises the data information.
Specifically, for convenience of introduction, please refer to fig. 3, where fig. 3 is a schematic diagram of original data file content in an embodiment of the present application. The header information is the first 4 rows of the table, and the contents of the first 4 rows are filled in according to the contents agreed in advance. Starting with the fifth line of the file as the original data line.
The game development engine obtains the raw data file. Specifically, the game development engine may directly read a preset configuration file, where the configuration file includes storage addresses of all original data files to be imported, and then, the game development engine reads corresponding original data files according to the storage addresses. In another embodiment, the game development engine may obtain the relevant processing instructions through an editor interface, and the user may directly specify the raw data file to be imported in the editor interface. The editor may be, for example, a data editor, and a user may directly define and modify data information, such as a data name, a data type, a specific value or a value range, and the like, that needs to be used in an application through the data editor. The editor interface can also be a picture editor, and a user can draw, modify and the like various graphs and pictures required to be used by the application through the picture editor, and meanwhile, the drawn graphs and pictures can be associated with the defined data content so as to use related data in the service logic of the application. For convenience of introduction, please refer to fig. 4, in which fig. 4 is a schematic diagram of an editor interface according to an embodiment of the present application. As shown in fig. 4, the "import data file" button is included in the drop-down menu option on the editor interface, and the user can trigger a file import command by clicking on the button. After receiving a file import instruction, the game development engine acquires an original data file list according to a preset address and reads an original data file according to the address in the list, or after clicking an "import data file" button, a user can select or input the address of a data file to be imported in a pop-up window, and the game development engine reads a corresponding original data file according to the selected or input address.
Step S302, analyzing and binary conversion processing are carried out on the data in the original data file to obtain an intermediate data file.
Specifically, the client analyzes data in the original data file according to a preset rule, so that data rows in the file are extracted according to row units, and each data field is divided according to data columns in each row of data. Then, binary conversion processing is carried out on the analyzed data, so that the data in the original data file are converted into data in a binary format, and then the converted data are connected together according to the form of data lines to form an intermediate data file. The binary data conversion mode can adopt the existing binary serialization protocol to carry out conversion.
Step S303, generating a target data file according to the data description information of the original data file and the intermediate data file.
The description information is information generated according to the header information in the original data file, and is mainly used for indicating the specific meaning of the binary data in the intermediate data file. The binary data in the intermediate data file is usually stored in the form of data rows, and the description information correspondingly marks information such as specific data meaning, data type and the like of each field of the data rows. With continued reference to fig. 3, wherein the information of the first row, the second row and the third row are respectively a data identifier, a data type and a chinese name, these three data are usually included in the description information, the data of the fourth row is mainly used for identifying a specific operation on the data in each data column, the content of which may not be included in the description information, but the data operation is reserved according to the identifier when generating the target data file, and the fourth column in fig. 3 is identified as "Skip" to indicate that this field is an illustrative field, which will be skipped when generating binary data. The client combines the description information with the intermediate data file to generate a target data file.
Step S304, adding the index information of the target data file in the file index information.
The generated target data file is stored in a predetermined storage directory. The client adds the storage address of the target data file to the file index information for subsequent use. Specifically, if the file index information does not include the storage address of the target data file, the storage address is added to the file index information, and if the file index information already includes the storage address of the target data file, the storage address of the new file is added to the current record, but the storage address of the old file is still reserved. When data is acquired from a target data file, the data is acquired from the file with the latest updating time, and if the required information is not acquired from the file, the data is further acquired from the file with the earlier updating time until the required data is acquired or the required information cannot be acquired.
It will be appreciated that the terminal device used to import new data to the client may be a different device than the terminal device actually operated by the client. Therefore, the addresses recorded in the file index information are generally relative addresses.
In the embodiment of the application, the data in the original data file is subjected to binary conversion, and the structural information in the data file is omitted, so that the data volume irrelevant to the data content in the data file can be reduced, the data content is reduced, and the storage space is saved.
In an embodiment of the application, in order to generate a binary intermediate data file, in step S302, analyzing and binary converting the data in the original data file to obtain the intermediate data file, the method may include the following steps:
receiving a data import instruction through an editor;
responding to a data import instruction, performing binary coding on at least one original data row in an original data file to obtain at least one binary data row, wherein each original data row corresponds to one binary data row, and each data value in each original data row corresponds to one binary data field;
and combining at least one binary data row to generate an intermediate data file.
The scheme of the embodiment is executed on the terminal equipment, and can be specifically executed by a game development engine. The client receives the data import instruction through an editor, wherein the editor can be a client interface of a game development engine in general. Referring again to FIG. 4, a "generate binary" button is included in the drop-down menu option on the editor interface, and the user can trigger a data import instruction by clicking on the button. After receiving the data import instruction, the game development engine sequentially carries out binary coding on the original data files acquired in the previous steps. For an original data file, the binary coding process is carried out in units of data lines, that is, a data table in the original data file is parsed into a plurality of original data lines, each original data line is parsed into a plurality of data values, then, binary coding conversion is carried out on each data value, and then, the data values are spliced together according to the positions and the sequence of the data values in the original data lines to generate the binary data lines corresponding to the data values, wherein the head position of each binary data line also comprises the total line number of the binary data line. The binary code may adopt ASCII code, GBK code and other encoding rules.
After all the original data rows in an original data file are converted into binary data rows, all the binary data rows obtained by a game development engine are merged and connected to obtain binary data, the total number of the rows of the data is counted, and then the total number of the rows is set to the first bit of the binary data to form an intermediate data file. That is, the specific form of the intermediate data file is to begin with the total number of lines of the file, then to concatenate the individual binary data lines, and to begin with each binary data line for the length of that line.
In the embodiment of the application, the original data file is coded by carrying out binary coding on the original data according to the user instruction, and the coding work can be finished only by single operation, and the extra coding work matched with the data is not needed, so that the development time is saved, and the coding efficiency is improved.
In an embodiment of the present application, in order to generate a binary intermediate data file, the above step of binary-coding at least one original data row in the original data file to obtain at least one binary data row may include the following steps:
for each data value in the original data row, calculating a data header of the data value according to the data type of the data value and the sequence order in the original data row;
binary coding is carried out on the data head and the data value to obtain a binary data field;
combining the binary data fields into a binary sequence according to the sequence order;
and carrying out binary coding on the data length information of the binary sequence, and combining the coding result with the binary sequence to generate a binary data row corresponding to the data value.
Specifically, in the binary encoding process, the original data line is first tapped into a plurality of data values and then operated on for each data value. The encoding process may be performed in the order of the data values in the data rows, and first, according to the data type of the data values, the corresponding data type identifier is determined. Specifically, the data type and data type identifier correspondence is that 0 corresponds to a variable length value, such as a 32-bit integer, a 64-bit integer, an unsigned 64-bit number, an unsigned 32-bit number, a signed 64-bit number, a signed 32-bit number, a boolean value, and an enumerated value, 1 corresponds to a 64-bit number, such as a double-float number, 2 corresponds to a length-limited value, such as a string, and 5 corresponds to a 32-bit number, such as a single-float number. And then determining the field unique identification of the field according to the sequence order of the field in the original data line. In the specific calculation, each data is represented by binary, for example, if the second data value of the data column is a string of numbers, the data header thereof may be 20, where 2 is the sequence position and 0 is the data type.
Then, binary coding is performed on the data header and the data value to obtain a binary data field, specifically, the coding mode of the data header may be processed in a left shift mode, for example, a number uniquely identified by the field is left-shifted by three bits and then forms a data header code together with the data type identifier. The data value can be directly binary-coded according to coding modes such as ASCII codes and the like, and the data header code and the binary code of the data value are combined into a binary data field. For example, assuming that the data value of the second field in a row is "zhangsan", the binary code of this data value can be expressed as "11 7A 68 6E 67 73 61 6E" in hexadecimal, where "11" is the result of the or operation performed on the field unique identifier 2 shifted left by three bits and with the data type identifier 1, and "7A 68 6E 67 73 6E" is the conversion result of the ASCII code of "zhangsan".
After each field is converted, the conversion results of the fields are combined according to the original sequence order to form a binary sequence. At this time, the specific length of the binary sequence may be counted, and then the length is converted into a binary format and placed at the head of the binary sequence, so as to generate a binary data row corresponding to the data value.
In one embodiment, the encoding process may use existing binary compression techniques, such as using protobuf or like encryption protocols.
In the embodiment of the application, each field in the data line is converted by a binary coding mode, so that data content required for expressing the structure of the data table in data expression is omitted, the data volume of the data line can be compressed, and the storage consumption is reduced.
In an embodiment of the application, in order to generate the target data file, in step S303, the generating the target data file according to the data description information of the original data file and the intermediate data file may include the following steps:
receiving a description information generation instruction through an editor;
responding to a description information generation instruction, and analyzing the header information in the original data file to obtain at least one data identifier;
determining address mapping information of the binary data row according to the primary key data of the binary data row in the intermediate data file and the initial address and the data length of the binary data row;
determining data mapping information of the binary data field according to the mapping relation between at least one data identifier and the binary data field in the binary data row;
and generating a target data file according to the address mapping information, the data mapping information and the intermediate data file.
In the present embodiment, a method for adding description information to a binary file to generate a target data file is provided. The scheme of the embodiment is executed on the terminal device, and can be specifically executed by a game development engine. Referring again to fig. 4, a "create data file" button is also included in the drop down menu option on the editor interface, and the user can trigger the descriptive information generation instruction by clicking on the button. This operation is usually performed after the operation of clicking the "generate binary file" button in the above-described embodiment. In another embodiment, the description information generation instruction may also be automatically triggered by the editor following the process described in the above embodiments without further operations. After receiving the description information generation instruction, the game development engine processes the original data file which is converted into the binary file. First, header information in an original data file is obtained. The header information in the original data file is typically filled in at a fixed location in a pre-agreed format, such as in the first four rows of the table. By analyzing the header information according to a preset rule, the data identifier and related information of each data column in the table, for example, the column name and column identifier of the data column, the data type, and the like, can be obtained. The header information includes annotation information for each data column, which identifies the primary key data in the middle data table. And determining the address mapping information of the binary data row according to the primary key data of the binary data row in the intermediate data file and the initial address and the data length of the binary data row. Specifically, the address mapping information may take the form of key value pairs, where the data keys in a key value pair are the primary key data of each data row. The header information may have additional labels added to each data column, where the additional labels are used to indicate additional operations that need to be performed on each data column, and include a primary key label, a bypass label, a client label and a server label, and an additional processing label, where the primary key label is used to indicate that the data column is a primary key, the bypass label indicates that the data included in the data column is descriptive information, the data column is not included in the binary intermediate data file, and the client label indicates that the data column is only used by the client, so the information is not included in the application on the server side, and correspondingly, the data column with the server label is not included in the application on the client, and the additional processing label indicates that the data column needs to be subjected to additional conversion processing, for example, 2-bit decimal needs to be reserved in a ten-thousandth ratio. The data columns included in the primary key data may be determined according to corresponding additional labels, and the specific data is the specific content of the primary key data columns, and may be in an original data form or binary data. The data value in the key value pair is the start address and data length of the binary data row in which the primary key data is located. The address mapping information is used for inquiring the initial address and the data length of the data line according to the primary key information of the data line, and further the binary data line can be obtained.
The data mapping information of the binary data field may be determined according to a correspondence of the at least one data identity with the binary data field of the corresponding data. Specifically, the data mapping information may also take the form of a key-value pair, where the data key of the key-value pair is the column name or identifier of each data column, and the data value of the key-value pair is the corresponding data field type and additional label. According to the data mapping information, the data type of each field and the special processing required to be carried out can be obtained when the binary data row is analyzed.
Then, the game data engine composes the obtained address mapping information, data mapping information, and intermediate data file into a target data file. In addition, other additional data may be included in the target data file, including the name of the original data file, the name of the protocol used for binary conversion, the primary key of the data table, and the identification information of each data column.
Specifically, please refer to fig. 5, wherein fig. 5 is a schematic structural diagram of a target data file according to an embodiment of the present application. As shown in fig. 5, the target data file is composed of a binary intermediate data file and description information of data. The structure of the intermediate data file is that the first 4 bytes are the number of data lines included in the file, the data line is immediately the data length of one line of data, binary information corresponding to one line of data can be extracted in a backward offset mode according to the length, and the structure of the data length and the data information is repeated after one line of data is finished until the intermediate data file is finished. The description information of the data comprises the name of an original data file, the name of a protocol adopted by binary conversion, a main key of a data table, a starting address of a row of data corresponding to the main key in the binary file, the length of the row of data corresponding to the main key in the binary file, the data type corresponding to a field, an additional processing label corresponding to the field and identification information of each data column.
In the embodiment of the application, the address mapping information and the data mapping information are generated and are combined with the intermediate data file to form the target data file, so that a specific mode for generating the target data file is provided, and the operability of a scheme is improved.
In an embodiment of the present application, in order to obtain an original data file, a scheme of the present application may further include the following steps:
receiving a file import instruction through an editor;
responding to a file import instruction, and acquiring a file to be processed according to a preset file list to be processed;
and splitting the data table in the file to be processed to obtain the original data file.
Specifically, referring again to FIG. 4, an "import data File" button is included in the drop-down menu option on the editor interface, and the user can trigger a File import instruction by clicking on this button. After receiving the file import instruction, the game development engine acquires an import list file according to an address set in the file import instruction or a preset address. The import list file includes information that all original data files need to be imported. The import list file comprises file names of all files to be imported, names of data pages in the files, names of corresponding data elements, data types and other related information. The game development engine conducts traversal processing on all the tables, divides each file to be processed into each data table according to the data page, and then conducts import on the basis of each data table.
The overall flow of the import process will be described below by way of example. For convenience of introduction, please refer to fig. 6, in which fig. 6 is a flowchart illustrating an overall process of updating data according to an embodiment of the present disclosure. As shown in fig. 6, before importing, in step 301, an original data file (e.g., an Excel file) needs to be configured according to a preset rule, then in step 302, the original data file is placed in a specified path and then in step 303, its file information is added to an import file list (e.g., a config. In step 304, according to the rules and manners adopted by the binary code, it is further necessary to define data definitions (e.g., protobuf definitions) of the respective data tables, that is, data entity forms after data is imported into the game development engine, for example, determine data formats of the respective data columns, define enumerated values of enumerated data columns, and so on. Then, in step 305, for each file in the import file list, binary encoding is performed on each data line therein, intermediate data (e.g., protobin) is generated, and in step 306, length information is added to the head of each line in the intermediate data. In step 307, all data lines are merged and the line head in the first line is added to the number of data lines, a binary file (bin) of the data table may be formed.
For the header content in the original data file, in step 308, the game development engine analyzes the structure according to the preset analysis, and in step 309, extracts the description information of each analyzed data column to form description information, which includes the address mapping information, the data mapping information, the table name, the primary key information, and the data identifier described in the above embodiments, and records the description information in the target data file (e.g., uaset). It is understood that at this time, the target data file may not contain a binary file of the physical contents of the data table. That is, the generation process of the description information and the generation process of the binary file are independent processes, and may be executed in parallel or sequentially. The populating of the description information and binary content portions into the target data file in step 310 may form a complete target data file. Thereafter, in step 311, the information of the generated target data file is updated to the file index information for subsequent use. The data update process ends here.
In the embodiment of the application, the original data files are processed in batches by presetting the file list to be processed, so that the operation process of technicians is simplified, and the efficiency of data import is improved.
In an embodiment of the present application, the data identifier to be queried includes a primary key to be queried and a field identifier to be queried, and in order to obtain the target binary data field, in step S204, according to the data description information of the target data file, the step of obtaining the target binary data field corresponding to the data identifier to be queried from the target binary data row of the target data file may include the following steps:
searching a starting address and a data length corresponding to a main key to be inquired from the data description information;
reading a target binary data row from a target data file according to a corresponding initial address and data length of a main key to be inquired;
and acquiring a target binary data field corresponding to the field identifier to be inquired from the target binary data row according to the data description information of the target data file.
In the present embodiment, a specific method of querying a binary data field is provided. The data to be queried identification usually comprises a main key to be queried and a field to be queried identification. The main key to be queried is a main key of a data row where the queried data is located, which is determined according to business requirements, and the identification of the field to be queried is the identification of a data column of the target data. For example, in the course of a game, a certain building price is required, and assuming that the primary key of the data table in which the building price is located includes three columns of building type, subdivision type and building level, the primary key to be queried may be composed of building type "1", subdivision type "1" and building level "1", while the field to be queried is identified as "JG", corresponding to the price. In the target data file, a target binary data row can be read from the binary data file according to the primary key to be queried. Specifically, according to the primary key to be queried, the start address and the data length of the target binary data row in the binary data file can be queried from the address mapping information. And performing address offset according to the data length from the initial address, so as to read out the target binary data row.
The target binary data row may then be parsed according to a preset structure. For example, each binary field has a fixed length. In one embodiment, the data description information includes protocol rules used when encoding binary data. When binary data row analysis is performed, a protocol rule may be obtained first, and then the data row may be analyzed into a data field according to the protocol rule. After each binary field is obtained, the data identifier corresponding to each data field can be confirmed according to the data mapping relation in the data description information, and the target binary data field can be queried according to the field identifier to be queried.
In another embodiment, the game application parses all data rows in the whole data table according to the header information stored in the data description information during the process of loading the game or when data reading is needed. Specifically, the number of data columns and the data identification of each data column are acquired first. And traversing all data in the binary data, and instantiating each row of binary data into an instance object, thereby loading all data in a data table. Therefore, the corresponding binary data field can be directly acquired according to the primary key to be queried and the field identifier to be queried.
In the embodiment of the application, a specific mode for acquiring the required binary field is provided, and the binary data field can be directly read, so that the data does not need to be restored, and the reading result can be directly used for calculation, so that the process of transcoding the data after the data is read can be omitted, and the data processing speed is improved.
It should be noted that although the steps of the methods in this application are depicted in the drawings in a particular order, this does not require or imply that the steps must be performed in this particular order or that all of the depicted steps must be performed to achieve desirable results. Additionally or alternatively, certain steps may be omitted, multiple steps combined into one step execution, and/or one step broken down into multiple step executions, etc.
The following describes an apparatus implementation of the present application, which may be used to perform the method for querying data in the above embodiments of the present application. Fig. 7 schematically shows a block diagram of the data query device in the embodiment of the present application. As shown in fig. 7, the data query apparatus 400 may mainly include:
according to an aspect of an embodiment of the present application, there is provided a data query apparatus including:
the instruction obtaining module 410 is configured to obtain a data query instruction, where the data query instruction includes a file identifier to be queried and a data identifier to be queried, where the file identifier to be queried corresponds to data to be queried;
an index information obtaining module 420, configured to obtain file index information in response to the data query instruction, where the file index information includes a corresponding relationship between a file identifier and a data file, the data file is generated after binary coding is performed according to an original data file, the data file includes data description information and at least one binary data row, the binary data row includes at least one binary data field, and the data description information is used to indicate a corresponding relationship between a data identifier and a binary data field;
the file reading module 430 is configured to read, according to the file index information, a target data file corresponding to the file identifier to be queried;
a field obtaining module 440, configured to obtain, according to the data description information of the target data file, a target binary data field corresponding to the to-be-queried data identifier from a target binary data row of the target data file.
In some embodiments of the present application, based on the above technical solutions, the data query apparatus 400 further includes:
the device comprises an original file acquisition module, a data acquisition module and a data processing module, wherein the original file acquisition module is used for acquiring an original data file, and the original data file comprises header information and at least one original data line;
the binary system processing module is used for analyzing and binary system converting the data in the original data file to obtain an intermediate data file;
the file generation module is used for generating the target data file according to the data description information of the original data file and the intermediate data file;
and the index updating module is used for adding the index information of the target data file in the file index information.
In some embodiments of the present application, based on the above technical solution, the binary processing module includes:
an import instruction receiving unit for receiving a data import instruction through an editor;
the encoding unit is used for responding to the data import instruction, performing binary encoding on at least one original data row in the original data file to obtain at least one binary data row, wherein each original data row corresponds to one binary data row, and each data value in each original data row corresponds to one binary data field;
and the merging unit is used for merging the at least one binary data row to generate an intermediate data file.
In some embodiments of the present application, based on the above technical solution, the encoding unit includes:
a calculation subunit, configured to calculate, for each data value in the original data line, a data header of the data value according to a data type of the data value and a sequence order in the original data line;
the data coding subunit is used for carrying out binary coding on the data head and the data value to obtain a binary data field;
a sequence combining subunit, configured to combine the binary data fields into a binary sequence according to the sequence order;
and the data row merging subunit is used for carrying out binary coding on the data length information of the binary sequence, merging the coding result with the binary sequence and generating a binary data row corresponding to the data value.
In some embodiments of the present application, based on the above technical solutions, the file generating module includes:
a generation instruction receiving unit configured to receive a description information generation instruction by the editor;
the analysis unit is used for responding to the description information generation instruction and analyzing the header information in the original data file to obtain at least one data identifier;
an address mapping determining unit, configured to determine address mapping information of a binary data row according to primary key data of the binary data row in the intermediate data file and a start address and a data length of the binary data row;
the data mapping determining unit is used for determining data mapping information of the binary data fields according to the mapping relation between the at least one data identifier and the binary data fields in the binary data rows;
and the file composition unit is used for generating the target data file according to the address mapping information, the data mapping information and the intermediate data file.
In some embodiments of the present application, based on the above technical solutions, the original file obtaining module includes:
an import instruction receiving unit for receiving a file import instruction through an editor;
the import instruction corresponding unit is used for responding to the file import instruction and acquiring a file to be processed according to a preset file list to be processed;
and the data table splitting unit is used for splitting the data table in the file to be processed to obtain an original data file.
In some embodiments of the application, based on the above technical solution, the identifier of the data to be queried includes a main key to be queried and an identifier of the data to be queried; a field acquisition module 440, comprising:
the searching unit is used for searching the initial address and the data length corresponding to the main key to be inquired from the data description information;
the reading unit is used for reading the target binary data row from the target data file according to the starting address and the data length corresponding to the main key to be inquired;
and the field acquisition unit is used for acquiring the target binary data field corresponding to the field identifier to be inquired from the target binary data row according to the data description information of the target data file.
It should be noted that the apparatus provided in the foregoing embodiment and the method provided in the foregoing embodiment belong to the same concept, and the specific manner in which each module performs the operation has been described in detail in the method embodiment, and is not described again here.
FIG. 8 illustrates a schematic structural diagram of a computer system suitable for use to implement the electronic device of the embodiments of the present application.
It should be noted that the computer system 500 of the electronic device shown in fig. 8 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present application.
As shown in fig. 8, the computer system 500 includes a Central Processing Unit (CPU) 501, which can perform various appropriate actions and processes according to a program stored in a Read-Only Memory (ROM) 502 or a program loaded from a storage section 508 into a Random Access Memory (RAM) 503. In the RAM 503, various programs and data necessary for system operation are also stored. The CPU 501, ROM 502, and RAM 503 are connected to each other via a bus 504. An Input/Output (I/O) interface 505 is also connected to bus 504.
The following components are connected to the I/O interface 505: an input portion 506 including a keyboard, a mouse, and the like; an output section 507 including a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, a speaker, and the like; a storage portion 508 including a hard disk and the like; and a communication section 509 including a Network interface card such as a LAN (Local Area Network) card, a modem, or the like. The communication section 509 performs communication processing via a network such as the internet. A drive 510 is also connected to the I/O interface 505 as needed. A removable medium 511 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 510 as necessary, so that a computer program read out therefrom is mounted into the storage section 508 as necessary.
In particular, the processes described in the various method flowcharts may be implemented as computer software programs, according to embodiments of the present application. For example, embodiments of the present application include a computer program product comprising a computer program embodied on a computer readable storage medium, the computer program comprising program code for performing the method illustrated by the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 509, and/or installed from the removable medium 511. The computer program executes various functions defined in the system of the present application when executed by a Central Processing Unit (CPU) 501.
It should be noted that the computer readable storage medium shown in the embodiments of the present application may be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a Read-Only Memory (ROM), an Erasable Programmable Read-Only Memory (EPROM), a flash Memory, an optical fiber, a portable Compact Disc Read-Only Memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present application, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In this application, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable storage medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable storage medium may be transmitted using any appropriate medium, including but not limited to: wireless, wired, etc., or any suitable combination of the foregoing.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems that perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
It should be noted that although in the above detailed description several modules or units of the device for action execution are mentioned, such a division is not mandatory. Indeed, the features and functions of two or more modules or units described above may be embodied in one module or unit according to embodiments of the application. Conversely, the features and functions of one module or unit described above may be further divided into embodiments by a plurality of modules or units.
Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein may be implemented by software, or by software in combination with necessary hardware. Therefore, the technical solution according to the embodiments of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a usb disk, a removable hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a touch terminal, or a network device, etc.) to execute the method according to the embodiments of the present application.
Other embodiments of the present application will be apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the invention following, in general, the principles of the application and including such departures from the present disclosure as come within known or customary practice within the art to which the invention pertains.
It will be understood that the present application is not limited to the precise arrangements that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the application is limited only by the appended claims.

Claims (10)

1. A method of data querying, comprising:
acquiring a data query instruction, wherein the data query instruction comprises a file identifier to be queried and a data identifier to be queried, which correspond to data to be queried;
responding to the data query instruction, acquiring file index information, wherein the file index information comprises a corresponding relation between a file identifier and a data file, the data file is generated after binary coding is carried out according to an original data file, the data file comprises data description information and at least one binary data row, the binary data row comprises at least one binary data field, and the data description information is used for indicating the corresponding relation between the data identifier and the binary data field;
reading a target data file corresponding to the file identification to be inquired according to the file index information;
and acquiring a target binary data field corresponding to the data identifier to be inquired from a target binary data row of the target data file according to the data description information of the target data file.
2. The method of claim 1, further comprising:
acquiring an original data file, wherein the original data file comprises header information and at least one original data line;
analyzing and binary conversion processing are carried out on the data in the original data file to obtain an intermediate data file;
generating the target data file according to the data description information of the original data file and the intermediate data file;
and adding the index information of the target data file in the file index information.
3. The method according to claim 2, wherein the parsing and binary converting the data in the original data file to obtain an intermediate data file comprises:
receiving a data import instruction through an editor;
in response to the data import instruction, performing binary encoding on at least one original data row in the original data file to obtain at least one binary data row, wherein each original data row corresponds to one binary data row, and each data value in each original data row corresponds to one binary data field;
and merging the at least one binary data row to generate an intermediate data file.
4. The method of claim 3, wherein said binary encoding at least one row of raw data in said raw data file to obtain at least one row of binary data comprises:
for each data value in the original data row, calculating a data header of the data value according to the data type of the data value and the sequence order in the original data row;
binary coding is carried out on the data head and the data value to obtain a binary data field;
combining the binary data fields into a binary sequence according to the sequence order;
and carrying out binary coding on the data length information of the binary sequence, and combining a coding result with the binary sequence to generate a binary data row corresponding to the data value.
5. The method of claim 2, wherein generating the target data file from the data description information of the original data file in combination with the intermediate data file comprises:
receiving a description information generation instruction through an editor;
responding to the description information generation instruction, analyzing the header information in the original data file to obtain at least one data identifier;
determining address mapping information of a binary data row according to primary key data of the binary data row in the intermediate data file and the initial address and the data length of the binary data row;
determining data mapping information of the binary data field according to the mapping relation between the at least one data identifier and the binary data field in the binary data row;
and generating the target data file according to the address mapping information, the data mapping information and the intermediate data file.
6. The method of claim 2, wherein obtaining the raw data file comprises:
receiving a file import instruction through an editor;
responding to the file import instruction, and acquiring a file to be processed according to a preset file list to be processed;
and splitting the data table in the file to be processed to obtain an original data file.
7. The method according to any one of claims 1 to 6, wherein the data to be queried identification comprises a primary key to be queried and a field to be queried identification; the acquiring, according to the data description information of the target data file, a target binary data field corresponding to the identifier of the data to be queried from a target binary data row of the target data file includes:
searching the initial address and the data length corresponding to the main key to be inquired from the data description information;
reading the target binary data row from the target data file according to the initial address and the data length corresponding to the primary key to be inquired;
and acquiring the target binary data field corresponding to the field identifier to be queried from the target binary data row according to the data description information of the target data file.
8. A data query device, comprising:
the instruction acquisition module is used for acquiring a data query instruction, wherein the data query instruction comprises a file identifier to be queried and a data identifier to be queried, which correspond to data to be queried;
an index information obtaining module, configured to obtain file index information in response to the data query instruction, where the file index information includes a correspondence between a file identifier and a data file, the data file is generated after binary coding is performed on an original data file, the data file includes data description information and at least one binary data row, the binary data row includes at least one binary data field, and the data description information is used to indicate a correspondence between the data identifier and the binary data field;
the file reading module is used for reading a target data file corresponding to the file identifier to be inquired according to the file index information;
and the field acquisition module is used for acquiring a target binary data field corresponding to the data identifier to be inquired from a target binary data row of the target data file according to the data description information of the target data file.
9. An electronic device, comprising:
a processor;
a memory for storing executable instructions of the processor;
wherein the processor is configured to perform the method of data querying of any one of claims 1 to 7 via execution of the executable instructions.
10. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out a method for data query according to any one of claims 1 to 7.
CN202110437274.7A 2021-04-22 2021-04-22 Data query method and device, electronic equipment and storage medium Pending CN115237853A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110437274.7A CN115237853A (en) 2021-04-22 2021-04-22 Data query method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110437274.7A CN115237853A (en) 2021-04-22 2021-04-22 Data query method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115237853A true CN115237853A (en) 2022-10-25

Family

ID=83666313

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110437274.7A Pending CN115237853A (en) 2021-04-22 2021-04-22 Data query method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115237853A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115604365A (en) * 2022-11-15 2023-01-13 南京芯传汇电子科技有限公司(Cn) Data encoding and decoding method and device, electronic equipment and readable storage medium
CN116627568A (en) * 2023-05-25 2023-08-22 成都融见软件科技有限公司 Visual positioning system of data
CN116820602A (en) * 2023-05-25 2023-09-29 成都融见软件科技有限公司 Database partial loading system
CN116933298A (en) * 2023-09-18 2023-10-24 广东省科技基础条件平台中心 Encryption processing method, device, storage medium and equipment for scientific and technological achievement data

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115604365A (en) * 2022-11-15 2023-01-13 南京芯传汇电子科技有限公司(Cn) Data encoding and decoding method and device, electronic equipment and readable storage medium
CN115604365B (en) * 2022-11-15 2023-03-10 南京芯传汇电子科技有限公司 Data encoding and decoding method and device, electronic equipment and readable storage medium
CN116627568A (en) * 2023-05-25 2023-08-22 成都融见软件科技有限公司 Visual positioning system of data
CN116820602A (en) * 2023-05-25 2023-09-29 成都融见软件科技有限公司 Database partial loading system
CN116627568B (en) * 2023-05-25 2024-02-20 成都融见软件科技有限公司 Visual positioning system of data
CN116820602B (en) * 2023-05-25 2024-04-26 成都融见软件科技有限公司 Database partial loading system
CN116933298A (en) * 2023-09-18 2023-10-24 广东省科技基础条件平台中心 Encryption processing method, device, storage medium and equipment for scientific and technological achievement data
CN116933298B (en) * 2023-09-18 2024-02-09 广东省科技基础条件平台中心 Encryption processing method, device, storage medium and equipment for scientific and technological achievement data

Similar Documents

Publication Publication Date Title
CN115237853A (en) Data query method and device, electronic equipment and storage medium
CN111414407A (en) Data query method and device of database, computer equipment and storage medium
US20240012641A1 (en) Model construction method and apparatus, and medium and electronic device
CN108733317B (en) Data storage method and device
CN111797351A (en) Page data management method and device, electronic equipment and medium
CN111881209A (en) Data synchronization method and device for heterogeneous database, electronic equipment and medium
CN112070608B (en) Information processing method, device, medium and electronic equipment
CN112906206B (en) Digital twin model construction method and device
CN118368268B (en) Unified operation method and device for multi-social media comments
US9934292B2 (en) Dynamic presentation of a results set by a form-based software application
CN116360769A (en) Code generation method, device, equipment and storage medium
EP4120096A1 (en) Method and device for data retrieval, electronic device, and storage medium
CN112765280B (en) Block data storage method and device, computer readable medium and electronic equipment
CN110765610B (en) PDM integration method, PDM integration device, computer equipment and storage medium
CN114625407A (en) Method, system, equipment and storage medium for implementing AB experiment
CN112434062A (en) Quasi-real-time data processing method, device, server and storage medium
CN116842012A (en) Method, device, equipment and storage medium for storing Redis cluster in fragments
CN110309062A (en) Case generation method, device, electronic equipment and storage medium
CN112416875B (en) Log management method, device, computer equipment and storage medium
US20130097622A1 (en) Framework for system communication for handling data
CN115437906A (en) Test method and device
CN107609871B (en) Payment track reproduction method, device, system, electronic equipment and storage medium
CN116702218B (en) Rendering method, device, terminal and storage medium of three-dimensional model in applet
CN116861455B (en) Event data processing method, system, electronic device and storage medium
JP7249452B1 (en) CONTRACT CONCLUSION PROGRAM, INFORMATION PROCESSING DEVICE, INFORMATION PROCESSING SYSTEM, INFORMATION PROCESSING METHOD

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