Method, device and equipment for index definition table establishment and storage medium

By acquiring user-defined indicator information, the indicator definition result table is automatically created, which solves the problem that the indicator result table needs to be manually maintained from time to time in the existing technology and improves the automation level of the system.

CN119003522APending Publication Date: 2024-11-22BEIJING YAHUA WULIAN TECH DEV CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202411023703.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-29
Publication Date
2024-11-22

AI Technical Summary

Technical Problem

In existing technologies, the structure of the indicator result table requires periodic manual maintenance, which increases maintenance costs and is not intelligent enough.

Method used

By obtaining user-defined metrics, the metric definition information is determined, including metric fields such as metric identifier, metric value, metric dimension, and metric billing period. The metric definition result table is automatically queried and created if it does not exist.

Benefits of technology

It enables automatic mapping of table structures when the indicator definition result table does not exist, reducing manual maintenance costs and improving the automation level of the indicator management system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119003522A_ABST
    Figure CN119003522A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of data processing, and discloses a method, device and equipment for index definition table establishment and a storage medium, the method comprises the following steps: obtaining a user defined index, and determining index definition information based on the user defined index, the index definition information comprising an index field, the index field comprising an index identifier, an index value, an index dimension and an index account period; querying whether an index definition result table exists or not based on the index dimension; if the index definition result table does not exist, creating the index definition result table based on the index field; wherein the index identifier is used for uniquely identifying the index definition information; the index account period is used for distinguishing the date to which the index data represented by the index definition information belongs; the index dimension is used for determining the dimension to which the index data belongs; the index value is used for counting the value of the index data. The problem that the index definition result table needs to be manually maintained irregularly is effectively solved, and the manual maintenance cost of the index definition result table is saved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing technology, and in particular to a method, device, equipment and storage medium for index definition and table building. Background Art

[0002] The indicator definition table building method in the related technology requires R&D personnel to pre-define the indicator result table structure and initialize it into the database. However, faced with the diversity of indicator definitions and the uncertainty of the fields of the indicator result table structure corresponding to the indicator definitions, the pre-defined indicator result table structure needs to be manually maintained from time to time, which increases the maintenance cost of the indicator result table and is not smart enough. Summary of the invention

[0003] In view of this, the present invention provides a method, device, equipment and storage medium for index definition table creation to solve the problem that the pre-defined index result table structure needs to be manually maintained from time to time, which increases the maintenance cost of the index result table and is not intelligent enough.

[0004] In a first aspect, the present invention provides a method for creating a table for indicator definition, the method comprising: obtaining a user-defined indicator, and determining indicator definition information based on the user-defined indicator, the indicator definition information comprising: an indicator field, the indicator field comprising: an indicator identifier, an indicator value, an indicator dimension, and an indicator account period; based on the indicator dimension, querying whether an indicator definition result table exists; if the indicator definition result table does not exist, creating the indicator definition result table based on the indicator field; wherein the indicator identifier is used to uniquely identify the indicator definition information; the indicator account period is used to distinguish the date to which the indicator data represented by the indicator definition information belongs; the indicator dimension is used to determine the dimension to which the indicator data belongs; and the indicator value is used to count the numerical value of the indicator data.

[0005] In an optional implementation, the indicator definition information further includes: at least one of the following items corresponding to each of the indicator fields: field type, field length, field decimal places and field comments; indicator name; and / or indicator identification name.

[0006] In an optional implementation, based on the indicator dimension, querying whether an indicator definition result table exists includes: taking the indicator dimension as a query condition, querying whether a first indicator definition result table with the same dimension as that represented by the indicator dimension exists in the database; if the first indicator definition result table exists, and the account period in the first indicator definition result table is earlier than the account period represented by the indicator account period, the indicator definition result table exists; wherein, the indicator dimension includes at least one field.

[0007] In an optional implementation, determining the dimension of the indicator data includes: determining that the indicator dimension includes at least one of the following: the company to which the gas meter belongs, the gas meter number, the gas meter type, the gas meter operator, the gas meter equipment name, and the gas consumption of the gas meter.

