CN110990411B - 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
CN110990411B
CN110990411B CN201911309932.3A CN201911309932A CN110990411B CN 110990411 B CN110990411 B CN 110990411B CN 201911309932 A CN201911309932 A CN 201911309932A CN 110990411 B CN110990411 B CN 110990411B
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.)
Active
Application number
CN201911309932.3A
Other languages
Chinese (zh)
Other versions
CN110990411A (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

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 data structure generation method and device, and a calling method and device, wherein the method comprises the following steps: when the triggering target operation is detected, acquiring a pre-established mapping relation configuration file; determining a data type and a mapping 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; based on the mapping values and the data reading mode, a target data structure corresponding to the target operation is obtained. The technical scheme of the embodiment of the invention solves the problems that the contents in the table are required to be modified, time and labor are wasted and errors are easy to occur when the data is added or deleted in the prior art, realizes the technical effects that the file is not required to be rewritten when the target data structure is acquired based on the generated mapping relation configuration file, and improves 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 method and a device for generating a data structure, and a method and a device for calling the data structure.
Background
In the process of developing a game project, each time a table is read in, a target file corresponding to the table needs to be created, optionally, a xxxx general LogicData.cs file is selected, and data reading is performed according to data defined by each column, however, in adding or deleting the content in the table, the xx general LogicData.c file needs to be modified, which is time-consuming and labor-consuming and is easy to make mistakes.
Disclosure of Invention
The embodiment of the invention provides a data structure generation method and device, a data structure calling method and device, which are used for quickly calling the 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 calling a data structure, where the method includes:
when the triggering target operation is detected, acquiring a pre-established mapping relation configuration file;
determining a data type and a mapping value corresponding to the target operation based on the mapping relation configuration file;
determining a data read 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 value and the data reading mode;
the mapping relation configuration file is obtained by generating a data structure, and the mapping relation configuration file comprises a corresponding relation between mapping numerical values 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 as to acquire a target data structure corresponding to a target operation based on the mapping relation configuration file when the data structure is called.
In a third aspect, an embodiment of the present invention further provides a device for calling 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 triggering target operation is detected;
the data reading mode determining module is used for determining a data reading mode and a mapping value corresponding to the target operation based on the mapping relation configuration file;
a target data determining module, configured to obtain a target data structure corresponding to the target operation based on the mapping value and the data reading mode;
the mapping relation configuration file is obtained by generating a data structure, and the mapping relation configuration file comprises a corresponding relation between mapping numerical values and the data structure.
In a fourth aspect, an embodiment of the present invention further provides a device for generating a data structure, where the device 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 as to acquire a target data structure corresponding to a target operation based on the mapping relation configuration file when the data structure is called.
In a fifth aspect, an embodiment of the present invention further provides a server, where the server includes:
one or more processors;
storage means 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 a method for generating a data structure or a method for calling a data structure according to any one of the embodiments of the present invention.
In a sixth aspect, embodiments of the present invention also provide a storage medium containing computer-executable instructions, which when executed by a computer processor, are configured to perform a method of generating a data structure or a method of calling a data structure according to any of the embodiments of the present invention.
According to the technical scheme, when the triggering target operation is detected, a pre-established mapping relation configuration file is obtained; determining a data type and a mapping 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 a target operation based on the mapping value and the data reading mode; the mapping relation configuration file is obtained by generating the data structure, and comprises the mapping relation between the mapping values and the data structure, so that the problems that in the prior art, when data is added or deleted, the contents in the table are required to be modified, time and labor are wasted, and errors are easy to occur are solved, the technical effect that the file is not required to be rewritten when the target data structure is acquired based on the generated mapping relation configuration file, and the file calling efficiency is improved are achieved.
Drawings
In order to more clearly illustrate the technical solution of the exemplary embodiments of the present invention, a brief description is given below of the drawings required for describing the embodiments. It is obvious that the drawings presented are only drawings of some of the embodiments of the invention to be described, and not all the drawings, and that other drawings can be made according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flowchart of a method for calling a data structure according to an embodiment of the present invention;
fig. 2 is a flowchart of a method for generating a data structure according to a second embodiment of the present invention;
FIG. 3 is a flowchart of a method for calling a data structure according to a third embodiment of the present invention;
fig. 4 is a flowchart of a method for generating a data structure according to a third embodiment of the present invention;
fig. 5 is a schematic 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 device according to a fifth embodiment of the present invention;
fig. 7 is a schematic diagram of a server according to a sixth embodiment of the present invention.
Detailed Description
The invention is described in further detail below with reference to the drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting thereof. It should be further noted that, for convenience of description, only some, but not all of the structures related to the present invention are shown in the drawings.
Example 1
Fig. 1 is a schematic flow chart of a method for calling a data structure according to an embodiment of the present invention, where the method may be performed by a device for calling a target data structure based on a pre-established data mapping relationship configuration table, and the device may be implemented in software and/or hardware, and the hardware may be an electronic device, optionally, a mobile terminal or a PC.
As shown in fig. 1, the method of the present embodiment includes:
s110, when the triggering target operation is detected, a pre-established mapping relation configuration file is obtained.
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 triggering 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.
S120, determining a data reading mode and a mapping 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 the mapping numerical value. The data read type can be understood as a data read mode. Optionally, the data reading mode includes an excel format data reading mode or a json format data reading mode. The mapping value is a unique identifier corresponding to the target operation.
Specifically, based on the obtained mapping configuration file, a data reading type corresponding to the target operation and a mapping value corresponding to the target operation may be determined.
S130, acquiring a target data structure corresponding to the target operation based on the mapping value and the data reading mode.
Wherein the target data structure is a data structure corresponding to the target operation.
Specifically, a target data structure corresponding to a target operation may be invoked according to a mapping value corresponding to the target operation and a data read mode in a 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 format based on the mapping value; and when the data reading mode is a json format, reading a target data structure corresponding to the target operation in the json mode based on the mapping value.
That is, when it is determined that the data pattern corresponding to the target data structure is in an excel format, the target data structure corresponding to the target operation may be called in the excel format based on the mapping value corresponding to the target operation. If the data read mode corresponding to the target data structure is determined to be json format, the target data structure corresponding to the target operation may be retrieved in json mode based on the mapping value corresponding to the target operation.
In this embodiment, when the game is running, during triggering the target operation, the data reading manner corresponding to the target operation may be obtained from the pre-established mapping relationship configuration file according to the target triggering operation, and the target data corresponding to the target operation is loaded into the table corresponding to the data reading mode and 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 presented on the display interface in a target format.
Wherein the target format is a format corresponding to the data reading mode. Optionally, the data reading mode is an excel format, the target format is an excel format, the data reading mode is a json format, and the target format is a json format.
Specifically, the target structure may be presented on the display interface in a target format according to the data reading mode.
According to the technical scheme, when the triggering target operation is detected, a pre-established mapping relation configuration file is obtained; determining a data reading mode and a mapping value corresponding to the target operation based on the mapping relation configuration file; based on the mapping value and the data reading mode, the target data structure corresponding to the target operation is obtained, the technical problem that the file is required to be redetermined to be time-consuming and labor-consuming when the data structure is called in the prior art is solved, the target data structure corresponding to the target operation is obtained quickly and conveniently and is sent to a demand side, and the technical effect of obtaining the convenience of 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 demander based on the file reading manner corresponding to the target data.
Example two
Fig. 2 is a flow chart of a data structure generating method according to a second embodiment of the present invention, where the method may be performed by a data structure generating device, and the device may be implemented in software and/or hardware.
As shown in fig. 2, the method includes:
s210, acquiring a configuration file and at least one pre-established data type table.
The configuration file is a configuration file 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 the actual demand. Optionally, the data type table includes an excel table and or 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 acquired first.
In this embodiment, the data type table may be established before the configuration file and the data type table are acquired. The data type table may be an excel table or a json format data type table.
Optionally, when the data type table is an excel table, adding at least one attribute information in the 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 the format of the excel table is determined first, at least two rows of table heads are added on the basis of the original excel table, each row of table heads is respectively a parameter name, a parameter type, an optional, int, float, string and the like, and the parameters are further annotated by using an area, an optional, a server or a client, a Chinese meaning and an optional. Data corresponding to different operations is written in the corresponding header. The method has the advantages that data used by a client part and data used by a server part in the table can be automatically distinguished, loading of useless data is avoided, writing formats are unified, and notes are added for each parameter. When the parameters in the data table need to be deleted, added or modified, the data table can be directly called for modification.
Accordingly, determining the data structure corresponding to the different data types according to 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 in the excel table and correspond to each attribute information; the data structure comprises a data reading mode corresponding to the data structure, notes corresponding to each data name and a use area of the data structure.
The data structure generating codes are used for processing the data in the table to generate corresponding data structures. That is, the data structure includes a data type, a data name, and a usage area of the data.
Specifically, if the header of each row in the excel table indicates the data type of the column data, the data structure generating code may perform integration processing on the data in the same column in the excel table, as a data structure corresponding to the excel.
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 table is different, the manner in which the data structure is generated is also different. Optionally, if the data type table is an excel table, the data generating code may be invoked to process at least one group of data in the same column of the excel table and corresponding to each attribute information, so as to obtain a plurality of data structures. If the data type is the json format data type, the values in the data table can be obtained, and the values are analyzed to obtain the data structure identical to the different values.
In this embodiment, it should be further noted that, the use areas of different data are written in the excel table, 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 as to acquire a target data structure corresponding to the target operation based on the mapping relation configuration file when the data structure is called.
Specifically, after determining the data structure corresponding to each set of data, the data structure may be processed, the mapping value corresponding to each set of data structure may be determined, and a mapping relationship configuration file between the data structure and the mapping value may be established.
According to the technical scheme, the configuration file and at least one pre-established data type table are acquired; determining data structures corresponding to different data types according to the data type table; the mapping numerical value corresponding to the data structure is generated based on the data structure, and the mapping relation configuration file between the data structure and the mapping numerical value is established, so that when the data structure is called, the target data structure corresponding to the target operation is obtained based on the mapping relation configuration file, the technical problem of complexity and complexity when the data structure corresponding to the excel table is required to be written manually in the prior art is solved, the automatic writing of the data structure corresponding to the data table of different types is realized, the mapping relation configuration file corresponding to the data structure is generated, and the technical effect of convenience in generating the data structure is improved.
Example III
As a preferred embodiment of the foregoing embodiments, fig. 3 is a flowchart of 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 in and analyzing the configuration file.
The configuration file is corresponding to the data type table, namely, 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 so as to obtain the 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 so, error prompt information is popped up, and if not, the user is prompted.
S303, judging whether the data table type is in a target format, if so, executing S304; if not, S305 is performed.
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, if yes, the data in the excel table is processed, that is, S304 is executed; if not, S305 is performed.
S304, the data table 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 usage 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, the data structure corresponding to the data value is obtained by processing according to the numerical value in the json type data table.
S306, judging whether each column is a client value, if so, executing S307; if not, then S308 is performed.
Specifically, whether the data is client data or server data may be determined according to the usage area of the data in the data type table. If the usage area of a certain set of data is the client, executing S208; if the usage area of the data type of a certain group is a server, the data structure may be stored in the server, that is, S308 is performed. 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 calling efficiency of the data is improved.
S307, generating a data structure according to the defined format.
Specifically, the data which are identical to each attribute and are in the same group are taken as a whole to obtain a data structure. That is, the number of data structures is the same as the number of arrays.
S308, skipping.
That is, data corresponding to the client may be filtered out, 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 loading useless data during the game.
S309, generating a data structure according to the numerical analysis.
Specifically, the data table type is json format type, and the values in the data table can be analyzed to obtain a data structure corresponding to each value.
S310, generating a mapping numerical configuration file according to the generated data structure.
After generating the data structures based on the different data tables, a map value profile may be generated from the data structures to determine a data read mode from the map value profile and a target data structure corresponding to the target operation.
Based on the technical scheme, when the data structure is called, the data structure can be obtained based on a pre-established mapping relation configuration file. Fig. 4 is a flowchart illustrating a method for retrieving a data structure according to a third embodiment of the present invention. As shown in fig. 4, the method includes:
s410, reading the mapping relation configuration file.
Specifically, the mapping configuration file is pre-established and includes a unique identifier corresponding to the data structure.
S420, judging whether the reading mode is a target reading mode, if so, executing S430; if not, S440 is performed.
In this embodiment, the target read mode is an excel mode.
Specifically, according to the mapping relation configuration file, a data structure reading mode corresponding to the target triggering operation can be determined, and according to the obtained data reading mode, whether the data structure reading mode is the target reading mode or not, namely whether the data structure reading mode is the excel mode or not can be determined. If yes, S430 may be performed, and the data structure corresponding to the mapping value may be read in excel mode, otherwise S440 may be performed.
S430, reading in an excel mode according to the mapping value.
Specifically, the target data structure is read from the mapping relation configuration file in an excel mode according to the mapping values.
S440, reading in a json mode according to the mapping value.
Specifically, the target data structure is read from the mapping relation configuration file in json mode according to the mapping values.
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 numerical value may be returned.
According to the technical scheme, the configuration file and at least one pre-established data type table are acquired; determining data structures corresponding to different data types according to the data type table; the mapping numerical value corresponding to the data structure is generated based on the data structure, and the mapping relation configuration file between the data structure and the mapping numerical value is established, so that when the data structure is called, the target data structure corresponding to the target operation is obtained based on the mapping relation configuration file, the technical problem of complexity and complexity when the data structure corresponding to the excel table is required to be written manually in the prior art is solved, the automatic writing of the data structure corresponding to the data table of different types is realized, the mapping relation configuration file corresponding to the data structure is generated, and the technical effect of convenience in generating the data structure is improved.
Example IV
Fig. 5 is a schematic structural diagram of a data structure calling device according to a fourth embodiment of the present invention, where the device includes: a mapping profile acquisition module 510, a data read mode determination module 520, and a target data structure determination module 530.
The mapping data obtaining module 510 is configured to obtain a mapping relationship configuration file established in advance when detecting a trigger target operation; a data reading mode determining module 520, configured to determine a data reading mode and a mapping value corresponding to the target operation based on the mapping relationship configuration file; a target data determining 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 relation configuration file is obtained by generating a data structure, and the mapping relation configuration file comprises a corresponding relation between mapping numerical values and the data structure.
According to the technical scheme, the configuration file and at least one pre-established data type table are acquired; determining data structures corresponding to different data types according to the data type table; the mapping numerical value corresponding to the data structure is generated based on the data structure, and the mapping relation configuration file between the data structure and the mapping numerical value is established, so that when the data structure is called, the target data structure corresponding to the target operation is obtained based on the mapping relation configuration file, the technical problem of complexity and complexity when the data structure corresponding to the excel table is required to be written manually in the prior art is solved, the automatic writing of the data structure corresponding to the data table of different types is realized, the mapping relation configuration file corresponding to the data structure is generated, and the technical effect of convenience in generating the data structure is improved.
Based on the above technical solutions, the data type includes an excel format data type or a json format data type. 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 value;
and when the data type is in the json format, reading a target data structure corresponding to the target operation in the json mode based on the mapping value.
On the basis of the technical schemes, the device further comprises: 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 each unit and module included in the above apparatus are only divided according to the functional logic, but not limited to the above division, so long as the corresponding functions can be implemented; in addition, the specific names of the functional units are also only for distinguishing from each other, and are not used to limit the protection scope of the embodiments of the present invention.
Example five
Fig. 6 is a schematic diagram of a data structure generating device according to a fifth embodiment of the present invention. As shown in fig. 6, the apparatus includes: a profile 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 data structures corresponding to different data types according to the data type table; the mapping file determining module 630 is configured to generate a mapping 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 value, so as to obtain, when the data structure is called, a target data structure corresponding to a target operation based on the mapping relationship configuration file.
According to the technical scheme, 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 mapping numerical value corresponding to the data structure is generated based on the data structure, and the mapping relation configuration file between the data structure and the mapping numerical value is established, so that when the data structure is called, the target data structure corresponding to the target operation is obtained based on the mapping relation configuration file, the technical problem of complexity and complexity when the data structure corresponding to the excel table is required to be written manually in the prior art is solved, the automatic writing of the data structure corresponding to the data table of different types is realized, the mapping relation configuration file corresponding to the data structure is generated, and the technical effect of convenience in generating the data structure is improved.
On the basis of the technical schemes, the device further comprises: an excel table building module, configured to:
adding at least one attribute information in the header of the excel table;
the attribute information includes: a data name, a data type, a usage area, and an annotation corresponding to the data name.
On the basis of the above technical solutions, the data structure determining module is further configured to:
invoking 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 in the excel table and correspond to each attribute information;
the data structure comprises a data reading mode corresponding to the data structure, notes 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 each unit and module included in the above apparatus are only divided according to the functional logic, but not limited to the above division, so long as the corresponding functions can be implemented; in addition, the specific names of the functional units are also only for distinguishing from each other, and are not used to limit the protection scope of the embodiments of the present invention.
Example six
Fig. 7 is a schematic structural diagram of a server according to a fourth embodiment of the present invention. Fig. 7 shows 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 be construed as limiting the functionality and scope of use of the embodiments of the present invention.
As shown in FIG. 7, the server 70 is embodied in the form of a general purpose computing device. 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 connects the various system components (including the system memory 702 and the processing units 701).
Bus 703 represents one or more 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, and not limitation, such architectures include 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.
Server 70 typically includes a variety of computer system readable media. Such media can 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. Server 70 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, 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 non-volatile magnetic disk (e.g., a "floppy disk"), and an optical disk drive for reading from or writing to a removable non-volatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In such cases, each drive may be coupled to bus 703 through one or more data medium interfaces. Memory 702 may include at least one program product having a set (e.g., at least one) of program modules 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 in, for example, 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 or some combination of which may include an implementation of a network environment. Program modules 707 generally perform the functions and/or methods of the embodiments described herein.
The server 70 may also be in communication with one or more external devices 709 (e.g., keyboard, pointing device, display 710, etc.), one or more devices that enable a user to interact with the server 70, and/or 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 through an input/output (I/O) interface 711. Also, server 70 may communicate with one or more networks such as a Local Area Network (LAN), a Wide Area Network (WAN) and/or a public network, such as the Internet, through a network adapter 712. As shown, network adapter 712 communicates with other modules of server 70 via bus 703. It should be appreciated that although not shown in fig. 7, other hardware and/or software modules may be used in connection with server 70, including, but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, data backup storage systems, and the like.
The processing unit 701 executes various functional applications and data processing by running a program stored in the system memory 702, for example, implementing a data structure generation method or a data structure calling method provided by an embodiment of the present invention.
Example seven
The seventh embodiment of the present invention also provides a storage medium containing computer-executable instructions for performing a method of generating a data structure or a method of calling a data structure when executed by a computer processor.
The method comprises the following steps:
when the triggering target operation is detected, acquiring a pre-established mapping relation configuration file;
determining a data type and a mapping value corresponding to the target operation based on the mapping relation configuration file;
determining a data read 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 value and the data reading mode;
the mapping relation configuration file is obtained by generating a data structure, and the mapping relation configuration file comprises a corresponding relation between mapping numerical values and the data structure.
Or alternatively, the first and second heat exchangers may be,
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 as to acquire a target data structure corresponding to a target operation based on the mapping relation configuration file when the data structure is called.
The computer storage media of embodiments of the invention may take the form of 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. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any 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 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.
The computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, either 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 of the foregoing. 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 ++ 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 kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (for example, through the Internet using an Internet service provider).
Note that the above is only a preferred embodiment of the present invention and the technical principle applied. 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, while the invention has been described in connection with the above embodiments, the invention is not limited to the embodiments, but may be embodied in many other equivalent forms without departing from the spirit or scope of the invention, which is set forth in the following claims.

Claims (7)

1. A method for invoking 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, wherein the data type table comprises an excel table format and a json format;
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 as to acquire a target data structure corresponding to a target operation based on the mapping relation configuration file when the data structure is called;
when the triggering target operation is detected, acquiring a pre-established mapping relation configuration file;
determining a data reading mode and a mapping 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 value and the data reading mode, wherein the data reading mode comprises an excel format or a json format;
the mapping relation configuration file is obtained by generating a data structure, and the mapping relation configuration file comprises a corresponding relation between mapping numerical values and the data structure.
2. The method of claim 1, wherein the obtaining a target data structure corresponding to the target operation based on the mapping value and the data read mode comprises:
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 value;
and when the data reading mode is a json format, reading a target data structure corresponding to the target operation in the json mode based on the mapping value.
3. The method as recited in claim 1, further comprising:
and displaying the target data structure on a display interface in a target format.
4. The method of claim 1, further comprising, prior to the obtaining the profile and the pre-established at least one data type table:
adding at least one attribute information in the header of the excel table;
the attribute information includes: a data name, a data type, a usage area, and an annotation corresponding to the data name.
5. The method of claim 4, wherein determining data structures corresponding to different data types from the data type table comprises:
invoking 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 in the excel table and correspond to each attribute information;
the data structure comprises a data reading mode corresponding to the data structure, notes corresponding to each data name and a use area of the data structure.
6. The method of claim 1, wherein said determining data structures corresponding to different data types from said data type table comprises:
and analyzing the numerical values in the data type table to generate data structures corresponding to different numerical values.
7. A data structure calling device, comprising:
the mapping data acquisition module is used for acquiring a pre-established mapping relation configuration file when the triggering target operation is detected;
the data reading mode determining module is used for determining a data reading mode and a mapping value corresponding to the target operation based on the mapping relation configuration file;
the target data determining module is used for acquiring a target data structure corresponding to the target operation based on the mapping value and the data reading mode, wherein the data reading mode comprises an excel format or a json format;
the mapping relation configuration file is obtained by generating a data structure, and the mapping relation configuration file comprises a corresponding relation between mapping numerical values and the data structure;
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, wherein the data type table comprises an excel table format and a json format;
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 as to acquire a target data structure corresponding to a target operation based on the mapping relation configuration file when the data structure is called.
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 CN110990411A (en) 2020-04-10
CN110990411B true 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)

