Updating method and device for data in energy internet marketing service system and storage medium

Through the introduction of diagram neural networks in the energy Internet marketing service system, dynamic selection of database nodes for data update, solving the problem of uneven load load of distributed database nodes, and improving system stability and performance.

CN119377240AActive Publication Date: 2025-01-28NORTH CHINA GRID MEASUREMENT CENT +2

Patent Information

Application Number
CN202411520567.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-29
Publication Date
2025-01-28
Estimated Expiration
2044-10-29

AI Technical Summary

Technical Problem

In the energy Internet marketing service system, the node load of the distributed database is unbalanced, resulting in excessive processing volume of the dispatch nodes and even downtime, affecting system performance. The prior art adopts multiple scheduling nodes, but the scheduling algorithm is complex, the maintenance cost is high, and it is difficult to solve the problem of unbalanced data storage.

Method used

It proposes a data update method based on graphic neural network. By scheduling the node to determine the storage location of the operation type and data object, the diagram neural network is used to select the appropriate database node for data operation to avoid the use of load balancing and data migration algorithm.

Benefits of technology

Effectively solve the problem of imbalanced data storage, reduce the burden of scheduling nodes, improve the stability and performance of the system, and avoid data inconsistency caused by data update failure.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119377240A_ABST
    Figure CN119377240A_ABST
Patent Text Reader

Abstract

The invention provides a method and device for updating data in an energy internet marketing service system and a storage medium, and the method comprises the steps: receiving an operation request of a user at any energy sales terminal of a channel, and transmitting the operation request to a scheduling node of a data medium and a database node connected with the energy sales terminal; obtaining an operation type and an operation data identifier from the operation request, if the operation type is addition or modification, judging whether an operated data object is stored on a database node connected with the energy sales terminal based on the operation data identifier, and if not, executing the operation on the energy sales terminal; if yes, one database node is selected from the M database nodes on the basis of the first graph neural network, a data operation memory space is opened up on the database node, updating of the data object is completed in the space on the basis of the operation type and the operation data identifier, and the data object in the corresponding database node is updated on the basis of the updated operation object. And the burden of the scheduling node is greatly reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of database operation, and in particular to a method, device and storage medium for updating middleware data in an energy internet marketing service system. Background Art

[0002] Energy Internet marketing service system, for example, the marketing system on the power grid involves multiple sales channels, each sales channel has multiple sales terminals, and the amount of transaction data per unit time (such as one day or one hour, etc.) is extremely large. Therefore, a distributed database is generally used to store transaction data. Since there are many database nodes, a balancing algorithm is required for load balancing when storing data, and when the amount of data on a certain database node is large, a data migration algorithm is required to migrate its data. These operations require the use of scheduling nodes. Due to the large amount of power grid transaction data, the data processing volume of the scheduling node increases. In extreme cases, the scheduling node may crash, affecting system performance.

[0003] In the prior art, there is another method of using multiple scheduling nodes. However, using multiple scheduling nodes makes the scheduling algorithm more complicated, making it difficult to find bugs when they occur, and the maintenance cost is high. Summary of the invention

[0004] The present invention proposes the following technical solutions to address one or more technical deficiencies in the above-mentioned prior art.

[0005] The present invention proposes a method for updating data in a middle platform of an energy internet marketing service system, wherein the energy internet marketing service system comprises a data middle platform and energy sales terminals of N channels, wherein the data middle platform is constructed based on a distributed database, wherein the distributed database has M database nodes, and the energy sales terminals of the N channels are connected to a scheduling node of the data middle platform via the Internet, and the energy sales terminals of the N channels are connected to at least one database node of the M database nodes, and the method comprises:

[0006] A request step, receiving an operation request from a user at any energy sales terminal in a channel, and sending the operation request to the scheduling node of the data center and the database node connected to the energy sales terminal;

[0007] A judgment step, the scheduling node obtains the operation type and the operation data identifier from the operation request. If the operation type is addition or modification, it is judged based on the operation data identifier whether the data object of the operation is stored in the database node connected to the energy sales terminal. If yes, a data operation memory space is opened on the database node connected to the energy sales terminal. If not, a database node is selected from the M database nodes based on the first graph neural network, and a data operation memory space is opened on the selected database node.

[0008] An updating step, completing the updating of the data object in the data operation memory space based on the operation type and the operation data identifier, and updating the data object in the corresponding database node based on the updated operation object;

[0009] Among them, M≥2, N≥2.

[0010] Furthermore, the operation of opening up a data operation memory space on the database node connected to the energy sales terminal includes: if there is only one database node connected to the energy sales terminal, then opening up a data operation memory space on the database node; if there are more than one database nodes connected to the energy sales terminal, then randomly selecting a database node to open up a data operation memory space on it.

