Data storage methods, devices, storage media and electronic devices
Patent Information
- Application Number
- CN202211049919.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-30
- Publication Date
- 2026-09-18
- Estimated Expiration
- 2042-08-30
AI Technical Summary
[0005]本申请实施例提供了一种数据存储方法、装置、存储介质及电子装置,以至少解决相关技术中,如何根据目标对象的选择操作对数据进行存储的问题
[0016]In this embodiment, multiple data storage types provided by the data storage platform are obtained; a selection operation of a target object is received to determine the target data storage type corresponding to the data to be stored from the multiple data storage types; a storage area pre-set for the target data storage type in the data storage platform is obtained, and the data to be stored is stored in the storage area; by adopting the above technical solution, the problem of how to store data according to the selection operation of the target object is solved, and thus data storage can be realized according to the selection operation of the target object, that is, data storage can be performed according to user needs.
Smart Images

Figure CN117666930B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of smart home technology, and more specifically, to a data storage method, apparatus, storage medium, and electronic device. Background Technology
[0002] Currently, with the information explosion, the volume of data is growing exponentially. It's no exaggeration to say that data is crucial to people's lives. In this era, people not only have increasingly higher demands for data storage security, but also hope to store data accurately and conveniently while ensuring security. Currently, the urgent problem for users is how to accurately store data according to their needs.
[0003] However, the solutions in related technologies to address this problem are simply to classify the data first and then store it. This classification method is too fixed and lacks flexibility, making it impossible to achieve fast and accurate storage according to user needs.
[0004] Therefore, no effective solution has yet been proposed for the problem of how to store data based on the selection operation of the target object in related technologies. Summary of the Invention
[0005] This application provides a data storage method, apparatus, storage medium, and electronic device to at least solve the problem in the related art of how to store data based on the selection operation of a target object.
[0006] According to one embodiment of this application, a data storage method is provided, comprising: obtaining a plurality of data storage types provided by the data storage platform; receiving a selection operation of a target object to determine a target data storage type corresponding to the data to be stored from the plurality of data storage types; obtaining a storage area pre-set for the target data storage type in the data storage platform, and storing the data to be stored in the storage area.
[0007] In one exemplary embodiment, obtaining multiple data storage types provided by the data storage platform includes: obtaining data configuration tags provided by the data storage platform, wherein the data configuration tags include at least one of the following: data access method tag, data access type tag, data model tag, and data storage unit tag; and determining the multiple data storage types based on the data configuration tags.
[0008] In one exemplary embodiment, receiving a selection operation of a target object to determine a target data storage type corresponding to the data to be stored from the plurality of data storage types includes: determining, based on the selection operation of the target object, a target data access method corresponding to the data access method label, a target data access type corresponding to the data access type label, a target data model corresponding to the data model label, and a target data storage unit corresponding to the data storage unit label from the plurality of data storage types; wherein, the target data model is a target data model provided by the data storage platform when the selection operation of the target object indicates the selection of a model; and determining the target data storage type corresponding to the data to be stored based on the target data access method, the target data access type, the target data model, and the target data storage unit.
[0009] In one exemplary embodiment, the method further includes: determining a target data model corresponding to the data model tag from the plurality of data storage types based on the selection operation of the target object, including: determining a model creation operation corresponding to the data model tag when the selection operation of the target object indicates the creation of a new model; obtaining a configuration parameter type provided for the model creation operation in the data storage platform, and obtaining a first data model provided for the model creation operation in the data storage platform; wherein the configuration parameter type includes at least one of the following: model name, model field name, model field type, primary key information, and the first data model represents an unconfigured model template; obtaining a target configuration parameter corresponding to the configuration parameter type; configuring the first data model based on the target configuration parameter to obtain the target data model.
[0010] In an exemplary embodiment, before configuring the first data model based on the target configuration parameters to obtain the target data model, the method further includes: performing a validity check on the target access data type of the data to be stored; if the check is passed, obtaining the data storage queue created for the target access data type in the data storage platform, and the first data storage area created for the target access data type in the data storage platform; establishing a correspondence between the target access data type, the data storage queue corresponding to the target access data type, and the first data storage area corresponding to the target access data type, so as to provide the first data model for the model building operation based on the correspondence.
[0011] In an exemplary embodiment, obtaining a storage area pre-set for the target data storage type in the data storage platform includes: determining a data storage method corresponding to the target data storage unit, wherein the data storage method includes at least one of the following: a first storage method using storage units and databases, a second storage method using at least two of the storage units, and a third storage method using at least two of the databases; and determining the storage area corresponding to the data storage method as a storage area pre-set for the target data storage type in the data storage platform.
[0012] In an exemplary embodiment, storing the data to be stored in the storage area includes: grouping the data to be stored according to the target data access type to obtain multiple groups of first data; for each group of first data, performing data splitting processing according to a data splitting structure to obtain second data; wherein the data splitting structure includes at least: a data verification layer for verifying each group of first data, a business processing layer for service forwarding, task scheduling, and task execution of each group of first data, and a logical splitting layer for matching each group of first data that passes verification to the business processing layer; and storing the second data in the storage area.
[0013] According to another embodiment of the present application, a data storage device is also provided, comprising: an acquisition module, configured to acquire multiple data storage types provided by the data storage platform; a receiving module, configured to receive a selection operation of a target object to determine a target data storage type corresponding to the data to be stored from the multiple data storage types; and a storage module, configured to acquire a storage area pre-set for the target data storage type in the data storage platform and store the data to be stored in the storage area.
[0014] According to another aspect of the embodiments of this application, a computer-readable storage medium is also provided, wherein a computer program is stored in the computer-readable storage medium, and the computer program is configured to execute the above-described data storage method when it is run.
[0015] According to another aspect of the embodiments of this application, an electronic device is also provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the above-described data storage method through the computer program.
[0016] In this embodiment, multiple data storage types provided by the data storage platform are obtained; a selection operation of a target object is received to determine the target data storage type corresponding to the data to be stored from the multiple data storage types; a storage area pre-set for the target data storage type in the data storage platform is obtained, and the data to be stored is stored in the storage area; by adopting the above technical solution, the problem of how to store data according to the selection operation of the target object is solved, and thus data storage can be realized according to the selection operation of the target object, that is, data storage can be performed according to user needs. Attached Figure Description
[0017] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0018] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0019] Figure 1 This is a schematic diagram of the hardware environment for a data storage method according to an embodiment of this application;
[0020] Figure 2 This is a flowchart of a data storage method according to an embodiment of this application;
[0021] Figure 3 This is a data interaction diagram of a data storage platform according to an embodiment of this application;
[0022] Figure 4 This is a flowchart illustrating a data storage method according to an embodiment of this application;
[0023] Figure 5 This is a schematic diagram illustrating the data access method configuration according to an embodiment of this application;
[0024] Figure 6 This is a schematic diagram illustrating the creation of a page based on a data model according to an embodiment of this application;
[0025] Figure 7 This is a schematic diagram of the data model creation process according to an embodiment of this application;
[0026] Figure 8 This is a schematic diagram of data splitting according to an embodiment of this application;
[0027] Figure 9 This is a flowchart (a) of the stored data according to an embodiment of this application;
[0028] Figure 10 This is a flowchart (II) of the storage data according to an embodiment of this application;
[0029] Figure 11 This is a flowchart (iii) of the storage data according to an embodiment of this application;
[0030] Figure 12 This is a flowchart illustrating the query data according to an embodiment of this application;
[0031] Figure 13 This is a structural block diagram of a data storage device according to an embodiment of this application. Detailed Implementation
[0032] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.
[0033] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0034] According to one aspect of the embodiments of this application, a data storage method is provided. This data storage method is widely used in whole-house intelligent digital control application scenarios such as smart homes, smart home ecosystems, and intelligencehouse ecosystems. Optionally, in this embodiment, the above-mentioned data storage method can be applied to, for example... Figure 1 The hardware environment shown consists of terminal device 102 and server 104. For example... Figure 1As shown, server 104 is connected to terminal device 102 via a network and can be used to provide services (such as application services) to the terminal or clients installed on the terminal. A database can be set up on the server or independently of the server to provide data storage services for server 104. Cloud computing and / or edge computing services can be configured on the server or independently of the server to provide data processing services for server 104.
[0035] The aforementioned network may include, but is not limited to, at least one of the following: wired network, wireless network. The aforementioned wired network may include, but is not limited to, at least one of the following: wide area network, metropolitan area network, local area network. The aforementioned wireless network may include, but is not limited to, at least one of the following: Wi-Fi (Wireless Fidelity), Bluetooth. The terminal device 102 may not be limited to PC, mobile phone, tablet computer, smart air conditioner, smart range hood, smart refrigerator, smart oven, smart stove, smart washing machine, smart water heater, smart washing equipment, smart dishwasher, smart projector, smart TV, smart clothes rack, smart curtains, smart audio-visual equipment, smart socket, smart speaker, smart speaker box, smart fresh air equipment, smart kitchen and bathroom equipment, smart bathroom equipment, smart robot vacuum cleaner, smart window cleaning robot, smart mopping robot, smart air purifier, smart steam oven, smart microwave oven, smart water heater, smart air purifier, smart water dispenser, smart door lock, etc.
[0036] This embodiment provides a data storage method applied to the aforementioned computer terminal. Figure 2 This is a flowchart of a data storage method according to an embodiment of this application, which includes the following steps:
[0037] Step S202: Obtain multiple data storage types provided by the data storage platform;
[0038] Step S204: Receive a target object selection operation to determine the target data storage type corresponding to the data to be stored from the plurality of data storage types;
[0039] Step S206: Obtain the storage area pre-set for the target data storage type in the data storage platform, and store the data to be stored in the storage area.
[0040] Through the above steps, multiple data storage types provided by the data storage platform are obtained; a selection operation of the target object is received to determine the target data storage type corresponding to the data to be stored from the multiple data storage types; a storage area pre-set for the target data storage type in the data storage platform is obtained, and the data to be stored is stored in the storage area. This solves the problem in related technologies of how to store data according to the selection operation of the target object, and thus enables data storage according to the selection operation of the target object, that is, data storage can be performed according to user needs.
[0041] In an exemplary embodiment, a technical solution is provided to implement the above step S202 of obtaining multiple data storage types provided by the data storage platform, including: obtaining data configuration tags provided by the data storage platform, wherein the data configuration tags include at least one of the following: data access method tag, data access type tag, data model tag, and data storage unit tag; and determining the multiple data storage types according to the data configuration tags.
[0042] It should be noted that the aforementioned data storage platform can also display to users the data storage type determined based on the data configuration tags, for example, such as... Figure 5 As shown, the data storage type corresponding to the data access method can be identified by the data access method tag, the data storage type corresponding to the access data type can be identified by the data access type tag, the data storage type corresponding to the data model can be identified by the data model tag, and the data storage type corresponding to the data storage unit can be identified by the data storage unit tag. The selectable options for data access methods include "File Entry," "Message Subscription," and "Interface Entry." The selectable options for access data types include "MQ" and "FILE." The selectable options for data models include "Select a pre-existing model in the system or create a new model." The selectable options for data storage units include ignite, Es, and Hazelcast.
[0043] In an exemplary embodiment, to better understand the process of selecting a target object in step S204 above to determine the target data storage type corresponding to the data to be stored from the plurality of data storage types, the target data access method corresponding to the data access method label, the target data access type corresponding to the data access type label, the target data model corresponding to the data model label, and the target data storage unit corresponding to the data storage unit label can be further determined from the plurality of data storage types according to the target object selection operation; wherein, the target data model is the target data model provided by the data storage platform when the target object selection operation indicates the selection of a model; the target data storage type corresponding to the data to be stored is determined according to the target data access method, the target data access type, the target data model, and the target data storage unit.
[0044] It should be noted that the above-mentioned target object selection operation, indicating the selection of a model, can be understood as the user selecting "select a model newly created in the system" from the available data model options. Therefore, the above-mentioned determination of the target data model corresponding to the data model label from the multiple data storage types based on the target object selection operation can be understood as determining the target data model based on the model selected by the user from "models newly created in the system".
[0045] The above-mentioned method of determining the target data access method corresponding to the data access method label from the multiple data storage types based on the selection operation of the target object can be understood as the user selecting any one of "file entry", "message subscription" or "interface entry" from the selectable data access methods, and the target data access method is determined based on the user's selection result.
[0046] The above-mentioned selection operation of the target object to determine the target data access type corresponding to the data access type label from the multiple data storage types can be understood as the user selecting either "MQ" or "FILE" from the selectable access data types, and determining the target data access type based on the user's selection result.
[0047] The above-mentioned selection of the target data storage unit corresponding to the data storage unit label from the multiple data storage types based on the selection operation of the target object can be understood as the user selecting any one of ignite, Es, and Hazelcast from the selectable options of data storage units, and determining the target data storage unit based on the user's selection result.
[0048] Furthermore, the target data access method, the target data access type, the target data model, and the target data storage unit can be determined as the target data storage type corresponding to the data to be stored, such as... Figure 5 As shown, after determining the target data storage type, users can complete the data access method configuration process through the "Publish Configuration" button.
[0049] In one exemplary embodiment, an implementation scheme is also proposed for determining a target data model corresponding to the data model label from the plurality of data storage types based on the selection operation of the target object. The specific steps include: when the selection operation of the target object indicates the creation of a new model, determining the model creation operation corresponding to the data model label; obtaining the configuration parameter type provided for the model creation operation in the data storage platform, and obtaining the first data model provided for the model creation operation in the data storage platform; wherein the configuration parameter type includes at least one of the following: model name, model field name, model field type, primary key information, and the first data model represents an unconfigured model template; obtaining the target configuration parameter corresponding to the configuration parameter type; configuring the first data model based on the target configuration parameter to obtain the target data model.
[0050] It should be noted that the above configuration parameter types can be, for example, as follows: Figure 6 The "model name", "field name", and "field type" are among them.
[0051] like Figure 6 As shown, the above target object selection operation indicating the creation of a new model corresponds to the user selecting "Create New Model" from the available options for the data model. The model name could be represented, for example, as... Figure 6 In the context of "INGITE_MODULE", the aforementioned model field name can be represented as, for example, as... Figure 6 In the example, "Field1" in the above model field type can be represented as: Figure 6 The "String" in the above primary key information can be understood as whether the field is a primary key. If the user does not specify it, it can be assumed to be not a primary key. For example... Figure 6 As shown, users can complete the process of creating a new data model by clicking the "Publish Configuration" button.
[0052] In an exemplary embodiment, before configuring the first data model based on the target configuration parameters to obtain the target data model, a technical solution is further implemented as follows: The legality of the target access data type of the data to be stored is verified; if the verification is successful, a data storage queue created for the target access data type in the data storage platform and a first data storage area created for the target access data type in the data storage platform are obtained; a correspondence is established between the target access data type, the data storage queue corresponding to the target access data type, and the first data storage area corresponding to the target access data type, so as to provide the first data model for the model building operation based on the correspondence.
[0053] In an exemplary embodiment, to better understand how the scheme for obtaining the storage area pre-set for the target data storage type in the data storage platform in step S206 above is provided, the following steps are provided: determining the data storage method corresponding to the target data storage unit, wherein the data storage method includes at least one of the following: a first storage method using storage units and database storage, a second storage method using at least two of the storage units, and a third storage method using at least two of the databases; and determining the storage area corresponding to the data storage method as the storage area pre-set for the target data storage type in the data storage platform.
[0054] It should be noted that the above storage units can refer to storage tools used to implement storage, including but not limited to Ignite, Elasticsearch, etc., and the above databases can include Redis+MySQL, etc.
[0055] The first storage method mentioned above may include Ignite+mysql, the second storage method mentioned above may include Ignite+Elasticsearch, and the third storage method mentioned above may include redis+mysql. This application does not impose any restrictions on this.
[0056] In an exemplary embodiment, a technical solution is also provided for implementing step S206 above, which involves storing the data to be stored in the storage area. The specific steps include: grouping the data to be stored according to the target data access type to obtain multiple groups of first data; for each group of first data, performing data splitting processing according to a data splitting structure to obtain second data; wherein the data splitting structure includes at least: a data verification layer for verifying each group of first data, a business processing layer for service forwarding, task scheduling, and task execution of each group of first data, and a logical splitting layer for matching each group of first data that passes verification to the business processing layer; and storing the second data in the storage area.
[0057] To better understand the process of the above data storage method, the implementation flow of the above data storage method will be described below in conjunction with optional embodiments, but this is not intended to limit the technical solution of the embodiments of this application.
[0058] Figure 3 This is a data interaction diagram of a data storage platform according to an embodiment of this application, such as... Figure 3 As shown, this embodiment provides a data storage platform (i.e., a digital middleware data engine). The data storage platform can provide data query engines for all modules, such as Apache Ignite, Redis, Hazelcast, Elasticsearch, and MySQL. It can also implement the function of user-input query parameters through the front-end UI interface. After the user inputs the query parameters, the query parameters are obtained from the front-end UI interface using JavaScript, and then the back-end data engine API is called to obtain the data corresponding to the query parameters.
[0059] In the data storage platform, the front-end UI is responsible for user configuration, including configuration parameter structure and storage structure. The presentation layer serves as an intermediary layer for front-end and back-end exchange, handling data rendering and other processing. The business layer processes the UI user configuration, determining the data storage structure (MySQL or Redis, etc.) based on the front-end configuration data and establishing data storage channels. The data layer directly calls storage tools for data storage, using corresponding tool call programs or custom functions and algorithms to operate various storage tools. For example, it can use streaming computing to filter useless data, call the Ignite (distributed cluster) operation program to set the data storage backup mode, and operate the corresponding mode. Custom functions are used as upper-layer callbacks to notify the caller of the execution results. Transaction configuration maintains data consistency and security, ensuring overall data rollback in case of partial operation failure. Databases that the data layer can read and write to include Apache Ignite, Redis, Hazelcast, MySQL, and Hazelcast. The runtime environment can use the mature Kubernetes container deployment, which can efficiently solve problems such as circuit breaking and horizontal scaling, ensuring more stable system operation.
[0060] Each data model module is an internal data structure model used to receive and transmit DTO parameters, with a one-to-one correspondence between the module and the DTO parameters. Different data models have different DTO parameters, and each DTO parameter corresponds to a data storage unit. The storage structure of the data storage unit corresponding to each module is unique; for example, Apache Ignite corresponds to igniteCache, Elasticsearch corresponds to index, and MySQL corresponds to table.
[0061] In the execution layer, user-input parameters can also be validated.
[0062] Before storing data, you can use the data query engine to query whether the data to be stored corresponds to the operation type of creating new data or the operation type of updating data.
[0063] Optionally, in one embodiment, a query API can also be encapsulated to enable queries on different modules.
[0064] Among these, the data storage process within the presentation layer, business layer, and data layer is a crucial step in achieving data storage, and can be combined with... Figure 4 To explain, Figure 4 This is a flowchart illustrating a data storage method according to an embodiment of this application; as shown below. Figure 4 As shown, the specific steps are as follows:
[0065] Step S401: Configure data (i.e., data to be stored) on the UI;
[0066] Step S402: Determine the data type to be input (equivalent to the data access type mentioned above); classify the data to be stored according to different data access types;
[0067] Step S403: Determine the data access type as "message subscription";
[0068] Step S404: Determine the data access type as "file entry";
[0069] Step S405: Determine the data access type as "interface entry type";
[0070] Furthermore, the following information in steps S403-S405 can be determined: data access type, SUBSCRIBE additional information, subscription type, and usage scenario type.
[0071] Step S406: Perform data splitting processing;
[0072] Step S407: Verify whether it can operate normally; if yes, proceed to step S409; if no, proceed to step S408.
[0073] Step S408: Return the exception verification result to the front end (i.e., the UI);
[0074] Step S409: Send the task to the execution service and execute the storage scheme using data storage method in steps S410-S412;
[0075] Step S410: Determine the data storage method to use "Ignite+mysql" (equivalent to the first storage method mentioned above) to store the data;
[0076] Step S411: Determine the data storage method to use, "Ignite + Elasticsearch" (equivalent to the second storage method mentioned above);
[0077] Step S412: Determine the data storage method to use "redis+mysql" (equivalent to the third storage method mentioned above) to store the data;
[0078] Step S413: Return the execution result of data storage.
[0079] Through the steps outlined above, a data storage parameter configuration interface is provided based on the user-provided data storage platform. Data is grouped according to the data access method to allow for simultaneous processing of data within different groups. Next, the data SDK is used to process the data, and after successful verification, the data is stored using different data storage methods.
[0080] In short, the focus of this application is to provide a platform that allows users to configure storage methods, obtain the parameters of the data to be stored configured by the user on the UI, and then store the data to be stored according to the corresponding data storage method.
[0081] In one embodiment, such as Figure 5 As shown, on the "Data Access Method Configuration" page in the UI, users can select the data access method using the "Please Select Data Access Method" button (corresponding to the "Data Access Method" label above), the data access type using the "Please Select Data Access Type" button (corresponding to the "Data Access Type" label above), the data model using the "Please Select Data Model" button (corresponding to the "Data Model" label above), and the data storage unit using the "Please Select Data Storage Unit" button (corresponding to the "Data Storage Unit" label above). After successful configuration, clicking the "Publish Configuration" button will automatically configure the data access service link on the data storage platform.
[0082] In one embodiment, it can be combined Figure 6 The process of creating a new data model is explained, such as... Figure 6 As shown, when selecting a data model, users can create a module by clicking the MODULE button on the page. Taking user A as an example, after entering a model name, user A clicks the "Publish Configuration" or "Save" button. The data storage platform will validate the model name to avoid duplicate names. Next, if user A clicks "Add Field," they can continue to enter the field name, field type, and whether it is a primary key. The field name and field type are required, while "Primary Key" is optional and defaults to "No." Finally, clicking "Publish Configuration" will automatically save the newly created model.
[0083] In one embodiment, for example, if the user configures the data type as Ignite storage and the access method as message subscription, and the module corresponds to the data field in the message body, this process will create data storage in the Ignite data channel. Each time the message queue receives a message, the service will automatically consume the data in the queue and store it in the Ignite component.
[0084] Furthermore, it can be based on Figure 7 The process of creating a data model is explained below, with the specific steps as follows:
[0085] Step S701: Begin model creation;
[0086] Step S702: Configure the module field, field type, and whether it is an index;
[0087] Step S703: Determine if the dateType is valid; if yes, proceed to step S704; otherwise, proceed to step S702.
[0088] Step S704: Determine the dateType;
[0089] Step S705: Create the corresponding Ignite cache (equivalent to the first data storage area mentioned above);
[0090] Step S706: Create the corresponding cluster queue (equivalent to the data storage queue mentioned above);
[0091] Step S707: Create tables corresponding to the ignite cache, cluster queue, and dateType types (equivalent to the correspondence between the target access data type, the data storage queue corresponding to the target access data type, and the first data storage area corresponding to the target access data type);
[0092] Step S708: Determine whether the creation was successful; if yes, proceed to step S709; otherwise, proceed to step S701.
[0093] Step S709: Return a success message.
[0094] In one embodiment, combined Figure 8 Explain the data splitting process, such as Figure 8 As shown, the data offloading service essentially processes data sequentially using a data validation layer, a logical offloading layer, and a service forwarding layer, based on the configuration parameters input by the user at the front end (equivalent to the target configuration parameters mentioned above). The logical offloading layer matches the user's configuration parameters to the next business processing layer, which is a collective term for a service forwarding layer, a task scheduling layer, and an execution layer. Based on the concept of distributed processing, there can be multiple task scheduling layers and services to improve efficiency. The step from task distribution to task execution can be implemented by the "execution layer" of the data offloading service or by the "execution environment" of the digital middleware data engine.
[0095] Next, combined Figure 9-11 This section explains the data storage process using different data storage methods.
[0096] For data storage methods like Ignite+MySQL, such as Figure 9 As shown, the storage process is as follows:
[0097] Step S1: Obtain the storage parameter DTO;
[0098] Step S2: Obtain the igniteCache corresponding to the data storage method Ignite+mysql;
[0099] Specifically, when initializing the cache without obtaining igniteCache, an igniteCache corresponding to the data storage method Ignite+mysql is initialized within the cache area.
[0100] Step S3: Query the data to be stored using the data query engine;
[0101] Step S4: Determine whether the data to be stored has already been stored;
[0102] Step S5: If the data to be stored has not been stored, it means that the data to be stored is new data, and it is stored in the ignite Cache;
[0103] Step S6: If the data to be stored has already been stored, it means the data is consistent, and no update or entry operation is performed;
[0104] Step S7: Return a success result;
[0105] Step S8: Return failure result.
[0106] For data storage methods like Ignite + Elasticsearch, such as Figure 10 As shown, the storage process is as follows:
[0107] Step S1: Store the data DTO;
[0108] Step S2: Obtain the corresponding index and mapping;
[0109] Step S3: Obtain the storage unit;
[0110] Step S4: Verify the existence of data by querying the data through the data engine;
[0111] Step S5: If data exists, update the data;
[0112] Step S6: Store the data; for example, the sequence index of the data can be stored.
[0113] Step S7: Determine whether the save was successful; if the save was successful, return a success result; if the save failed, send a message to the user to indicate that the save failed.
[0114] For data storage methods like Redis + MySQL, such as Figure 11 As shown, the storage process is as follows:
[0115] Step S1: Store the data DTO;
[0116] In one embodiment, taking data DTO1, DTO2, and DTO3 as examples, the process of storing data may include storing data DTO1, storing data DTO2, and storing data DTO3.
[0117] Step S2: Call the data engine to query the DTO;
[0118] Optionally, in one embodiment, taking data DTO1, DTO2, and DTO3 as examples, the process of calling the data engine to query DTO may include calling the data engine to query DTO1, calling the data engine to query DTO2, and calling the data engine to query DTO3.
[0119] Step S3: Process the DTO data;
[0120] Optionally, in one embodiment, taking data DTO1, DTO2, and DTO3 as examples, the process of processing data DTO may include updating DTO1, inserting DTO2, and not processing DTO3.
[0121] Step S4: Determine the DTO storage result; for example, it can be determined that DTO1 was successfully updated to MySQL, or DTO2 was successfully inserted.
[0122] Optionally, after successful data storage, the data storage platform also provides a data query function, the specific query principle of which is as follows: Figure 12 As shown, the specific steps are as follows:
[0123] Step S1201: Input the Module and the corresponding query condition fields;
[0124] Step S1202: Use the query function;
[0125] Step S1203: Query module1; if module1 can be found, the query for module1 is successful, and proceed to step S1204. If module1 cannot be found, the query for module1 fails, and proceed to step S1205.
[0126] Step S1204: Add to the result set;
[0127] Step S1205: module is null;
[0128] Step S1206: Query module2; if module2 can be found, the module2 query is successful, proceed to step S1207. If module2 cannot be found, the module2 query fails, proceed to step S1208.
[0129] Step S1207: Add to the result set;
[0130] Step S1208: module is null;
[0131] Step S1209: Store in the result set;
[0132] Step S1210: Output the query result set.
[0133] Through the above embodiments, a data storage platform is provided to users through the data engine of the data-driven middle platform. It can realize data grouping and store multiple groups of data at the same time, which can speed up the storage speed. It can also determine the corresponding storage tools based on different storage models, which can achieve precise storage of different data. It not only provides users with a convenient data storage tool, but also improves the convenience and experience of users when storing data through intuitive parameter configuration. It can also realize user customization configuration, such as users redefining new grouping methods for data.
[0134] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods of the various embodiments of this application.
[0135] Figure 13 This is a structural block diagram of a data storage device according to an embodiment of this application; as shown below. Figure 13 As shown, it includes:
[0136] The acquisition module 1302 is used to acquire multiple data storage types provided by the data storage platform;
[0137] The receiving module 1304 is used to receive the selection operation of the target object, so as to determine the target data storage type corresponding to the data to be stored from the plurality of data storage types;
[0138] Storage module 1306 is used to obtain a storage area pre-set for the target data storage type in the data storage platform and store the data to be stored in the storage area.
[0139] The above-described device acquires multiple data storage types provided by the data storage platform; receives a selection operation of a target object to determine the target data storage type corresponding to the data to be stored from the multiple data storage types; acquires a storage area pre-set for the target data storage type in the data storage platform, and stores the data to be stored in the storage area. This solves the problem in related technologies of how to store data according to the selection operation of a target object, and thus enables data storage according to the selection operation of the target object, i.e., data storage can be performed according to user needs.
[0140] In an exemplary embodiment, the acquisition module 1302 is further configured to acquire data configuration tags provided by the data storage platform, wherein the data configuration tags include at least one of the following: data access method tag, data access type tag, data model tag, and data storage unit tag; and determine the plurality of data storage types based on the data configuration tags.
[0141] It should be noted that the aforementioned data storage platform can also display to users the data storage type determined based on the data configuration tags, for example, such as... Figure 5 As shown, the data storage type corresponding to the data access method can be identified by the data access method tag, the data storage type corresponding to the access data type can be identified by the data access type tag, the data storage type corresponding to the data model can be identified by the data model tag, and the data storage type corresponding to the data storage unit can be identified by the data storage unit tag. The selectable options for data access methods include "File Entry," "Message Subscription," and "Interface Entry." The selectable options for access data types include "MQ" and "FILE." The selectable options for data models include "Select a pre-existing model in the system or create a new model." The selectable options for data storage units include ignite, Es, and Hazelcast.
[0142] In an exemplary embodiment, the receiving module 1304 is further configured to determine, based on the selection operation of the target object, a target data access method corresponding to the data access method label, a target data access type corresponding to the data access type label, a target data model corresponding to the data model label, and a target data storage unit corresponding to the data storage unit label from the plurality of data storage types; wherein, the target data model is a target data model provided by the data storage platform when the selection operation of the target object indicates the selection of a model; and to determine the target data storage type corresponding to the data to be stored based on the target data access method, the target data access type, the target data model, and the target data storage unit.
[0143] It should be noted that the above-mentioned target object selection operation, indicating the selection of a model, can be understood as the user selecting "select a model newly created in the system" from the available data model options. Therefore, the above-mentioned determination of the target data model corresponding to the data model label from the multiple data storage types based on the target object selection operation can be understood as determining the target data model based on the model selected by the user from "models newly created in the system".
[0144] The above-mentioned method of determining the target data access method corresponding to the data access method label from the multiple data storage types based on the selection operation of the target object can be understood as the user selecting any one of "file entry", "message subscription" or "interface entry" from the selectable data access methods, and the target data access method is determined based on the user's selection result.
[0145] The above-mentioned selection operation of the target object to determine the target data access type corresponding to the data access type label from the multiple data storage types can be understood as the user selecting either "MQ" or "FILE" from the selectable access data types, and determining the target data access type based on the user's selection result.
[0146] The above-mentioned selection of the target data storage unit corresponding to the data storage unit label from the multiple data storage types based on the selection operation of the target object can be understood as the user selecting any one of ignite, Es, and Hazelcast from the selectable options of data storage units, and determining the target data storage unit based on the user's selection result.
[0147] Furthermore, the target data access method, the target data access type, the target data model, and the target data storage unit can be determined as the target data storage type corresponding to the data to be stored, such as... Figure 5 As shown, after determining the target data storage type, users can complete the data access method configuration process through the "Publish Configuration" button.
[0148] In an exemplary embodiment, the receiving module 1304 is further configured to determine a target data model corresponding to the data model tag from the plurality of data storage types based on the selection operation of the target object, including: when the selection operation of the target object indicates the creation of a new model, determining a model creation operation corresponding to the data model tag; obtaining a configuration parameter type provided for the model creation operation in the data storage platform, and obtaining a first data model provided for the model creation operation in the data storage platform; wherein the configuration parameter type includes at least one of the following: model name, model field name, model field type, primary key information, and the first data model represents an unconfigured model template; obtaining a target configuration parameter corresponding to the configuration parameter type; configuring the first data model based on the target configuration parameter to obtain the target data model.
[0149] It should be noted that the above configuration parameter types can be, for example, as follows: Figure 6 The "model name", "field name", and "field type" are among them.
[0150] like Figure 6 As shown, the above target object selection operation indicating the creation of a new model corresponds to the user selecting "Create New Model" from the available options for the data model. The model name could be represented, for example, as... Figure 6 In the context of "INGITE_MODULE", the aforementioned model field name can be represented as, for example, as... Figure 6 In the example, "Field1" in the above model field type can be represented as: Figure 6 The "String" in the above primary key information can be understood as whether the field is a primary key. If the user does not specify it, it can be assumed to be not a primary key. For example... Figure 6 As shown, users can complete the process of creating a new data model by clicking the "Publish Configuration" button.
[0151] In an exemplary embodiment, before configuring the first data model based on the target configuration parameters to obtain the target data model, the receiving module 1304 is further configured to perform a validity check on the target access data type of the data to be stored; if the verification is passed, the receiving module 1304 obtains the data storage queue created for the target access data type in the data storage platform, and the first data storage area created for the target access data type in the data storage platform; and establishes a correspondence between the target access data type, the data storage queue corresponding to the target access data type, and the first data storage area corresponding to the target access data type, so as to provide the first data model for the model building operation based on the correspondence.
[0152] In an exemplary embodiment, the storage module 1306 is further configured to determine the data storage method corresponding to the target data storage unit, wherein the data storage method includes at least one of the following: a first storage method using storage units and database storage, a second storage method using at least two of the storage units, and a third storage method using at least two of the databases; and to determine the storage area corresponding to the data storage method as a storage area pre-set for the target data storage type in the data storage platform.
[0153] It should be noted that the above storage units can refer to storage tools used to implement storage, including but not limited to Ignite, Elasticsearch, etc., and the above databases can include Redis+MySQL, etc.
[0154] The first storage method mentioned above may include Ignite+mysql, the second storage method mentioned above may include Ignite+Elasticsearch, and the third storage method mentioned above may include redis+mysql. This application does not impose any restrictions on this.
[0155] In an exemplary embodiment, the storage module 1306 is further configured to group the data to be stored according to the target data access type to obtain multiple groups of first data; for each group of first data, the data of each group of first data is split according to a data splitting structure to obtain second data; wherein, the data splitting structure includes at least: a data verification layer for verifying each group of first data, a business processing layer for service forwarding, task scheduling, and task execution of each group of first data, and a logical splitting layer for matching each group of first data that passes verification to the business processing layer; and storing the second data in the storage area.
[0156] Embodiments of this application also provide a storage medium including a stored program, wherein the program executes any of the methods described above when it is run.
[0157] Optionally, in this embodiment, the storage medium may be configured to store program code for performing the following steps:
[0158] S1, Obtain multiple data storage types provided by the data storage platform;
[0159] S2, receive the target object selection operation to determine the target data storage type corresponding to the data to be stored from the plurality of data storage types;
[0160] S3, obtain the storage area pre-set for the target data storage type in the data storage platform, and store the data to be stored in the storage area.
[0161] Embodiments of this application also provide an electronic device including a memory and a processor, wherein the memory stores a computer program and the processor is configured to run the computer program to perform the steps in any of the above method embodiments.
[0162] Optionally, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor and the input / output device is connected to the processor.
[0163] Optionally, in this embodiment, the processor can be configured to perform the following steps via a computer program:
[0164] S1, Obtain multiple data storage types provided by the data storage platform;
[0165] S2, receive the target object selection operation to determine the target data storage type corresponding to the data to be stored from the plurality of data storage types;
[0166] S3, obtain the storage area pre-set for the target data storage type in the data storage platform, and store the data to be stored in the storage area.
[0167] Optionally, in this embodiment, the storage medium may include, but is not limited to, various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.
[0168] Optionally, specific examples in this embodiment can refer to the examples described in the above embodiments and optional implementations, and will not be repeated here.
[0169] Obviously, those skilled in the art should understand that the modules or steps of this application described above can be implemented using general-purpose computing devices. They can be centralized on a single computing device or distributed across a network of multiple computing devices. Optionally, they can be implemented using computer-executable program code, thereby storing them in a storage device for execution by a computing device. In some cases, the steps shown or described can be performed in a different order than those presented here, or they can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. Thus, this application is not limited to any particular combination of hardware and software.
[0170] The above description is only a preferred embodiment of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of this application, and these improvements and modifications should also be considered within the scope of protection of this application.
Claims
1. A data storage method, characterized in that, Applications in data storage platforms, including: Obtain multiple data storage types provided by the data storage platform; Receive a selection operation for a target object to determine the target data storage type corresponding to the data to be stored from the plurality of data storage types; Obtain the storage area pre-set for the target data storage type in the data storage platform, and store the data to be stored in the storage area; This includes acquiring multiple data storage types provided by the data storage platform, including: Obtain the data configuration tags provided by the data storage platform, wherein the data configuration tags include at least one of the following: data access method tag, data access type tag, and data model tag; The multiple data storage types are determined based on the data configuration tags.
2. The data storage method according to claim 1, characterized in that, The data configuration label also includes: Data storage unit label.
3. The data storage method according to claim 2, characterized in that, Receiving a target object selection operation to determine the target data storage type corresponding to the data to be stored from the plurality of data storage types includes: Based on the target object selection operation, the target data access method corresponding to the data access method label, the target data access type corresponding to the data access type label, the target data model corresponding to the data model label, and the target data storage unit corresponding to the data storage unit label are determined from the plurality of data storage types; wherein, the target data model is the target data model provided by the data storage platform when the target object selection operation indicates the selection of a model; The target data storage type corresponding to the data to be stored is determined based on the target data access method, the target data access type, the target data model, and the target data storage unit.
4. The data storage method according to claim 2, characterized in that, In the process of receiving a selection operation for a target object to determine the target data storage type corresponding to the data to be stored from the plurality of data storage types, the method further includes: Based on the selection operation of the target object, a target data model corresponding to the data model label is determined from the plurality of data storage types, including: When the selection operation of the target object indicates the creation of a new model, determine the model creation operation corresponding to the data model label; Obtain the configuration parameter type provided for model creation operation in the data storage platform, and obtain the first data model provided for model creation operation in the data storage platform; wherein, the configuration parameter type includes at least one of the following: model name, model field name, model field type, primary key information, and the first data model represents an unconfigured model template; Obtain the target configuration parameters corresponding to the configuration parameter type; The first data model is configured based on the target configuration parameters to obtain the target data model.
5. The data storage method according to claim 4, characterized in that, Before configuring the first data model based on the target configuration parameters to obtain the target data model, the method further includes: Perform a validity check on the target access data type of the data to be stored; If the verification is successful, obtain the data storage queue created for the target access data type in the data storage platform, and the first data storage area created for the target access data type in the data storage platform; Establish a correspondence between the target access data type, the data storage queue corresponding to the target access data type, and the first data storage area corresponding to the target access data type, so as to provide the first data model for the model building operation based on the correspondence.
6. The data storage method according to claim 3, characterized in that, Obtaining the storage area pre-set for the target data storage type in the data storage platform includes: Determine the data storage method corresponding to the target data storage unit, wherein the data storage method includes at least one of the following: a first storage method using storage units and database storage, a second storage method using at least two of the storage units, and a third storage method using at least two of the databases; The storage area corresponding to the data storage method is determined as the storage area pre-set for the target data storage type in the data storage platform.
7. The data storage method according to claim 3, characterized in that, Storing the data to be stored into the storage area includes: The data to be stored is grouped according to the target data access type to obtain multiple groups of first data; For each set of first data in multiple sets of first data, the data of each set of first data is split according to the data splitting structure to obtain second data; The data splitting structure includes at least: a data verification layer for verifying each group of first data, a business processing layer for service forwarding, task scheduling, and task execution of each group of first data, and a logical splitting layer for matching each group of first data that passes verification to the business processing layer. The second data is stored in the storage area.
8. A data storage platform, characterized in that, include: The acquisition module is used to acquire multiple data storage types provided by the data storage platform; A receiving module is used to receive a selection operation of a target object in order to determine the target data storage type corresponding to the data to be stored from the plurality of data storage types; The storage module is used to obtain a storage area pre-set for the target data storage type in the data storage platform and store the data to be stored in the storage area; The acquisition module is further configured to acquire data configuration tags provided by the data storage platform, wherein the data configuration tags include at least one of the following: data access method tag, data access type tag, and data model tag; and determine the multiple data storage types based on the data configuration tags.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored program, wherein the program, when executed, performs the method described in any one of claims 1 to 7.
10. An electronic device comprising a memory and a processor, characterized in that, The memory stores a computer program, and the processor is configured to execute the method described in any one of claims 1 to 7 through the computer program.
Citation Information
Patent Citations
Storage method, extraction method, storage platform and extraction platform for equipment data
CN108334549A
Nonvolatile memory with increased number of usable times
CN110392885A