Families Citing this family (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
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
CN115037610B (en) * 2022-04-24 2023-09-22 浙江清捷智能科技有限公司 Automatic configuration system and automatic configuration method

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7730065B2 (en) * 2007-04-27 2010-06-01 Microsoft Corporation File formats for external specification of object-relational mapping
CN105446966B (en) * 2014-05-30 2019-01-18 国际商业机器公司 The method and apparatus that production Methods data are converted to the mapping ruler of RDF format data
US10839011B2 (en) * 2018-04-18 2020-11-17 International Business Machines Corporation Application programing interface document generator

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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
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***.计算机集成制造***.2009,(03),全文. *
潘大四 ; 杨梦宁 ; .一种匹配目的端模式的异构数据交换.重庆大学学报(自然科学版).2007,(08),全文. *

Also Published As

Publication number Publication date
CN110990411A (en) 2020-04-10

Similar Documents

Publication Publication Date Title
CN110990411B (en) Data structure generation method and device, and calling method and device
CN107506300B (en) User interface testing method, device, server and storage medium
CN106550038B (en) Data configuration diagnosis system and method of digital control system
CN108874441B (en) Board card configuration method, device, server and storage medium
CN110659210A (en) Information acquisition method and device, electronic equipment and storage medium
CN113204345A (en) Page generation method and device, electronic equipment and storage medium
CN113051514A (en) Element positioning method and device, electronic equipment and storage medium
CN113384896A (en) Unity-based resource packaging method, device, equipment and medium
CN111274130A (en) Automatic testing method, device, equipment and storage medium
CN114003269A (en) Component processing method and device, electronic equipment and storage medium
CN113836014A (en) Interface testing method and device, electronic equipment and storage medium
CN111694684A (en) Abnormal construction method and device of storage equipment, electronic equipment and storage medium
CN110888641B (en) Script automatic generation method and device, server and storage medium
CN113792138B (en) Report generation method and device, electronic equipment and storage medium
CN111124423B (en) Compiling detection method, device, server and medium based on multiple platforms
CN114461214A (en) Page display method and device, electronic equipment and storage medium
CN110866492B (en) Baseline branch identification method and device and computer system
US11392371B2 (en) Identification of a partial code to be refactored within a source code
CN109948251B (en) CAD-based data processing method, device, equipment and storage medium
CN113590446A (en) Method and device for detecting numerical value file, electronic equipment and storage medium
CN109358972B (en) Log management method and device of middleware client and computer system
CN112966671A (en) Contract detection method and device, electronic equipment and storage medium
CN113590225B (en) Mapping detection method and device, electronic equipment and storage medium
CN112988593B (en) Code analysis method, device, computer 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