[0011] Furthermore, the operation of the update step is: locking the data operation memory space, if the operation type is addition, the operation data identifier and the data object are combined into a data record in the data operation memory space, if there is a database node connected to the energy sales terminal, the data record is inserted into the database table in the database node connected to the energy sales terminal, if there is no database node connected to the energy sales terminal, the data record is inserted into the database table in a database node selected from M database nodes based on the first graph neural network; if the operation type is modification and there is a database node connected to the energy sales terminal, Based on the operation data identifier, the original data object is read from the database node connected to the energy sales terminal into the data operation memory space, the data object is used to modify the original data object in the data operation memory space, and the modified data object and the operation data identifier are used to form a data record in the data operation memory space, and the modified data record is used to replace the data record of the database table in the database node connected to the energy sales terminal based on the operation data identifier. If the operation type is modification and there is no database node connected to the energy sales terminal, the scheduling node searches for the database node where the data record is located based on the operation data identifier. If If the database node where the data record is located is the same node as a database node selected from the M database nodes based on the first graph neural network, then the original data object is read from the same database node to the data operation memory space based on the operation data identifier, the original data object is modified using the data object in the data operation memory space, and the modified data object and the operation data identifier are used to form a data record in the data operation memory space, and the modified data record replaces the data record of the database table in the same node based on the operation data identifier. If the database node where the data record is located is not the same node as the database node selected from the M database nodes based on the first graph neural network, then the scheduling node reads the original data object from another data node different from the selected database node to the data operation memory space based on the operation data identifier, the original data object is modified using the data object in the data operation memory space, and the modified data object and the operation data identifier are used to form a data record in the data operation memory space, and the modified data record is inserted into the database table of the selected database node based on the operation data identifier, and the data record of the data table in another data node different from the selected database node is deleted based on the operation data identifier.

[0012] Furthermore, the graph of the first graph neural network is composed as follows: N channels serve as N channel nodes of the graph, and M database nodes serve as M database nodes of the graph. If an energy sales terminal of a channel is connected to a database node, there is an edge between the channel node and the database node, otherwise, there is no edge.

[0013] Furthermore, the characteristic value of the channel node is:

[0014]

[0015] The characteristic values ​​of the M database nodes are:

[0016]

[0017] Among them, Cchannel i Represents the eigenvalue of the i-th channel node, Ter i represents the number of sales terminals connected to the i-th channel node, sumTertrans i represents the sum of transactions per unit time of all sales terminals connected to the i-th channel node, Cdatabase j Represents the characteristic value of the j-th database node, link j Represents the number of channels connected to the j-th database node, N≥i≥1, M≥j≥1.

[0018] Furthermore, the weight of the edge between the channel node and the database node of the graph neural network is:

[0019]

[0020] Furthermore, if the operation type is deletion, the scheduling node directly deletes the corresponding data record based on the operation data identifier.

[0021] The present invention also proposes a device for updating data in a middle platform of an energy internet marketing service system, wherein the energy internet marketing service system comprises a data middle platform and energy sales terminals of N channels, wherein the data middle platform is constructed based on a distributed database, wherein the distributed database has M database nodes, and the energy sales terminals of the N channels are connected to the scheduling node of the data middle platform via the Internet, and the energy sales terminals of the N channels are connected to at least one database node of the M database nodes, and the device comprises:

[0022] A request unit, receiving an operation request from a user at any energy sales terminal in a channel, and sending the operation request to the scheduling node of the data center and the database node connected to the energy sales terminal;

[0023] A judgment unit, wherein the scheduling node obtains an operation type and an operation data identifier from the operation request. If the operation type is addition or modification, it is judged based on the operation data identifier whether the data object of the operation is stored in a database node connected to the energy sales terminal. If yes, a data operation memory space is opened on the database node connected to the energy sales terminal. If not, a database node is selected from the M database nodes based on the first graph neural network, and a data operation memory space is opened on the selected database node.

[0024] An updating unit, which completes the updating of the data object based on the operation type and the operation data identifier in the data operation memory space, and updates the data object in the corresponding database node based on the updated operation object;

[0025] Among them, M≥2, N≥2.

[0026] Furthermore, the operation of opening up a data operation memory space on the database node connected to the energy sales terminal includes: if there is only one database node connected to the energy sales terminal, then opening up a data operation memory space on the database node; if there are more than one database nodes connected to the energy sales terminal, then randomly selecting a database node to open up a data operation memory space on it.

