Data sharing method, device, equipment, storage medium and computer program product
By obtaining the types of energy enterprise data and splitting and serializing using preset type association templates, the sharing difficulties caused by inconsistent data standards in the energy industry network are solved, and the correlation maintenance and accurate sharing of data are achieved.
Patent Information
- Application Number
- CN202411704714.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-26
- Publication Date
- 2025-07-22
- Estimated Expiration
- 2044-11-26
AI Technical Summary
In the energy industry network, due to inconsistent data standards among various energy companies, data sharing and interaction are difficult. The existing technology ignores the correlation between data, resulting in data loss and error after splitting.
By obtaining the type of data to be shared, selecting a preset type association template for splitting, generating a data structure chart, and serializing it to realize data sharing.
Ensure that data remains relevant during sharing, avoid information loss and format errors, and improve the accuracy and efficiency of data sharing.
Smart Images

Figure CN119718713B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of data sharing, and particularly relates to a data sharing method, apparatus, device, storage medium, and computer program product. Background Art
[0002] In the current development of the energy industrial network, the inconsistency of data standard conditions among energy enterprises leads to differences in data reception by the energy industrial network, making unified processing extremely difficult, and further increasing the difficulty of data sharing and interaction.
[0003] Existing methods can split the data to be shared based on its data type, encapsulate the split results, and generate a data interface, so as to realize sharing different formats of acquired data through the above data interface. However, since the existing methods only split the data to be shared based on the data type and ignore the relevance between data, data loss problems occur in the split data to be shared. Summary of the Invention
[0004] The main purpose of this application is to provide a data sharing method, aiming to solve the problem of how to maintain the relevance between data while ensuring data sharing.
[0005] To achieve the above purpose, this application proposes a data sharing method, and the method includes:
[0006] Obtain the data to be shared, and obtain the data types involved in the data to be shared;
[0007] Select a corresponding preset data type association template based on the data type, and split the data to be shared based on the preset data type association template to obtain a data structure diagram;
[0008] Serialize the data structure diagram, and perform data sharing on the data to be shared based on the serialization result.
[0009] In an embodiment, the step of splitting the data to be shared based on the preset data type association template to obtain a data structure diagram includes:
[0010] Obtain the association types between the associated data types based on the preset data type association template;
[0011] Obtain the data content corresponding to each data type, and generate corresponding data nodes based on each data type and the corresponding data content;
[0012] Generate corresponding data edges based on the association types, and generate a data structure diagram according to the data nodes and the data edges.
[0013] In one embodiment, the step of generating corresponding data connection lines based on the association type includes:
[0014] Obtaining the preset algorithms and algorithm weights between the corresponding data nodes based on the association type;
[0015] Generating data connection lines between the corresponding data nodes based on the preset algorithms and the algorithm weights.
[0016] In one embodiment, the step of serializing the data structure diagram includes:
[0017] Traversing the data structure diagram to obtain the corresponding data nodes and data connection lines;
[0018] Serializing the data structure diagram based on the data nodes and the data connection lines.
[0019] In one embodiment, the step of serializing the data structure diagram based on the data nodes and the data connection lines includes:
[0020] Obtaining the data content and adjacent node list corresponding to the data node, and serializing the data node based on the data content and the adjacent node list to obtain node key-value pairs;
[0021] Obtaining the source node, target node, and association weight corresponding to the data connection line, and serializing the data connection line based on the source node, the target node, and the association weight to obtain connection line key-value pairs;
[0022] Serializing the data structure diagram according to the node key-value pairs and the connection line key-value pairs.
[0023] In one embodiment, before the step of obtaining the data to be shared and obtaining the data type involved in the data to be shared, it further includes:
[0024] Defining an initial engine based on preset rules to obtain a preset rule engine;
[0025] The step of obtaining the data type involved in the data to be shared includes:
[0026] Inputting the data to be shared into the preset rule engine to obtain the data type corresponding to the data to be shared.
[0027] In addition, to achieve the above object, the present application also proposes a data sharing device, and the device includes:
[0028] A data acquisition module, configured to acquire data to be shared and acquire the data type involved in the data to be shared;
[0029] A data processing module, configured to select a corresponding preset data type association template based on the data type, and split the data to be shared based on the preset data type association template to obtain a data structure diagram;
[0030] A data sharing module, configured to serialize the data structure diagram and perform data sharing on the data to be shared based on the serialization result.
[0031] In addition, to achieve the above object, the present application further provides a data sharing device, where the device includes: a memory, a processor, and a computer program stored on the memory and executable on the processor, and the computer program is configured to implement the steps of the data sharing method as described above.
[0032] In addition, to achieve the above object, the present application further provides a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium, and when the computer program is executed by a processor, the steps of the data sharing method as described above are implemented.
[0033] In addition, to achieve the above object, the present application further provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, the steps of the data sharing method as described above are implemented
[0034] The present application provides a data sharing method, device, device, storage medium and computer program product. The method includes: acquiring data to be shared and acquiring the data type involved in the shared data; selecting a corresponding preset type association template based on the data type, and splitting the data to be shared based on the preset type association template to generate a data structure diagram; serializing the data structure diagram and sharing the data to be shared based on the serialization result. This shows that the present application can complete data sharing by acquiring the data type involved in the data to be shared, selecting a corresponding preset data type association template according to the data type, splitting the data to be shared based on the preset data type association template and obtaining a data structure diagram, and serializing the data structure. Since the present application splits the data to be shared according to the preset data type association template determined by the data type and analyzes the influence of the correlation between data types on the data to be shared, the shared data is more accurate. Description of the Drawings
[0035] The drawings here are incorporated into the description and form a part of this description, showing embodiments consistent with the present application, and are used together with the description to explain the principles of the present application.
[0036] To more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the accompanying drawings required for the description of the embodiments or the prior art. Obviously, for those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.
[0037] Figure 1 Flowchart of the first embodiment of the data sharing method proposed in this embodiment;
[0038] Figure 2 Example diagram of the data type association template in the data sharing method proposed in this embodiment;
[0039] Figure 3 Example diagram of the data structure diagram in the data sharing method proposed in this embodiment;
[0040] Figure 4 Flowchart of the second embodiment of the data sharing method proposed in this embodiment;
[0041] Figure 5 Data sharing device diagram provided by the embodiments of the present application;
[0042] Figure 6 Structural schematic diagram of a data sharing device suitable for implementing the embodiments of the present application.
[0043] The realization of the objectives of the present application, functional features, and advantages will be further described in conjunction with the embodiments with reference to the accompanying drawings. Detailed implementation manners
[0044] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.
[0045] The following will clearly and completely describe the technical solutions in the embodiments of the present application with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art without creative efforts based on the embodiments in the present application belong to the scope of protection of the present application.
[0046] It should be noted that all the directional indications (such as up, down, left, right, front, back...) in the embodiments of the present application are only used to explain the relative positional relationship and movement conditions between components in a specific posture (as shown in the accompanying drawings). If the specific posture changes, the directional indications will also change accordingly.
[0047] It is understandable that in the energy industrial network, the problem of differences in data standards among enterprises is particularly prominent. Since different energy enterprises follow different data standard conditions, the energy industrial network faces a situation where data of multiple standards and different processing conditions are mixed when receiving data. This situation makes the unified processing of data extremely difficult and seriously hinders the efficiency of data sharing and interaction. To solve this problem, existing technical means attempt to classify data types and then split and encapsulate the data to be shared to generate data interfaces. However, although this method realizes the sharing of different format data to a certain extent, its limitations are also very obvious.
[0048] Existing data processing methods only focus on data types and ignore the internal relevance between data. In practical applications, data does not exist in isolation but is interconnected and mutually influential. If data is only split according to data types, it is easy to cause the split data to lose its original logical relationship, resulting in data errors. Such errors will not only affect the accuracy of data but may also lead to deviations in the decision-making process of enterprises. Therefore, how to maintain the relevance between data while ensuring data sharing has become an urgent problem to be solved in the current energy industrial network.
[0049] Therefore, to solve the problem of how to maintain the relevance between data while ensuring data sharing, this embodiment proposes a data sharing method, which includes: obtaining the data to be shared and the data types involved in the shared data; selecting the corresponding preset type association template based on the data type, and splitting the data to be shared based on the preset type association template to generate a data structure diagram; serializing the data structure diagram and sharing the data to be shared based on the serialization result. This shows that this embodiment can obtain the data types involved in the data to be shared, select the corresponding preset data type association template according to the data type to split the data to be shared and obtain a data structure diagram, and complete data sharing by serializing the data structure. Since this embodiment analyzes the influence of the relevance between data types on the data to be shared, the data to be shared after sharing is more accurate.
[0050] For ease of understanding, the following combines Figures 1 to 6 to specifically introduce the data sharing method provided by the embodiments of the present application and the data sharing methods, devices, equipment, storage media, and computer program products provided by the following embodiments.
[0051] The embodiments of the present application provide a data sharing method. Refer to Figure 1 , Figure 1 which is the flowchart of the first embodiment of the data sharing method proposed by the embodiments of the present application.
[0052] As Figure 1As shown in the figure, the method includes:
[0053] Step S10: Obtain the data to be shared and obtain the data type involved in the data to be shared.
[0054] It should be noted that the execution subject of this embodiment can be a computing service device with functions of data sharing, network communication, and program running, such as a data transmitter, etc., or an electronic device capable of implementing the above functions. In this embodiment, a data sharing device (hereinafter referred to as the device) is used. This device can be a data transmitter device connected to a data acquisition device or can be applied to other scenarios. This embodiment takes the data transmitter device connected to the data acquisition device as an example for illustration, but does not specifically limit this embodiment.
[0055] It should also be noted that the above data to be shared can be information selected as the sharing object in the data sharing of energy enterprises, such as electricity production volume, energy consumption rate, equipment operation status, etc. The above data type can be the data classification corresponding to the data to be shared, such as user name, electricity consumption, electricity price, electricity production volume, etc.
[0056] In specific implementation, during the process of data sharing by the above device, first, the data to be shared is identified and extracted. This step involves screening a large amount of information stored in a database or a data lake to determine which data is to be shared. These data to be shared may include but are not limited to user information, equipment status records, energy consumption, and related price information. At the same time, the above device also needs to obtain the data type involved in these data to be shared. This process ensures that the data can maintain its original attributes and structure during sharing, thus avoiding information loss or format errors during data transmission and docking. By specifically identifying the data type, the above device can build a clear data classification framework, laying a solid foundation for subsequent data splitting, encapsulation, and interface generation.
[0057] Further, in order to accurately identify the data type of the above data to be shared, before the step of obtaining the data to be shared and obtaining the data type involved in the data to be shared, it further includes:
[0058] Define an initial engine based on a preset rule to obtain a preset rule engine;
[0059] The step of obtaining the data type involved in the data to be shared includes:
[0060] Input the data to be shared into the preset rule engine to obtain the data type corresponding to the data to be shared.
[0061] It should be noted that the above-mentioned preset rule engine can be a software system based on predefined rules and algorithms for automated processing and decision-making. In this embodiment, it can be used to identify and classify data types. The above-mentioned preset rules can be methods for identifying the data types of data to be shared, such as a data type library or data recognition algorithms such as keyword matching rules, data range rules, and regular expression rules. Among them, the above-mentioned keyword matching rule can determine the type of data by identifying specific keywords or phrases in the data. For example, data containing words such as "electricity demand value" and "electricity production value" may be electricity demand production data. The above-mentioned data range rule can judge the data type according to the numerical range of the data. For example, a certain numerical value between 0 and 100 may be percentage data. The above-mentioned regular expression rule can match data in a specific format by defining a series of regular expressions, such as email addresses, phone numbers, dates, etc.
[0062] In specific implementation, before the above-mentioned device starts to execute the data sharing process, it first needs to define the initial rule engine according to the preset rules to obtain an accurate and efficient preset rule engine. Among them, it involves configuring the parameters of the rule engine, including but not limited to data recognition criteria, data classification logic, data conversion format, etc. Through this process, the above-mentioned device can ensure that in subsequent data processing, all data to be shared can be correctly identified and processed according to the established rules.
[0063] In the step of the above-mentioned device obtaining the data types involved in the data to be shared, the data set to be shared is first input into the predefined preset rule engine. The core of this step is to utilize the intelligent recognition ability of the rule engine to deeply analyze the data to be shared, so as to determine the specific data type corresponding to each data record or field. The preset rule engine scans and matches the data to be shared through a series of predefined rules and algorithms, and identifies the type of data items.
[0064] In this process, the above-mentioned device will perform the following operations: First, preprocess the data to be shared, clean up invalid or incorrect data, and ensure the quality of the input data; Second, transfer the preprocessed data to the preset rule engine, and the engine classifies the data according to the preset rules and identifies the type of each data item; Finally, the above-mentioned device will mark the corresponding data type for each data or data field according to the output result of the rule engine.
[0065] Through the accurate identification of data types, the above device can ensure that the receiving party can correctly understand and apply the data during the data sharing process, thus avoiding errors or confusion caused by data type mismatches. In addition, the use of the preset rule engine also improves the degree of automation of data processing, reduces manual intervention, and improves the efficiency and accuracy of data sharing.
[0066] Step S20: Select a corresponding preset data type association template based on the data type, and split the data to be shared based on the preset data type association template to obtain a data structure diagram. Select a corresponding preset data type association template based on the data type, and split the data to be shared based on the preset data type association template to obtain a data structure diagram.
[0067] It should be noted that the above preset data association template can be a set of predefined rules and structures for guiding how to split data into structured units according to data types, such as data nodes with empty data content and edges with empty weights. The above device can split the above data to be shared according to the number of data nodes and the edge connection relationship, and input the data content and weight ratio into the data nodes or edges for easy data sharing and exchange. The above data splitting can be a process of decomposing a complete data set into multiple parts or fields according to specific rules and formats for further processing and sharing of data. The above data structure diagram can be a graphical data representation method for displaying the logical relationship and structure between data items to help understand the composition and association of data, and can be composed of nodes and edges.
[0068] In a specific implementation, after the above device successfully obtains the data to be shared and its corresponding data types, it will select corresponding preset data type association templates based on these data types. These templates are pre-designed, and they define the logical relationship and structure between different data types, ensuring that the data can maintain its original semantics and context during the splitting process. The above device provides precise guidance for the splitting of the data to be shared by matching the data types with the templates.
[0069] In addition, the above device can use the selected preset data type association template to split the data to be shared, which is used to decompose a complex data set into smaller, structured data units, and each unit is organized according to the format and rules defined in the template. In this way, the above device can generate a clear data structure diagram, which shows the hierarchical relationship and dependency relationship between data items, providing an intuitive view for data sharing and exchange.
[0070] Reference Figure 2 , Figure 2This is an example diagram of a data type association template in the data sharing method proposed in this embodiment. Here, E, F, G, and H are data nodes with empty data content, and U, V, W, and X are data edges with empty weights. The above data nodes and data edges together form a data type association template. When the connection relationship between data types with data to be shared is consistent with the connection relationship of the data nodes in this data type association template, the data to be shared can be split through this data type association template, and the obtained data content and weight relationship are filled into the above data type association template to obtain a data structure diagram.
[0071] The data structure diagram not only reveals the internal composition structure of the data but also indicates the association paths between data items. This method of splitting and structuring ensures the integrity and consistency of the data during transmission, enabling the receiving party to more easily understand and reuse the data.
[0072] Furthermore, in order to accurately obtain the above data structure diagram, the step of splitting the data to be shared based on the preset data type association template to obtain a data structure diagram includes:
[0073] Obtaining the association types between the associated data types based on the preset data type association template;
[0074] Obtaining the data content corresponding to each data type and generating corresponding data nodes based on each data type and the corresponding data content;
[0075] Generating corresponding data edges based on the association types and generating a data structure diagram according to the data nodes and the data edges.
[0076] It should be noted that the above association types can be a classification describing the relationship between data fields, such as one-to-one, one-to-many, many-to-many, etc., used to define the connection method between nodes in the data structure diagram and the relationship between nodes, such as the independent variable and dependent variable relationship or positive correlation, etc., and can also represent the influence degree between nodes, such as weight ratio, etc. The above data nodes can be the basic units in the data structure diagram, representing a specific information point in the data set, including data type and data content. The above data edges can be the connecting lines in the data structure diagram used to represent the association relationship between data nodes, which can show the direction and logical path of data flow or weight ratio.
[0077] In a specific implementation, the above-mentioned device first determines the association types between various data types according to a preset data type association template. This step involves parsing the rules and logics defined in the template to identify how different data fields are related to each other, such as a direct parent-child relationship, a reference relationship, or other more complex association patterns. By clarifying these association types, the above-mentioned device lays a foundation for constructing a data structure diagram.
[0078] Secondly, the above-mentioned device obtains the data content corresponding to each data type. This involves extracting the data of specific fields from the original data set to ensure that each data item is correctly classified and extracted. On this basis, the above-mentioned device generates data nodes based on each data type and its corresponding data content. Each data node is a basic unit in the data structure diagram, representing a specific information point in the data set.
[0079] Thirdly, the above-mentioned device generates data edges according to the previously determined association types. Data edges play a role in connecting different data nodes in the data structure diagram, symbolizing the logical relationships and flow paths between data. Through these edges, the interaction and dependency relationships between data nodes can be clearly shown.
[0080] Finally, the above-mentioned device combines the generated data nodes and data edges into a complete data structure diagram. This diagram not only shows the static structure of the data but also reveals the dynamic associations between data, providing an intuitive view and operation guide for data sharing and interaction. In this way, the above-mentioned device ensures the accuracy and availability of data during the sharing process, improving the efficiency and security of data exchange.
[0081] Furthermore, the above-mentioned association relationship can be a preset algorithm and weight between data. The step of generating corresponding data edges based on the association type includes:
[0082] Obtaining the preset algorithm and algorithm weight between the corresponding data nodes based on the association type;
[0083] Generating data edges between the corresponding data nodes based on the preset algorithm and the algorithm weight.
[0084] It should be noted that the above-mentioned preset algorithm can be a calculation method or rule used to define how data nodes interact with each other in the data structure diagram, which can be a mathematical formula, a logical judgment, or a data processing flow (such as a formula for calculating power based on current and voltage values). The above-mentioned algorithm weight can be a value assigned to the preset algorithm, representing the relative importance or influence of the algorithm in the relationship between data nodes, affecting the priority and result of data processing.
[0085] In a specific implementation, the above device first parses a preset data type association template to identify the specific algorithms that should be followed between different data nodes, as well as the importance or priority of these algorithms in data flow, that is, the algorithm weights.
[0086] Specifically, the above device will determine appropriate algorithms for the connection between each data node according to the definition of the association type. These algorithms may be simple mapping relationships or complex calculation logics. At the same time, the above device will also assign weights to these algorithms to ensure that important data relationships can be properly emphasized during data sharing and decision-making processes. Finally, based on these preset algorithms and algorithm weights, the above device generates data edges between each data node.
[0087] Reference Figure 3 , Figure 3 is an example diagram of a data structure diagram in the data sharing method proposed in this embodiment. Exemplarily, assume that the acquired data includes: username (such as zhangsan), user electricity consumption (such as Figure 3 500 in Figure 3 ), electricity price (such as Figure 3 0.75 in Figure 3 ), and electricity production (such as Figure 3 800 in
[0088] There is a negative correlation between the electricity price and the user electricity consumption. When the electricity price increases, the user electricity consumption will decrease, where the negative correlation coefficient is K. There is a positive correlation between the electricity production and the user electricity consumption. When the user electricity consumption increases, the electricity production also needs to increase, where the positive correlation coefficient is I. There is also a negative correlation between the electricity production and the electricity price. When the electricity production decreases, the electricity price may increase, where the negative correlation coefficient is L. The above device can generate data nodes (such as
[0089] A, B, C, D in
[0090] Step S30: Serialize the data structure diagram, and perform data sharing on the data to be shared based on the serialization result.
[0089] It should be noted that the above serialization can be a process of converting a data structure or object state into a storable or transmittable format, usually used for data exchange between in-memory structures and other storage media. For example, the process of converting an object into JSON or XML format is serialization.
[0090] In a specific implementation, when the above device executes a data sharing task, it first needs to perform serialization processing on the involved data structure diagram. The purpose of serialization is to convert a complex, non-flattened data structure into a linear format for easy storage, transmission, and parsing of data. For example, the above device may receive a user social network data structure diagram with multiple levels of nested relationships. Through serialization, these relationships can be converted into a series of key-value pairs or markup language elements.
[0091] Based on the above serialization result, the above device can efficiently share the data to be shared. This means that data that could originally only be accessed in a specific system or platform can now be converted into a common format, such as JSON or XML, so that the data can be understood and utilized by different applications and systems.
[0092] This embodiment proposes a data sharing method, which includes: obtaining the data to be shared and the data types involved in the shared data; selecting a corresponding preset type association template based on the data types, and splitting the data to be shared based on the preset type association template to generate a data structure diagram; serializing the data structure diagram, and sharing the data to be shared based on the serialization result. This shows that this embodiment can complete data sharing by obtaining the data types involved in the data to be shared, selecting the corresponding preset data type association template according to the data types to split the data to be shared and obtain a data structure diagram, and serializing the data structure. Since this embodiment analyzes the influence of the relationship between data types on the data to be shared and splits the data to be shared based on this influence, the split data to be shared is more accurate.
[0093] Based on the first embodiment, in the second embodiment, the same or similar content as in the above-mentioned first embodiment can be referred to the above introduction and will not be elaborated hereinafter. On this basis, please refer to Figure 4 , Figure 4 which is the flowchart of the second embodiment of the data sharing method proposed in this embodiment. Further, the step of serializing the data structure diagram includes:
[0094] Step S31: Traverse the data structure diagram to obtain the corresponding data nodes and data edges;
[0095] Step S32: Serialize the data structure diagram based on the data nodes and the data edges.
[0096] It should be noted that traversing a data structure diagram is an algorithmic process used to visit each node in the data structure diagram in a specific order to ensure that all elements are processed. The above serialization can be a process of converting the data structure or object state into a storable or transmittable format, usually for data persistence or network transmission.
[0097] In a specific implementation, after the construction of the data structure diagram is completed, the above device needs to serialize the data structure diagram for easy data transmission and storage. This step first involves traversing the entire data structure diagram to obtain all the data nodes and data edges in the diagram. The above device ensures through systematic retrieval that no node or edge is missed, thus guaranteeing the integrity and accuracy of the data structure diagram.
[0098] During the traversal process, the above device will visit each data node in the data structure diagram in a certain order, and at the same time record the data edges connected to these nodes. These data nodes and data edges together constitute the framework of the data structure diagram, which carry the detailed information of the data and the logical relationships between the data.
[0099] Next, based on these obtained data nodes and data edges, the above device serializes the data structure diagram. Serialization is a process of converting a data structure into a storable or transmittable format. The above device encodes the attributes of the data nodes and edges and their mutual relationships into a standardized format, such as JSON, XML or other custom formats, so that the data structure diagram can be easily stored in a database or transmitted over the network.
[0100] Furthermore, the step of serializing the data structure diagram based on the data nodes and the data edges includes:
[0101] Obtain the data content corresponding to the data node and the adjacent node list, and serialize the data node based on the data content and the adjacent node list to obtain node key-value pairs;
[0102] Obtain the source node, target node and associated weight corresponding to the data edge, and serialize the data edge based on the source node, the target node and the associated weight to obtain edge key-value pairs;
[0103] Serialize the data structure diagram according to the node key-value pairs and the edge key-value pairs.
[0104] It should be noted that the above data content can be the specific information contained in the data node, such as numerical values, text, or other data types. The above adjacent node list can be a list of other data nodes directly connected to a specific data node, representing the direct relationship between the nodes. The above node key-value pair can be a data representation form, where the key is the unique identifier of the data node, and the value is the data content of the node and the adjacent node information. The above edge key-value pair can be a data representation form, where the key is the unique identifier of the data edge, and the value contains information about the source node, target node, and association weight. The above source node can be a data node connected by the edge, and the above target node can be another data node connected to the source node through the above edge. The above association weight can be the relevance and degree of association between the source node and the target node connected by the above data edge.
[0105] In a specific implementation, first, for each data node, the above device obtains its corresponding data content and adjacent node list. This step involves extracting the attribute information of the node from the data structure diagram, including the data value of the node and other nodes directly connected to this node, forming a complete view of the node information.
[0106] Next, based on these data content and adjacent node list, the above device serializes the data node. This process includes converting the attributes and relationships of the node into a key-value pair form, where the key is usually the unique identifier of the node, and the value contains the data content of the node and the adjacent node information. The generation of this node key-value pair provides the basic data unit for the serialization of the data structure diagram.
[0107] At the same time, the above device also processes the data edges. It obtains the source node, target node, and association weight corresponding to each data edge. The source node and target node define the starting point and ending point of the edge, and the association weight represents the strength or importance of the relationship between these two nodes. Based on this information, the above device serializes the data edge to generate edge key-value pairs, which contain sufficient information to reconstruct the relationship network in the data structure diagram.
[0108] Finally, based on the generated node key-value pairs and edge key-value pairs, the above device serializes the entire data structure diagram. This process involves combining all the node key-value pairs and edge key-value pairs into an ordered and structured data set, which can be a JSON object, an XML document, or any other suitable serialization format. In this way, the above device ensures the integrity and reversibility of the data structure diagram after serialization, providing convenience for the sharing and interaction of data between different systems.
[0109] This embodiment also provides a data sharing device. Please refer to Figure 5 ,Figure 5 This is a diagram of the data sharing device provided by the embodiment of the present application. The data sharing device includes:
[0110] A data acquisition module, configured to acquire data to be shared and acquire the data type involved in the data to be shared;
[0111] A data processing module, configured to select a corresponding preset data type association template based on the data type, and split the data to be shared based on the preset data type association template to obtain a data structure diagram;
[0112] A data sharing module, configured to serialize the data structure diagram and perform data sharing on the data to be shared based on the serialization result.
[0113] The data sharing device provided by this embodiment adopts the data sharing method in the above embodiment, and can solve the problem of how to maintain the relevance between data while ensuring data sharing. Compared with the prior art, the beneficial effects of the data sharing device provided by this embodiment are the same as those of the data sharing method provided by the above embodiment, and other technical features in the data sharing device are the same as those disclosed in the above embodiment method, and will not be elaborated here.
[0114] This embodiment provides a data sharing device. The data sharing device includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein, the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the data sharing method in the first embodiment above.
[0115] Next, refer to Figure 6 , Figure 6 , which is a schematic structural diagram of a data sharing device suitable for implementing the embodiment of the present application. The data sharing device in the embodiment of the present application may include, but is not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 6 The data sharing device shown is only an example and should not impose any limitations on the functions and usage scope of the embodiment of the present application.
[0116] As Figure 6As shown, the data sharing device may include a processing device 1001 (such as a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 into a random access memory (RAM: Random Access Memory) 1004. In the RAM 1004, various programs and data required for the operation of the data sharing device are also stored. The processing device 1001, the ROM 1002, and the RAM 1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touchpad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the data sharing device to communicate with other devices wirelessly or wiredly to exchange data. Although the figure shows a data sharing device having various systems, it should be understood that it is not required to implement or have all the shown systems. Instead, more or fewer systems can be implemented or had.
[0117] In particular, according to this embodiment, the process described above with reference to the flowchart can be implemented as a computer software program. For example, this embodiment includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains program codes for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through the communication device, or installed from the storage device 1003, or installed from the ROM 1002. When the computer program is executed by the processing device 1001, the above functions defined in the method of the disclosed embodiment of this embodiment are executed.
[0118] The data sharing device provided in this embodiment adopts the data sharing method in the above embodiment, and can solve the problem of how to maintain the relevance between data while ensuring data sharing. Compared with the prior art, the beneficial effects of the data sharing device provided in this embodiment are the same as those of the data sharing method provided in the above embodiment, and other technical features in this data sharing device are the same as those disclosed in the method of the previous embodiment, and will not be elaborated here.
[0119] It should be understood that the various parts disclosed in this embodiment can be implemented by hardware, software, firmware, or a combination thereof. In the description of the above embodiments, specific features, structures, materials, or characteristics can be combined in a suitable manner in any one or more embodiments or examples.
[0120] As described above, the above is only the specific implementation manner of this embodiment, but the protection scope of this embodiment is not limited thereto. Any person skilled in the art within the technical scope disclosed in this embodiment can easily think of changes or substitutions, which should all be covered within the protection scope of this embodiment. Therefore, the protection scope of this embodiment shall be subject to the protection scope of the claims.
[0121] This embodiment provides a computer-readable storage medium having computer-readable program instructions (i.e., computer programs) stored thereon, and the computer-readable program instructions are used to execute the data sharing method in the above embodiments.
[0122] The computer-readable storage medium provided in this embodiment can be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or any combination of the above. More specific examples of the computer-readable storage medium may include, but are not limited to: electrical connections with one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM) or flash memory, optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the above. In this embodiment, the computer-readable storage medium can be any tangible medium that contains or stores a program, and this program can be used by or combined with an instruction execution system, device, or device. The program code contained on the computer-readable storage medium can be transmitted by any appropriate medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
[0123] The above computer-readable storage medium can be included in the data sharing device; or it can exist separately without being assembled into the data sharing device.
[0124] The above computer-readable storage medium carries one or more programs, and when the above one or more programs are executed by the data sharing device, the data sharing device is caused to: perform data sharing.
[0125] Computer program code for performing the operations of this embodiment may be written in one or more programming languages or combinations thereof. The above-mentioned programming languages include object-oriented programming languages such as Java, Smalltalk, C++, and also include conventional procedural programming languages such as the "C" language or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, executed as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a local area network (LAN: Local Area Network) or a wide area network (WAN: Wide Area Network), or it may be connected to an external computer (for example, by using an Internet service provider to connect through the Internet).
[0126] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions, and operations of the systems, methods, and computer program products according to various embodiments of this embodiment. In this regard, each block in the flowchart or block diagram may represent a module, a program segment, or a part of code that contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than that marked in the accompanying drawings. For example, two consecutively represented blocks may actually be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram and / or flowchart, and the combination of blocks in the block diagram and / or flowchart, may be implemented by a dedicated hardware-based system for performing the specified functions or operations, or may be implemented by a combination of dedicated hardware and computer instructions.
[0127] The modules described in this embodiment may be implemented in software or in hardware. Among them, the name of the module does not constitute a limitation on the unit itself in some cases.
[0128] The readable storage medium provided in this embodiment is a computer-readable storage medium. The computer-readable storage medium stores computer-readable program instructions (i.e., computer programs) for performing the above data sharing method, and can solve the problem of how to maintain the relevance between data while ensuring data sharing. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in this embodiment are the same as those of the data sharing method provided in the above embodiment, and will not be elaborated here.
[0129] The above are only some embodiments, and do not limit the patent scope of this embodiment. Any equivalent structural transformation made under the technical concept of this application by using the content of the specification and drawings of this application, or any direct / indirect application in other related technical fields is included in the patent protection scope of this application.
Claims
1. A data sharing method, characterized in that, The method includes: Obtain the data to be shared and obtain the data type involved in the data to be shared; Select a corresponding preset data type association template based on the data type, and split the data to be shared based on the preset data type association template to obtain a data structure diagram; Serialize the data structure diagram, and perform data sharing on the data to be shared based on the serialization result; The step of splitting the data to be shared based on the preset data type association template to obtain a data structure diagram includes: Obtain the association types between the associated data types based on the preset data type association template; Obtain the data content corresponding to each data type, and generate corresponding data nodes based on each data type and the corresponding data content; Generate corresponding data edges based on the association type, and generate a data structure diagram according to the data nodes and the data edges; The step of generating corresponding data edges based on the association type includes: Obtain the preset algorithm and algorithm weight between the corresponding data nodes based on the association type; Generate data edges between the corresponding data nodes based on the preset algorithm and the algorithm weight; The step of serializing the data structure diagram includes: Traverse the data structure diagram to obtain the corresponding data nodes and data edges; Serialize the data structure diagram based on the data nodes and the data edges; The step of serializing the data structure diagram based on the data nodes and the data edges includes: Obtain the data content and adjacent node list corresponding to the data node, and serialize the data node based on the data content and the adjacent node list to obtain a node key-value pair; Obtain the source node, target node, and association weight corresponding to the data edge, and serialize the data edge based on the source node, the target node, and the association weight to obtain an edge key-value pair; Serialize the data structure diagram according to the node key-value pair and the edge key-value pair.
2. The method according to claim 1, characterized in that Before the step of obtaining the data to be shared and obtaining the data type involved in the data to be shared, it further includes: Define an initial engine based on a preset rule to obtain a preset rule engine; The step of obtaining the data type involved in the data to be shared includes: Input the data to be shared into the preset rule engine to obtain the data type corresponding to the data to be shared.
3. A data sharing device, characterized in that, The device includes: A data acquisition module, configured to acquire the data to be shared and acquire the data type involved in the data to be shared; A data processing module, configured to select a corresponding preset data type association template based on the data type, and split the data to be shared based on the preset data type association template to obtain a data structure diagram; A data sharing module, configured to serialize the data structure diagram and perform data sharing on the data to be shared based on the serialization result; The data processing module is further configured to obtain the association types between the associated data types based on the preset data type association templates; acquire the data content corresponding to each of the data types, and generate corresponding data nodes based on each of the data types and the corresponding data content; generate corresponding data connection lines based on the association types, and generate a data structure diagram according to the data nodes and the data connection lines. The data processing module is further configured to obtain the preset algorithms and algorithm weights between the corresponding data nodes based on the association types; generate the data connection lines between the corresponding data nodes based on the preset algorithms and the algorithm weights. The data sharing module is further configured to traverse the data structure diagram to obtain the corresponding data nodes and the data connection lines; serialize the data structure diagram based on the data nodes and the data connection lines. The data sharing module is further configured to obtain the data content corresponding to the data nodes and the adjacent node list, and serialize the data nodes based on the data content and the adjacent node list to obtain node key-value pairs; obtain the source node, target node, and association weight corresponding to the data connection lines, and serialize the data connection lines based on the source node, the target node, and the association weight to obtain connection line key-value pairs; serialize the data structure diagram according to the node key-value pairs and the connection line key-value pairs.
4. A data sharing device, characterized in that, The device includes: a memory, a processor, and a computer program stored on the memory and executable on the processor, the computer program being configured to implement the steps of the data sharing method as claimed in claim 1 or 2.
5. A storage medium, characterized in that, The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium, the computer program, when executed by a processor, implementing the steps of the data sharing method as claimed in claim 1 or 2.
6. A computer program product, characterized in that, The computer program product includes a computer program, the computer program, when executed by a processor, implementing the steps of the data sharing method as claimed in claim 1 or 2.
Citation Information
Patent Citations
Multi-service sharing method and device based on big data, equipment and storage medium
CN116226459A