CN110990411A - Data structure generation method and device and calling method and device - Google Patents

Data structure generation method and device and calling method and device Download PDF

Info

Publication number
CN110990411A
CN110990411A CN201911309932.3A CN201911309932A CN110990411A CN 110990411 A CN110990411 A CN 110990411A CN 201911309932 A CN201911309932 A CN 201911309932A CN 110990411 A CN110990411 A CN 110990411A
Authority
CN
China
Prior art keywords
data
data structure
mapping
configuration file
target
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201911309932.3A
Other languages
Chinese (zh)
Other versions
CN110990411B (en
Inventor
张�杰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Mihayou Network Science And Technology Co ltd
Original Assignee
Shanghai Mihayou Network Science And Technology 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 Shanghai Mihayou Network Science And Technology Co ltd filed Critical Shanghai Mihayou Network Science And Technology Co ltd
Priority to CN201911309932.3A priority Critical patent/CN110990411B/en
Publication of CN110990411A publication Critical patent/CN110990411A/en
Application granted granted Critical
Publication of CN110990411B publication Critical patent/CN110990411B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • 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
    • 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/28Databases characterised by their database models, e.g. relational or object models
    • G06F16/284Relational databases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

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

Abstract

The invention discloses a method and a device for generating a data structure and a method and a device for calling the data structure, wherein the method comprises the following steps: when the trigger target operation is detected, acquiring a pre-established mapping relation configuration file; determining a data type and a mapping numerical value corresponding to the target operation based on the mapping relation configuration file; determining a data reading mode corresponding to the data type based on the data type; and acquiring a target data structure corresponding to the target operation based on the mapping numerical value and the data reading mode. The technical scheme of the embodiment of the invention solves the problems that the content in the table needs to be modified when data is added or deleted, which is time-consuming, labor-consuming and easy to make mistakes in the prior art, realizes that the file is configured based on the generated mapping relation, the file does not need to be rewritten when the target data structure is obtained, and improves the technical effect of the file calling efficiency.

Description

Data structure generation method and device and calling method and device
Technical Field
The embodiment of the invention relates to the technical field of game development, in particular to a data structure generation method and device and a data structure calling method and device.
Background
In the process of game project development, each time a table is read in, namely a target file corresponding to the table needs to be created, optionally, xxxxgeneral logic data.cs files, and data reading is performed according to data defined by each column.
Disclosure of Invention
The embodiment of the invention provides a data structure generation method and device and a data structure calling method and device, which are used for quickly calling a data structure and improving the technical effect of convenience in calling the data structure.
In a first aspect, an embodiment of the present invention provides a method for invoking a data structure, where the method includes:
when the trigger target operation is detected, acquiring a pre-established mapping relation configuration file;
determining a data type and a mapping numerical value corresponding to the target operation based on the mapping relation configuration file;
determining a data reading mode corresponding to the data type based on the data type;
acquiring a target data structure corresponding to the target operation based on the mapping numerical value and the data reading mode;
the mapping relationship configuration file is obtained by generating a data structure, and the mapping relationship configuration file comprises a corresponding relationship between a mapping numerical value and the data structure.
In a second aspect, an embodiment of the present invention further provides a method for generating a data structure, where the method includes:
acquiring a configuration file and at least one pre-established data type table;
determining data structures corresponding to different data types according to the data type table;
and generating a mapping numerical value corresponding to the data structure based on the data structure, and establishing a mapping relation configuration file between the data structure and the mapping numerical value, so that when the data structure is called, a target data structure corresponding to a target operation is obtained based on the mapping relation configuration file.
In a third aspect, an embodiment of the present invention further provides a device for invoking a data structure, where the device includes:
the mapping data acquisition module is used for acquiring a pre-established mapping relation configuration file when the trigger target operation is detected;
the data reading mode determining module is used for determining a data reading mode and a mapping numerical value corresponding to the target operation based on the mapping relation configuration file;
a target data determination module, configured to obtain a target data structure corresponding to the target operation based on the mapping numerical value and the data reading mode;
the mapping relationship configuration file is obtained by generating a data structure, and the mapping relationship configuration file comprises a corresponding relationship between a mapping numerical value and the data structure.
In a fourth aspect, an embodiment of the present invention further provides an apparatus for generating a data structure, where the apparatus includes:
acquiring a configuration file and at least one pre-established data type table;
determining data structures corresponding to different data types according to the data type table;
and generating a mapping numerical value corresponding to the data structure based on the data structure, and establishing a mapping relation configuration file between the data structure and the mapping numerical value, so that when the data structure is called, a target data structure corresponding to a target operation is obtained based on the mapping relation configuration file.
In a fifth aspect, an embodiment of the present invention further provides a server, where the server includes:
one or more processors;
a storage device for storing one or more programs,
when the one or more programs are executed by the one or more processors, the one or more processors implement the method for generating the data structure or the method for calling the data structure according to any of the embodiments of the present invention.
In a sixth aspect, the present invention further provides a storage medium containing computer-executable instructions, which when executed by a computer processor, are used to execute the method for generating a data structure or the method for calling a data structure according to any one of the embodiments of the present invention.
According to the technical scheme of the embodiment of the invention, when the trigger target operation is detected, the pre-established mapping relation configuration file is obtained; determining a data type and a mapping numerical value corresponding to the target operation based on the mapping relation configuration file; determining a data reading mode corresponding to the data type based on the data type; acquiring a target data structure corresponding to the target operation based on the mapping numerical value and the data reading mode; the mapping relation configuration file is obtained by generating a data structure, the mapping relation configuration file comprises a mapping numerical value and a corresponding relation between the data structure, the problems that contents in a table need to be modified when data are added or deleted, time and labor are wasted, and errors are prone to occurring in the prior art are solved, the purpose that the file does not need to be rewritten when a target data structure is obtained based on the generated mapping relation configuration file is achieved, and the technical effect of improving the file calling efficiency is improved.
Drawings
In order to more clearly illustrate the technical solutions of the exemplary embodiments of the present invention, a brief description is given below of the drawings used in describing the embodiments. It should be clear that the described figures are only views of some of the embodiments of the invention to be described, not all, and that for a person skilled in the art, other figures can be derived from these figures without inventive effort.
Fig. 1 is a schematic flowchart of a data structure invoking method according to an embodiment of the present invention;
fig. 2 is a schematic flow chart of a method for generating a data structure according to a second embodiment of the present invention;
fig. 3 is a schematic flowchart of a data structure calling method according to a third embodiment of the present invention;
fig. 4 is a schematic flow chart of a method for generating a data structure according to a third embodiment of the present invention;
fig. 5 is a schematic structural diagram of a data structure calling device according to a fourth embodiment of the present invention;
fig. 6 is a schematic structural diagram of a data structure generating apparatus according to a fifth embodiment of the present invention;
fig. 7 is a schematic structural diagram of a server according to a sixth embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be further noted that, for the convenience of description, only some of the structures related to the present invention are shown in the drawings, not all of the structures.
Example one
Fig. 1 is a schematic flow chart of a method for invoking a data structure according to an embodiment of the present invention, where the embodiment is applicable to a case where a target data structure is invoked based on a pre-established data mapping relationship configuration table, the method may be executed by an invoking device of the data structure, the invoking device may be implemented in a form of software and/or hardware, and the hardware may be an electronic device, an optional mobile terminal or a PC terminal, and the like.
As shown in fig. 1, the method of the present embodiment includes:
and S110, when the trigger target operation is detected, acquiring a pre-established mapping relation configuration file.
Wherein a target operation may be understood as an operation that triggers the acquisition of a target data structure. The mapping relation configuration file is pre-established and comprises a data structure and a mapping numerical value corresponding to the data structure, namely a unique identifier corresponding to the data structure.
Specifically, when the trigger target operation is detected, a pre-established mapping relationship configuration file may be acquired to determine a target data structure corresponding to the target operation from the mapping relationship configuration file.
And S120, determining a data reading mode and a mapping numerical value corresponding to the target operation based on the mapping relation configuration file.
The mapping relation configuration file not only comprises a target data structure and a unique identifier corresponding to the target data structure, but also comprises a data reading type corresponding to a mapping numerical value. The data read type may be understood as a data read mode. Optionally, the data reading mode includes a data reading mode in an excel format or a data reading mode in a json format. The mapping value is a unique identifier corresponding to the target operation.
Specifically, based on the obtained mapping configuration file, the data reading type corresponding to the target operation and the mapping numerical value corresponding to the target operation may be determined.
And S130, acquiring a target data structure corresponding to the target operation based on the mapping numerical value and the data reading mode.
Wherein the target data structure is a data structure corresponding to the target operation.
Specifically, the target data structure corresponding to the target operation may be called according to the mapping value corresponding to the target operation and the data reading mode in the mapping configuration file.
Optionally, when the data reading mode is an excel format, reading a target data structure corresponding to the target operation in the excel mode based on the mapping numerical value; and when the data reading mode is in a json format, reading a target data structure corresponding to the target operation in the json mode based on the mapping numerical value.
That is, upon determining that the data schema corresponding to the target data structure is in excel format, the target data structure corresponding to the target operation may be invoked in excel format based on the mapped numerical values corresponding to the target operation. If the data reading mode corresponding to the target data structure is determined to be in a json format, the target data structure corresponding to the target operation may be invoked in the json mode based on the mapping value corresponding to the target operation.
In this embodiment, when the game runs and the target operation is triggered, the data reading mode corresponding to the target operation may be acquired from the pre-established mapping relationship configuration file according to the target trigger operation, the target data corresponding to the target operation is loaded into the table corresponding to the data reading mode, and the table is returned to the display interface, so that the user triggering the target operation may preview the data structure corresponding to the target operation.
Optionally, the target data structure is displayed on the display interface in a target format.
The target format is a format corresponding to the data reading mode. Optionally, if the data reading mode is an excel format, the target format is an excel format, and if the data reading mode is a json format, the target format is a json format.
Specifically, the target structure may be displayed on the display interface in a target format according to the data reading mode.
According to the technical scheme of the embodiment of the invention, when the trigger target operation is detected, the pre-established mapping relation configuration file is obtained; determining a data reading mode and a mapping numerical value corresponding to the target operation based on the mapping relation configuration file; based on the mapping numerical value and the data reading mode, the target data structure corresponding to the target operation is obtained, the technical problem that in the prior art, when the data structure is called, a file needs to be determined again, time and labor are wasted is solved, the target data structure corresponding to the target operation is rapidly and conveniently obtained and sent to a demand side, and the technical effect of convenience in obtaining the target data structure is improved.
In this embodiment, when the game is running, the target data structure corresponding to the target operation may be acquired according to the trigger operation of the user, and the target data may be automatically loaded into the table and returned to the value requesting party based on the file reading manner corresponding to the target data.
Example two
Fig. 2 is a schematic flow chart of a data structure generating method according to a second embodiment of the present invention, where this embodiment is applicable to a situation where target data is processed to generate a target data structure, and the method may be executed by a data structure generating device, and the device may be implemented in a form of software and/or hardware.
As shown in fig. 2, the method includes:
s210, obtaining a configuration file and at least one data type table which is established in advance.
The configuration file is used for generating a mapping relation table. The at least one data type table includes one, two, or more. The user can set the number of the data type tables according to actual requirements. Optionally, the data type table includes an excel table and a json format table.
That is, when determining to establish the mapping relationship configuration file, the data type table and the configuration file corresponding to the data type table may be obtained first.
In this embodiment, before the configuration file and the data type table are obtained, the data type table may be established. The data type table can be an excel table and can also be a json format data type table.
Optionally, when the data type table is an excel table, adding at least one attribute information in a header of the excel table; the attribute information includes: data name, data type, usage area, and annotation corresponding to the data name.
It can be understood that, firstly, the format of the excel table is determined, at least two rows of headers are added on the basis of the original excel table, each row of headers is respectively a parameter name, a parameter type, an optional table, int, float, string and the like, an area, an optional table, a server or a client, a Chinese meaning and an optional table are used, and parameters are further annotated. Data corresponding to the different operations are written in the corresponding headers. The advantages of adding a plurality of rows of headers in the excel table and writing corresponding information are that data used by a client part and data used by a server part in the excel table can be automatically distinguished, loading of useless data is avoided, writing formats are unified, and annotations are added to each parameter. When the parameters in the data table need to be deleted, added or modified, the data table can be directly called to be modified.
Correspondingly, determining data structures corresponding to different data types according to the data type table comprises the following steps: calling a data structure generation code to generate a data structure corresponding to the data type from a group of data which are in the same column and correspond to each attribute information in the excel table; the data structure comprises a data reading mode corresponding to the data structure, a comment corresponding to each data name and a use area of the data structure.
The data structure generation code is used for processing the data in the table and generating a corresponding data structure. That is, the data structure includes a data type, a data name, and a use area of the data.
Specifically, if the header of each row in the excel table indicates the data type of the line of data, the data structure generation code may perform integration processing on the data in the same line in the excel table, and the integrated data is used as a data structure corresponding to the excel.
And S220, determining data structures corresponding to different data types according to the data type table.
In this embodiment, the data type table may be one or more of an excel table and a json format.
Specifically, when the data type tables are different, the manner of generating the data structure is also different. Optionally, if the data type table is an excel table, the data generation code may be called to process at least one group of data in the excel table, which is in the same column and corresponds to each attribute information, so as to obtain a plurality of data structures. If the data type is the data type of json format, the numerical values in the data table can be obtained, and the numerical values are analyzed to obtain the data structure the same as different numerical values.
In this embodiment, it should be further noted that, the excel table has written therein the use areas of different data, and the data belonging to the client may be stored in the client, and the data structure belonging to the server may be stored in the server.
S230, generating a mapping numerical value corresponding to the data structure based on the data structure, and establishing a mapping relation configuration file between the data structure and the mapping numerical value, so that when the data structure is called, a target data structure corresponding to the target operation is obtained based on the mapping relation configuration file.
Specifically, after determining the data structure corresponding to each group of data, the data structure may be processed to determine the mapping value corresponding to each group of data structure, and a mapping relationship configuration file between the data structure and the mapping value is established.
According to the technical scheme of the embodiment of the invention, the configuration file and at least one pre-established data type table are obtained; determining data structures corresponding to different data types according to the data type table; the method comprises the steps of generating mapping numerical values corresponding to data structures based on the data structures, establishing mapping relation configuration files between the data structures and the mapping numerical values, obtaining target data structures corresponding to target operations based on the mapping relation configuration files when the data structures are called, solving the technical problem that in the prior art, when the data structures corresponding to excel tables need to be manually written, the data structures corresponding to different types of data tables are automatically written, generating the mapping relation configuration files corresponding to the data structures, and improving the technical effect of convenience in data structure generation.
EXAMPLE III
As a preferred embodiment of the foregoing embodiment, fig. 3 is a flowchart illustrating a method for generating a data structure according to a third embodiment of the present invention. As shown in fig. 3, the method includes:
s301, reading and analyzing the configuration file.
The configuration file corresponds to the data type table, that is, the configuration file for processing the data type table.
Specifically, a configuration file analysis module is called to analyze the configuration file corresponding to the data type table to obtain an analyzed configuration file.
S302, checking the format of the configuration file.
Specifically, a preset test program is called, the analyzed configuration file is checked, whether a certain format error exists in the analyzed configuration file or not is determined, if yes, an error prompt message is popped up, and if not, a user is prompted.
S303, judging whether the type of the data table is in a target format, if so, executing S304; if not, S305 is executed.
The target format may be an excel table type.
Specifically, the data type includes at least one type, and it may be determined whether the data table type is an excel table type, and if so, the data in the excel table is processed, that is, S304 is executed; if not, S305 is executed.
And S304, the data sheet type is an excel type.
Specifically, if the data table type is an excel type, the data type table includes a data type, a data name, a use area, and a chinese comment. And processing the data in the same group in the excel table to obtain a plurality of data structures.
S305, the data table type is json type.
Specifically, processing is performed according to the numerical value in the json type data table, and a data structure corresponding to the data value is obtained.
S306, judging whether each row is a client numerical value or not, if so, executing S307; if not, go to S308.
Specifically, it may be determined whether the data is client data or server data according to the usage area of the data in the data type table. If the use area of a certain group of data is the client, executing S208; if the usage area of a certain group of data types is a server, S308 is executed when the data structure can be stored in the server. The method has the advantages that the data volume of the installation package can be reduced, the data used by the client can be stored in the memory, and the data calling efficiency is improved.
S307, generating a data structure according to the defined format.
Specifically, the data structure is obtained by taking the data which has the same attribute and is in the same group as each other as a whole. That is, the number of data structures is the same as the number of arrays.
S308, skipping.
That is, the data corresponding to the client may be filtered out and stored in the client, and the remaining data structures corresponding to the server may be stored in the server. The advantage of this arrangement is that the data corresponding to the server and the data corresponding to the client can be quickly determined from all the data and stored separately, avoiding the loading of useless data during the game.
S309, generating a data structure according to numerical analysis.
Specifically, when the data table type is a json format type, the values in the data table may be analyzed to obtain a data structure corresponding to each value.
And S310, generating a mapping numerical value configuration file according to the generated data structure.
After generating the data structure based on the different data tables, a mapping value profile may be generated from the data structure to determine a data reading mode from the mapping value profile and a target data structure corresponding to the target operation.
On the basis of the technical scheme, when the data structure is called, the data structure can be obtained based on a mapping relation configuration file established in advance. Fig. 4 is a schematic flowchart of a data structure calling process according to a third embodiment of the present invention. As shown in fig. 4, the method includes:
and S410, reading the mapping relation configuration file.
Specifically, the mapping relationship configuration file is pre-established and includes a unique identifier corresponding to the data structure.
S420, judging whether the reading mode is the target reading mode, if so, executing S430; if not, S440 is performed.
In this embodiment, the target read mode is an excel mode.
Specifically, a data structure reading mode corresponding to the target trigger operation can be determined according to the mapping relationship configuration file, and whether the data structure reading mode is the target reading mode, that is, whether the data structure reading mode is the excel mode can be determined according to the obtained data reading mode. If so, S430 may be executed to read the data structure corresponding to the mapped value in excel mode, and if not, S440 is executed.
And S430, reading in an excel mode according to the mapping numerical value.
Specifically, the target data structure is read from the mapping relation configuration file in an excel mode according to the mapping numerical value.
And S440, reading in the json mode according to the mapping numerical value.
Specifically, the target data structure is read from the mapping relationship configuration file in a json mode according to the mapping numerical value.
And S450, generating a data list by using the read data, and returning the numerical value in the data list.
Specifically, after the target data structure is obtained, a data list may be generated according to the target data structure, and the value may be returned.
According to the technical scheme of the embodiment of the invention, the configuration file and at least one pre-established data type table are obtained; determining data structures corresponding to different data types according to the data type table; the method comprises the steps of generating mapping numerical values corresponding to data structures based on the data structures, establishing mapping relation configuration files between the data structures and the mapping numerical values, obtaining target data structures corresponding to target operations based on the mapping relation configuration files when the data structures are called, solving the technical problem that in the prior art, when the data structures corresponding to excel tables need to be manually written, the data structures corresponding to different types of data tables are automatically written, generating the mapping relation configuration files corresponding to the data structures, and improving the technical effect of convenience in data structure generation.
Example four
Fig. 5 is a schematic structural diagram of a data structure invoking device according to a fourth embodiment of the present invention, where the device includes: a mapping relation configuration file obtaining module 510, a data reading mode determining module 520 and a target data structure determining module 530.
The mapping data obtaining module 510 is configured to, when a trigger target operation is detected, obtain a pre-established mapping relationship configuration file; a data reading mode determining module 520, configured to determine a data reading mode and a mapping numerical value corresponding to the target operation based on the mapping relationship configuration file; a target data determination module 530, configured to obtain a target data structure corresponding to the target operation based on the mapping value and the data reading mode; the mapping relationship configuration file is obtained by generating a data structure, and the mapping relationship configuration file comprises a corresponding relationship between a mapping numerical value and the data structure.
According to the technical scheme of the embodiment of the invention, the configuration file and at least one pre-established data type table are obtained; determining data structures corresponding to different data types according to the data type table; the method comprises the steps of generating mapping numerical values corresponding to data structures based on the data structures, establishing mapping relation configuration files between the data structures and the mapping numerical values, obtaining target data structures corresponding to target operations based on the mapping relation configuration files when the data structures are called, solving the technical problem that in the prior art, when the data structures corresponding to excel tables need to be manually written, the data structures corresponding to different types of data tables are automatically written, generating the mapping relation configuration files corresponding to the data structures, and improving the technical effect of convenience in data structure generation.
On the basis of the above technical solutions, the data type includes a data type in an excel format or a data type in a json format. On the basis of the above technical solutions, the target data structure determining module is further configured to:
when the data type is in an excel format, reading a target data structure corresponding to the target operation in an excel mode based on the mapping numerical value;
and when the data type is in a json format, reading a target data structure corresponding to the target operation in a json mode based on the mapping numerical value.
On the basis of the above technical solutions, the apparatus further includes: and the display module is used for displaying the target data structure on a display interface in a target format.
It should be noted that, the units and modules included in the apparatus are merely divided according to functional logic, but are not limited to the above division as long as the corresponding functions can be implemented; in addition, specific names of the functional units are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the embodiment of the invention.
EXAMPLE five
Fig. 6 is a schematic diagram of a data structure generation apparatus according to a fifth embodiment of the present invention. As shown in fig. 6, the apparatus includes: a configuration file acquisition module 610, a data structure determination module 620, and a mapping file determination module 630, wherein,
a configuration file obtaining module 610, configured to obtain a configuration file and at least one pre-established data type table; a data structure determining module 620, configured to determine, according to the data type table, data structures corresponding to different data types; the mapping file determining module 630 is configured to generate a mapping numerical value corresponding to the data structure based on the data structure, and establish a mapping relationship configuration file between the data structure and the mapping numerical value, so that when the data structure is called, a target data structure corresponding to a target operation is obtained based on the mapping relationship configuration file.
According to the technical scheme of the embodiment of the invention, the configuration file and at least one pre-established data type table are obtained; determining data structures corresponding to different data types according to the data type table; the method comprises the steps of generating mapping numerical values corresponding to data structures based on the data structures, establishing mapping relation configuration files between the data structures and the mapping numerical values, obtaining target data structures corresponding to target operations based on the mapping relation configuration files when the data structures are called, solving the technical problem that in the prior art, when the data structures corresponding to excel tables need to be manually written, the data structures corresponding to different types of data tables are automatically written, generating the mapping relation configuration files corresponding to the data structures, and improving the technical effect of convenience in data structure generation.
On the basis of the above technical solutions, the apparatus further includes: the excel table establishing module is used for:
adding at least one attribute information in a header of an excel table;
the attribute information includes: a data name, a data type, a usage area, and a comment corresponding to the data name.
On the basis of the above technical solutions, the data structure determining module is further configured to:
calling a data structure generation code to generate a data structure corresponding to the data type from a group of data which are in the same column and correspond to each attribute information in the excel table;
the data structure comprises a data reading mode corresponding to the data structure, a comment corresponding to each data name and a use area of the data structure.
On the basis of the above technical solutions, the data structure determining module is further configured to:
and analyzing the numerical values in the data type table to generate data structures corresponding to different numerical values.
It should be noted that, the units and modules included in the apparatus are merely divided according to functional logic, but are not limited to the above division as long as the corresponding functions can be implemented; in addition, specific names of the functional units are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the embodiment of the invention.
EXAMPLE six
Fig. 7 is a schematic structural diagram of a server according to a fourth embodiment of the present invention. FIG. 7 illustrates a block diagram of an exemplary server 70 suitable for use in implementing embodiments of the present invention. The server 70 shown in fig. 7 is only an example, and should not bring any limitation to the function and the scope of use of the embodiment of the present invention.
As shown in FIG. 7, the server 70 is embodied in the form of a general purpose computing device. The components of server 70 may include, but are not limited to: one or more processors or processing units 701, a system memory 702, and a bus 703 that couples various system components including the system memory 702 and the processing unit 701.
Bus 703 represents one or more of any of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor, or a local bus using any of a variety of bus architectures. By way of example, such architectures include, but are not limited to, Industry Standard Architecture (ISA) bus, micro-channel architecture (MAC) bus, enhanced ISA bus, Video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.
The server 70 typically includes a variety of computer system readable media. Such media may be any available media that is accessible by server 70 and includes both volatile and nonvolatile media, removable and non-removable media.
The system memory 702 may include computer system readable media in the form of volatile memory, such as Random Access Memory (RAM)704 and/or cache memory 705. The server 70 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, the storage system 706 may be used to read from and write to non-removable, nonvolatile magnetic media (not shown in FIG. 7, commonly referred to as a "hard drive"). Although not shown in FIG. 7, a magnetic disk drive for reading from and writing to a removable, nonvolatile magnetic disk (e.g., a "floppy disk") and an optical disk drive for reading from or writing to a removable, nonvolatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to bus 703 via one or more data media interfaces. Memory 702 may include at least one program product having a set (e.g., at least one) of program modules that are configured to carry out the functions of embodiments of the invention.
A program/utility 708 having a set (at least one) of program modules 707 may be stored, for example, in memory 702, such program modules 707 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which examples or some combination thereof may comprise an implementation of a network environment. The program modules 707 generally perform the functions and/or methodologies of the described embodiments of the invention.
The server 70 may also communicate with one or more external devices 709 (e.g., keyboard, pointing device, display 710, etc.), with one or more devices that enable a user to interact with the server 70, and/or with any devices (e.g., network card, modem, etc.) that enable the server 70 to communicate with one or more other computing devices. Such communication may occur via an input/output (I/O) interface 711. Also, the server 70 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN) and/or a public network, such as the Internet) via a network adapter 712. As shown, the network adapter 712 communicates with the other modules of the server 70 via a bus 703. It should be appreciated that although not shown in FIG. 7, other hardware and/or software modules may be used in conjunction with the server 70, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
The processing unit 701 executes various functional applications and data processing, such as a generation method of a data structure or a calling method of a data structure provided by an embodiment of the present invention, by executing a program stored in the system memory 702.
EXAMPLE seven
An embodiment of the present invention further provides a storage medium containing computer-executable instructions, which are used for executing a generation method of a data structure or a calling method of the data structure when executed by a computer processor.
The method comprises the following steps:
when the trigger target operation is detected, acquiring a pre-established mapping relation configuration file;
determining a data type and a mapping numerical value corresponding to the target operation based on the mapping relation configuration file;
determining a data reading mode corresponding to the data type based on the data type;
acquiring a target data structure corresponding to the target operation based on the mapping numerical value and the data reading mode;
the mapping relationship configuration file is obtained by generating a data structure, and the mapping relationship configuration file comprises a corresponding relationship between a mapping numerical value and the data structure.
Or the like, or, alternatively,
acquiring a configuration file and at least one pre-established data type table;
determining data structures corresponding to different data types according to the data type table;
and generating a mapping numerical value corresponding to the data structure based on the data structure, and establishing a mapping relation configuration file between the data structure and the mapping numerical value, so that when the data structure is called, a target data structure corresponding to a target operation is obtained based on the mapping relation configuration file.
Computer storage media for embodiments of the invention may employ any combination of one or more computer-readable media. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. 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 (a non-exhaustive list) of the computer readable storage medium would include the following: 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 or 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 context of this document, 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.
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 many 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 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 medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for embodiments of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims (10)

