Database one-key creation method and device, medium and equipment

The one-click database creation method and device solve the problem of complex and time-consuming database creation in existing technologies, and realize fast and efficient database creation and management, meeting the needs of low cost and high practicality.

CN116431600BActive Publication Date: 2026-05-29SIEMENS (CHINA) CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SIEMENS (CHINA) CO LTD
Filing Date
2023-03-01
Publication Date
2026-05-29

AI Technical Summary

Technical Problem

In existing technologies, when creating a database using the database import/export tool that comes with Wincc OA, various attributes need to be configured separately, making the creation process complex and time-consuming.

Method used

A method and apparatus for one-click database creation are provided. The database is created quickly through a point creation module, including creating empty points, obtaining storage paths, determining attribute information, extracting and importing attribute information from data files, supporting the format and unit judgment of data structures, and executing the point creation process serially.

Benefits of technology

It enables rapid database creation, reduces configuration time, ensures the effectiveness of data points, reduces CPU load, simplifies management and maintenance, and meets the requirements of low cost and high practicality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116431600B_ABST
    Figure CN116431600B_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a database one-key creation method and device, medium and equipment. The method comprises: when a database creation key is triggered, a creation process of each point in the database is executed to realize creation of the database; wherein the creation process of each point comprises: creating an empty point; obtaining a storage path of a data file corresponding to the point; determining attribute information of each point that needs to be imported; searching for the data file according to the storage path, extracting attribute information from the found data file according to the attribute information of each point that needs to be imported, and importing the extracted attribute information into the point to realize attribute configuration of the point. Embodiments of the present application can realize one-key creation of a database.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of database technology, and in particular to a one-click database creation method, apparatus, medium, and device. Background Technology

[0002] Currently, users can utilize the controls, scripts, and methods provided by the Wincc OA host computer-based monitoring and programming software to develop and create animated human-machine interfaces for the control system, thereby achieving monitoring of the control system. In the initial development stage, database creation is fundamental to the entire process. The Wincc OA host computer-based monitoring and programming software's built-in database import / export tool configures various data attributes separately, which makes database creation relatively complex. Summary of the Invention

[0003] This invention provides a method, apparatus, medium, and device for one-click database creation, which can realize one-click database creation.

[0004] According to a first aspect, an embodiment of the present invention provides a one-click database creation method, comprising:

[0005] When the database creation button is triggered, the creation process for each point in the database is executed to create the database; wherein the creation process for each point includes:

[0006] Create an empty point;

[0007] Get the storage path of the data file corresponding to this location;

[0008] Determine which attribute information for this location needs to be imported;

[0009] The data file is located according to the storage path. The attribute information of each point to be imported is extracted from the data file and imported into the point to realize the attribute configuration of the point.

[0010] According to a second aspect, an embodiment of the present invention provides a one-click database creation device, comprising:

[0011] The point creation module is used to execute the creation process of each point in the database when the database creation button is triggered, so as to realize the creation of the database. The creation process of each point includes: creating an empty point; obtaining the storage path of the data file corresponding to the point; determining the attribute information of the point that needs to be imported; finding the data file according to the storage path; extracting attribute information from the found data file according to the attribute information of the point that needs to be imported; and importing the extracted attribute information into the point to realize the attribute configuration of the point.

[0012] Thirdly, one embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed in a computer, causes the computer to perform the method described in the first aspect.

[0013] Fourthly, one embodiment of the present invention provides a computing device, including a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, it implements the method provided in the first aspect.

[0014] The one-click database creation method, apparatus, medium, and device provided in this invention, individually or in combination, have at least the following technical effects:

[0015] (1) When a user triggers the database creation button, the creation process for each point is executed. The creation process for each point includes: creating an empty point; obtaining the storage path of the data file corresponding to the point; determining the attribute information to be imported for the point; finding the data file according to the storage path; extracting attribute information from the found data file according to the attribute information to be imported for the point; and importing the extracted attribute information into the point to achieve attribute configuration for the point. Once all points are created, the database creation is complete. In this process, the user only needs to click the database creation button, achieving one-click database creation, which is very convenient for the user. Since the attribute information is extracted from the data file and imported into the point, it is not necessary to configure each attribute information of each point separately, thus greatly shortening the time required for database creation.

[0016] (2) In one embodiment, before extracting attribute information from the data file, the unit and / or format of the attribute information in the data file are judged according to the data structure. Only when all the attribute requirements in the data file meet the format and / or unit requirements in the data structure is the data file considered usable and the attribute information is extracted from the data file. This ensures that the attribute information imported to the point is valid, thereby ensuring that the point is valid and avoiding the creation of unusable points.

[0017] (3) In one embodiment, the creation process of each point in the database is executed serially. That is, the next point will only be created after the creation of one point is completed. If the creation of one point fails, the creation of the next point will not be executed. This method can not only reduce the CPU load, but also avoid the need to continue the creation of the next point if the creation of one point fails, thus reducing useless work. Attached Figure Description

[0018] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0019] Figure 1 This is a flowchart illustrating the creation process of each point in the one-click database creation method in one embodiment of the present invention.

[0020] Figure 2 This is a schematic diagram of the various units included in the creation process for each point in the point creation module of the database one-click creation device in one embodiment of the present invention.

[0021] Figure label:

[0022] S110~S140 step 110 Point creation unit 120 Path acquisition unit 130 Attribute Determination Unit 140 Attribute extraction unit Detailed Implementation

[0023] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are some embodiments of the present invention, but not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the scope of protection of the present invention.

[0024] In a first aspect, embodiments of the present invention provide a one-click database creation method.

[0025] The method provided in this embodiment of the invention can be executed by a computing device. A database creation button is displayed on a page of the computing device. When a user clicks the database creation button, the method provided in this embodiment of the invention is triggered. Since multiple points need to be created in the database, and a creation process needs to be executed for each point, after the creation process for each point is completed, the created database is obtained, thereby achieving one-click database creation.

[0026] The method provided in this embodiment of the invention specifically includes: when the database creation button is triggered, executing the creation process of each point in the database to realize the creation of the database; wherein, the creation process of each point includes the following steps S110 to S140:

[0027] S110, Create an empty point;

[0028] Understandably, a database contains multiple points, which can also be called data points. The purpose of data points is to store data; that is, the data in the database is stored on various data points.

[0029] Understandably, you first create an empty point, and then configure the empty point, for example, by importing relevant attribute information into the empty point. Only then is the creation of such a point complete.

[0030] In one embodiment, creating an empty point in S110 may include: creating an empty point by defining the name of a data structure; wherein the data structure is configured with multiple attribute information formats and / or formats.

[0031] The data structure configures the format and / or unit of multiple attribute information for each point. The format includes, for example, whether the attribute information is floating-point, integer, or another format. The unit includes, for example, whether the unit of flow rate in the alarm attribute is bytes, megabytes, gigabytes, or another unit.

[0032] The data structure is pre-built. The units and / or formats of the attribute information in the data structure are set according to the attribute information requirements of the points, thus the data structure reflects the attribute configuration requirements of the points.

[0033] In a real-world scenario, naming a data structure for the first time creates the first empty point; naming it a second time creates the second empty point. The naming of the data structure can be done using default settings. For example, the first name given to the data structure is "Point 1," thus creating the first empty point "Point 1." The second name given is "Point 2," thus creating the second empty point "Point 2."

[0034] As can be seen, obtaining empty points by naming data structures is a very simple method that does not involve complex logical operations and is easy to implement.

[0035] Furthermore, the data structure may include the unit and / or format of at least one of the following attributes: alarm attribute, archiving attribute, access control attribute, and description attribute.