[0027] Furthermore, the operation of the update unit is: locking the data operation memory space, if the operation type is addition, the operation data identifier and the data object are combined into a data record in the data operation memory space, if there is a database node connected to the energy sales terminal, the data record is inserted into the database table in the database node connected to the energy sales terminal, if there is no database node connected to the energy sales terminal, the data record is inserted into the database table in a database node selected from M database nodes based on the first graph neural network; if the operation type is modification and there is a database node connected to the energy sales terminal, Based on the operation data identifier, the original data object is read from the database node connected to the energy sales terminal into the data operation memory space, the data object is used to modify the original data object in the data operation memory space, and the modified data object and the operation data identifier are used to form a data record in the data operation memory space, and the modified data record is used to replace the data record of the database table in the database node connected to the energy sales terminal based on the operation data identifier. If the operation type is modification and there is no database node connected to the energy sales terminal, the scheduling node searches for the database node where the data record is located based on the operation data identifier. If If the database node where the data record is located is the same node as a database node selected from the M database nodes based on the first graph neural network, then the original data object is read from the same database node to the data operation memory space based on the operation data identifier, the original data object is modified using the data object in the data operation memory space, and the modified data object and the operation data identifier are used to form a data record in the data operation memory space, and the modified data record replaces the data record of the database table in the same node based on the operation data identifier. If the database node where the data record is located is not the same node as the database node selected from the M database nodes based on the first graph neural network, then the scheduling node reads the original data object from another data node different from the selected database node to the data operation memory space based on the operation data identifier, the original data object is modified using the data object in the data operation memory space, and the modified data object and the operation data identifier are used to form a data record in the data operation memory space, and the modified data record is inserted into the database table of the selected database node based on the operation data identifier, and the data record of the data table in another data node different from the selected database node is deleted based on the operation data identifier.

[0028] Furthermore, the graph of the first graph neural network is composed as follows: N channels serve as N channel nodes of the graph, and M database nodes serve as M database nodes of the graph. If an energy sales terminal of a channel is connected to a database node, there is an edge between the channel node and the database node, otherwise, there is no edge.

[0029] Furthermore, the characteristic value of the channel node is:

[0030]

[0031] The characteristic values ​​of the M database nodes are:

[0032]

[0033] Among them, Cchannel i Represents the eigenvalue of the i-th channel node, Ter i represents the number of sales terminals connected to the i-th channel node, sumTertrans i represents the sum of transactions per unit time of all sales terminals connected to the i-th channel node, Cdatabase j Represents the characteristic value of the j-th database node, link j Represents the number of channels connected to the j-th database node, N≥i≥1, M≥j≥1.

[0034] Furthermore, the weight of the edge between the channel node and the database node of the graph neural network is:

[0035]

[0036] Furthermore, if the operation type is deletion, the scheduling node directly deletes the corresponding data record based on the operation data identifier.

[0037] The present invention further provides a computer-readable storage medium, wherein the storage medium stores computer program code, and when the computer program code is executed by a computer, any of the above methods is executed.

[0038] The technical effect of the present invention is: an energy internet marketing service system data updating method, device and storage medium of the present invention, the energy internet marketing service system includes a data middle platform and N channels of energy sales terminals, the data middle platform is constructed based on a distributed database, the distributed database has M database nodes, the energy sales terminals of the N channels are connected to the scheduling node of the data middle platform through the Internet, and the energy sales terminals of the N channels are connected to at least one database node of the M database nodes, the method includes: a request step S101, receiving an operation request from a user at any energy sales terminal in a channel, and sending the operation request to the scheduling node of the data middle platform and the database node connected to the energy sales terminal; a judgment step S102, 02, the scheduling node obtains the operation type and the operation data identifier from the operation request. If the operation type is addition or modification, it is determined based on the operation data identifier whether the data object of the operation is stored in the database node connected to the energy sales terminal. If so, a data operation memory space is opened on the database node connected to the energy sales terminal. If not, a database node is selected from M database nodes based on the first graph neural network, and a data operation memory space is opened on the selected database node; update step S103, complete the update of the data object in the data operation memory space based on the operation type and the operation data identifier, and update the data object in the corresponding database node based on the updated operation object; wherein, M≥2, N≥2. The present invention solves the problem of uneven data storage in the background technology, and does not use a load balancing algorithm or a data migration method. The scheduling node determines that the operation type is addition or modification, and then determines whether the data object of the operation is stored in the database node connected to the energy sales terminal based on the operation data identifier. If yes, a data operation memory space is opened on the database node connected to the energy sales terminal. If not, a database node is selected from M database nodes based on the first graph neural network, and a data operation memory space is opened on the selected database node, that is, the method of determining the storage location of the updated data object is solved based on artificial intelligence, thereby ensuring that data migration is completed when the data object is updated according to the state of each database node, replacing the balancing algorithm and data migration algorithm in the prior art, greatly reducing the burden of the scheduling node, and improving the stability of the system. Furthermore, since the data operation memory space is opened up, the data update operation is performed therein, and the data is inserted into the database node after the update is completed, it is ensured that the data object update fails during the update process due to downtime, power failure, etc., resulting in inconsistent data objects. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] Other features, objects and advantages of the present application will become more apparent from the detailed description of non-limiting embodiments made with reference to the following drawings.

[0040] Figure 1 The present invention is a flowchart of a method for updating middleware data in an energy Internet marketing service system according to an embodiment of the present invention.

[0041] Figure 2 It is a structural diagram of a device for updating middleware data in an energy Internet marketing service system according to an embodiment of the present invention. DETAILED DESCRIPTION

[0042] The present application will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the relevant invention, rather than to limit the invention. It should also be noted that, for ease of description, only the parts related to the relevant invention are shown in the accompanying drawings.