1. A method for invoking a data structure, comprising:
when the trigger target operation is detected, acquiring a pre-established mapping relation configuration file;
determining a data reading mode and a mapping numerical value corresponding to the target operation based on the mapping relation configuration file;
acquiring a target data structure corresponding to the target operation based on the mapping numerical value and the data reading mode;
the mapping relationship configuration file is obtained by generating a data structure, and the mapping relationship configuration file comprises a corresponding relationship between a mapping numerical value and the data structure.
2. The method of claim 1, wherein the data read mode comprises an excel format or a json format.
3. The method of claim 2, wherein obtaining the target data structure corresponding to the target operation based on the mapped value and the data read mode comprises:
when the data reading mode is in an excel format, reading a target data structure corresponding to the target operation in the excel mode based on the mapping numerical value;
and when the data reading mode is in a json format, reading a target data structure corresponding to the target operation in the json mode based on the mapping numerical value.
4. The method of claim 1, further comprising:
and displaying the target data structure on a display interface in a target format.
5. A method for generating a data structure, comprising:
acquiring a configuration file and at least one pre-established data type table;
determining data structures corresponding to different data types according to the data type table;
and generating a mapping numerical value corresponding to the data structure based on the data structure, and establishing a mapping relation configuration file between the data structure and the mapping numerical value, so that when the data structure is called, a target data structure corresponding to a target operation is obtained based on the mapping relation configuration file.
6. The method according to claim 5, wherein the data type table comprises data types in an excel table format, and before the obtaining the configuration file and the at least one pre-established data type table, the method further comprises:
adding at least one attribute information in a header of an excel table;
the attribute information includes: a data name, a data type, a usage area, and a comment corresponding to the data name.
7. The method of claim 6, wherein determining data structures corresponding to different data types from the data type table comprises:
calling a data structure generation code to generate a data structure corresponding to the data type from a group of data which are in the same column and correspond to each attribute information in the excel table;
the data structure comprises a data reading mode corresponding to the data structure, a comment corresponding to each data name and a use area of the data structure.
8. The method of claim 5, wherein the data type table includes data types in json format, and wherein determining data structures corresponding to different data types from the data type table comprises:
and analyzing the numerical values in the data type table to generate data structures corresponding to different numerical values.
9. An apparatus for invoking a data structure, comprising:
the mapping data acquisition module is used for acquiring a pre-established mapping relation configuration file when the trigger target operation is detected;
the data reading mode determining module is used for determining a data reading mode and a mapping numerical value corresponding to the target operation based on the mapping relation configuration file;
a target data determination module, configured to obtain a target data structure corresponding to the target operation based on the mapping numerical value and the data reading mode;
the mapping relationship configuration file is obtained by generating a data structure, and the mapping relationship configuration file comprises a corresponding relationship between a mapping numerical value and the data structure.
10. An apparatus for generating a data structure, comprising:
the configuration file acquisition module is used for acquiring a configuration file and at least one pre-established data type table;
the data structure determining module is used for determining data structures corresponding to different data types according to the data type table;
and the mapping file determining module is used for generating a mapping numerical value corresponding to the data structure based on the data structure, and establishing a mapping relation configuration file between the data structure and the mapping numerical value, so that when the data structure is called, a target data structure corresponding to a target operation is obtained based on the mapping relation configuration file.
CN201911309932.3A 2019-12-18 2019-12-18 Data structure generation method and device, and calling method and device Active CN110990411B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911309932.3A CN110990411B (en) 2019-12-18 2019-12-18 Data structure generation method and device, and calling method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911309932.3A CN110990411B (en) 2019-12-18 2019-12-18 Data structure generation method and device, and calling method and device