[0008] In an optional implementation, the indicator definition result table is created based on the indicator field, including: determining the table name annotation content of the indicator definition result table based on the indicator name; determining the name of the indicator definition result table based on the indicator identification name; and determining the table field name in the indicator definition result table based on the indicator field.

[0009] In an optional implementation, determining indicator definition information based on the user-defined indicator includes: determining the indicator dimension and the indicator account period based on the user-defined indicator; determining the indicator value to be obtained based on the indicator dimension and the indicator account period; and setting the indicator identifier.

[0010] In an optional implementation, the aforementioned method for creating an indicator definition table further includes: if the indicator definition result table exists, storing the indicator data represented by the indicator definition information in the existing indicator definition result table.

[0011] In a second aspect, the present invention provides a device for defining and building a table for indicators, the device comprising: an acquisition module, used to acquire user-defined indicators, and determine indicator definition information based on the user-defined indicators, the indicator definition information comprising: indicator fields, the indicator fields comprising: indicator identifiers, indicator values, indicator dimensions and indicator account periods; a query module, used to query whether an indicator definition result table exists based on the indicator dimensions; a table building module, used to create the indicator definition result table based on the indicator fields if the indicator definition result table does not exist; wherein the indicator identifier is used to uniquely identify the indicator definition information; the indicator account period is used to distinguish the date to which the indicator data represented by the indicator definition information belongs; the indicator dimension is used to determine the dimension to which the indicator data belongs; and the indicator value is used to count the numerical value of the indicator data.

[0012] In a third aspect, the present invention provides a computer device, comprising: a memory and a processor, the memory and the processor are communicatively connected to each other, computer instructions are stored in the memory, and the processor executes the method for defining and building an indicator table according to the first aspect or any corresponding embodiment thereof by executing the computer instructions.

[0013] In a fourth aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the method for defining and building a table for indicators according to the first aspect or any corresponding embodiment thereof.

[0014] Based on different user-defined indicators, the indicator definition information is determined. If the indicator definition result table does not exist, the table structure is automatically mapped, and the indicator definition result table is automatically created based on the indicator definition information. This effectively solves the problem of the indicator definition result table requiring irregular manual maintenance, saves the cost of manual maintenance of the indicator definition result table, and improves the automation level of the indicator management system. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] In order to more clearly illustrate the specific embodiments of the present invention or the technical solutions in the related technologies, the drawings required for use in the specific embodiments or the related technical descriptions will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0016] Figure 1 A schematic diagram showing a flow chart of a method for creating a table for defining indicators according to an embodiment of the present invention is shown;

[0017] Figure 2 A schematic diagram showing the structure of a device for index definition table building according to an embodiment of the present invention is shown;

[0018] Figure 3 It is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0019] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.

[0020] The indicator data result table database construction function in the indicator management system in the related art is relatively simple, and is mostly implemented by manually designing the table structure and manually creating the database table. With the increase in the types of indicator definitions, the increase in the diversity of indicator fields, and the uncertainty of the fields in the indicator data result table structure corresponding to the indicator definition, the pre-defined indicator data result table structure needs to be manually maintained from time to time, which increases the maintenance cost of the indicator data result table and is not smart enough. Therefore, a method for indicator definition table construction is needed to solve the problem that the indicator result table needs to maintain the table structure from time to time.

[0021] According to an embodiment of the present invention, a method embodiment for defining an indicator table is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0022] In this embodiment, a method for defining an indicator table is provided, which can be used in mobile terminals, such as mobile phones, desktop computers, tablet computers, etc. Figure 1 A flow chart of a method for defining and building a table for indicators according to an embodiment of the present invention is shown. Figure 1 As shown, the process includes the following steps:

[0023] Step S101, obtaining a user-defined indicator, and determining indicator definition information based on the user-defined indicator, the indicator definition information including: an indicator field, the indicator field including: an indicator identifier, an indicator value, an indicator dimension, and an indicator account period.