[0036] Among them, the alarm attribute refers to the attribute that triggers an alarm when the amount of data at a location exceeds a set threshold. The archive attribute refers to the attribute that stores specific data of a parameter within a certain time period at a location, thereby summarizing the changes of that parameter so that users can view the changes of that parameter over a period of time on the host computer. The access control attribute refers to whether the location has access control. The descriptive attribute refers to the attribute that provides a Chinese description of the location or the data within the location.

[0037] Of course, other attributes can also be included, which will not be introduced here.

[0038] S120. Obtain the storage path of the data file corresponding to this location;

[0039] For example, if 1000 data points need to be created in the database, 1000 data files can be set in advance. When the first data point is created, the storage path of the first data file corresponding to the first data point is obtained.

[0040] Each point's file data stores various attribute information for that point. Each point's corresponding data file is pre-formed and stored on a local device or server. Therefore, each point's corresponding data file has its own storage path. In S120, the storage path of the data file corresponding to that point must be obtained in order to import attribute information in subsequent steps.

[0041] S130. Determine the attribute information of the point that needs to be imported;

[0042] Understandably, the attribute information that needs to be configured for different locations may differ, meaning that the attribute information that needs to be imported for different locations may also differ. For example, the first location may need to import alarm attributes, description attributes, etc., while the second location may need alarm attributes, description attributes, archive attributes, etc.

[0043] Which point or which attribute information needs to be imported can be pre-configured. Therefore, based on the pre-configured information, it can be determined which attribute information needs to be imported for the current point.

[0044] S140. Locate the data file according to the storage path, extract the attribute information from the found data file according to the attribute information of the point to be imported, and import the extracted attribute information into the point to realize the attribute configuration of the point.

[0045] That is, the corresponding data file can be found according to the storage path found in S120. Then, according to the attribute information of the point that needs to be imported as determined in S130, the attribute information is extracted from the data file and then imported into the point. When all the attribute information of the point that needs to be imported as determined in S130 has been extracted and imported into the point, the attribute configuration work of the point is completed, that is, the creation work of the point is completed.

[0046] In one embodiment, the step of extracting attribute information from the found data file according to the required import of various attribute information of the point in S140 may include: extracting attribute information from the data file by cyclic scanning according to the required import of various attribute information of the point.

[0047] Understandably, a single data point typically requires multiple attribute information entries. Therefore, a cyclic scanning method can be used to extract the necessary attribute information from the data file. This cyclic scanning method involves first scanning the data file corresponding to the data point based on the first attribute information determined in S130 that needs to be imported, and then extracting the scanned attribute information. Then, based on the second attribute information determined in S130 that needs to be imported, the data file is scanned again, and the scanned attribute information is extracted. This process continues until all the attribute information determined in S130 that needs to be imported from the data file is extracted.

[0048] In one embodiment, before extracting attribute information from the found data file according to the required import of various attribute information of the point in S140, the process may further include:

[0049] Determine whether the format of the attribute information in the data file conforms to the format configured in the data structure for the same attribute information, and determine whether the unit of the attribute information in the data file conforms to the unit configured in the data structure for the same attribute information; if all attribute information in the data file conforms to the format and / or unit configured in the data structure for the corresponding attribute information, then execute the step "extract attribute information from the found data file according to the attribute information of the point that needs to be imported".

[0050] In other words, the system first determines whether the format of the attribute information in the data file found according to the storage path determined in S120 matches the format of the same attribute information in the data structure, and whether the unit of the attribute information in the data file found according to the storage path determined in S120 matches the unit of the same attribute information in the data structure. For example, for the alarm attribute, if the data structure has a unit for flow rate, the system determines whether the unit of flow rate for the alarm attribute in the data file is consistent with the unit of flow rate for the alarm attribute in the data structure. Similarly, for the description attribute, if the data structure has a format for description information, the system determines whether the format of the description attribute in the data file is consistent with the format of the description attribute in the data structure. If all the attribute requirements in the data file meet the format and / or unit requirements in the data structure, the data file is considered usable, and attribute information is extracted from the data file. Otherwise, attribute information cannot be extracted from the data file, the attribute information import operation for that point fails, and the user needs to be notified that the point creation failed, which in turn leads to the failure of the entire database creation.