Publications (2)

Publication Number Publication Date
CN110990411A true CN110990411A (en) 2020-04-10
CN110990411B CN110990411B (en) 2024-02-06

Family

ID=70095261

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911309932.3A Active CN110990411B (en) 2019-12-18 2019-12-18 Data structure generation method and device, and calling method and device

Country Status (1)

Country Link
CN (1) CN110990411B (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112084757A (en) * 2020-09-11 2020-12-15 北京中油瑞飞信息技术有限责任公司 List construction method and device based on industrial application platform
CN112206531A (en) * 2020-10-19 2021-01-12 珠海金山网络游戏科技有限公司 Game creation method and device
CN112685413A (en) * 2020-12-28 2021-04-20 北京像素软件科技股份有限公司 Game configuration table reading method and device, storage medium and electronic equipment
CN113779943A (en) * 2021-01-12 2021-12-10 北京沃东天骏信息技术有限公司 Table generation method, table generation device, storage medium, and electronic apparatus
CN115037610A (en) * 2022-04-24 2022-09-09 浙江清捷智能科技有限公司 Automatic configuration system and automatic configuration method

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090063555A1 (en) * 2007-04-27 2009-03-05 Microsoft Corporation File formats for external specification of object-relational mapping
US20150347620A1 (en) * 2014-05-30 2015-12-03 International Business Machines Corporation Generating a mapping rule for converting relational data into rdf format data
CN105760534A (en) * 2016-03-10 2016-07-13 上海晶赞科技发展有限公司 User-defined serializable data structure, hadoop cluster, server and application method thereof
CN105787808A (en) * 2016-03-01 2016-07-20 中国电力科学研究院 IEC61968 standard document generation system and method based on generic programming and reflection mechanism
CN106293770A (en) * 2016-08-24 2017-01-04 珠海金山网络游戏科技有限公司 The general of a kind of table data leads table system and method
CN107992624A (en) * 2017-12-22 2018-05-04 百度在线网络技术(北京)有限公司 Parse method, apparatus, storage medium and the terminal device of serialized data
CN109753536A (en) * 2019-01-15 2019-05-14 顺丰科技有限公司 A kind of data docking facilities and method
CN110020353A (en) * 2017-09-30 2019-07-16 北京国双科技有限公司 The construction method and device of web form
US20190325074A1 (en) * 2018-04-18 2019-10-24 International Business Machines Corporation Application programing interface document generator

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090063555A1 (en) * 2007-04-27 2009-03-05 Microsoft Corporation File formats for external specification of object-relational mapping
US20150347620A1 (en) * 2014-05-30 2015-12-03 International Business Machines Corporation Generating a mapping rule for converting relational data into rdf format data
CN105787808A (en) * 2016-03-01 2016-07-20 中国电力科学研究院 IEC61968 standard document generation system and method based on generic programming and reflection mechanism
CN105760534A (en) * 2016-03-10 2016-07-13 上海晶赞科技发展有限公司 User-defined serializable data structure, hadoop cluster, server and application method thereof
CN106293770A (en) * 2016-08-24 2017-01-04 珠海金山网络游戏科技有限公司 The general of a kind of table data leads table system and method
CN110020353A (en) * 2017-09-30 2019-07-16 北京国双科技有限公司 The construction method and device of web form
CN107992624A (en) * 2017-12-22 2018-05-04 百度在线网络技术(北京)有限公司 Parse method, apparatus, storage medium and the terminal device of serialized data
US20190325074A1 (en) * 2018-04-18 2019-10-24 International Business Machines Corporation Application programing interface document generator
CN109753536A (en) * 2019-01-15 2019-05-14 顺丰科技有限公司 A kind of data docking facilities and method

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
刘晓军;易红;仇晓黎;倪中华;: "基于STEP-NC的可互操作CAPP/CAM***" *
潘大四;杨梦宁;: "一种匹配目的端模式的异构数据交换" *

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112084757A (en) * 2020-09-11 2020-12-15 北京中油瑞飞信息技术有限责任公司 List construction method and device based on industrial application platform
CN112206531A (en) * 2020-10-19 2021-01-12 珠海金山网络游戏科技有限公司 Game creation method and device
CN112206531B (en) * 2020-10-19 2022-08-26 珠海金山数字网络科技有限公司 Game creation method and device
CN112685413A (en) * 2020-12-28 2021-04-20 北京像素软件科技股份有限公司 Game configuration table reading method and device, storage medium and electronic equipment
CN113779943A (en) * 2021-01-12 2021-12-10 北京沃东天骏信息技术有限公司 Table generation method, table generation device, storage medium, and electronic apparatus
CN115037610A (en) * 2022-04-24 2022-09-09 浙江清捷智能科技有限公司 Automatic configuration system and automatic configuration method
CN115037610B (en) * 2022-04-24 2023-09-22 浙江清捷智能科技有限公司 Automatic configuration system and automatic configuration method

Also Published As

Publication number Publication date
CN110990411B (en) 2024-02-06

Similar Documents

Publication Publication Date Title
CN108519967B (en) Chart visualization method and device, terminal and storage medium
CN110990411B (en) Data structure generation method and device, and calling method and device
CN111177176B (en) Data detection method, device and storage medium
CN112732567B (en) Mock data testing method and device based on ip, electronic equipment and storage medium
CN113204345A (en) Page generation method and device, electronic equipment and storage medium
CN112363753A (en) Data verification method and device, electronic equipment and storage medium
CN110955640A (en) Cross-system data file processing method, device, server and storage medium
CN113384896A (en) Unity-based resource packaging method, device, equipment and medium
CN110647523B (en) Data quality analysis method and device, storage medium and electronic equipment
CN113760839A (en) Log data compression processing method and device, electronic equipment and storage medium
CN111913922B (en) Binary structured log generation method, device, equipment and storage medium
CN112799760B (en) Form rendering method and device
CN113836014A (en) Interface testing method and device, electronic equipment and storage medium
CN108959508B (en) SQL data generation method and device
CN110888641A (en) Automatic script generation method and device, server and storage medium
CN113792138B (en) Report generation method and device, electronic equipment and storage medium
CN108536715B (en) Preview page generation method, device, equipment and storage medium
CN115391322A (en) Data checking method, device, equipment, storage medium and program product
CN112748930B (en) Compilation detection method, device, equipment and storage medium
CN114154468A (en) Report synthesis method and device, electronic equipment and storage medium
CN111741046B (en) Data reporting method, data acquisition method, device, equipment and medium
CN111124423A (en) Multi-platform-based compiling detection method, device, server and medium
CN115222371B (en) Problem troubleshooting method and device, electronic equipment and storage medium
CN112363778B (en) Dynamic picture loading method and device, electronic equipment and storage medium
CN112445790B (en) Report data storage method, device, equipment and medium

Legal Events

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