Update Method, Device and Storage Medium for Data in the Middle Platform of the Energy Internet Marketing Service System

By introducing graph neural network into the energy Internet marketing service system, dynamically selecting database nodes for data updates, the problem of unbalanced load of distributed database nodes is solved and the system stability and performance is improved.

CN119377240BActive Publication Date: 2025-05-27NORTH CHINA GRID MEASUREMENT CENT +2
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411520567.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-10-29
Publication Date
2025-05-27
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

A data update method based on graph neural network is proposed. By scheduling nodes, the operation type and storage location of data objects are judged, and the graph neural network is used to select appropriate database nodes for data operations, avoiding the use of load balancing and data migration algorithms.

Benefits of technology

It effectively solves the problem of unbalanced data storage, reduces the burden on scheduling nodes, improves the stability and performance of the system, and avoids data inconsistency caused by failure of data updates.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119377240B_ABST
    Figure CN119377240B_ABST
Patent Text Reader

Abstract

The present invention provides a method, device and storage medium for updating data in the middle platform of an energy Internet marketing service system. The method includes: receiving an operation request of a user at any energy sales terminal of a channel and sending it to a scheduling node of the data middle platform and a database node connected to 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, it is determined 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 not, a database node is selected from M database nodes based on a first graph neural network, and a data operation memory space is opened on it. The data object is updated in this space based on the operation type and the operation data identifier, and the data object in the corresponding database node is updated based on the updated operation object. This greatly reduces the burden on the scheduling node.
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 operations, and particularly relates to a method, device, and storage medium for updating data in the middle platform of an energy Internet marketing service system. Background Art

[0002] In an energy Internet marketing service system, such as an electricity grid marketing system, there are multiple sales channels, and each sales channel has multiple sales terminals. The transaction data volume within a 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, when storing data, a load balancing algorithm needs to be used for load balancing, and when the data volume on a certain database node is large, a data migration algorithm needs to be used to migrate its data. These operations all require the use of a scheduling node. Due to the large volume of power grid transaction data, the data processing volume of the scheduling node increases. In extreme cases, the scheduling node crashes, affecting the system performance.

[0003] In the prior art, there is also a method of using multiple scheduling nodes. However, using multiple scheduling nodes makes the scheduling algorithm more complex, difficult to find bugs when they occur, and has a higher maintenance cost. Summary of the Invention

[0004] In view of one or more of the above technical deficiencies in the prior art, the present invention proposes the following technical solutions.

[0005] The present invention proposes a method for updating data in the middle platform of an energy Internet marketing service system. The energy Internet marketing service system includes a data middle platform and energy sales terminals of N channels. The data middle platform is built based on a distributed database, and 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 of the M database nodes. The method includes:

[0006] A request step of receiving an operation request of a user at any energy sales terminal of one 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.

[0007] A judgment step, in which 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 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 so, it allocates a data operation memory space on the database node connected to the energy sales terminal. If not, it selects a database node from M database nodes based on the first graph neural network and allocates a data operation memory space on the selected database node;

[0008] An update step, in which the data object is updated in the data operation memory space based on the operation type and the operation data identifier, and the data object in the corresponding database node is updated based on the updated operation object;

[0009] Wherein, M≥2 and N≥2.

[0010] Furthermore, the operation of allocating 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, a data operation memory space is allocated on this database node; if there are more than one database nodes connected to the energy sales terminal, a database node is randomly selected and a data operation memory space is allocated on it.

[0011] Further, the operation of the updating step is as follows: lock the data operation memory space. If the operation type is addition, form a data record with the operation data identifier and the data object in the data operation memory space. If there is a database node connected to the energy sales terminal, insert the data record 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, insert the data record 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 modification and there is a database node connected to the energy sales terminal, read the original data object from the database node connected to the energy sales terminal into the data operation memory space based on the operation data identifier, modify the original data object with the data object in the data operation memory space, form a data record with the modified data object and the operation data identifier in the data operation memory space, and then replace the data record in the database table of the database node connected to the energy sales terminal with the modified data record 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 database node where the data record is located is the same as the one database node selected from the M database nodes based on the first graph neural network, read the original data object from the same database node into the data operation memory space based on the operation data identifier, modify the original data object with the data object in the data operation memory space, form a data record with the modified data object and the operation data identifier in the data operation memory space, and replace the data record in the database table of the same node with the modified data record based on the operation data identifier. If the database node where the data record is located is not the same as the one 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 one database node into the data operation memory space based on the operation data identifier, modify the original data object with the data object in the data operation memory space, form a data record with the modified data object and the operation data identifier in the data operation memory space, insert the modified data record into the database table of the selected one database node based on the operation data identifier, and delete the data record in the data table of another data node different from the selected one database node based on the operation data identifier.