[0043] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0044] Figure 1 A method for updating data in a middle platform of an energy internet marketing service system of the present invention is shown. The energy internet marketing service system includes a data middle platform and energy sales terminals of N channels. The data middle platform is constructed based on a distributed database. The distributed database has M database nodes. The energy sales terminals of the N channels are connected to the scheduling node of the data middle platform through the Internet, and the energy sales terminals of the N channels are connected to at least one database node of the M database nodes. The method includes:

[0045] Request step S101, receiving an operation request from a user at any energy sales terminal in a channel, and sending the operation request to the scheduling node of the data center and the database node connected to the energy sales terminal;

[0046] In the judgment step S102, the scheduling node obtains the operation type and the operation data identifier from the operation request. If the operation type is addition or modification, it is judged based on the operation data identifier whether the data object of the operation is stored in the database node connected to the energy sales terminal. If yes, a data operation memory space is opened on the database node connected to the energy sales terminal. If not, a database node is selected from the M database nodes based on the first graph neural network, and a data operation memory space is opened on the selected database node.

[0047] In the updating step S103, the data object is updated based on the operation type and the operation data identifier in the data operation memory space, and the data object in the corresponding database node is updated based on the updated operation object; wherein M≥2 and N≥2.

[0048] An important inventive concept of the present invention is to solve the problem of uneven data storage in the background technology without using a load balancing algorithm or a data migration method. The scheduling node determines that the operation type is addition or modification, and then determines whether the data object of the operation is stored in the database node connected to the energy sales terminal based on the operation data identifier. If yes, a data operation memory space is opened on the database node connected to the energy sales terminal. If not, a database node is selected from M database nodes based on the first graph neural network, and a data operation memory space is opened on the selected database node, that is, the method of determining the storage location of the updated data object is solved based on artificial intelligence, thereby ensuring that data migration is completed when the data object is updated according to the state of each database node, replacing the balancing algorithm and data migration algorithm in the prior art, greatly reducing the burden on the scheduling node, and improving the stability of the system. Furthermore, since a data operation memory space is opened up, data update operations are performed therein, and the data is inserted into the database node after the update is completed, it is ensured that the data object update fails to update due to downtime, power failure, etc. during the update process, resulting in the defect of inconsistent data objects.

[0049] In one embodiment, the operation of opening a data operation memory space on the database node connected to the energy sales terminal includes: if there is only one database node connected to the energy sales terminal, then opening a data operation memory space on the database node; if there are more than one database nodes connected to the energy sales terminal, then randomly selecting a database node to open a data operation memory space thereon. In the present invention, in order to minimize the burden of the scheduling node, when there are more than one database nodes connected to the energy sales terminal, randomly selecting a database node to open a data operation memory space thereon greatly improves the computational load of the scheduling node. This premise is based on the fact that the states of all database nodes are basically consistent, that is, the state parameters of all database nodes in the present invention are basically consistent.

[0050] In one embodiment, the operation of the update step S103 is: lock the data operation memory space, if the operation type is add, then the operation data identifier and the data object are combined into a data record in the data operation memory space, if there is a database node connected to the energy sales terminal, then the data record is inserted into the database table in the database node connected to the energy sales terminal, if there is no database node connected to the energy sales terminal, then the data record is inserted into the database table in a database node selected from the M database nodes based on the first graph neural network; if the operation type is modify and there is a database node connected to the energy sales terminal, then the data record is inserted into the database table in the ... If the energy sales terminal is a database node, then based on the operation data identifier, the original data object is read from the database node connected to the energy sales terminal into the data operation memory space, the original data object is modified using the data object in the data operation memory space, and the modified data object and the operation data identifier are used to form a data record in the data operation memory space, then the modified data record replaces the data record of the database table in the database node connected to the energy sales terminal based on the operation data identifier. If the operation type is modification and there is no database node connected to the energy sales terminal, then the scheduling node searches for the database node where the data record is located based on the operation data identifier. If the database node where the data record is located is the same node as a database node selected from M database nodes based on the first graph neural network, then based on the operation data identifier, the original data object is read from the same database node to the data operation memory space, the data object is used to modify the original data object in the data operation memory space, the modified data object and the operation data identifier are used to form a data record in the data operation memory space, and the modified data record replaces the data record of the database table in the same node based on the operation data identifier. If the database node where the data record is located is not the same node as a database node selected from M database nodes based on the first graph neural network, then the scheduling node will read the original data object from another data node different from the selected database node to the data operation memory space based on the operation data identifier, the data object is used to modify the original data object in the data operation memory space, the modified data object and the operation data identifier are used to form a data record in the data operation memory space, the modified data record is inserted into the database table of the selected database node based on the operation data identifier, and the data record of the data table in another data node different from the selected database node is deleted based on the operation data identifier.