[0051] Understandably, this method avoids the possibility that the attribute information imported into the point will be valid later, thus ensuring that the point is valid.

[0052] In one embodiment, before executing the creation process of each point in the database, the method may further include: performing secondary classification on the various attribute information involved in creating the database, forming data files corresponding to each point based on the classification results, and storing the data files.

[0053] In other words, the process of creating a data file is as follows: First, the attribute information is classified a second time, and then a data file is created based on the classification results. The so-called second classification refers to first classifying the attribute information according to attribute type, and then classifying it according to location. This process then creates a data file corresponding to each location based on the attribute information of each type. In other words, each attribute information is first labeled with its attribute type, then the location requiring that attribute information is labeled, and finally, based on the labeling information of each attribute information, a data file corresponding to each location is created.

[0054] As can be seen, this method makes it easy to organize the data files for each location.

[0055] In one embodiment, the process of creating each point in the execution database may specifically include: executing the creation process of each point in the database serially. That is, the creation process of each point is performed sequentially, i.e., serially. Only after one point is created will the next point be created. If the creation of one point fails, the creation of subsequent points will not be executed. This method can not only reduce the CPU load, but also avoid continuing to create the next point if one point creation fails, thus reducing wasted work.

[0056] Understandably, since attribute information can include alarm attributes, archiving attributes, and access control attributes, these attributes can be directly extracted from the data file and imported into the points, eliminating the need for individual configuration of each point's attribute information. This significantly reduces the time required for database creation. Furthermore, the unit and / or format of attribute information in the data file can be determined based on the data structure, further ensuring the validity of the point's attribute information.

[0057] The creation of data structures can be achieved through function calls. These functions include both standard functions from the Wincc OA monitoring and programming software and project functions derived through secondary development. By combining these two types of functions, the aforementioned data structures can be created. Furthermore, preliminary tasks such as data file creation can also be accomplished through function calls. The development of these functions is not limited by the Wincc OA software's own licensing restrictions. The creation process is fast, point management is convenient, and subsequent maintenance is simple, meeting the requirements of low cost and high practicality.

[0058] Furthermore, the method provided in this embodiment of the invention can be implemented using the C programming language. By implementing the above steps through C programming, one-click database creation can be achieved. Since all the technologies used are open source, the technical risks are relatively low, and development time is shortened.

[0059] Secondly, embodiments of the present invention provide a one-click database creation device, the device comprising:

[0060] The point creation module is used to execute the creation process of each point in the database when the database creation button is triggered, so as to realize the creation of the database.

[0061] Among them, see Figure 2 The creation process for each point in the point creation module includes the following units:

[0062] Point creation unit 110 is used to create an empty point;

[0063] The path acquisition unit 120 is used to acquire the storage path of the data file corresponding to the point;

[0064] The attribute determination unit 130 is used to determine the attribute information of the point that needs to be imported.

[0065] The attribute extraction unit 140 is used to locate the data file according to the storage path, extract attribute information from the located data file according to the attribute information of the point to be imported, and import the extracted attribute information into the point to realize the attribute configuration of the point.

[0066] In one embodiment, the point creation unit is specifically used to: create an empty point by defining the name of a data structure; wherein the data structure is configured with multiple attribute information formats and / or formats.

[0067] In one embodiment, before extracting attribute information from the found data file according to the attribute information of the point to be imported, the attribute extraction unit is further configured to: determine whether the format of the attribute information in the data file conforms to the format configured in the data structure for the same attribute information, and determine whether the unit of the attribute information in the data file conforms to the unit configured in the data structure for the same attribute information; if all attribute information in the data file conforms to the format and / or unit configured in the data structure for the corresponding attribute information, then the step "extract attribute information from the found data file according to the attribute information of the point to be imported" is executed.