[0012] Further, the composition of the graph of the first graph neural network is 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 there is a connection between the energy sales terminal of a channel and a database node, there is an edge between the channel node and the database node; otherwise, there is no edge.

[0013] Further, the eigenvalue of the channel node is:

[0014]

[0015] The eigenvalue of the M database nodes is:

[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 eigenvalue of the j-th database node, link j represents the number of channels connected to the j-th database node, where N≥i≥1 and M≥j≥1.

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

[0019]

[0020] Further, 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 provides an updating device for the data in the middle platform of an energy Internet marketing service system. The energy Internet marketing service system includes a data middle platform and energy sales terminals of N channels. The data middle platform is built based on a distributed database, and 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 at least one database node among the M database nodes is connected to the energy sales terminals of the N channels. The device includes:

[0022] A request unit, which receives an operation request from a user at any energy sales terminal of a channel and sends the operation request to the scheduling node of the data middle platform and the database node connected to the energy sales terminal;

[0023] A judgment unit, 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 determines whether the data object of the operation is stored on the database node connected to the energy sales terminal based on the operation data identifier. If so, it opens a data operation memory space on the database node connected to the energy sales terminal. If not, it selects a database node from M database nodes based on the first graph neural network and opens a data operation memory space on the selected database node;

[0024] An update unit, which completes the update 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;

[0025] Wherein, M≥2 and N≥2.

[0026] Furthermore, 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, it opens a data operation memory space on this database node. If there are more than one database nodes connected to the energy sales terminal, it randomly selects a database node and opens a data operation memory space on it.

[0027] Further, the operation of the updating unit is as follows: lock the data operation memory space. If the operation type is addition, form a data record with the operation data identifier and the data object in the data operation memory space. If there is a database node connected to the energy sales terminal, insert the data record 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, insert the data record 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 modification and there is a database node connected to the energy sales terminal, read the original data object from the database node connected to the energy sales terminal into the data operation memory space based on the operation data identifier, modify the original data object with the data object in the data operation memory space, and form a data record with the modified data object and the operation data identifier in the data operation memory space. Then, replace the data record in the database table of the database node connected to the energy sales terminal with the modified data record 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 database node where the data record is located is the same as a database node selected from the M database nodes based on the first graph neural network, read the original data object from the same database node into the data operation memory space based on the operation data identifier, modify the original data object with the data object in the data operation memory space, and form a data record with the modified data object and the operation data identifier in the data operation memory space. Then, replace the data record in the database table of the same node with the modified data record based on the operation data identifier. If the database node where the data record is located is not the same 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 into the data operation memory space based on the operation data identifier, modify the original data object with the data object in the data operation memory space, and form a data record with the modified data object and the operation data identifier in the data operation memory space. Then, insert the modified data record into the database table of the selected database node based on the operation data identifier, and delete the data record in the data table of another data node different from the selected database node based on the operation data identifier.

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

[0029] Furthermore, the eigenvalue of the channel node is:

[0030]

[0031] The eigenvalue of the M database nodes is:

[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 of all sales terminals connected to the i-th channel node per unit time, Cdatabase j represents the eigenvalue 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 also proposes a computer-readable storage medium, on which computer program code is stored, and when the computer program code is executed by a computer, the method described above is executed.

[0038] The technical effect of the present invention is as follows: A method, device, and storage medium for updating data in the middle platform of an energy Internet marketing service system. The energy Internet marketing service system includes a data middle platform and energy sales terminals of N channels. The data middle platform is built based on a distributed database, and 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 of the M database nodes. The method includes: a request step S101, receiving an operation request of a user at any energy sales terminal of one 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, the scheduling node obtains the operation type and operation data identifier from the operation request. If the operation type is addition or modification, it is judged whether the data object of the operation is stored on the database node connected to the energy sales terminal based on the operation data identifier. 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 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 update step S103, completing the update of the data object in the data operation memory space based on the operation type and operation data identifier, and updating the data object in the corresponding database node based on the updated operation object; where M≥2 and N≥2. The present invention solves the problem of unbalanced data storage in the background technology, and does not use a load balancing algorithm or a data migration method. By the scheduling node judging that the operation type is addition or modification, it is judged whether the data object of the operation is stored on the database node connected to the energy sales terminal based on the operation data identifier. 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 the 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 an artificial intelligence method, so as to ensure that data migration is completed when the data object is updated according to the status of each database node, replacing the existing balancing algorithm and data migration algorithm, greatly reducing the burden on the scheduling node, improving the stability of the system, and further, since a data operation memory space is opened, data update operations are performed therein, and after the update is completed, it is inserted into the database node, ensuring that the data object update does not have the defect of inconsistent data objects due to data object update failure caused by downtime, power failure, etc. during the update process. BRIEF DESCRIPTION OF THE DRAWINGS

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

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

[0041] Figure 2 is a structural diagram of a device for updating the data in the middle platform of an energy Internet marketing service system according to an embodiment of the present invention. Detailed implementation manners

[0042] The present application will be further described in detail below with reference to the accompanying drawings and embodiments. It can be understood that the specific embodiments described herein are only used to explain the related invention and are not intended to limit the invention. Additionally, it should be noted that for the convenience of description, only the parts related to the relevant invention are shown in the drawings.

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

[0044] Figure 1 There is shown a method for updating the data in the middle platform of an energy Internet marketing service system according to the present invention. The energy Internet marketing service system includes a data middle platform and energy sales terminals of N channels. The data middle platform is built based on a distributed database, and 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 at least one of the M database nodes is connected to the energy sales terminals of the N channels. The method includes:

[0045] A request step S101, receiving an operation request of a user at any energy sales terminal of one 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;

[0046] A judgment step S102, the scheduling node obtaining the operation type and 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 the M database nodes based on a first graph neural network, and a data operation memory space is opened on the selected database node;

[0047] 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; where M≥2, N≥2.

[0048] An important inventive concept of the present invention is to solve the problem of unbalanced data storage in the background technology, and without using a load balancing algorithm or a data migration method. If the scheduling node determines that the operation type is addition or modification, then based on the operation data identifier, it is determined whether the data object of the operation is stored on 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. That is, the way to determine the storage location of the updated data object is solved in an artificial intelligence manner, so as to ensure that data migration is completed when the data object is updated according to the status of each database node, replacing the existing balancing algorithm and data migration algorithm, greatly reducing the burden on the scheduling node, improving the stability of the system, and further, because a data operation memory space is opened, data update operations are performed therein, and after the update is completed, it is inserted into the database node, ensuring that the data object update does not have the defect of inconsistent data objects caused by data object update failure due to downtime, power failure, etc. during the update process.

[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, a data operation memory space is opened on this database node. If there are more than one database nodes connected to the energy sales terminal, a database node is randomly selected and a data operation memory space is opened on it. In the present invention, in order to minimize the burden on the scheduling node, when there are more than one database nodes connected to the energy sales terminal, a database node is randomly selected and a data operation memory space is opened on it, greatly increasing the computing amount of the scheduling node. This premise is based on the fact that the status parameters of all database nodes in the present invention are basically the same.

[0050] In one embodiment, the operation of the update step S103 is as follows: lock the data operation memory space. If the operation type is addition, form a data record with the operation data identifier and the data object in the data operation memory space. If there is a database node connected to the energy sales terminal, insert the data record 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, insert the data record 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 modification and there is a database node connected to the energy sales terminal, read the original data object from the database node connected to the energy sales terminal into the data operation memory space based on the operation data identifier, modify the original data object with the data object in the data operation memory space, and form a data record with the modified data object and the operation data identifier in the data operation memory space. Then, replace the data record in the database table of the database node connected to the energy sales terminal with the modified data record 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 database node where the data record is located is the same as the database node selected from the M database nodes based on the first graph neural network, read the original data object from the same database node into the data operation memory space based on the operation data identifier, modify the original data object with the data object in the data operation memory space, and form a data record with the modified data object and the operation data identifier in the data operation memory space. Then, replace the data record in the database table of the same node with the modified data record based on the operation data identifier. If the database node where the data record is located is not the same as the 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 into the data operation memory space based on the operation data identifier, modify the original data object with the data object in the data operation memory space, and form a data record with the modified data object and the operation data identifier in the data operation memory space. Then, insert the modified data record into the database table of the selected database node based on the operation data identifier, and delete the data record in the data table of another data node different from the selected database node based on the operation data identifier.

[0051] The main means to implement 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 as a database node selected from 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 into the data operation memory space based on the operation data identifier, modifies the original data object with the data object in the data operation memory space, forms a data record in the data operation memory space with the modified data object and the operation data identifier, 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 M database nodes based on the first graph neural network and deletes the original data record, realizing the balance of database nodes and data migration without using an equilibrium algorithm, greatly reducing the overhead of the scheduling node and improving the overall efficiency of the system, which is one of the important inventive points of the present invention.

[0052] In one embodiment, the composition mode of the graph of the first graph neural network 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 there is a connection relationship between the energy sales terminal of a channel and 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 eigenvalue of the channel node is:

[0054]

[0055] The eigenvalue of the M database nodes is:

[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 eigenvalue 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] To solve the defects in the background technology, an important inventive point of the present invention lies in constructing a graph neural network. The composition of the graph is 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 there is a connection relationship between the energy sales terminal of a channel and a database node, there is an edge between the channel node and the database node; otherwise, there is no edge. Specifically, based on the number of sales terminals connected to the channel node, the sum of transactions of all sales terminals connected to the channel node per unit time, and the number of channels connected to the database node, the eigenvalue of the channel node and the database node and the weight of the edge are determined. Since the next node that can store the data object is predicted based on the number of sales terminals, the sum of transactions of all sales terminals connected to the channel node per unit time, 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 inventive points of the present invention. The specific calculation methods of the eigenvalue and edge weight described in the present invention have been implemented in the State Grid sales system. After testing, the effect is better than the original balancing algorithm and data migration algorithm, improving the system performance.

[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 in a direct deletion manner, improving the efficiency of data deletion. This deletion operation, together with other operations, can maximize the overall efficiency of the system.

[0062] Figure 2 An updating device for the data in the middle platform of an energy Internet marketing service system according to 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 built based on a distributed database, and 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 at least one database node among the M database nodes is connected to the energy sales terminals of the N channels. The device includes:

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

[0064] A determination unit 202, 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 determines whether the data object of the operation is stored on the database node connected to the energy sales terminal based on the operation data identifier. If so, it opens a data operation memory space on the database node connected to the energy sales terminal. If not, it selects a database node from the M database nodes based on the first graph neural network and opens a data operation memory space on the selected database node;

[0065] An update unit 203, completes the update 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; where M≥2, N≥2.

[0066] An important inventive concept of the present invention is to solve the problem of unbalanced data storage in the background art, and without using a load balancing algorithm or a data migration method. By the scheduling node determining that the operation type is addition or modification, it determines whether the data object of the operation is stored on the database node connected to the energy sales terminal based on the operation data identifier. If so, it opens a data operation memory space on the database node connected to the energy sales terminal. If not, it selects a database node from the M database nodes based on the first graph neural network and opens a data operation memory space on the selected database node, that is, it solves the way to determine the storage location of the updated data object in an artificial intelligence manner, so as to ensure that data migration is completed when the data object is updated according to the status of each database node, replacing the existing balancing algorithm and data migration algorithm, greatly reducing the burden on the scheduling node, improving the stability of the system, and further, since a data operation memory space is opened, data update operations are performed therein, and after the update is completed, it is inserted into the database node, ensuring the defect that the data object update fails due to downtime, power failure, etc. during the update process, resulting in inconsistent data objects.

[0067] In one embodiment, the operation of opening a data operation memory space on a database node connected to the energy sales terminal includes: if there is only one database node connected to the energy sales terminal, open a data operation memory space on this database node; if there are more than one database nodes connected to the energy sales terminal, randomly select one database node and open a data operation memory space on it. In the present invention, in order to minimize the burden on the scheduling node, when there are more than one database nodes connected to the energy sales terminal, randomly select one database node and open a data operation memory space on it, which greatly improves the computing amount of the scheduling node. This premise is based on the condition that the states of all database nodes are basically the same, that is, the state parameters of all database nodes in the present invention are basically the same.

[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 addition, form a data record with the operation data identifier and the data object in the data operation memory space, and if there is a database node connected to the energy sales terminal, insert the data record into the database table in the database node connected to the energy sales terminal, and if there is no database node connected to the energy sales terminal, insert the data record 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 modification and there is a database node connected to the energy sales terminal, read the original data object from the database node connected to the energy sales terminal into the data operation memory space, modify the original data object with the data object in the data operation memory space, form a data record with the modified data object and the operation data identifier in the data operation memory space, and then replace the data record in the database table of the database node connected to the energy sales terminal with the modified data record 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 database node where the data record is located is the same as a database node selected from the M database nodes based on the first graph neural network, read the original data object from the same database node into the data operation memory space, modify the original data object with the data object in the data operation memory space, form a data record with the modified data object and the operation data identifier in the data operation memory space, and replace the data record in the database table of the same node with the modified data record based on the operation data identifier. If the database node where the data record is located is not the same 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 into the data operation memory space based on the operation data identifier, modify the original data object with the data object in the data operation memory space, form a data record with the modified data object and the operation data identifier in the data operation memory space, insert the modified data record into the database table of the selected database node based on the operation data identifier, and delete the data record in the data table of another data node different from the selected database node based on the operation data identifier.

[0069] The main means to implement 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 as a database node selected from 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, modifies the original data object with the data object in the data operation memory space, forms a data record in the data operation memory space with the modified data object and the operation data identifier, 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 M database nodes based on the first graph neural network and deletes the original data record, realizing the balance of database nodes and data migration without using a balancing algorithm, greatly reducing the overhead of the scheduling node and improving the overall efficiency of the system, which is one of the important inventive points of the present invention.

[0070] In one embodiment, the composition manner of the graph of the first graph neural network 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 there is a connection relationship between the energy sales terminal of a channel and 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 eigenvalue of the channel node is:

[0072]

[0073] The eigenvalue of the M database nodes is:

[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 eigenvalue 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 as follows:

[0077]

[0078] To solve the defects in the background art, an important inventive point of the present invention lies in constructing a graph neural network. The composition of the graph is as follows: N channels serve as the N channel nodes of the graph, and M database nodes serve as the M database nodes of the graph. If there is a connection relationship between the energy sales terminal of a channel and a database node, there is an edge between the channel node and the database node; otherwise, there is no edge. Specifically, based on the number of sales terminals connected to the channel node, the sum of transactions of all sales terminals connected to the channel node per unit time, and the number of channels connected to the database node, the eigenvalue of the channel node and the database node and the weight of the edge are determined. Since the next node that can store a data object is predicted based on the number of sales terminals, the sum of transactions of all sales terminals connected to the channel node per unit time, and the number of channels connected to the database node, data balance is automatically achieved, thus replacing the existing balancing algorithm and data migration algorithm. This is one of the important inventive points of the present invention. The specific calculation method of the eigenvalue 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, improving the system performance.

[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 directly, improving the efficiency of data deletion. This 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 proposed. A computer program is stored on the computer storage medium. 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, etc.

[0081] For the convenience of description, the above device is described by dividing its functions into various units. Of course, when implementing the present application, the functions of each unit can be implemented in one or more software and / or hardware.

[0082] As can be seen from the description of the above embodiments, those skilled in the art can clearly understand that this application can be implemented by means of software plus a necessary general hardware platform. Based on such an understanding, the technical solution of this application, in essence, or the part that contributes to the prior art can be embodied in the form of a software product. This computer software product can be stored in a storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the device described in each embodiment or some parts of the embodiments of this application.

[0083] Finally, it should be noted that the above embodiments are only used 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 of ordinary skill in the art should understand that: the present invention can still be modified or equivalently replaced, and any modification or partial replacement without departing from the spirit and scope of the present invention shall be covered by 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; The operation of opening a data operation memory space on a database node connected to the energy sales terminal includes: if there is only one database node connected to the energy sales terminal, opening a data operation memory space on the database node; if there is more than one database node connected to the energy sales terminal, randomly selecting a database node and opening a data operation memory space on it; Among them, 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 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 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 operation data The 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 replaces the data record of the database table in the database node connected to the energy sales terminal with the modified data record 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 database node where the data record is located is consistent with the base If a database node selected by the first graph neural network from the M database nodes is the same node, 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 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 by the first graph neural network from the M database nodes, then the modification The 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, modifies the original data object using the 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, deletes the original data record, thereby achieving database node balancing and data migration; The graph of the first graph neural network is composed in the following manner: 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 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:

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

3. A device for updating middleware 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; The operation of opening a data operation memory space on a database node connected to the energy sales terminal includes: if there is only one database node connected to the energy sales terminal, opening a data operation memory space on the database node; if there is more than one database node connected to the energy sales terminal, randomly selecting a database node and opening a data operation memory space on it; The operation of the update unit is as follows: locking the data operation memory space; if the operation type is adding, forming 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, inserting 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, inserting 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 modifying and there is a database node connected to the energy sales terminal, based on the operation data The 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 replaces the data record of the database table in the database node connected to the energy sales terminal with the modified data record 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 database node where the data record is located is consistent with the base If a database node selected by the first graph neural network from the M database nodes is the same node, 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 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 by the first graph neural network from the M database nodes, then the modification The 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, modifies the original data object using the 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, deletes the original data record, thereby achieving database node balancing and data migration; The graph of the first graph neural network is composed in the following manner: 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 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:

4. 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 2 is implemented.

Citation Information

Patent Citations

  • Rapid data storage method of industrial process control

    CN107329410A

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

    CN115202591A