[0051] The main means to realize the important inventive concept of the present invention is that when it is determined that the database node where the data record is located is not the same node as a database node selected from the M database nodes based on the first graph neural network, the scheduling node reads the original data object from another data node different from the selected database node to the data operation memory space based on the operation data identifier, uses the data object to modify the original data object in the data operation memory space, uses the modified data object and the operation data identifier to form a data record in the data operation memory space, inserts the modified data record into the database table of the selected database node based on the operation data identifier, and deletes the data record in the data table of another data node different from the selected database node based on the operation data identifier, that is, inserts the updated data record into the data table of a database node selected from the M database nodes based on the first graph neural network, and deletes the original data record, thereby realizing the balancing of database nodes and data migration without using a balancing algorithm, greatly reducing the overhead of scheduling nodes, and improving the overall efficiency of the system. This is one of the important inventive points of the present invention.

[0052] In one embodiment, the graph of the first graph neural network is composed as follows: N channels serve as N channel nodes of the graph, and M database nodes serve as M database nodes of the graph. If an energy sales terminal of a channel is connected to a database node, there is an edge between the channel node and the database node, otherwise, there is no edge.

[0053] In one embodiment, the characteristic value of the channel node is:

[0054]

[0055] The characteristic values ​​of the M database nodes are:

[0056]

[0057] Among them, Cchannel i Represents the eigenvalue of the i-th channel node, Ter i represents the number of sales terminals connected to the i-th channel node, sumTertrans i represents the sum of transactions per unit time of all sales terminals connected to the i-th channel node, Cdatabase j Represents the characteristic value of the j-th database node, link j Represents the number of channels connected to the j-th database node, N≥i≥1, M≥j≥1.

[0058] In one embodiment, the weight of the edge between the channel node and the database node of the graph neural network is:

[0059]

[0060] In order to solve the defects in the background technology, the important invention of the present invention is to construct a graph neural network, and the composition of the graph is as follows: N channels are used as N channel nodes of the graph, and M database nodes are used as M database nodes of the graph. If the energy sales terminal of a channel is connected to a database node, there is an edge between the channel node and the database node, otherwise, there is no edge. The characteristic values ​​and edge weights of the channel node and the database node are determined based on the number of sales terminals connected to the channel node, the sum of transactions per unit time of all sales terminals connected to the channel node, and the number of channels connected to the database node. Since the next node that can store data objects is predicted based on the number of sales terminals, the sum of transactions per unit time of all sales terminals connected to the channel node, and the number of channels connected to the database node, data balance is automatically achieved, thereby replacing the existing balancing algorithm and data migration algorithm. This is one of the important inventions of the present invention. The specific calculation method of the characteristic value and edge weight described in the present invention has been implemented in the State Grid sales system. After testing, the effect is better than the original balancing algorithm and data migration algorithm, and the system performance is improved.

[0061] In one embodiment, if the operation type is deletion, the scheduling node directly deletes the corresponding data record based on the operation data identifier. Since the deletion operation is to delete useless data records, it can be deleted by direct deletion to improve the efficiency of data deletion. The deletion operation together with other operations can maximize the overall efficiency of the system.

[0062] Figure 2 An apparatus for updating middle-end data of an energy internet marketing service system of the present invention is shown. The energy internet marketing service system includes a data middle-end and N channels of energy sales terminals. The data middle-end is constructed based on a distributed database. The distributed database has M database nodes. The energy sales terminals of the N channels are connected to the scheduling node of the data middle-end through the Internet, and the energy sales terminals of the N channels are connected to at least one database node of the M database nodes. The apparatus includes:

[0063] The request unit 201 receives an operation request from a user at any energy sales terminal in a channel, and sends the operation request to the scheduling node of the data center and the database node connected to the energy sales terminal;

[0064] Determining unit 202, the scheduling node obtains the operation type and the operation data identifier from the operation request. If the operation type is adding or modifying, it is determined based on the operation data identifier whether the data object of the operation is stored in the database node connected to the energy sales terminal. If yes, a data operation memory space is opened on the database node connected to the energy sales terminal. If not, a database node is selected from the M database nodes based on the first graph neural network, and a data operation memory space is opened on the selected database node.

[0065] The updating unit 203 completes the updating of the data object in the data operation memory space based on the operation type and the operation data identifier, and updates the data object in the corresponding database node based on the updated operation object; wherein M≥2, N≥2.

[0066] An important inventive concept of the present invention is to solve the problem of uneven data storage in the background technology without using a load balancing algorithm or a data migration method. The scheduling node determines that the operation type is addition or modification, and then determines whether the data object of the operation is stored in the database node connected to the energy sales terminal based on the operation data identifier. If yes, a data operation memory space is opened on the database node connected to the energy sales terminal. If not, a database node is selected from M database nodes based on the first graph neural network, and a data operation memory space is opened on the selected database node, that is, the method of determining the storage location of the updated data object is solved based on artificial intelligence, thereby ensuring that data migration is completed when the data object is updated according to the state of each database node, replacing the balancing algorithm and data migration algorithm in the prior art, greatly reducing the burden on the scheduling node, and improving the stability of the system. Furthermore, since a data operation memory space is opened up, data update operations are performed therein, and the data is inserted into the database node after the update is completed, it is ensured that the data object update fails to update due to downtime, power failure, etc. during the update process, resulting in the defect of inconsistent data objects.