[0024] In this step, the indicator is the statistical data of a specific data dimension and a specific time dimension. For example, in the daily gas consumption indicator data of a gas meter, the data dimension is the gas meter number, which is the unique identifier of the gas meter, and the time dimension is the time range representing the gas consumption of the gas meter, such as a certain day. The user determines the indicator based on actual needs and obtains the user-defined indicator; based on the user-defined indicator, the indicator definition information is determined.

[0025] Indicator definition information is the definition information that provides information for specific business objectives based on a certain caliber and calculation method. Indicator definition information may also include: application model identifier, fact table identifier, pre-indicator identifier, indicator classification identifier, calculation mode, indicator version number, indicator unit identifier, indicator description, indicator creator and indicator creation time. Among them, the calculation mode includes: atomic indicator 1, aggregate indicator 2, derived indicator 3 and composite indicator 4.

[0026] Step S103: Based on the indicator dimension, query whether the indicator definition result table exists.

[0027] The indicator dimension may include one field or multiple fields. The specific number of fields included in the indicator dimension needs to be determined according to the user-defined indicator. For example, in the definition of the daily gas consumption indicator of a gas meter, the indicator dimension field of the daily gas consumption indicator data of the gas meter is determined to be the gas meter number or the gas meter device unique identifier field. In the definition of the proportion indicator of operators under each company, the indicator dimension field of the indicator data is determined to be the company identifier and the operator identifier. Based on the indicator dimension, query whether there is an indicator definition result table containing the current indicator dimension field in the database.

[0028] Step S105, if the indicator definition result table does not exist, create an indicator definition result table based on the indicator field; wherein the indicator identifier is used to uniquely identify the indicator definition information; the indicator account period is used to distinguish the date to which the indicator data represented by the indicator definition information belongs; the indicator dimension is used to determine the dimension to which the indicator data belongs; and the indicator value is used to count the numerical value of the indicator data.

[0029] When the indicator definition result table does not exist, a Structured Query Language (SQL) statement for creating the indicator definition result table is written based on the indicator field, and the aforementioned SQL statement is executed to create the indicator definition result table.

[0030] The indicator value field is the original table field used to count the indicator data. For example, in the three-day battery voltage attenuation indicator definition of a gas meter, the indicator value field is the battery voltage field in the device reporting data table, which is used to compare the difference in the battery voltage value of the gas meter three days ago.

[0031] For example, the user defines the indicator as voltage drop range, determines the indicator field in the indicator definition information, the indicator table identifier corresponding to the indicator field is indicators_id, the indicator value is voltage_diff, the indicator dimension is device_id, and the indicator account period is stat_date. If the voltage drop range result table cannot be found, create the voltage drop range result table based on the indicator field, and the table creation SQL statement is as follows:

[0032] CREATE TABLE`voltage_diffs_device_day`(

[0033] `indicators_id` bigint(20) NULL COMMENT 'Indicator id',

[0034] `stat_date` date NULL COMMENT'Account period',

[0035] `2` bigint(20) NULL COMMENT 'Device ID',

[0036] `indicators_val` decimal(10,3) NULL COMMENT 'Battery voltage drop value in one day'

[0037] )ENGINE=OLAP

[0038] UNIQUE KEY(`indicators_id`,`stat_date`,`2`)

[0039] COMMENT 'Voltage drop'

[0040] DISTRIBUTED BY HASH(`stat_date`)BUCKETS1

[0041] PROPERTIES("replication_num"="1")

[0042] By executing the above SQL statement, a voltage drop range result table can be obtained based on the voltage drop range indicator definition information.

[0043] The method for creating an indicator definition table provided in this embodiment determines the indicator definition information based on different user-defined indicators, automatically maps the table structure when the indicator definition result table does not exist, and automatically creates the indicator definition result table based on the indicator definition information, effectively solving the problem of requiring irregular manual maintenance of the indicator definition result table, saving the cost of manual maintenance of the indicator definition result table, and improving the automation level of the indicator management system.