[0068] In one embodiment, the data structure includes the unit and / or format of at least one of the following attributes: alarm attribute, archive attribute, access control attribute, and description attribute.

[0069] In one embodiment, the attribute extraction unit is specifically used to: extract attribute information from the data file by cyclically scanning, according to the required import of various attribute information of the point.

[0070] In one embodiment, before the point creation module executes the creation process of each point in the database, it is further configured to: perform secondary classification on the various attribute information involved in creating the database, form a data file corresponding to each point according to the classification result, and store the data file.

[0071] In one embodiment, the point creation module is specifically used to: serially execute the creation process of each point in the database.

[0072] It is understood that explanations, specific implementation methods, beneficial effects, examples, etc. of the contents of the apparatus provided in the embodiments of the present invention can be found in the corresponding parts of the method provided in the first aspect, and will not be repeated here.

[0073] According to a third aspect, one embodiment of this specification provides a computer-readable storage medium having a computer program stored thereon that, when executed in a computer, causes the computer to perform the methods of any embodiment of the specification.

[0074] It is understood that explanations, specific implementation methods, beneficial effects, examples, etc. of the contents in the computer-readable medium provided in the embodiments of the present invention can be found in the corresponding parts of the method provided in the first aspect, and will not be repeated here.

[0075] According to a fourth aspect, one embodiment of this specification provides a computing device including a memory and a processor, wherein the memory stores executable code, and the processor, when executing the executable code, implements the method of any embodiment of the specification.

[0076] It is understood that explanations, specific implementation methods, beneficial effects, examples, etc. of the computing device provided in the embodiments of the present invention can be found in the corresponding parts of the method provided in the first aspect, and will not be repeated here.

[0077] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the apparatus embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions of the method embodiments.

[0078] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made on the basis of the technical solution of the present invention should be included within the scope of protection of the present invention.

Claims

1. A one-click database creation method, characterized in that, include: When the database creation button is triggered, the creation process for each point in the database is executed to create the database; wherein the creation process for each point includes: Create an empty point; Get the storage path of the data file corresponding to this location; Determine which attribute information for this location needs to be imported; The data file is located according to the storage path. Attribute information for the required location is extracted from the located data file and imported into the location to configure its attributes. Creating an empty point includes: creating an empty point by defining a name for a data structure; wherein the data structure is configured with units and / or formats for multiple attribute information. The data structure includes at least one of the following attributes: alarm attribute, archive attribute, access control attribute, and description attribute, specifying the unit and / or format.

2. The method according to claim 1, characterized in that, Before extracting attribute information from the found data file according to the required import of various attribute information of the point, the method further includes: Determine whether the format of the attribute information in the data file conforms to the format configured in the data structure for the same attribute information, and determine whether the unit of the attribute information in the data file conforms to the unit configured in the data structure for the same attribute information. If each attribute information in the data file conforms to the format and / or unit configured for the corresponding attribute information in the data structure, then the step "extract attribute information from the found data file according to the attribute information of the point that needs to be imported" is executed.

3. The method according to claim 1, characterized in that, The step of extracting attribute information from the found data file according to the required attribute information of the point includes: According to the requirements, import the attribute information of the point and extract the attribute information from the data file by cyclic scanning.

4. The method according to claim 1, characterized in that, Before the process of creating each point in the execution database, the method further includes: The various attribute information involved in creating the database is classified a second time, and data files corresponding to each point are formed according to the classification results, and the data files are stored.

5. The method according to claim 1, characterized in that, The process of creating each point in the execution database includes: serially executing the process of creating each point in the database.

6. A computer-readable storage medium, characterized in that, It stores a computer program that, when executed in a computer, causes the computer to perform the method described in any one of claims 1 to 5.

7. A computing device, characterized in that, The method includes a memory and a processor, wherein the memory stores executable code, and the processor executes the executable code to implement the method described in any one of claims 1 to 5.