[0067] In one embodiment, the operation of opening a data operation memory space on the database node connected to the energy sales terminal includes: if there is only one database node connected to the energy sales terminal, then opening a data operation memory space on the database node; if there are more than one database nodes connected to the energy sales terminal, then randomly selecting a database node to open a data operation memory space thereon. In the present invention, in order to minimize the burden of the scheduling node, when there are more than one database nodes connected to the energy sales terminal, randomly selecting a database node to open a data operation memory space thereon greatly improves the computational load of the scheduling node. This premise is based on the fact that the states of all database nodes are basically consistent, that is, the state parameters of all database nodes in the present invention are basically consistent.

[0068] In one embodiment, the operation of the update unit 203 is as follows: lock the data operation memory space; if the operation type is add, form a data record in the data operation memory space with the operation data identifier and the data object; if there is a database node connected to the energy sales terminal, insert the data record into a database table in the database node connected to the energy sales terminal; if there is no database node connected to the energy sales terminal, insert the data record into a database table in a database node selected from M database nodes based on the first graph neural network; if the operation type is modify and there is a database node connected to the energy sales terminal, library node, then based on the operation data identifier, the original data object is read from the database node connected to the energy sales terminal into the data operation memory space, the original data object is modified using the data object in the data operation memory space, and the modified data object and the operation data identifier are used to form a data record in the data operation memory space, then the modified data record is used to replace the data record of the database table in the database node connected to the energy sales terminal based on the operation data identifier, if the operation type is modification and there is no database node connected to the energy sales terminal, then the scheduling node searches for the database node where the data record is located based on the operation data identifier, If the database node where the data record is located is the same node as a database node selected from M database nodes based on the first graph neural network, then based on the operation data identifier, the original data object is read from the same database node to the data operation memory space, the data object is used to modify the original data object in the data operation memory space, the modified data object and the operation data identifier are used to form a data record in the data operation memory space, and the modified data record replaces the data record of the database table in the same node based on the operation data identifier. If the database node where the data record is located is not the same node as a database node selected from M database nodes based on the first graph neural network, then the scheduling node will read the original data object from another data node different from the selected database node to the data operation memory space based on the operation data identifier, the data object is used to modify the original data object in the data operation memory space, the modified data object and the operation data identifier are used to form a data record in the data operation memory space, the modified data record is inserted into the database table of the selected database node based on the operation data identifier, and the data record of the data table in another data node different from the selected database node is deleted based on the operation data identifier.

[0069] The main means to realize the important inventive concept of the present invention is that when it is determined that the database node where the data record is located is not the same node as a database node selected from the M database nodes based on the first graph neural network, the scheduling node reads the original data object from another data node different from the selected database node to the data operation memory space based on the operation data identifier, uses the data object to modify the original data object in the data operation memory space, uses the modified data object and the operation data identifier to form a data record in the data operation memory space, inserts the modified data record into the database table of the selected database node based on the operation data identifier, and deletes the data record in the data table of another data node different from the selected database node based on the operation data identifier, that is, inserts the updated data record into the data table of a database node selected from the M database nodes based on the first graph neural network, and deletes the original data record, thereby realizing the balancing of database nodes and data migration without using a balancing algorithm, greatly reducing the overhead of scheduling nodes, and improving the overall efficiency of the system. This is one of the important inventive points of the present invention.

[0070] In one embodiment, the graph of the first graph neural network is composed as follows: N channels serve as N channel nodes of the graph, and M database nodes serve as M database nodes of the graph. If an energy sales terminal of a channel is connected to a database node, there is an edge between the channel node and the database node, otherwise, there is no edge.

[0071] In one embodiment, the characteristic value of the channel node is:

[0072]

[0073] The characteristic values ​​of the M database nodes are:

[0074]

[0075] Among them, Cchannel i Represents the eigenvalue of the i-th channel node, Ter i represents the number of sales terminals connected to the i-th channel node, sumTertrans i represents the sum of transactions per unit time of all sales terminals connected to the i-th channel node, Cdatabase j Represents the characteristic value of the j-th database node, link j Represents the number of channels connected to the j-th database node, N≥i≥1, M≥j≥1.

[0076] In one embodiment, the weight of the edge between the channel node and the database node of the graph neural network is:

[0077]

[0078] In order to solve the defects in the background technology, the important invention of the present invention is to construct a graph neural network, and the composition of the graph is as follows: N channels are used as N channel nodes of the graph, and M database nodes are used as M database nodes of the graph. If the energy sales terminal of a channel is connected to a database node, there is an edge between the channel node and the database node, otherwise, there is no edge. The characteristic values ​​and edge weights of the channel node and the database node are determined based on the number of sales terminals connected to the channel node, the sum of transactions per unit time of all sales terminals connected to the channel node, and the number of channels connected to the database node. Since the next node that can store data objects is predicted based on the number of sales terminals, the sum of transactions per unit time of all sales terminals connected to the channel node, and the number of channels connected to the database node, data balance is automatically achieved, thereby replacing the existing balancing algorithm and data migration algorithm. This is one of the important inventions of the present invention. The specific calculation method of the characteristic value and edge weight described in the present invention has been implemented in the State Grid sales system. After testing, the effect is better than the original balancing algorithm and data migration algorithm, and the system performance is improved.