[0044] In some optional implementations, the indicator definition information further includes: at least one of the following corresponding to each indicator field: field type, field length, field decimal places and field comments; indicator name; and / or indicator identification name.

[0045] In this embodiment, the indicator definition information also includes: items corresponding to each indicator field, or, the indicator name, or, the indicator identification name, or, the indicator name and the indicator identification name, or, the items corresponding to each indicator field and the indicator name, or, the items corresponding to each indicator field and the indicator identification name, or, the items corresponding to each indicator field and the indicator name and the indicator identification name.

[0046] Among them, the items corresponding to each indicator field include: the field type corresponding to each indicator field, or the field length corresponding to each indicator field, or the field decimal places corresponding to each indicator field, or the field annotation corresponding to each indicator field, or the field type corresponding to each indicator field and the field length corresponding to each indicator field, or the field type corresponding to each indicator field and the field decimal places corresponding to each indicator field, or the field type corresponding to each indicator field and the field annotation corresponding to each indicator field, or the field length corresponding to each indicator field and the field decimal places corresponding to each indicator field, or the field length corresponding to each indicator field and the field annotation corresponding to each indicator field, or the field decimal places corresponding to each indicator field and The field annotation corresponding to each indicator field, or the field type corresponding to each indicator field and the field length corresponding to each indicator field and the field decimal places corresponding to each indicator field, or the field type corresponding to each indicator field and the field length corresponding to each indicator field and the field annotation corresponding to each indicator field, or the field type corresponding to each indicator field and the field decimal places corresponding to each indicator field and the field annotation corresponding to each indicator field, or the field length corresponding to each indicator field and the field decimal places corresponding to each indicator field and the field annotation corresponding to each indicator field, or the field type corresponding to each indicator field and the field length corresponding to each indicator field and the field decimal places corresponding to each indicator field and the field annotation corresponding to each indicator field.

[0047] For example, the user-defined indicator is a voltage drop range, and the indicator definition information includes: the indicator name is a voltage drop range, the indicator identification name is voltage_diffs_device_day, and the items corresponding to each indicator field are shown in Table 1 below:

[0048] Table 1 Items corresponding to each indicator field

[0049]

[0050] In some optional embodiments, based on the indicator dimension, querying whether the indicator definition result table exists includes: taking the indicator dimension as the query condition, querying whether there is a first indicator definition result table in the database with the same dimension as the dimension represented by the indicator dimension; if the first indicator definition result table exists, and the account period in the first indicator definition result table is earlier than the account period represented by the indicator account period, the indicator definition result table exists; wherein the indicator dimension includes at least one field.

[0051] In this embodiment, for the voltage drop amplitude indicator, the indicator dimension in the indicator definition information is determined to be device_id, and device_id is used as a query condition to query whether there is a first indicator definition result table in the database whose indicator account period is earlier than the indicator account period of the current indicator definition. If the first indicator definition result table does not exist, an indicator definition result table is created. If the first indicator definition result table exists, there is no need to create the table, and the earliest created indicator definition result table is obtained.

[0052] In some optional embodiments, determining the dimension of the indicator data includes: determining that the indicator dimension includes at least one of the following: the company to which the gas meter belongs, the gas meter number, the gas meter type, the gas meter operator, the gas meter equipment name, and the gas consumption of the gas meter.

[0053] In this implementation, the indicator dimension is determined based on the user's indicator definition requirements, and the indicator dimension corresponding table 2 is shown below:

[0054] Table 2 Indicator dimension correspondence table

[0055] Metric dimension identifier Indicator Dimensions 1 Gas meter company 2 Gas meter number 3 Gas meter version 4 Gas Meter Operators 5 Gas meter equipment name 6 Gas meter gas consumption

[0056] In some optional implementations, the indicator definition result table is created based on the indicator field, including: determining the table name annotation content of the indicator definition result table based on the indicator name; determining the name of the indicator definition result table based on the indicator identification name; determining the table field name in the indicator definition result table based on the indicator field.

