CN115168365B - Data storage method and device, electronic equipment and storage medium - Google Patents

Data storage method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN115168365B
CN115168365B CN202211059937.7A CN202211059937A CN115168365B CN 115168365 B CN115168365 B CN 115168365B CN 202211059937 A CN202211059937 A CN 202211059937A CN 115168365 B CN115168365 B CN 115168365B
Authority
CN
China
Prior art keywords
work order
message
model
data
information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202211059937.7A
Other languages
Chinese (zh)
Other versions
CN115168365A (en
Inventor
毕孝田
杨位久
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Inspur Communication Information System Co Ltd
Original Assignee
Inspur Communication Information System Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Inspur Communication Information System Co Ltd filed Critical Inspur Communication Information System Co Ltd
Priority to CN202211059937.7A priority Critical patent/CN115168365B/en
Publication of CN115168365A publication Critical patent/CN115168365A/en
Application granted granted Critical
Publication of CN115168365B publication Critical patent/CN115168365B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2228Indexing structures
    • G06F16/2246Trees, e.g. B+trees
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2282Tablespace storage structures; Management thereof
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/25Integrating or interfacing systems involving database management systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/28Databases characterised by their database models, e.g. relational or object models
    • G06F16/284Relational databases

Abstract

The invention provides a data storage method, a data storage device, an electronic device and a storage medium, which belong to the technical field of computers and comprise the following steps: determining a business main key corresponding to the work order message from a preset message structure tree based on node information of the work order message, and determining a target model task instance from a plurality of model task instances correspondingly configured by the business main key; executing a target model task instance to translate node information of the work order message into data information in a target format, and mapping the data information in the target format into attribute information in a corresponding database data model; storing the attribute information in a physical database. The invention can realize automatic translation, mapping analysis and persistent storage of various work order message data, can effectively solve the problem that a work order message data storage program needs to be frequently developed and message specifications need to be modified, greatly reduces the secondary development cost of products, and is beneficial to improving the efficiency of research, development and output of service products.

Description

Data storage method and device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a data storage method and apparatus, an electronic device, and a storage medium.
Background
In a Business Operation Support System (BOSS) developed based on a workflow, a work order is distributed by the BOSS, serves as a key unit for supporting Business flow in a Business opening process, and carries information of multiple dimensions, including ordering and description information of a customer for Business, product specification information provided by an operator, equipment resource information for carrying Business opening, instantiation identification information depending on the workflow, and the like.
However, in the workflow application field, due to the rapid superposition of customer services, the node structure of the work order message is subject to frequent changes, so that the data storage program of the work order message needs to be frequently developed and the message specification needs to be modified, thereby greatly increasing the secondary development cost and causing the low efficiency of research, development and output of service products.
Disclosure of Invention
The invention provides a data storage method, a data storage device, electronic equipment and a storage medium, which are used for solving the defects that in the prior art, as a work order message data storage program needs to be frequently developed and message specifications need to be modified, the secondary development cost is greatly increased, and the efficiency of research and development of service products is low.
The invention provides a data storage method, which comprises the following steps:
determining a service main key corresponding to a work order message from a preset message structure tree based on node information of the work order message, and determining a target model task instance from a plurality of model task instances configured correspondingly to the service main key;
executing the target model task instance to translate the node information of the work order message into data information in a target format, and mapping the data information in the target format into attribute information in a corresponding database data model;
and storing the attribute information into a physical database.
According to a data storage method provided by the present invention, before determining a service key corresponding to the work order packet from a preset packet structure tree based on the node information of the work order packet, the method further includes:
generating the preset message structure tree based on the node information of each work order message;
selecting a target node corresponding to each work order message from the preset message structure tree as a service main key corresponding to each work order message; the target node is used for identifying the service type.
According to a data storage method provided by the present invention, after selecting a target node corresponding to each work order packet from the preset packet structure tree as a service key corresponding to each work order packet, the method further includes:
extracting tables and fields of a relational database, and generating a database data model based on the tables and the fields;
configuring a mapping relation between a field of each node information and a corresponding attribute field of the database data model, and configuring a translation rule of each node information;
and combining the mapping relation corresponding to each node information with the translation rule of each node information to obtain a target model task corresponding to each node information.
According to a data storage method provided by the present invention, after selecting a target node corresponding to each work order packet from the preset packet structure tree as a service key corresponding to each work order packet, the method further includes:
configuring a template of each service primary key; each template comprises a plurality of the model tasks, and each model task corresponds to one database data model.
According to a data storage method provided by the present invention, the configuring the template of each service primary key includes:
based on the execution relation among each model task, performing task arrangement on a plurality of model tasks to obtain each arranged model task;
and assembling each arranged model task to obtain a template of each service main key.
According to a data storage method provided by the present invention, the generating the preset packet structure tree based on the node information of each work order packet includes:
analyzing the node information of each work order message, and determining the inclusion relationship among the nodes of each work order message;
and generating the preset message structure tree based on the inclusion relationship among the work order message nodes.
According to a data storage method provided by the invention, the method further comprises the following steps:
and configuring and packaging the interface of the work order message into the single atom receiving capacity.
The present invention also provides a data storage device comprising:
the first processing module is used for determining a service main key corresponding to a work order message from a preset message structure tree based on node information of the work order message and determining a target model task instance from a plurality of model task instances correspondingly configured by the service main key;
the first execution module is used for executing the target model task instance, so as to translate the node information of the work order message into data information in a target format, and map the data information in the target format into attribute information in a corresponding database data model;
and the first storage module is used for storing the attribute information into a physical database.
The invention also provides an electronic device comprising a memory, a processor and a computer program stored on the memory and operable on the processor, wherein the processor implements the data storage method as described in any one of the above when executing the program.
The invention also provides a non-transitory computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements a data storage method as described in any one of the above.
The invention also provides a computer program product comprising a computer program which, when executed by a processor, implements a data storage method as in any one of the above.
The data storage method, the data storage device, the electronic equipment and the storage medium provided by the invention determine a business main key corresponding to a work order message from a preset message structure tree by pre-establishing a database data model, uniformly configuring a mapping relation between a work order message node information field and a database data model attribute field and a translation rule of the work order message node information and according to the received node information of the work order message; according to the business main key, determining a target model task instance from a plurality of model task instances of the template instance correspondingly configured by the business main key so as to realize customized data processing on various standard work order messages; by automatically executing a target model task instance, the node information of the work order message is translated into the data information in the target format, the data information in the target format is mapped into the attribute information in the corresponding database data model, and the attribute information is stored in the physical database, so that the automatic translation, mapping analysis and persistent storage of various work order message data can be realized, the problem that a work order message data storage program needs to be frequently developed and message specification is modified can be effectively solved, the secondary development cost of a product is greatly reduced, and the efficiency of research, development and output of a service product is improved.
Drawings
In order to more clearly illustrate the technical solutions of the present invention or the prior art, the drawings needed for the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and those skilled in the art can also obtain other drawings according to the drawings without creative efforts.
FIG. 1 is a schematic flow chart of a data storage method provided by the present invention;
FIG. 2 is a schematic structural diagram of a data storage device provided by the present invention;
fig. 3 is a schematic physical structure diagram of an electronic device provided in the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings, and it is obvious that the described embodiments are some, but not all embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In the description of the invention, it is to be noted that, unless otherwise explicitly specified or limited, the terms "mounted," "connected," and "connected" are to be construed broadly, e.g., as meaning either a fixed connection, a removable connection, or an integral connection; can be mechanically or electrically connected; they may be connected directly or indirectly through intervening media, or they may be interconnected between two elements. The specific meanings of the above terms in the present invention can be understood according to specific situations by those of ordinary skill in the art.
The data storage method, apparatus, electronic device and storage medium of the present invention are described below with reference to fig. 1 to 3.
Fig. 1 is a schematic flow chart of a data storage method provided by the present invention, as shown in fig. 1, including: step 110, step 120 and step 130.
Step 110, based on node information of the work order message, determining a service primary key corresponding to the work order message from a preset message structure tree, and determining a target model task instance from a plurality of model task instances configured correspondingly to the service primary key;
specifically, the work order message described in the embodiment of the present invention refers to a work order message distributed by the business operation support system BOSS, and may also be described as a work order distribution message.
The node information of the work order message described in the embodiment of the present invention refers to the service node information carried in the work order message, and may specifically include information such as a service name, a service number, and a service type.
The preset message structure tree described in the embodiment of the present invention refers to a tree structure model constructed according to a preset message format configuration table corresponding to a work order message, where the preset message structure tree includes a plurality of message domain nodes, and the message format configuration table stores node information of the work order message corresponding to the message domain nodes.
The service key described in the embodiment of the present invention refers to a message domain node reflecting the uniqueness of service data from a service level in a preset message structure tree, and can carry key service information, such as a service number, a service type, a service operation type, a network access mode, and the like. The Network access mode may include an internet dedicated line, an online open, and a Passive Optical Network (PON) mode.
The target model task instance described in the embodiment of the present invention refers to a model task instance for processing received work order message node information among multiple model task instances.
Based on the content of the foregoing embodiment, as an optional embodiment, the method further includes:
and configuring and packaging the interface of the work order message into the single atom receiving capacity.
Specifically, in the embodiment of the present invention, the order-accepting atomic capability refers to a minimum capability unit that can be independently operated in the terminal device, and is used for receiving the work order sent by the BOSS. The capability encapsulation and interface protocol adaptation are carried out on the interface of the work order message to abstract the ability of receiving the single atom, which is beneficial to the transmission and interaction of the work order message data. Meanwhile, the abstracted atomic capability can be opened to the user through an application programming API interface to provide services for the outside.
According to the method provided by the embodiment of the invention, the interface configuration of the work order message is encapsulated into the single-atom receiving capacity, so that a user can be helped to hatch and construct a new scene service more quickly, and the user experience is improved.
Further, in the embodiment of the present invention, by acquiring and analyzing the node information of the work order message, the preset message structure tree may be traversed based on the service information carried by the node information obtained through analysis, such as the service number, the service type, and other information, to determine the service key corresponding to the work order message.
The template example described in the embodiment of the invention is obtained by instantiating a template pre-configured by a service main key. Generally, in object-oriented programming, the process of creating an object with a class is referred to as instantiation.
In the embodiment of the invention, after the node information of the work order message is received, the template example which is configured correspondingly to the service main key can be triggered to be automatically executed. Wherein, the template instance can comprise a plurality of model task instances.
In the embodiment of the invention, based on the node information of the work order message, the target model task instance for processing the node information of the work order message can be found from each model task instance in the template instance according to the product service information in the node information.
It is understood that the model task instance is obtained by instantiating the model task.
It should be noted that, in the embodiment of the present invention, the database data model is obtained by abstracting a table of the relational database, where a table field of the relational database is abstracted as an attribute of the database data model.
In the embodiment of the invention, the mapping relation between the node information field of the work order message and the attribute field of the database data model, the translation rule of the node information data and the like are uniformly configured in advance based on the node information of each work order message, and finally the configuration is combined into the model task. A model task may correspond to a database data model.
In the embodiment of the invention, through different model task instances, the node information of the corresponding work order message can be translated into the data information with the required format, and the data information is mapped into the attribute information in the corresponding database data model.
Step 120, executing a target model task instance to translate node information of the work order message into data information in a target format, and mapping the data information in the target format into attribute information in a corresponding database data model;
specifically, the target format described in the embodiment of the present invention is a data format obtained by translating the node information of the work order packet according to a preset translation rule. Which is used to facilitate the storage and transfer of subsequent data.
Further, in the embodiment of the present invention, a target model task instance is executed, and the target model task instance is responsible for translating the node information of the work order packet into data information in a target format, and mapping the data information in the target format into attribute information in a corresponding database data model.
Step 130, store the attribute information in the physical database.
Specifically, in the embodiment of the present invention, after the node information of the work order packet is translated and mapped into the attribute information in the corresponding database data model by using the target model task instance, the attribute information may be directly and synchronously stored in the physical database, so that the data storage is performed on the node information of the work order packet by using the data model mapping method.
The data storage method provided by the embodiment of the invention determines the business main key corresponding to the work order message from a preset message structure tree according to the received node information of the work order message by pre-establishing a database data model and uniformly configuring the mapping relation between the information field of the work order message node and the attribute field of the database data model and the translation rule of the work order message node information; according to the business main key, determining a target model task instance from a plurality of model task instances of the template instance correspondingly configured by the business main key so as to realize customized data processing on various standard work order messages; by automatically executing a target model task instance, the node information of the work order message is translated into the data information in the target format, the data information in the target format is mapped into the attribute information in the corresponding database data model, and the attribute information is stored in the physical database, so that the automatic translation, mapping analysis and persistent storage of various work order message data can be realized, the problem that a work order message data storage program needs to be frequently developed and message specification is modified can be effectively solved, the secondary development cost of a product is greatly reduced, and the efficiency of research, development and output of a service product is improved.
Based on the content of the foregoing embodiment, as an optional embodiment, before determining, based on node information of the work order packet, a service key corresponding to the work order packet from a preset packet structure tree, the method further includes:
generating a preset message structure tree based on the node information of each work order message;
selecting a target node corresponding to each work order message from the preset message structure tree as a service main key corresponding to each work order message; the target node is used to identify the traffic type.
Specifically, the target node described in the embodiment of the present invention refers to a packet domain node in a preset packet structure tree, which can be used to identify a service type and carry key service information, and can be used as a parent node in the preset structure tree.
Further, by receiving the work order message dispatched by the BOSS, analyzing the node information of each work order message, determining the internal relation between service nodes carried by each work order message and the dependency relationship between node data, and constructing a preset message structure tree.
Based on the content of the foregoing embodiment, as an optional embodiment, the generating a preset packet structure tree based on node information of each work order packet includes:
analyzing the node information of each work order message, and determining the inclusion relationship among the nodes of each work order message;
and generating a preset message structure tree based on the inclusion relationship among the work order message nodes.
It should be noted that, in the embodiment of the present invention, a node at the topmost level of the preset message structure tree is referred to as a root node, the preset message structure tree may be divided into a plurality of sub-trees, each node represents itself and a sub-tree taking itself as a root node, the sub-trees include a plurality of nodes, the root node may be used as a parent node and include a plurality of child nodes, and the child nodes may also be used as a parent node and also include a plurality of child nodes. A parent node may contain multiple children, with a child having only one parent node. There is no overlap of nodes between subtrees.
Specifically, in the embodiment of the present invention, the data type and the data value of the node information of each work order packet are analyzed to determine the inclusion relationship, such as a service inclusion relationship, between the nodes, so that a parent node and a corresponding child node thereof can be selected from the nodes, and the parent node and the child node are organized and associated to form a plurality of hierarchical structures by analyzing the inclusion relationship between the nodes and the branch relationship between the subtree branches, so as to obtain a tree structure model with a certain depth, and generate a preset packet structure tree.
Therefore, through traversing the preset message structure tree, the operations of analyzing and extracting data in the node information of each worksheet message and the like can be efficiently executed, and compared with the traditional mode of acquiring information layer by layer, the data processing efficiency can be greatly improved.
The method of the embodiment of the invention analyzes the inclusion relationship among the nodes of each work order message based on the node information of each work order message, constructs the preset message structure tree, and is beneficial to efficiently extracting and analyzing the node information of the work order message subsequently.
Further, in the embodiment of the present invention, a target node for distinguishing different services is selected from a preset message structure tree as a service primary key, and a service primary key corresponding to each work order message is obtained.
According to the method provided by the embodiment of the invention, the preset structure tree is generated based on the node information of the work order message, so that the information of each node in the tree-shaped structure model can be conveniently and quickly obtained subsequently, the service key corresponding to the work order message can be found out, the template configured by the service key can be favorably searched, and the efficiency of mapping and storing the work order message node data can be completed.
Based on the content of the foregoing embodiment, as an optional embodiment, after selecting a target node corresponding to each work order packet from a preset packet structure tree as a service key corresponding to each work order packet, the method further includes:
extracting tables and fields of the relational database, and generating a database data model from the tables and the fields;
configuring the mapping relation between the fields of each node information and the attribute fields of the corresponding database data model, and configuring the translation rule of each node information;
and combining the mapping relation corresponding to each node information with the translation rule of each node information to obtain the target model task corresponding to the node information of each work order message.
Specifically, in an embodiment of the present invention, a database data model is generated based on tables and fields of a relational database by extracting the tables and fields of the relational database, defining the tables as the data model, and defining table fields as attributes in the data model.
Further, the mapping relation between the fields of the node information of each work order message and the attribute fields of the corresponding database data model is configured in a unified mode, and the node information is mapped into the attribute data of the model in the corresponding database data model to be stored. Meanwhile, by setting the model shared data area, the information of each node can be mapped to the attribute information in the corresponding database data model for sharing and synchronously stored in the physical database.
The translation rules described in the embodiments of the present invention may include a date escape rule, an enumeration translation rule, a cascade translation rule, and the like.
Further, in the embodiment of the present invention, the mapping relationship corresponding to each node information and the translation rule of each node information are combined to obtain the target model task corresponding to the node information of each work order packet. Each target model task may be responsible for translating the node information of the corresponding work order packet into data information in a required format, and mapping the data information into attribute information in a corresponding database data model for model storage.
The method of the embodiment of the invention configures the mapping relation between the field of each node message and the attribute field of the corresponding database data model and the translation rule of each node message by presetting a data configuration strategy, realizes the configuration of the target model task corresponding to each work order message node message, and provides data support for the subsequent template for configuring the service main key.
Based on the content of the foregoing embodiment, as an optional embodiment, after selecting a target node corresponding to each work order packet from a preset packet structure tree as a service key corresponding to each work order packet, the method further includes:
configuring a template of each service main key; each template includes a plurality of model tasks, each model task corresponding to a database data model.
Specifically, in the embodiment of the present invention, after the service key corresponding to each work order packet is obtained, different templates are configured for different service keys, each template may be composed of a plurality of model tasks, and each model task corresponds to one database data model. The model tasks can be in a serial or parallel relationship, and the former model task and the latter model task in each model task can have a data dependency relationship, for example, the former model task and the latter model task respectively correspond to an internet service and an expansion service, such as a cloud video service.
The cloud video service is provided with a data dependency relationship, and the cloud video service is provided with a data dependency relationship.
Further, in the embodiment of the present invention, for each service primary key, a template of each service primary key may be configured in advance, including data such as a configuration template data area, model tasks, a concatenation relationship between the model tasks, input and output definitions of the template, and a trigger mechanism of the template.
The method of the embodiment of the invention configures the template of each service key aiming at each service key bearing key service information, provides automatically executed template example data in the actual data storage process, carries out customized data processing, improves the data storage efficiency and is beneficial to reducing the cost of secondary development of products.
Based on the content of the foregoing embodiment, as an optional embodiment, configuring a template of each service primary key includes:
based on the execution relation among each model task, performing task arrangement on a plurality of model tasks to obtain each arranged model task;
and assembling each arranged model task to obtain a template of each service main key.
Specifically, the execution relationship described in the embodiment of the present invention refers to a relationship of the model tasks in the execution order, which may include a serial execution relationship and a parallel execution relationship, where the serial execution relationship refers to a precedence relationship of each model task in the execution order.
In the embodiment of the invention, when the template design is executed, the model tasks can be used as the execution nodes, and the serial execution relationship and the parallel execution relationship among the execution nodes are arranged based on the execution relationship among each model task. Meanwhile, a trigger condition of each execution node needs to be set, a shared data area of a database data model corresponding to each model task is set, and a reading mapping relation between node information data and the corresponding shared data area is set, so that task arrangement of a plurality of model tasks is completed, and each arranged model task is obtained.
Further, in the embodiment of the present invention, each organized model task is assembled, and each organized model task is imported into the original template of the corresponding service primary key, so as to obtain a template of each service primary key.
According to the method provided by the embodiment of the invention, the execution relation among each model task is analyzed, the task arrangement and assembly are carried out on each model task, the configuration of each business main key template is realized, a model configuration scheme is provided for data storage in a business work order receiving process, and the convenience of the work order message mapping rule is improved.
In an embodiment of the present invention, taking a scenario in which a BOSS performs work order distribution as an example, the steps of the data storage method provided in the embodiment of the present invention may include:
step S1, a database data model is generated based on tables and fields of a relational database, physical tables of the relational database can be abstracted into a framework of the database data model, and table fields are abstracted into attributes of the database data model, so that the database data model is generated based on the tables and the fields of the relational database.
And S2, configuring and packaging the interface of the work order message into the single atom receiving capacity, and defining the node information of the work order message, including information such as a service name and a service type. Analyzing the node information of each work order message to determine the inclusion relationship among the nodes of each work order message; and generating a preset message structure tree according to the inclusion relation among the work order message nodes.
And S3, selecting a target node from the preset message structure tree as a service primary key to obtain the service primary key corresponding to each work order message, wherein the service primary key can bear key service information such as a service number, a service type, a service operation type, a network access mode and the like.
And S4, configuring different templates aiming at different service main keys, wherein one template consists of a plurality of model tasks. The mapping relation between the fields of each node information and the attribute fields of the corresponding database data model is configured in a unified mode, and the translation rules of each node information are configured, wherein the translation rules can comprise date escape rules, enumeration translation rules, cascade translation rules and the like; and combining the mapping relation corresponding to each node information with the translation rule of each node information to obtain the target model task corresponding to the node information of each work order message.
And performing task arrangement on each model task according to the serial execution relation or the parallel execution relation between each model task and the possible data dependency relation of the previous model task and the next model task to obtain each arranged model task, so that each arranged model task is assembled, and the template of each service main key is configured.
And the model task can also be provided with a preposed execution condition, and the preposed execution condition supports the use of the node information of the work order message. According to the judgment of the pre-execution condition, the model task in the template can be executed in a targeted manner.
And S5, aiming at a single model task, configuring the model task based on the database data model, wherein one model task corresponds to one database data model, and configuring generation strategy relations between attribute data of the database data model and node information of the work order message, wherein the generation strategy relations comprise one-to-one relation and one-to-many relation, namely, one work order message can correspondingly execute one model task and also can correspondingly execute a plurality of model tasks.
And S6, after receiving the work order message sent by the BOSS, automatically analyzing the node information of the work order message, creating a template example corresponding to the work order message, and triggering to execute the template example.
And S7, establishing a model task instance based on the template instance, and automatically executing a target model task instance corresponding to the node information of the work order message according to the configured data.
And S8, the target model task instance is responsible for translating the node information of the work order message into data information in a target format, mapping the data information in the target format into attribute information in a corresponding database data model, then executing warehousing operation, and storing the obtained attribute information data into a physical database.
The method of the embodiment of the invention can realize a general data storage scheme by analyzing the actual processing process of the real data and confirming that the dependence on the specific middleware can be separated, and the dispatch messages based on the structural definition, including the messages in XML and JSON formats, can be used for mapping and storing the data, thereby greatly reducing the cost of secondary development and improving the efficiency of research, development and output.
The data storage device provided by the invention is described below, and the data storage device described below and the data storage method described above can be correspondingly referred to.
Fig. 2 is a schematic structural diagram of a data storage device provided in the present invention, as shown in fig. 2, including:
the first processing module 210 is configured to determine, based on node information of a work order packet, a service primary key corresponding to the work order packet from a preset packet structure tree, and determine a target model task instance from a plurality of model task instances configured correspondingly to the service primary key;
a first executing module 220, configured to execute the target model task instance, so as to translate node information of the work order packet into data information in a target format, and map the data information in the target format into attribute information in a corresponding database data model;
a first storage module 230, configured to store the attribute information in a physical database.
The data storage device described in this embodiment may be used to implement the data storage method embodiments, and the principle and technical effect are similar, which are not described herein again.
The data storage device of the embodiment of the invention determines the business key corresponding to the work order message from a preset message structure tree according to the received node information of the work order message by pre-establishing a database data model and uniformly configuring the mapping relation between the information field of the work order message node and the attribute field of the database data model and the translation rule of the work order message node information; according to the business main key, determining a target model task instance from a plurality of model task instances of a template instance correspondingly configured by the business main key to realize customized data processing on various standard work order messages, translating the node information of the work order message into data information in a target format by automatically executing the target model task instance, mapping the data information in the target format into attribute information in a corresponding database data model, and storing the attribute information into a physical database.
Based on the content of the foregoing embodiment, as an optional embodiment, the apparatus provided in the embodiment of the present invention further includes:
the first generation module is used for generating a preset message structure tree based on the node information of each work order message;
the second processing model is used for selecting a target node corresponding to each work order message from a preset message structure tree as a service main key corresponding to each work order message; the target node is used to identify the traffic type.
Based on the content of the foregoing embodiment, as an optional embodiment, the apparatus provided in the embodiment of the present invention further includes:
the third processing module is used for extracting tables and fields of the relational database and generating a database data model based on the tables and the fields;
the first configuration module is used for configuring the mapping relation between the fields of the node information and the attribute fields of the corresponding database data model and configuring the translation rules of the node information;
and the first mapping module is used for combining the mapping relation corresponding to each node information with the translation rule of each node information to obtain a target model task corresponding to each node information.
Based on the content of the foregoing embodiment, as an optional embodiment, the apparatus provided in the embodiment of the present invention further includes:
the second configuration module is used for configuring the template of each service main key; each template includes a plurality of model tasks, each model task corresponding to a database data model.
Based on the content of the foregoing embodiment, as an optional embodiment, the second configuration module is further specifically configured to:
performing task arrangement on a plurality of model tasks based on the execution relation between each model task to obtain each arranged model task;
and assembling each arranged model task to obtain a template of each service main key.
Based on the content of the foregoing embodiment, as an optional embodiment, in the apparatus provided in the embodiment of the present invention, the first generating module is further specifically configured to:
analyzing the node information of each work order message, and determining the inclusion relationship among the nodes of each work order message;
and generating a preset message structure tree based on the inclusion relation among all the work order message nodes.
Based on the content of the foregoing embodiment, as an optional embodiment, the apparatus further includes:
and the first encapsulation module is used for encapsulating the interface configuration of the work order message into the single atom receiving capability.
In the embodiment of the present invention, the data storage device described in this embodiment may be used to execute the above-mentioned data storage method embodiment, and the principle and technical effect are similar, which are not described herein again.
Fig. 3 is a schematic physical structure diagram of an electronic device provided in the present invention, and as shown in fig. 3, the electronic device may include: a processor (processor) 310, a communication Interface (Communications Interface) 320, a memory (memory) 330 and a communication bus 340, wherein the processor 310, the communication Interface 320 and the memory 330 communicate with each other via the communication bus 340. The processor 310 may call logic instructions in the memory 330 to perform the data storage method provided by the above methods, the method comprising: determining a service main key corresponding to a work order message from a preset message structure tree based on node information of the work order message, and determining a target model task instance from a plurality of model task instances configured correspondingly to the service main key; executing the target model task instance to translate the node information of the work order message into data information in a target format, and mapping the data information in the target format into attribute information in a corresponding database data model; and storing the attribute information into a physical database.
In addition, the logic instructions in the memory 330 may be implemented in the form of software functional units and stored in a computer readable storage medium when the software functional units are sold or used as independent products. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
In another aspect, the present invention also provides a computer program product, the computer program product comprising a computer program, the computer program being storable on a non-transitory computer-readable storage medium, the computer program, when executed by a processor, being capable of executing the data storage method provided by the above methods, the method comprising: determining a service primary key corresponding to a work order message from a preset message structure tree based on node information of the work order message, and determining a target model task instance from a plurality of model task instances configured corresponding to the service primary key; executing the target model task instance to translate the node information of the work order message into data information in a target format, and mapping the data information in the target format into attribute information in a corresponding database data model; and storing the attribute information into a physical database.
In yet another aspect, the present invention also provides a non-transitory computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements a data storage method provided by the above methods, the method comprising: determining a service primary key corresponding to a work order message from a preset message structure tree based on node information of the work order message, and determining a target model task instance from a plurality of model task instances configured corresponding to the service primary key; executing the target model task instance to translate the node information of the work order message into data information in a target format, and mapping the data information in the target format into attribute information in a corresponding database data model; and storing the attribute information into a physical database.
The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one position, or may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware. Based on the understanding, the above technical solutions substantially or otherwise contributing to the prior art may be embodied in the form of a software product, which may be stored in a computer-readable storage medium, such as ROM/RAM, magnetic disk, optical disk, etc., and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method according to the various embodiments or some parts of the embodiments.
Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (10)

1. A method of storing data, comprising:
determining a service main key corresponding to a work order message from a preset message structure tree based on node information of the work order message, and determining a target model task instance from a plurality of model task instances configured correspondingly to the service main key; the preset message structure tree is a tree structure model constructed according to a preset message format configuration table corresponding to the work order message, the preset message structure tree comprises a plurality of message domain nodes, and the message format configuration table stores node information of the work order message corresponding to the message domain nodes; the service main key is a message domain node reflecting the uniqueness of service data from a service level in the preset message structure tree;
executing the target model task instance to translate the node information of the work order message into data information in a target format, and mapping the data information in the target format into attribute information in a corresponding database data model;
and storing the attribute information into a physical database.
2. The data storage method according to claim 1, wherein before determining the service key corresponding to the work order packet from a preset packet structure tree based on the node information of the work order packet, the method further comprises:
generating the preset message structure tree based on the node information of each work order message;
selecting a target node corresponding to each work order message from the preset message structure tree as a service main key corresponding to each work order message; the target node is used for identifying the service type.
3. The data storage method according to claim 2, wherein after selecting a target node corresponding to each work order packet from the preset packet structure tree as a service key corresponding to each work order packet, the method further comprises:
extracting tables and fields of a relational database, and generating a database data model based on the tables and the fields;
configuring a mapping relation between a field of each node information and a corresponding attribute field of the database data model, and configuring a translation rule of each node information;
and combining the mapping relation corresponding to each node information with the translation rule of each node information to obtain a target model task corresponding to each node information.
4. The data storage method according to claim 3, wherein after selecting a target node corresponding to each work order packet from the preset packet structure tree as a service key corresponding to each work order packet, the method further comprises:
configuring a template of each service primary key; each template comprises a plurality of the model tasks, and each model task corresponds to one database data model.
5. The data storage method of claim 4, wherein the configuring the template of each service primary key comprises:
based on the execution relation among each model task, performing task arrangement on the plurality of model tasks to obtain each arranged model task;
and assembling each arranged model task to obtain a template of each service main key.
6. The data storage method according to claim 2, wherein the generating the preset packet structure tree based on the node information of each work order packet comprises:
analyzing the node information of each work order message, and determining the inclusion relationship among the nodes of each work order message;
and generating the preset message structure tree based on the inclusion relationship among the work order message nodes.
7. The data storage method of any of claims 1-6, wherein the method further comprises:
the interface configuration of the work order message is packaged into the single atom receiving capacity; the order receiving atom capability is a minimum capability unit which operates independently in the terminal and is used for receiving the work order message.
8. A data storage device, comprising:
the first processing module is used for determining a service main key corresponding to a work order message from a preset message structure tree based on node information of the work order message and determining a target model task instance from a plurality of model task instances correspondingly configured by the service main key; the preset message structure tree is a tree structure model constructed according to a preset message format configuration table corresponding to the work order message, the preset message structure tree comprises a plurality of message domain nodes, and the message format configuration table stores node information of the work order message corresponding to the message domain nodes; the service main key is a message domain node reflecting the uniqueness of service data from a service level in the preset message structure tree;
the first execution module is used for executing the target model task instance, so as to translate the node information of the work order message into data information in a target format, and map the data information in the target format into attribute information in a corresponding database data model;
and the first storage module is used for storing the attribute information into a physical database.
9. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the data storage method of any one of claims 1 to 7 when executing the program.
10. A non-transitory computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the data storage method of any one of claims 1 to 7.
CN202211059937.7A 2022-09-01 2022-09-01 Data storage method and device, electronic equipment and storage medium Active CN115168365B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211059937.7A CN115168365B (en) 2022-09-01 2022-09-01 Data storage method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211059937.7A CN115168365B (en) 2022-09-01 2022-09-01 Data storage method and device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN115168365A CN115168365A (en) 2022-10-11
CN115168365B true CN115168365B (en) 2022-12-02

Family

ID=83481570

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211059937.7A Active CN115168365B (en) 2022-09-01 2022-09-01 Data storage method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115168365B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101055589A (en) * 2007-05-30 2007-10-17 北京航空航天大学 Embedded database storage management method
WO2022083464A1 (en) * 2020-10-19 2022-04-28 中兴通讯股份有限公司 Data processing method, apparatus and system, computer device and computer-readable storage medium

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7519574B2 (en) * 2003-08-25 2009-04-14 International Business Machines Corporation Associating information related to components in structured documents stored in their native format in a database
CN109460220B (en) * 2018-10-19 2022-04-12 泰康保险集团股份有限公司 Message predefined code generation method and device, electronic equipment and storage medium
CN110381054B (en) * 2019-07-16 2022-02-22 广东省新一代通信与网络创新研究院 Message analysis method, device, equipment and computer readable storage medium
CN110806986B (en) * 2019-11-04 2022-02-15 苏州盛科通信股份有限公司 Method, equipment and storage medium for improving message storage efficiency of network chip
CN114629807A (en) * 2020-12-11 2022-06-14 中国移动通信集团湖南有限公司 Work order processing method, device and equipment
CN114047989A (en) * 2021-11-12 2022-02-15 浪潮通信信息系统有限公司 Dynamic form configuration and rendering method, system and device

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101055589A (en) * 2007-05-30 2007-10-17 北京航空航天大学 Embedded database storage management method
WO2022083464A1 (en) * 2020-10-19 2022-04-28 中兴通讯股份有限公司 Data processing method, apparatus and system, computer device and computer-readable storage medium

Also Published As

Publication number Publication date
CN115168365A (en) 2022-10-11

Similar Documents

Publication Publication Date Title
US7584499B2 (en) Policy algebra and compatibility model
US9588742B2 (en) Rule-based automatic class generation from a JSON message
CN108984712A (en) Counting method, equipment and readable storage medium storing program for executing are made based on business scenario
CN104156313A (en) Method for automatically generating Web service testing case
CN104618433B (en) A kind of service combining method based on eca rule
CN101382893B (en) On-line assembling method for component based on Web service
CN108696381A (en) A kind of protocol configuration method and device
CN110673839B (en) Distributed tool configuration construction generation method and system
CN101609415A (en) Universal service calling system and method based on middleware
CN112287114A (en) Knowledge graph service processing method and device
US8392298B2 (en) Invoice adjustment data object for a common data object format
CN110020243A (en) Querying method, device, Internet of Things server and the storage medium of internet of things data
CN113157904B (en) Sensitive word filtering method and system based on DFA algorithm
CN114168117A (en) Credit low-code development tool based on designer and storage device
CN102316128A (en) A kind ofly be used to generate network service method and device
CN111522840B (en) Label configuration method, device, equipment and computer readable storage medium
US11755631B2 (en) Workflow-based dynamic data model and application generation
EP2395468A1 (en) Semantic user interface data assembling
CN115168365B (en) Data storage method and device, electronic equipment and storage medium
CN111104122B (en) Method for mapping xml service logic to java service logic
CN111343201A (en) Analysis method, device and system for rapidly adapting to protocol change
CN112783836A (en) Information exchange method, device and computer storage medium
CN109117152B (en) Service generation system and method
CN115017185A (en) Data processing method, device and storage medium
US8250090B2 (en) Method for performing message-based distributed computing, involves executing expression of matched message response on members identified by set instance definition using dimension values derived from message

Legal Events

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