[0079] In one embodiment, if the operation type is deletion, the scheduling node directly deletes the corresponding data record based on the operation data identifier. Since the deletion operation is to delete useless data records, it can be deleted by direct deletion to improve the efficiency of data deletion. The deletion operation together with other operations can maximize the overall efficiency of the system.

[0080] In one embodiment of the present invention, a computer storage medium is provided, on which a computer program is stored. When the computer program on the computer storage medium is executed by a processor, the above method is implemented. The computer storage medium can be a hard disk, DVD, CD, flash memory or other memory.

[0081] For the convenience of description, the above device is described in various units according to their functions. Of course, when implementing the present application, the functions of each unit can be implemented in the same or multiple software and / or hardware.

[0082] It can be known from the description of the above implementation methods that those skilled in the art can clearly understand that the present application can be implemented by means of software plus a necessary general hardware platform. Based on such an understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product can be stored in a storage medium, such as ROM / RAM, a magnetic disk, an optical disk, etc., and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the devices described in the various embodiments of the present application or certain parts of the embodiments.

[0083] Finally, it should be noted that the above embodiments are only intended to illustrate rather than limit the technical solutions of the present invention. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that the present invention can still be modified or replaced by equivalents. Any modification or partial replacement that does not depart from the spirit and scope of the present invention should be included in the scope of the claims of the present invention.

Claims

1. A method for updating data in an energy internet marketing service system, characterized in that: The energy internet marketing service system includes a data middle platform and N channels of energy sales terminals, the data middle platform is constructed based on a distributed database, the distributed database has M database nodes, the N channels of energy sales terminals are connected to the scheduling node of the data middle platform through the Internet, and the N channels of energy sales terminals are connected to at least one database node of the M database nodes, the method includes: A request step, receiving an operation request from a user at any energy sales terminal in a channel, and sending the operation request to the scheduling node of the data center and the database node connected to the energy sales terminal; A judgment step, the scheduling node obtains the operation type and the operation data identifier from the operation request. If the operation type is addition or modification, it is judged based on the operation data identifier whether the data object of the operation is stored in the database node connected to the energy sales terminal. If yes, a data operation memory space is opened on the database node connected to the energy sales terminal. If not, a database node is selected from the M database nodes based on the first graph neural network, and a data operation memory space is opened on the selected database node. An updating step, completing the updating of the data object in the data operation memory space based on the operation type and the operation data identifier, and updating the data object in the corresponding database node based on the updated operation object; Among them, M≥2, N≥2.

2. The method according to claim 1, characterized in that The operation of opening up a data operation memory space on the database node connected to the energy sales terminal includes: if there is only one database node connected to the energy sales terminal, then opening up a data operation memory space on the database node; if there are more than one database nodes connected to the energy sales terminal, then randomly selecting a database node and opening up a data operation memory space on it.

3. The method according to claim 2, characterized in that The operation of the update step is: lock the data operation memory space, if the operation type is add, then the operation data identifier and the data object are combined into a data record in the data operation memory space, if there is a database node connected to the energy sales terminal, then the data record is inserted into the database table of the database node connected to the energy sales terminal, if there is no database node connected to the energy sales terminal, then the data record is inserted into the database table of a database node selected from M database nodes based on the first graph neural network; if the operation type is modify and there is a database node connected to the energy sales terminal, then based on the The operation data identifier reads the original data object from the database node connected to the energy sales terminal into the data operation memory space, uses the data object to modify the original data object in the data operation memory space, and uses the modified data object and the operation data identifier to form a data record in the data operation memory space, then the modified data record replaces the data record of the database table in the database node connected to the energy sales terminal based on the operation data identifier. If the operation type is modification and there is no database node connected to the energy sales terminal, the scheduling node searches for the database node where the data record is located based on the operation data identifier. If the data If the database node where the record is located is the same node as a database node selected from M database nodes based on the first graph neural network, then the original data object is read from the same database node to the data operation memory space based on the operation data identifier, the original data object is modified using the data object in the data operation memory space, and the modified data object and the operation data identifier are used to form a data record in the data operation memory space, and the modified data record replaces the data record of the database table in the same node based on the operation data identifier. If the database node where the data record is located is not the same node as the database node selected from M database nodes based on the first graph neural network, then the scheduling node reads the original data object from another data node different from the selected database node to the data operation memory space based on the operation data identifier, the original data object is modified using the data object in the data operation memory space, and the modified data object and the operation data identifier are used to form a data record in the data operation memory space, and the modified data record is inserted into the database table of the selected database node based on the operation data identifier, and the data record of the data table in another data node different from the selected database node is deleted based on the operation data identifier.