[0057] In this embodiment, the method for index definition table building provided by the embodiment of the present invention does not directly build a table through the index definition information, and there is a certain mapping relationship between the index definition result table and the index definition information. Among them, the table name annotation content of the index definition result table can be determined based on the index name, and the name of the index definition result table can be determined based on the index identification name, and the index identification name is not repeated globally; the field type is the data type of the table field in the index definition result table; the field length is the length of the table field in the index definition result table; the field decimal places are the decimal places of the table field in the index definition result table, and it is allowed to be empty; the field comment is the comment of the table field in the index definition result table.

[0058] In some optional implementations, determining indicator definition information based on user-defined indicators includes: determining indicator dimensions and indicator account periods based on user-defined indicators; determining indicator values ​​to be obtained based on the indicator dimensions and indicator account periods; and setting indicator identifiers.

[0059] In this embodiment, after determining the indicator dimension and indicator account period based on the user-defined indicator, determine the indicator value to be obtained. For example, for the definition of the daily gas consumption indicator of the gas meter, determine the indicator dimension as the gas meter number, and obtain the indicator dimension identifier as 2. After the indicator dimension and indicator account period are determined, it can be determined that the indicator value to be obtained is the gas consumption of the gas meter; set the indicator identifier.

[0060] In some optional implementations, the aforementioned method for creating an indicator definition table further includes: if the indicator definition result table exists, storing the indicator data represented by the indicator definition information in the existing indicator definition result table.

[0061] In this way, by storing indicator data of the same indicator dimension in the same database table, the number of indicator result tables automatically created can be controlled to achieve rational use of database resources.

[0062] In some optional implementations, the aforementioned method for index definition table building further includes: providing the index definition result table automatic table building result to the user in the form of a chart for the user to view on each terminal.

[0063] For example, take the definition of the daily gas consumption indicator of a gas meter as an example. The indicator name is: daily gas consumption of a gas meter, the indicator identifier is: device_used_gas, and the indicator fields include: indicator identifier indicator_id, indicator value indicators_val corresponding to used_gas, indicator account period stat_date, and indicator dimension device_id. Based on the indicator dimension corresponding table, the indicator dimension can obtain device_id as '2'. The items corresponding to each indicator field are shown in Table 3 below:

[0064] Table 3 Items corresponding to each indicator field

[0065]

[0066] Create a gas meter daily gas consumption result table based on the indicator field. The SQL statement for creating the table is as follows:

[0067] CREATE TABLE`device_used_gas`(

[0068] `indicators_id` bigint(20) NULL COMMENT 'Indicator id',

[0069] indicators_val decimal(10,3)NULL COMMENT'Gas consumption',

[0070] stat_date date NULL COMMENT'Account period',

[0071] `2` bigint(20) NULL COMMENT 'Device ID'

[0072] )ENGINE=OLAP

[0073] UNIQUE KEY(`indicators_id`,`stat_date`,`1`)

[0074] COMMENT'Gas meter daily gas consumption'

[0075] DISTRIBUTED BY HASH(`stat_date`)BUCKETS1

[0076] PROPERTIES("replication_num"="1")

[0077] By executing the above SQL statement, a gas meter daily gas consumption result table can be obtained based on the gas meter daily gas consumption indicator definition information.

[0078] In this embodiment, a device for defining an indicator table is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and will not be repeated hereafter. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.

[0079] This embodiment provides a device for creating a table for indicator definition. Figure 2 A schematic diagram of the structure of the device for index definition table building according to an embodiment of the present invention is shown. Figure 2 As shown, including:

[0080] The acquisition module 501 is used to acquire the user-defined indicator and determine the indicator definition information based on the user-defined indicator. The indicator definition information includes: indicator fields. The indicator fields include: indicator identifier, indicator value, indicator dimension and indicator account period.

[0081] The query module 502 is used to query whether the indicator definition result table exists based on the indicator dimension.

[0082] Table creation module 503 is used to create an indicator definition result table based on the indicator field if the indicator definition result table does not exist; wherein the indicator identifier is used to uniquely identify the indicator definition information; the indicator account period is used to distinguish the date to which the indicator data represented by the indicator definition information belongs; the indicator dimension is used to determine the dimension to which the indicator data belongs; and the indicator value is used to count the numerical value of the indicator data.

