Data sharing method and device, equipment, storage medium and computer program product
By obtaining the data type of data to be shared and selecting preset association templates, the data is split and serialized, the data is solved, and data loss caused by ignoring data correlation in the data sharing process in the prior art is solved, and efficient and accurate data sharing is achieved.
Patent Information
- Application Number
- CN202411704714.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-26
- Publication Date
- 2025-03-28
- Estimated Expiration
- 2044-11-26
AI Technical Summary
The prior art ignores the correlation between data in the process of data sharing, resulting in data loss after splitting.
By obtaining the data type of data to be shared, selecting the corresponding preset data type association template, splitting the data to be shared, generating a data structure diagram, and serializing the data structure diagram to be shared to realize data sharing.
While ensuring data sharing, the correlation between data is maintained, data loss is avoided, and the accuracy and efficiency of data sharing are improved.
Smart Images

Figure CN119718713A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of data sharing, and in particular to a data sharing method, apparatus, device, storage medium and computer program product. Background Art
[0002] In the current development of the energy industry network, the inconsistency of data standard conditions among energy companies leads to differences in the energy industry network when receiving data, making unified processing extremely difficult, which in turn increases the difficulty of data sharing and interaction.
[0003] The existing method can split the acquired data based on its data type, split the data to be shared based on the data type, encapsulate the split result and generate a data interface, so as to share the acquired data in different formats through the above data interface. However, since the existing method only splits the shared data based on the data type and ignores the correlation between the data, the data to be shared after the split may be lost. 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 objectives, the present application proposes a data sharing method, which includes:
[0006] Acquire data to be shared, and acquire the data type involved in the data to be shared;
[0007] Selecting a corresponding preset data type association template based on the data type, and splitting the data to be shared based on the preset data type association template to obtain a data structure diagram;
[0008] The data structure diagram is serialized, and the data to be shared is shared based on the serialization result.
[0009] In one 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] Obtaining an association type between the associated data types based on the preset data type association template;
[0011] Acquire 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;
[0012] A corresponding data edge is generated based on the association type, and a data structure graph is generated according to the data nodes and the data edge.
[0013] In one embodiment, the step of generating a corresponding data edge based on the association type includes:
[0014] Based on the association type, obtain the corresponding preset algorithm and algorithm weight between each of the data nodes;
[0015] Based on the preset algorithm and the algorithm weight, data edges between corresponding data nodes are generated.
[0016] In one embodiment, the step of serializing the data structure graph includes:
[0017] Traversing the data structure graph to obtain the corresponding data nodes and data edges;
[0018] The data structure graph is serialized based on the data nodes and the data edges.
[0019] In one embodiment, the step of serializing the data structure graph based on the data nodes and the data edges includes:
[0020] Acquire the data content and the 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;
[0021] Obtaining a source node, a target node, and an associated weight corresponding to the data edge, and serializing the data edge based on the source node, the target node, and the associated weight to obtain an edge key-value pair;
[0022] The data structure graph is serialized according to the node key-value pairs and the edge 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, the step 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] The data to be shared is input into a preset rule engine to obtain a data type corresponding to the data to be shared.
[0027] In addition, to achieve the above purpose, the present application also proposes a data sharing device, the device comprising:
[0028] A data acquisition module, used to acquire the data to be shared and the data type involved in the data to be shared;
[0029] A data processing module, used for selecting a corresponding preset data type association template based on the data type, and splitting the to-be-shared data based on the preset data type association template to obtain a data structure diagram;
[0030] The data sharing module is used to serialize the data structure diagram and share the data to be shared based on the serialization result.
[0031] In addition, to achieve the above objectives, the present application also proposes a data sharing device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the data sharing method described above.
[0032] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, which is a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the data sharing method described above are implemented.
[0033] In addition, in order to achieve the above-mentioned purpose, the present application also proposes 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 described above are implemented.
[0034] The present application proposes a data sharing method, device, equipment, storage medium and computer program product, the method comprising: obtaining the data to be shared, and obtaining 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 obtain the data type involved in the data to be shared, and select the corresponding preset data type association template according to the data type, and split the data to be shared based on the preset data type association template and obtain the data structure diagram, and complete data sharing by 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 impact of the correlation between data types on the data to be shared, the shared data is made more accurate. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0036] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0037] Figure 1 This is a flow chart of a first embodiment of the data sharing method proposed in this embodiment;
[0038] Figure 2 This is an example diagram of a data type association template in the data sharing method proposed in this embodiment;
[0039] Figure 3 This is an example diagram of a data structure diagram in the data sharing method proposed in this embodiment;
[0040] Figure 4 This is a flow chart of a second embodiment of the data sharing method proposed in this embodiment;
[0041] Figure 5 A diagram of a data sharing device provided in an embodiment of the present application;
[0042] Figure 6 It is a structural diagram of a data sharing device suitable for implementing the embodiment of the present application.
[0043] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[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 be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0046] It should be noted that all directional indications in the embodiments of the present application (such as up, down, left, right, front, back, etc.) are only used to explain the relative position relationship, movement status, etc. between the components under a certain specific posture (as shown in the accompanying drawings). If the specific posture changes, the directional indication will also change accordingly.
[0047] It is understandable that in the energy industry network, the problem of differences in data standards between enterprises is particularly prominent. Since different energy companies follow different data standard conditions, the energy industry network faces a mixed situation of data with multiple standards and different processing conditions when receiving data. This situation makes it extremely difficult to uniformly process data, which seriously hinders the efficiency of data sharing and interaction. In order to solve this problem, existing technical means attempt to divide the data into types, and then split and encapsulate the data to be shared to generate a data interface. However, although this method has achieved the sharing of data in different formats to a certain extent, its limitations are also very obvious.
[0048] Existing data processing methods only focus on data types and ignore the inherent correlation between data. In practical applications, data does not exist in isolation, but is interconnected and mutually influential. If data is split only according to data type, it is easy to cause the split data to lose its original logical relationship, thereby causing data errors. This error not only affects the accuracy of the data, but may also cause deviations in the decision-making process of the enterprise. Therefore, how to maintain the correlation between data while ensuring data sharing has become an urgent problem to be solved in the current energy industry network.
[0049] Therefore, in order to solve the problem of how to maintain the correlation between data while ensuring data sharing, this embodiment proposes a data sharing method, which includes: obtaining the data to be shared, and obtaining the data type 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 type involved in the data to be shared, and select the corresponding preset data type association template according to the data type to split the data to be shared and obtain the data structure diagram, and complete data sharing by serializing the data structure. Since this embodiment analyzes the impact of the correlation between data types on the shared data, the data to be shared after sharing is more accurate.
[0050] For ease of understanding, the following combination Figures 1 to 6 The data sharing method provided in the embodiments of the present application and the data sharing methods, devices, equipment, storage media and computer program products provided in the following embodiments are introduced in detail.
[0051] The present application embodiment provides a data sharing method, referring to Figure 1 , Figure 1 This is a flow chart of the first embodiment of the data sharing method proposed in the embodiments of the present application.
[0052] like Figure 1As shown, the method includes:
[0053] Step S10: Acquire the data to be shared, and acquire 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 data sharing, network communication and program running functions, such as a data transmitter, or an electronic device capable of realizing the above functions. This embodiment adopts a data sharing device (hereinafter referred to as the device), which can be a data transmitter device connected to a data acquisition device and can also be applied to other scenarios. This embodiment takes a data transmitter device connected to a data acquisition device as an example for explanation but does not specifically limit this embodiment.
[0055] It should also be noted that the above-mentioned data to be shared can be information selected as sharing objects in energy enterprise data sharing, such as electricity production, energy consumption rate, equipment operating status, etc. The above-mentioned data type can be data classification corresponding to the data to be shared, such as user name, electricity consumption, electricity price, electricity production, etc.
[0056] In a specific implementation, the above-mentioned devices, in the process of executing data sharing, first identify and extract the data to be shared. This step involves screening a large amount of information stored in a database or data lake to determine which data is to be shared. These data to be shared may include but are not limited to user information, device status records, energy consumption, and related price information. At the same time, the above-mentioned devices also need to obtain the data types involved in these data to be shared. This process ensures that the data can maintain its original properties and structure when shared, thereby avoiding information loss or format errors during data transmission and docking. Through the specific identification of data types, the above-mentioned devices can build a clear data classification framework, laying a solid foundation for subsequent data splitting, encapsulation, and interface generation.
[0057] Furthermore, in order to accurately identify the data type of the 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, the following step is further included:
[0058] Defining an initial engine based on preset rules to obtain a preset rule engine;
[0059] The step of obtaining the data type involved in the data to be shared includes:
[0060] The data to be shared is input into a preset rule engine to obtain a data type corresponding to the data to be shared.
[0061] It should be noted that the 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 preset rules can be methods for identifying the data types of the shared data, such as data type libraries or data identification algorithms, such as keyword matching rules, data range rules, and regular expression rules. Among them, the keyword matching rules can be used to 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 data range rules can be used to determine the data type based on the numerical range of the data. For example, a numerical value between 0 and 100 may be percentage data. The regular expression rules can be used to match data in a specific format by defining a series of regular expressions, such as email addresses, telephone numbers, dates, etc.
[0062] In a 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. This involves configuring the parameters of the rule engine, including but not limited to data identification standards, data classification logic, data conversion format, etc. Through this process, the above-mentioned device can ensure that in the subsequent data processing, all data to be shared can be correctly identified and processed according to the established rules.
[0063] In the step of obtaining the data type involved in the data to be shared, the above device first inputs the data set to be shared into the defined preset rule engine. The core of this step is to use the intelligent recognition ability of the rule engine to conduct in-depth analysis of 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 to identify the type of data items.
[0064] During this process, the above-mentioned devices will perform the following operations: first, pre-process the shared data to clean up invalid or erroneous data to ensure the quality of the input data; second, pass the pre-processed 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 devices will mark the corresponding data type for each piece of data or data field based on the output results of the rule engine.
[0065] By accurately identifying data types, the above devices can ensure that the recipient can correctly understand and apply the data during data sharing, thereby avoiding errors or confusion caused by mismatched data types. In addition, the use of preset rule engines also improves the 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-mentioned 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-mentioned device can split the above-mentioned 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 to facilitate data sharing and exchange. The above-mentioned data splitting can be the process of decomposing a complete data set into multiple parts or fields according to specific rules and formats, so as to facilitate further processing and sharing of data. The above-mentioned data structure diagram can be a graphical data representation method used to show the logical relationship and structure between data items, help understand the composition and association of data, and can be composed of nodes and edges.
[0068] In a specific implementation, after successfully acquiring the data to be shared and its corresponding data type, the above device will select the corresponding preset data type association template 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 type with the template.
[0069] In addition, the above-mentioned device can use the selected preset data type association template to split the shared data to decompose the complex data set into smaller, structured data units, each of which is organized according to the format and rules defined in the template. In this way, the above-mentioned device can generate a clear data structure diagram that shows the hierarchical relationship and dependency relationship between data items, providing an intuitive view for data sharing and exchange.
[0070] refer to Figure 2 , Figure 2This is an example diagram of a data type association template in the data sharing method proposed in this embodiment, wherein the above-mentioned 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-mentioned data nodes and the above-mentioned data edges together constitute a data type association template. When the connection relationship between the data types with shared data is consistent with the connection relationship between the data nodes in the data type association template, the data type association template can be used to split the data to be shared, and the data content and weight relationship obtained by the split are filled into the above-mentioned data type association template to obtain a data structure diagram.
[0071] The data structure diagram not only reveals the internal structure of the data, but also indicates the association paths between data items. This splitting and structuring method ensures the integrity and consistency of the data during transmission, making it easier for the recipient to 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 the data structure diagram includes:
[0073] Obtaining an association type between the associated data types based on the preset data type association template;
[0074] Acquire 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;
[0075] A corresponding data edge is generated based on the association type, and a data structure graph is generated according to the data nodes and the data edge.
[0076] It should be noted that the above-mentioned association type can be a classification that describes the relationship between data fields, such as one-to-one, one-to-many, many-to-many, etc., which is used to define the connection method between nodes in the data structure diagram and the connection between nodes, such as the relationship between independent variables and dependent variables or positive correlation, etc., and can also indicate the degree of influence between nodes, such as weight ratio, etc. The above-mentioned data node can be the basic unit in the data structure diagram, representing a specific information point in the data set, including data type and data content. The above-mentioned data edge can be a connection line in the data structure diagram that is used to indicate the association relationship between data nodes, which can show the direction of data flow and the logical path or weight ratio.
[0077] In a specific implementation, the above device first determines the association type between data types based on a preset data type association template. This step involves parsing the rules and logic defined in the template to identify how different data fields are related to each other, such as direct parent-child relationships, reference relationships, or other more complex association patterns. By clarifying these association types, the above device lays the foundation for building a data structure diagram.
[0078] Secondly, the above device obtains the data content corresponding to each data type. This involves extracting data of specific fields from the original data set, ensuring that each data item is correctly classified and extracted. On this basis, the above 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, which represents a specific information point in the data set.
[0079] Again, the above device generates data edges according to the previously determined association type. Data edges play the role of connecting different data nodes in the data structure diagram. They symbolize the logical relationship and flow path between data. Through these edges, the interaction and dependency between data nodes can be clearly displayed.
[0080] Finally, the above devices combine 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 the data, providing an intuitive view and operation guide for data sharing and interaction. In this way, the above devices ensure the accuracy and availability of data during the sharing process, and improve the efficiency and security of data exchange.
[0081] Furthermore, the above association relationship may be a preset algorithm and weight between data, and the step of generating corresponding data edges based on the association type includes:
[0082] Based on the association type, obtain the corresponding preset algorithm and algorithm weight between each of the data nodes;
[0083] Based on the preset algorithm and the algorithm weight, data edges between corresponding data nodes are generated.
[0084] It should be noted that the above-mentioned preset algorithm can be a calculation method or rule in the data structure diagram that is used to define how data nodes interact with each other. It can be a mathematical formula, logical judgment or data processing flow (for example, a formula for calculating power based on current and voltage values). The above-mentioned algorithm weight can be a numerical value assigned to the preset algorithm, which is used to indicate the relative importance or influence of the algorithm in the relationship between data nodes, affecting the priority and results of data processing.
[0085] In a specific implementation, the above-mentioned device first parses the 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 weight.
[0086] Specifically, the above-mentioned device will determine the appropriate algorithm for the connection between each data node based on the definition of the association type. These algorithms may be simple mapping relationships or complex calculation logic. At the same time, the above-mentioned device will also assign weights to these algorithms to ensure that important data relationships can be properly valued during data sharing and decision-making. Finally, the above-mentioned device generates data edges between each data node based on these preset algorithms and algorithm weights.
[0087] refer to Figure 3 , Figure 3 This is an example diagram of the data structure diagram in the data sharing method proposed in this embodiment. For example, it is assumed that the acquired data includes: user name (such as zhangsan), user power consumption (such as Figure 3 500), electricity prices (such as Figure 3 0.75), power generation (such as Figure 3 800). Among them, there is a negative correlation between electricity price and user electricity consumption. When electricity price increases, user electricity consumption will decrease, where the negative correlation coefficient is K. There is a positive correlation between power generation and user electricity consumption. When user electricity consumption increases, power generation also needs to increase, where the positive correlation coefficient is I. There is also a negative correlation between power generation and electricity price. When power generation decreases, electricity price may increase, where the negative correlation coefficient is L. The above-mentioned device can generate data nodes (such as) according to the data types: user name, user electricity consumption, power generation and electricity price and combined with the data content therein. Figure 3 A, B, C, D), generate data edges according to the correlation between each data type (such as Figure 3 In K, I, L), a data structure diagram is obtained based on the above data nodes and the above data edges.
[0088] Step S30: serialize the data structure diagram, and share the data to be shared based on the serialization result.
[0089] It should be noted that the above serialization can be the process of converting a data structure or object state into a storable or transmittable format, which is usually used for data exchange between 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-mentioned device performs a data sharing task, it first needs to serialize the data structure graph involved. The purpose of serialization is to convert a complex, non-flat data structure into a linear format to facilitate data storage, transmission and parsing. For example, the above-mentioned device may receive a user social network data structure graph containing multiple layers 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 serialization results, the devices can efficiently share the data to be shared, which means that data that was originally only accessible in a specific system or platform can now be converted into a universal format, such as JSON or XML, so that the data can be understood and used by different applications and systems.
[0092] This embodiment proposes a data sharing method, which includes: obtaining the data to be shared, and obtaining 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 this embodiment can complete data sharing by obtaining the data type involved in the data to be shared, and selecting a 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 serializing the data structure. Since this embodiment analyzes the impact of the association between data types on the data to be shared and splits the data to be shared based on the impact, the split data to be shared is more accurate.
[0093] Based on the first embodiment, in the second embodiment, the same or similar contents as those in the above-mentioned embodiment 1 can be referred to the above introduction, and will not be described in detail later. Figure 4 , Figure 4 This is a flow chart 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 graph to obtain the corresponding data nodes and data edges;
[0095] Step S32: Serializing the data structure graph based on the data nodes and the data edges.
[0096] It should be noted that traversing a data structure graph is an algorithmic process used to access each node in the data structure graph in a specific order to ensure that all elements are processed. The above serialization can be a process of converting a data structure or object state into a storable or transmittable format, which is usually used for data persistence or network transmission.
[0097] In a specific implementation, after completing the construction of the data structure graph, the above-mentioned device needs to serialize the data structure graph to facilitate data transmission and storage. This step first involves traversing the entire data structure graph to obtain all data nodes and data edges in the graph. The above-mentioned device ensures that no node or edge is missed through systematic retrieval, thereby ensuring the integrity and accuracy of the data structure graph.
[0098] During the traversal process, the above devices will access each data node in the data structure diagram in a certain order, and record the data edges connected to these nodes. These data nodes and data edges together constitute the skeleton of the data structure diagram, which carries detailed information about the data and the logical relationship between the data.
[0099] Next, the above device serializes the data structure graph based on the acquired data nodes and data edges. Serialization is a process of converting a data structure into a storable or transmittable format. The above device encodes the attributes of data nodes and edges and their relationships into a standardized format, such as JSON, XML or other custom formats, so that the data structure graph can be easily stored in a database or transmitted over the network.
[0100] Furthermore, the step of serializing the data structure graph based on the data nodes and the data edges includes:
[0101] Acquire the data content and the 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;
[0102] Obtaining a source node, a target node, and an associated weight corresponding to the data edge, and serializing the data edge based on the source node, the target node, and the associated weight to obtain an edge key-value pair;
[0103] The data structure graph is serialized according to the node key-value pairs and the edge key-value pairs.
[0104] It should be noted that the above-mentioned data content can be specific information contained in the data node, such as a numerical value, text or other data type. The above-mentioned adjacent node list can be a list of other data nodes directly connected to a specific data node, indicating the direct relationship between the nodes. The above-mentioned node key-value pair can be a data representation form, wherein the key is a unique identifier of the data node, and the value is the data content of the node and the adjacent node information. The above-mentioned edge key-value pair can be a data representation form, wherein the key is a unique identifier of the data edge, and the value contains information about the source node, the target node and the associated weight. The above-mentioned source node can be a data node connected by an edge, the above-mentioned target node can be another data node connected to the source node through the above-mentioned edge, and the above-mentioned associated weight can be the correlation between the source node and the target node connected by the above-mentioned data edge and the degree of association.
[0105] In the specific implementation, first, the above device obtains the corresponding data content and adjacent node list for each data node. This step involves extracting the node's attribute information from the data structure graph, including the node's data value and other nodes directly connected to the node, forming a complete view of the node information.
[0106] Next, the above device serializes the data nodes based on the data contents and the list of adjacent nodes. This process involves converting the attributes and relationships of the nodes into a key-value pair, where the key is usually the unique identifier of the node, and the value contains the data content of the node and the information of the adjacent nodes. The generation of this node key-value pair provides the basic data unit for the serialization of the data structure graph.
[0107] At the same time, the above device also processes data edges. It obtains the source node, target node, and associated weight corresponding to each data edge. The source node and target node define the starting point and end point of the edge, while the associated weight represents the strength or importance of the relationship between the two nodes. Based on this information, the above device serializes the data edges and generates edge key-value pairs, which contain enough information to reconstruct the relationship network in the data structure graph.
[0108] Finally, the above device serializes the entire data structure graph based on the generated node key-value pairs and edge key-value pairs. This process involves combining all node key-value pairs and edge key-value pairs into an ordered, structured data set, which can be a JSON object, XML document, or any other suitable serialization format. In this way, the above device ensures the integrity and reproducibility of the data structure graph after serialization, facilitating 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 A diagram of a data sharing device provided in an embodiment of the present application, wherein the data sharing device comprises:
[0110] A data acquisition module, used to acquire the data to be shared and the data type involved in the data to be shared;
[0111] A data processing module, used for selecting a corresponding preset data type association template based on the data type, and splitting the to-be-shared data based on the preset data type association template to obtain a data structure diagram;
[0112] The data sharing module is used to serialize the data structure diagram and share the data to be shared based on the serialization result.
[0113] The data sharing device provided in this embodiment adopts the data sharing method in the above embodiment, which 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 the beneficial effects of the data sharing method provided in the above embodiment, and other technical features in the data sharing device are the same as the features disclosed in the above embodiment method, which will not be repeated here.
[0114] This embodiment provides a data sharing device, which includes: at least one processor; and a memory that is communicatively connected to the at least one processor; wherein the memory stores instructions that can be executed 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 above-mentioned embodiment one.
[0115] Reference below Figure 6 , Figure 6 Schematic diagram of the structure 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 merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0116] like Figure 6As shown, the data sharing device may include a processing device 1001 (e.g., a central processing unit, a graphics processor, 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 to a random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the data sharing device are also stored. The processing device 1001, ROM1002, and RAM1004 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 touch pad, 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 by wire to exchange data. Although the data sharing device with various systems is shown in the figure, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented or have alternatively.
[0117] In particular, according to the present embodiment, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the present embodiment includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through a 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-mentioned functions defined in the method of the embodiment disclosed in the present embodiment are executed.
[0118] The data sharing device provided in this embodiment adopts the data sharing method in the above embodiment, which 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 the beneficial effects of the data sharing method provided in the above embodiment, and other technical features in the data sharing device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated 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 any one or more embodiments or examples in a suitable manner.
[0120] The above is only a specific implementation of this embodiment, but the protection scope of this embodiment is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in this embodiment, which should be included in the protection scope of this embodiment. Therefore, the protection scope of this embodiment should be based on the protection scope of the claims.
[0121] This embodiment provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, and the computer-readable program instructions are used to execute the data sharing method in the above embodiment.
[0122] The computer-readable storage medium provided in this embodiment may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM: Random Access Memory), a read-only memory (ROM: Read Only Memory), an erasable programmable read-only memory (EPROM: Erasable Programmable Read Only Memory or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM: CD-Read Only Memory), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency: Radio Frequency), etc., or any suitable combination of the above.
[0123] The computer-readable storage medium may be included in the data sharing device; or may exist independently without being assembled into the data sharing device.
[0124] The computer-readable storage medium carries one or more programs. When the one or more programs are executed by the data sharing device, the data sharing device is enabled to: perform data sharing.
[0125] The computer program code for performing the operation of the present embodiment can be written in one or more programming languages or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as an independent software package, partially on the user's computer and partially on the remote computer, or entirely on the remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (for example, using an Internet service provider to connect through the Internet).
[0126] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present embodiment. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0127] The modules involved in the description of this embodiment may be implemented by software or hardware, wherein 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, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned 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 the beneficial effects of the data sharing method provided in the above-mentioned embodiment, and will not be repeated here.
[0129] The above descriptions are only some embodiments, and are not intended to limit the patent scope of this embodiment. All equivalent structural changes made using the contents of the specification and drawings of this application under the technical concept of this application, or directly / indirectly applied in other related technical fields are included in the patent protection scope of this application.
Claims
1. A data sharing method, characterized in that: The method comprises: Acquire data to be shared, and acquire the data type involved in the data to be shared; Selecting a corresponding preset data type association template based on the data type, and splitting the data to be shared based on the preset data type association template to obtain a data structure diagram; The data structure diagram is serialized, and the data to be shared is shared based on the serialization result.
2. The method according to claim 1, characterized in that The step of splitting the data to be shared based on the preset data type association template to obtain a data structure diagram includes: Obtaining an association type between the associated data types based on the preset data type association template; Acquire 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; A corresponding data edge is generated based on the association type, and a data structure graph is generated according to the data nodes and the data edge.
3. The method according to claim 2, characterized in that The step of generating a corresponding data edge based on the association type includes: Based on the association type, obtain the corresponding preset algorithm and algorithm weight between each of the data nodes; Based on the preset algorithm and the algorithm weight, data edges between corresponding data nodes are generated.
4. The method according to claim 2, characterized in that The step of serializing the data structure diagram comprises: Traversing the data structure graph to obtain the corresponding data nodes and data edges; The data structure graph is serialized based on the data nodes and the data edges.
5. The method according to claim 4, characterized in that The step of serializing the data structure graph based on the data nodes and the data edges includes: Acquire the data content and the 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; Obtaining a source node, a target node, and an associated weight corresponding to the data edge, and serializing the data edge based on the source node, the target node, and the associated weight to obtain an edge key-value pair; The data structure graph is serialized according to the node key-value pairs and the edge key-value pairs.
6. 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, the method further includes: Defining an initial engine based on preset rules to obtain a preset rule engine; The step of obtaining the data type involved in the data to be shared includes: The data to be shared is input into a preset rule engine to obtain a data type corresponding to the data to be shared.
7. A data sharing device, characterized in that: The device comprises: A data acquisition module, used to acquire the data to be shared and the data type involved in the data to be shared; A data processing module, used for selecting a corresponding preset data type association template based on the data type, and splitting the to-be-shared data based on the preset data type association template to obtain a data structure diagram; The data sharing module is used to serialize the data structure diagram and share the data to be shared based on the serialization result.
8. A data sharing device, characterized in that: The device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the data sharing method according to any one of claims 1 to 6.
9. 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. When the computer program is executed by a processor, the steps of the data sharing method according to any one of claims 1 to 6 are implemented.
10. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the steps of the data sharing method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Multi-service sharing method and device based on big data, equipment and storage medium
CN116226459A
Cited By
Data model management method and device, electronic equipment and storage medium
CN120670402A