4. The method according to claim 3, characterized in that The graph of the first graph neural network is composed as follows: N channels serve as N channel nodes of the graph, and M database nodes serve as M database nodes of the graph. If an energy sales terminal of a channel is connected to a database node, there is an edge between the channel node and the database node, otherwise, there is no edge. The characteristic value of the channel node is: The characteristic values ​​of the M database nodes are: Among them, Cchannel i Represents the eigenvalue of the i-th channel node, Ter i represents the number of sales terminals connected to the i-th channel node, sumTertrans i represents the sum of transactions per unit time of all sales terminals connected to the i-th channel node, Cdatabase j Represents the characteristic value of the jth database node, link j Represents the number of channels connected to the j-th database node, N≥i≥1, M≥j≥1. The weight of the edge between the channel node and the database node of the graph neural network is:

5. The method according to claim 4, characterized in that If the operation type is deletion, the scheduling node directly deletes the corresponding data record based on the operation data identifier.

6. A device for updating data in an energy internet marketing service system, characterized in that: The energy internet marketing service system includes a data middle platform and N channels of energy sales terminals, the data middle platform is built based on a distributed database, the distributed database has M database nodes, the N channels of energy sales terminals are connected to the scheduling node of the data middle platform through the Internet, and the N channels of energy sales terminals are connected to at least one database node of the M database nodes, the device includes: A request unit, receiving an operation request from a user at any energy sales terminal in a channel, and sending the operation request to the scheduling node of the data center and the database node connected to the energy sales terminal; A judgment unit, wherein the scheduling node obtains an operation type and an operation data identifier from the operation request. If the operation type is addition or modification, it is judged based on the operation data identifier whether the data object of the operation is stored in a database node connected to the energy sales terminal. If yes, a data operation memory space is opened on the database node connected to the energy sales terminal. If not, a database node is selected from the M database nodes based on the first graph neural network, and a data operation memory space is opened on the selected database node. An updating unit, which completes the updating of the data object based on the operation type and the operation data identifier in the data operation memory space, and updates the data object in the corresponding database node based on the updated operation object; Among them, M≥2, N≥2.

7. The device according to claim 1, characterized in that The operation of opening up a data operation memory space on the database node connected to the energy sales terminal includes: if there is only one database node connected to the energy sales terminal, then opening up a data operation memory space on the database node; if there are more than one database nodes connected to the energy sales terminal, then randomly selecting a database node and opening up a data operation memory space on it.

8. The device according to claim 7, characterized in that The operation of the update unit is: lock the data operation memory space, if the operation type is add, then the operation data identifier and the data object are combined into a data record in the data operation memory space, if there is a database node connected to the energy sales terminal, then the data record is inserted into the database table of the database node connected to the energy sales terminal, if there is no database node connected to the energy sales terminal, then the data record is inserted into the database table of a database node selected from M database nodes based on the first graph neural network; if the operation type is modify and there is a database node connected to the energy sales terminal, then based on the The operation data identifier reads the original data object from the database node connected to the energy sales terminal into the data operation memory space, uses the data object to modify the original data object in the data operation memory space, and uses the modified data object and the operation data identifier to form a data record in the data operation memory space, then the modified data record replaces the data record of the database table in the database node connected to the energy sales terminal based on the operation data identifier. If the operation type is modification and there is no database node connected to the energy sales terminal, the scheduling node searches for the database node where the data record is located based on the operation data identifier. If the data If the database node where the record is located is the same node as a database node selected from M database nodes based on the first graph neural network, then the original data object is read from the same database node to the data operation memory space based on the operation data identifier, the original data object is modified using the data object in the data operation memory space, and the modified data object and the operation data identifier are used to form a data record in the data operation memory space, and the modified data record replaces the data record of the database table in the same node based on the operation data identifier. If the database node where the data record is located is not the same node as the database node selected from M database nodes based on the first graph neural network, then the scheduling node reads the original data object from another data node different from the selected database node to the data operation memory space based on the operation data identifier, the original data object is modified using the data object in the data operation memory space, and the modified data object and the operation data identifier are used to form a data record in the data operation memory space, and the modified data record is inserted into the database table of the selected database node based on the operation data identifier, and the data record of the data table in another data node different from the selected database node is deleted based on the operation data identifier.

9. The device according to claim 8, characterized in that The graph of the first graph neural network is composed as follows: N channels serve as N channel nodes of the graph, and M database nodes serve as M database nodes of the graph. If an energy sales terminal of a channel is connected to a database node, there is an edge between the channel node and the database node, otherwise, there is no edge.

10. A computer storage medium, characterized in that: The computer storage medium stores a computer program, and when the computer program on the computer storage medium is executed by a processor, the method according to any one of claims 1 to 5 is implemented.

Citation Information

Patent Citations

  • Rapid data storage method of industrial process control

    CN107329410A

  • Urban road network traffic speed prediction method based on graph convolutional network node association degree

    CN112991721A

  • Distributed inference method and device, data processing method and device, terminal and computing equipment

    CN114139711A

  • Graph node representation information fusion processing method and device, terminal and medium

    CN114298239A

  • Storage device and method of distributed database system and storage medium

    CN115202591A

Cited By

  • Data processing method and device of energy internet marketing service system and storage medium

    CN120277052A