[0083] In some optional implementations, the acquisition module 501 includes:

[0084] The first acquisition unit is used to determine the indicator definition information, and also includes: at least one of the following items corresponding to each indicator field: field type, field length, field decimal places and field comments; indicator name; and / or indicator identification name.

[0085] In some optional implementations, the query module 502 includes:

[0086] The first query unit is used to query whether there is a first indicator definition result table with the same dimension as the indicator dimension represented by the indicator dimension in the database by taking the indicator dimension as the query condition; if the first indicator definition result table exists, and the account period in the first indicator definition result table is earlier than the account period represented by the indicator account period, the indicator definition result table exists; wherein the indicator dimension includes at least one field.

[0087] In some optional implementations, the table building module 503 includes:

[0088] The first meter creation unit is used to determine that the indicator dimensions include at least one of the following: the company to which the gas meter belongs, the gas meter number, the gas meter type, the gas meter operator, the gas meter equipment name and the gas meter gas consumption.

[0089] In some optional implementations, the table building module 503 further includes:

[0090] The second table creation unit is used to determine the table name annotation content of the indicator definition result table based on the indicator name; determine the name of the indicator definition result table based on the indicator identification name; and determine the table field name in the indicator definition result table based on the indicator field.

[0091] In some optional implementations, the second table building unit includes:

[0092] The second table creation first subunit is used to determine the indicator dimension and the indicator account period based on the user-defined indicator; determine the indicator value to be obtained based on the indicator dimension and the indicator account period; and set the indicator identifier.

[0093] In some optional implementations, the aforementioned device for index definition table building further includes:

[0094] The storage module is used to store the indicator data represented by the indicator definition information into the existing indicator definition result table if the indicator definition result table exists.

[0095] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.

[0096] The device for defining indicators and building tables in this embodiment is presented in the form of functional units, where the units refer to application specific integrated circuits (ASICs), processors and memories that execute one or more software or fixed programs, and / or other devices that can provide the above functions.

[0097] The device for creating an indicator definition table provided by an embodiment of the present invention determines indicator definition information based on different indicators defined by a user, automatically maps the table structure when an indicator definition result table does not exist, and automatically creates an indicator definition result table based on the indicator definition information, thereby effectively solving the problem of requiring irregular manual maintenance of the indicator definition result table, saving the cost of manual maintenance of the indicator definition result table, and improving the automation level of the indicator management system.

[0098] The embodiment of the present invention also provides a computer device having the above Figure 2 The device shown is used to define indicators and create tables.

[0099] See also Figure 3 , Figure 3 is a schematic diagram of the structure of a computer device provided by an optional embodiment of the present invention, such as Figure 3 As shown, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process instructions executed in the computer device, including instructions stored in or on the memory to display graphical information of a graphical user interface on an external input / output device (such as a display device coupled to an interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 3 A processor 10 is taken as an example.

[0100] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.

[0101] The aforementioned memory 20 stores instructions executable by at least one processor 10, so that the aforementioned at least one processor 10 executes the method shown in the above embodiment.

[0102] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0103] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.

[0104] The computer device also includes an input device 30 and an output device 40. The processor 10, the memory 20, the input device 30 and the output device 40 may be connected via a bus or other means. Figure 3 The example of connecting through bus is taken in the following.

[0105] The input device 30 can receive input digital or character information, and generate key signal input related to the user settings and function control of the computer device, such as a touch screen, a keypad, a mouse, a track pad, a touch pad, an indicator rod, one or more mouse buttons, a trackball, a joystick, etc. The output device 40 may include a display device, an auxiliary lighting device (such as a light emitting diode) and a tactile feedback device (such as a vibration motor), etc. The above-mentioned display device includes but is not limited to a liquid crystal display, a light emitting diode, a display and a plasma display. In some optional embodiments, the display device can be a touch screen.

[0106] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.

[0107] A part of the present invention may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present invention through the operation of the computer. Those skilled in the art should understand that the existence of the computer program instruction in a computer-readable medium includes, but is not limited to, a source file, an executable file, an installation package file, etc., and accordingly, the way in which the computer program instruction is executed by the computer includes, but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium may be any available computer-readable storage medium or communication medium accessible to the computer.

[0108] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.

Claims

1. A method for defining an indicator table, characterized in that: The method comprises: Obtaining a user-defined indicator, and determining indicator definition information based on the user-defined indicator, wherein the indicator definition information includes: an indicator field, and the indicator field includes: an indicator identifier, an indicator value, an indicator dimension, and an indicator account period; Based on the indicator dimension, query whether the indicator definition result table exists; If the indicator definition result table does not exist, create the indicator definition result table based on the indicator field; wherein the indicator identifier is used to uniquely identify the indicator definition information; the indicator account period is used to distinguish the date to which the indicator data represented by the indicator definition information belongs; the indicator dimension is used to determine the dimension to which the indicator data belongs; and the indicator value is used to count the numerical value of the indicator data.

2. The method according to claim 1, characterized in that: The indicator definition information also includes: At least one of the following corresponding to each of the indicator fields: field type, field length, field decimal places, and field comment; Indicator name; and / or The indicator identification name.

3. The method according to claim 1 or 2, characterized in that: Based on the indicator dimension, query whether the indicator definition result table exists, including: Using the indicator dimension as a query condition, querying a database to see whether there is a first indicator definition result table with the same dimension as that represented by the indicator dimension; If the first indicator definition result table exists, and the account period in the first indicator definition result table is earlier than the account period represented by the indicator account period, the indicator definition result table exists; Wherein, the indicator dimension includes at least one field.

4. The method according to claim 3, characterized in that Determining the dimension of the indicator data includes: Determine that the indicator dimension includes at least one of the following: the company to which the gas meter belongs, the gas meter number, the gas meter type, the gas meter operator, the gas meter equipment name and the gas meter gas consumption.

5. The method according to claim 2, characterized in that: Creating the indicator definition result table based on the indicator field includes: Determine the table name annotation content of the indicator definition result table based on the indicator name; Determine the name of the indicator definition result table based on the indicator identification name; The table field name in the indicator definition result table is determined based on the indicator field.

6. The method according to claim 3, characterized in that Determining indicator definition information based on the user-defined indicator includes: Determining the indicator dimension and the indicator account period based on the user-defined indicator; Based on the indicator dimension and the indicator account period, determine the indicator value to be obtained; Sets the indicator identifier.

7. The method according to claim 6, characterized in that Also includes: If the indicator definition result table exists, the indicator data represented by the indicator definition information is stored in the existing indicator definition result table.

8. A device for defining an indicator table, characterized in that: The device comprises: An acquisition module, used to acquire a user-defined indicator, and determine indicator definition information based on the user-defined indicator, wherein the indicator definition information includes: an indicator field, and the indicator field includes: an indicator identifier, an indicator value, an indicator dimension, and an indicator account period; A query module, used to query whether an indicator definition result table exists based on the indicator dimension; A table creation module is used to create the indicator definition result table based on the indicator field if the indicator definition result table does not exist; wherein the indicator identifier is used to uniquely identify the indicator definition information; the indicator account period is used to distinguish the date to which the indicator data represented by the indicator definition information belongs; the indicator dimension is used to determine the dimension to which the indicator data belongs; and the indicator value is used to count the numerical value of the indicator data.

9. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the method for defining an indicator table according to any one of claims 1 to 7 by executing the computer instructions.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the method for index definition table building according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Big data-based vehicle passing information inquiry method and device

    CN106326358A

  • Data query method and system for relational database, medium and electronic device

    CN110334109A

  • Data processing method and device for data warehouse, medium and computing equipment

    CN111966692A

  • Index configuration method and device, data acquisition method and device, equipment and medium

    CN114358636A

  • Data warehouse development method and device and electronic equipment

    CN118260290A