A data query method and device and a readable storage medium
By constructing digital twins and utilizing the energy consumption data of K pre-configured digital twin storage device components, the problem of low data interoperability between different devices is solved, enabling efficient data querying and simplified data association between devices.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- TENCENT TECHNOLOGY (SHENZHEN) CO LTD
- Filing Date
- 2021-05-20
- Publication Date
- 2026-07-07
AI Technical Summary
In existing technologies, data exchange between different devices requires fixed database associations and manual API configuration, resulting in low data query efficiency.
By constructing digital twins, using K pre-configured digital twins, each including a root node and child nodes, energy consumption data of device components is stored. Target energy consumption data can be queried using device identifiers and component identifiers, enabling data interoperability between devices.
It improves the efficiency of data query, reduces the time spent on data query, and simplifies the process of configuring data association between devices.
Smart Images

Figure CN115391381B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of big data, and in particular to a data query method, apparatus, and readable storage medium. Background Technology
[0002] In the current enterprise market, data interoperability cannot be achieved between different devices from the same manufacturer, the same devices from different manufacturers, or different devices. If data interoperability is to be achieved between different devices from the same manufacturer, the same devices from different manufacturers, or different devices, data transmission and integration can be achieved through application programming interfaces (APIs) or database associations.
[0003] Currently, data transfer between different devices or even the same devices can only be achieved through fixed database associations. This requires manually creating data relationships and then processing the data uploaded by each device. Consequently, querying device data from different devices necessitates configuring corresponding APIs and performing extensive manual configuration. Summary of the Invention
[0004] This application provides a data query method and related equipment, which can determine the corresponding energy consumption data from a digital twin. Compared with the existing method of configuring APIs and manually creating data relationships, this method can improve the efficiency of data query and reduce the time spent on data query.
[0005] One embodiment of this application provides a data query method, including:
[0006] Receive a data query instruction sent by the first device, the data query instruction carrying the device identifier of the second device and the component identifier of the first target component;
[0007] In response to a data query command, based on the device identifier of the second device and the component identifier of the first target component, the target energy consumption data for the first target component in the second device is determined from K digital twins. Each digital twin includes a root node and at least one child node. Each child node is used to store the energy consumption data for the component in the device. Each energy consumption data has the same data format. K is an integer greater than or equal to 1.
[0008] The target energy consumption data for the first target component in the second device is sent to the first device.
[0009] Another aspect of this application provides a data query device, including:
[0010] The receiving unit is configured to receive a data query instruction sent by the first device, wherein the data query instruction carries the device identifier of the second device and the component identifier of the first target component;
[0011] The determining unit is used to respond to the data query command and determine the target energy consumption data of the second device for the first target component from K digital twins according to the device identifier of the second device and the component identifier of the first target component. Each digital twin includes a root node and at least one child node. Each child node is used to store the energy consumption data of the component in the device. Each energy consumption data has the same data format, and K is an integer greater than or equal to 1.
[0012] The transmitting unit is used to transmit target energy consumption data of the first target component from the second device to the first device.
[0013] In one possible design,
[0014] The receiving unit is also used to obtain the identifier of the third device and the component identifier of at least one second target component corresponding to the third device, wherein the third device is an energy device for uploading energy consumption data;
[0015] The receiving unit is further configured to obtain the first energy consumption data of the third device based on the device identifier of the third device if there is a first digital twin among the K digital twins that corresponds to at least one second target component;
[0016] The determining unit is also used to convert the first energy consumption data of the third device according to the data format corresponding to each energy consumption data.
[0017] The determining unit is also used to add the converted first energy consumption data to the first child node in the first digital twin associated with the third device.
[0018] In one possible design, the determining element is also used for:
[0019] If the first digital twin does not exist among the K digital twins, then the first digital twin is constructed. The first digital twin includes the first root node and the second child node.
[0020] The first energy consumption data of the third device is converted according to the data format corresponding to each energy consumption data.
[0021] Add the converted first energy consumption data to the second child node.
[0022] In one possible design, the determining element is also used for:
[0023] If the first child node stores the second energy consumption data of the third device, then determine the data difference between the second energy consumption data of the third device and the first energy consumption data of the third device;
[0024] Adjust the second energy consumption data of the third device stored in the first child node based on the data differences.
[0025] In one possible design,
[0026] The receiving unit is also configured to receive management information corresponding to the first device, the management information including at least one of the business license information and amount information corresponding to the first device;
[0027] The determining unit is also used to authenticate the first device based on the management information corresponding to the first device.
[0028] In one possible design,
[0029] The receiving unit is also used to receive device association data for the fourth device after asymmetric encryption. The device association data is used to indicate component information and node information that are associated with the fourth device.
[0030] The device association data for the fourth device is decrypted to obtain decrypted data;
[0031] Perform format parsing and validation on the decrypted data;
[0032] If the format parsing and verification of the decrypted data passes, the association relationship of the fourth device is set according to the decrypted data.
[0033] In one possible design, the determining element is also used for:
[0034] If the first energy consumption data of the third device exists in the target format after format conversion, then the target format is recorded;
[0035] Adjust the data format corresponding to each energy consumption data point according to the target format;
[0036] The first energy consumption data of the third device is converted according to the data format corresponding to each adjusted energy consumption data.
[0037] Add the first energy consumption data of the third device after format conversion to the first child node.
[0038] Another aspect of this application provides a computer device including at least one connected processor, memory, and transceiver, wherein the memory is used to store program code, and the processor is used to call the program code in the memory to execute the steps of the data query method described in the above aspects.
[0039] Another aspect of this application provides a computer storage medium including instructions that, when executed on a computer, cause the computer to perform the steps of the data query method described in the above aspects.
[0040] In summary, it can be seen that in this embodiment, the server receives a data query instruction sent by the first device, which carries the device identifier of the second device and the component identifier of the first target component. Responding to the data query instruction, the server determines the target energy consumption data for the first target component in the second device from K digital twins based on the device identifier of the second device and the component identifier of the first target component. Each digital twin includes a root node and at least one child node, and each child node stores the energy consumption data for the component in the device. Each data point has the same data format, and K is an integer greater than or equal to 1. The server then sends the target energy consumption data for the first target component in the second device to the first device. Since K digital twins have been pre-configured, and each digital twin's child nodes store the energy consumption data for the component in the device, when querying the device's energy consumption data, only the device identifier and component identifier need to be obtained to determine the corresponding energy consumption data from the digital twins. Compared to the existing method of configuring APIs and manually creating data associations, this improves the efficiency of data querying and reduces the time spent on data querying. Attached Figure Description
[0041] Figure 1 A schematic diagram of the architecture of the data query system provided in the embodiments of this application:
[0042] Figure 2 A schematic diagram of an embodiment of the data query method provided in this application;
[0043] Figure 3 A schematic diagram illustrating the relationship between nodes and energy devices in a digital twin provided for embodiments of this application;
[0044] Figure 4 A schematic diagram of the root node and child nodes of the digital twin provided in the embodiments of this application;
[0045] Figure 5 A schematic diagram of another embodiment of the data query method provided in this application;
[0046] Figure 6 A virtual structural diagram of the data query device provided in the embodiments of this application;
[0047] Figure 7 This is a schematic diagram of the hardware structure of the server provided in an embodiment of this application. Detailed Implementation
[0048] The technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments.
[0049] The terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments described herein can be implemented in a sequence other than that illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or modules is not necessarily limited to those explicitly listed, but may include other steps or modules not explicitly listed or inherent to these processes, methods, products, or devices. The division of modules appearing in this application is merely a logical division; in practical applications, other division methods may be used. For example, multiple modules may be combined or integrated into another system, or some feature vectors may be ignored or not performed. Additionally, the shown or discussed mutual coupling or direct coupling or communication connection may be through some interface, and the indirect coupling or communication connection between modules may be electrical or other similar forms, none of which are limited in this application. Furthermore, the modules or sub-modules described as separate components may or may not be physically separate, may or may not be physical modules, or may be distributed among multiple circuit modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution in this application.
[0050] This application provides a data query method based on cloud computing technology, enabling data interoperability between different devices from the same manufacturer, the same device from different manufacturers, or different devices. Cloud computing refers to the delivery and usage model of Internet Technology (IT) infrastructure, meaning obtaining required resources in an on-demand and easily scalable manner through a network; broadly speaking, cloud computing refers to the delivery and usage model of services, meaning obtaining required services in an on-demand and easily scalable manner through a network. These services can be IT and software, Internet-related, or other services. Cloud computing is a product of the development and integration of traditional computer and network technologies such as grid computing, distributed computing, parallel computing, utility computing, network storage technologies, virtualization, and load balancing. With the development of the Internet, real-time data streams, the diversification of connected devices, and the driving force of demands such as search services, social networks, mobile commerce, and open collaboration, cloud computing has developed rapidly. Unlike previous parallel and distributed computing, the emergence of cloud computing will drive a revolutionary change in the entire Internet model and enterprise management model from a conceptual perspective.
[0051] The realization of cloud computing relies on cloud technology, which refers to a hosting technology that unifies hardware, software, and network resources within a wide area network (WAN) or local area network (LAN) to achieve data computation, storage, processing, and sharing. Cloud technology is a general term encompassing network technology, information technology, integration technology, management platform technology, and application technology applied to the cloud computing business model. It can form resource pools, providing flexible and convenient on-demand access. Cloud computing technology will become a crucial support. Backend services of technical network systems require substantial computing and storage resources, such as video websites, image websites, and many portal websites. With the rapid development and application of the internet industry, every item may have its own identification mark in the future, requiring transmission to backend systems for logical processing. Data at different levels will be processed separately, and various industry data will all require robust system support, which can only be achieved through cloud computing.
[0052] Please see Figure 1 , Figure 1 This is a schematic diagram of the architecture of the data query system in an embodiment of this application, such as... Figure 1As shown, the data query system includes energy device 101, network 102 and server 103. The energy device 101 includes N energy devices. Each energy device in the energy device 101 communicates with the server 103 through network 102, where N is an integer greater than or equal to 1.
[0053] Server 103 can receive a data query instruction sent by any device in energy equipment 101 via network 102. The data query instruction carries the device identifier of the second device and the component identifier of the first target component. Server 103 can determine the target energy consumption data of the second device for the first target component from K digital twins based on the device identifier of the second device and the component identifier of the first target component. The K digital twins are stored in server 103, and each digital twin includes a root node and at least one child node. Each child node is used to store the energy consumption data of the component in the device. Each energy consumption data has the same data format, and K is an integer greater than or equal to 1. After obtaining the target energy consumption data of the second device for the first target component, the server can send the target energy consumption data to the first device to realize data interoperability.
[0054] In addition, server 103 can also receive device identifiers and component identifiers sent by at least one energy device in energy device 101, construct a new digital twin based on the device identifier and component identifier, and add the energy consumption data of the energy device to the child node corresponding to the energy device in the digital twin; or, based on the device identifier or component identifier, attach at least one energy device in energy device 101 to the child node corresponding to the energy device in the existing digital twin, and add the energy consumption data of the energy device to the corresponding child node, thereby realizing the interoperability of energy consumption data between at least one energy device in energy device 101 and the energy device in the digital twin. That is, users register components through the data management platform, create data models, device parameters, and data fields associated with the components. For example, when relevant information of a power plant's generating equipment is reported to the data management platform, the "electricity" field can be customized, and the device parameters of the generating equipment can be customized. This data management platform configures relationships between multiple energy devices, components, or application scenarios (such as factories and data centers), as well as between energy devices and components. Through these fixed relationships, once the relationships are configured, the energy devices can upload energy consumption data to the platform. This includes data such as the hourly power generation of a power plant or photovoltaic system, and the heat generation data of the energy devices. Simultaneously, the energy device can also retrieve energy consumption data uploaded by other energy devices from the platform. Compared to existing methods of data transmission and integration via API interfaces or database connections, this reduces the time spent on data queries and uploads, improving query efficiency.
[0055] It is understood that the server involved in this application can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDN), and big data and artificial intelligence platforms. This application will use a cloud gaming server as an example. Terminal devices can be smartphones, tablets, laptops, PDAs, personal computers, smart TVs, smartwatches, etc., but are not limited to these. Terminal devices and servers can be directly or indirectly connected via wired or wireless communication, which is not limited in this application. The number of servers and terminal devices is also not limited.
[0056] A digital twin is a set of virtual information structures that can comprehensively describe a potential or actual physical product from the microscopic atomic level to the macroscopic geometric level. It can obtain any information about the physical product and contains the set of information necessary to describe and generate a physical product, allowing the physical version to overlap with or be paired with the virtual version. In this application, energy consumption data of energy devices is obtained through digital twins to construct the relationships between energy devices and between energy devices and components.
[0057] Based on the above introduction, the following section will describe the data query methods in this application from the server's perspective. Please refer to [link / reference]. Figure 2 , Figure 2 A schematic diagram of an embodiment of the data query method provided in this application, the data query method including:
[0058] 201. Receive the data query command sent by the first device.
[0059] In this embodiment, when the first device obtains the energy consumption data of the second device from the data management platform, it can send a data query instruction. The server can receive the data query instruction, which carries the device identifier of the second device and the component identifier of the first target component.
[0060] It should be noted that the first target component can be understood as a software product, such as a three-phase smart power meter, used to detect the power of energy equipment, mainly detecting the power, current and load time of the energy equipment; in addition, the first target component can also be other products, such as a single-phase smart power meter or a single-phase rail-mounted smart meter, depending on the energy equipment being detected, without any specific limitation.
[0061] In one embodiment, the operation for generating a data query instruction includes at least one of the following: gesture operation, swipe operation, click operation, and voice control operation. For example, when a user clicks on the query interface corresponding to the data management platform (the specific content included in the query interface is not limited here), the server can receive the click operation. At this time, the click operation generates the data query instruction. That is, the operation instruction can be defined in advance. For example, a swipe operation can be defined in advance as an operation to query the target energy consumption data of the first target component in the second device (such as left swipe, right swipe, up swipe, and down swipe, etc.), or a click operation can be defined as a operation to query the target energy consumption data of the first target component in the second device. Operations that specify energy consumption data (such as double-clicking, mouse swipe, long press, single click, simultaneous left and right mouse button presses, and scroll wheel / middle mouse button, etc.), or defining gesture operations as operations to query target energy consumption data for the first target component in the second device (such as swinging the wrist or arm to the left, swinging the wrist or arm to the right, such as four-finger contraction or three-finger swipe up, etc.), or defining voice control operations as operations to query target energy consumption data for the first target component in the second device (such as receiving a sound querying target energy consumption data for the first target component in the second device). The above are only examples and do not represent a limitation on the operations for generating data query commands. Of course, the data query command can also be generated by setting corresponding shortcut keys on the input device. For example, if the input device is a keyboard, the "CTRL+A key" can be set as the operation to query target energy consumption data for the first target component in the second device. The specific method is not limited.
[0062] 202. In response to the data query command, determine the target energy consumption data of the second device for the first target component from K digital twins based on the device identifier of the second device and the component identifier of the first target component.
[0063] In this embodiment, after receiving a data query instruction sent by the first device, the server can respond to the data query instruction and determine the target energy consumption data for the first target component in the second device from K digital twins based on the device identifier of the second device and the component identifier of the first target component. Each digital twin includes a root node and at least one child node. Each child node is used to store the energy consumption data for the component in the device. Each energy consumption data has the same data format, and K is an integer greater than or equal to 1.
[0064] It is understood that the energy consumption data in this application is composed of basic data (units / attributes, etc.), mainly describing the data characteristics of related energy equipment. Multiple attributes can be defined, each corresponding to a unit, making it convenient to define the energy consumption parameters of energy equipment (such as air conditioners and motors) as attribute-unit key-value pairs. These multiple attributes can correspond to one component or multiple components. That is, a component can be used to detect a certain attribute in an energy equipment, or a component can be used to detect multiple attributes in an energy equipment; the specifics are not limited.
[0065] It's important to note that each energy device has a unique asset code, `equip_id` (which is also the device identifier for each energy device). Each energy device is attached to a unique node. Nodes have hierarchical references and edges between any two nodes. These nodes combine to form a digital twin, which is used to enable the exchange of energy consumption data between multiple energy devices. Furthermore, energy devices can also establish relationships using pre-configured JavaScript Object Notation (JSON) data in a predefined format. When the JSON data is uploaded to the data management platform, the parent node's `p_node_id` and the current node's `node_id` are matched, and the unique asset code `equip_id` of each energy device is used to connect different energy devices and components, thus enabling the exchange of energy consumption data between them. JSON is based on a subset of the JavaScript specification defined by the European Computer Association (ECA) and uses a text format completely independent of programming languages to store and represent data.
[0066] The following is combined Figure 3 The relationship between nodes and energy devices in the digital twin provided in this application embodiment is explained as follows:
[0067] Please see Figure 3 , Figure 3 A schematic diagram illustrating the relationship between nodes and energy devices in a digital twin provided in this application embodiment includes:
[0068] Nodes A301, B302, C303, device A304, and device B305, wherein node A301 is the parent node, the node identifier of the parent node is node_A, and nodes B302 and C303 are child nodes of node A;
[0069] The unique asset ID of device A304 is e1, so device A304 is attached to node B302. The unique asset ID of device B305 is e2, so device A305 is attached to node A301. The node identifier of node B302 is node_B, and the node identifier of node C302 is node_C. Nodes B302 and C303 are edge nodes to each other (that is, node B302 is an edge node of node C303, and node C303 is an edge node of node B302).
[0070] Node B302 can receive data from device A (i.e., energy consumption data of device A) uploaded by device A304, and node B303 can receive data from device B uploaded by device A305. The attribute values of the data in device A and device B are the same (i.e., if the data collected from device A and device B is current, the unit is amperes). Here, the energy consumption data collected from device A and device B can be converted into energy consumption data with the same data format through the power model (i.e., the attribute unit key-value pair mentioned above), that is, a data format with consistent units. For example, whether the current of device A or device B is collected, the unit of the current is amperes.
[0071] Please see Figure 4 , Figure 4 The following is a schematic diagram of the root node and child nodes of the digital twin provided in this application embodiment: 401 is the root node, identifying a company (the standard gas basis is the unit of gas); 402 is the root node, a factory area (this factory area belongs to a company, and the standard hydraulic basis is the unit of hydraulic); the 21st floor computer room 404, the 22nd floor power distribution room 405, and the 19th floor conference room are child nodes of the factory area 402. Among them, the 21st floor computer room 404 and the 22nd floor power distribution room 405 need to be configured with the power basis (that is, the attribute unit key-value pair corresponding to power, such as the key-value pair of current and ampere); the 19th floor conference room 406 needs to be configured with the hydraulic basis (that is, the attribute unit key-value pair corresponding to hydraulic, such as the key-value pair of water consumption and cubic meters).
[0072] Among them, router 407 and host computer 409 are the energy equipment in server room 404 on the 21st floor, and voltage stability monitor and current stability monitor 408 are the energy equipment in power distribution room 405 on the 22nd floor. It is understandable that the above... Figure 4 This is just an example. Of course, the company's 401 also includes other factory areas, the factory area 402 also includes other areas, and the 21st floor machine room 404 may also include other energy equipment. There are no specific limitations. In addition, the limitations on the power foundation and standard hydraulic foundation are just examples.
[0073] In one embodiment, the server can not only receive data query instructions from the first device, but also receive energy consumption data uploaded by the energy device, and associate the energy device with other energy devices in the data management platform to achieve interoperability of energy consumption data, as described below:
[0074] The server obtains the identifier of the third device and the component identifier of at least one second target component corresponding to the third device, wherein the third device is an energy device for which energy consumption data is to be uploaded;
[0075] If there is a first digital twin among the K digital twins that corresponds to at least one second target component, then the first energy consumption data of the third device is obtained according to the device identifier of the third device;
[0076] The first energy consumption data of the third device is converted according to the data format corresponding to each energy consumption data.
[0077] The converted first energy consumption data is added to the first child node in the first digital twin that is associated with the third device.
[0078] In this embodiment, when the third device uploads energy consumption data, the server can obtain the identifier of the third device and the component identifier of at least one second target component corresponding to the third device. Since the server may store at least one second target component corresponding to the third device, and each of the at least one second target component will also have a corresponding digital twin among the K digital twins, a judgment can be performed at this time. That is, based on the component identifier of the at least one second target component, it can be determined whether there is a first digital twin among the K digital twins corresponding to at least one second target component. If K If a first digital twin exists in the K digital twins corresponding to at least one second target component, then the first energy consumption data of the third device is obtained according to the device identifier of the third device. The first energy consumption data of the third device is converted according to the data format corresponding to each energy consumption data (i.e., the attribute unit key-value pair mentioned above) to ensure that the energy consumption data of all devices in the K digital twins are data in a unified data format. The server adds the converted first energy consumption data to the first child node associated with the third device in the first digital twin. It can be understood that if there is no first child node associated with the third device in the first digital twin, a new child node can be created and the newly created child node can be determined as the first child node. At the same time, the third device is mounted to the first child node and the converted first energy consumption data is added to the first child node.
[0079] It should be noted that if the first digital twin does not exist among the K digital twins, it means that the third device belongs to a new energy device, that is, there are no other energy devices associated with it in the server. In this case, the first digital twin can be constructed. The first digital twin is the digital twin corresponding to the third device, and the first digital twin includes a first root node and a second child node. In addition, the first energy consumption data of the third device can be converted according to the data format corresponding to each energy consumption data, and the converted first energy consumption data can be added to the second child node.
[0080] It should also be noted that when the server adds the first energy consumption data to the first child node associated with the third device in the first digital twin, it can also determine whether the first child node stores the second energy consumption data of the third device. If the first child node stores the second energy consumption data of the third device, it means that the first energy consumption data is an adjustment to the energy consumption data of the third device stored in the first child node. The data difference between the first energy consumption data and the second energy consumption data can be determined, and the second energy consumption data of the third device stored in the first child node can be adjusted according to the data difference to ensure timely data updates.
[0081] 203. Send the target energy consumption data of the first target component from the second device to the first device.
[0082] In this embodiment, after the server determines the target energy consumption data for the first target component in the second device from K digital twins based on the device identifier of the second device and the component identifier of the first target component, it can send the target energy consumption data to the first device to realize data communication between the first device and the second device.
[0083] In summary, it can be seen that in the embodiments provided in this application, since K digital twins have been pre-configured, and each digital twin's child nodes store energy consumption data for the components in the device, when querying the device's energy consumption data, it is only necessary to obtain the device identifier and component identifier to determine the corresponding energy consumption data from the digital twin. Compared with the existing method of configuring APIs and manually creating database relationships for data exchange between energy devices, this method can improve the efficiency of data query and reduce the time spent on data query.
[0084] Optionally, in the above Figure 2 Based on the corresponding embodiments, in another optional embodiment provided by this application, the server receives management information corresponding to the first device, which includes at least one of business license information and amount information corresponding to the first device;
[0085] The first device is authenticated based on the management information corresponding to the first device.
[0086] In this embodiment, before uploading its corresponding energy consumption data, the first device needs to be authenticated for legitimacy. Specifically, the first device uploads its corresponding management information, which includes at least one of business license information and amount information. That is, the first device is authenticated by uploading business license information or by making a small payment. Afterwards, the server can authenticate the legitimacy of the first device based on the management information. Only after authentication can the first device upload energy consumption data or obtain energy consumption data of other energy devices from the server. This ensures that all energy devices connected to the server are legally authenticated, minimizing the possibility of illegal data upload or acquisition.
[0087] It should be noted that the server provides two methods to implement the association between energy devices. One is to configure it directly on the management platform, and the other is for users to configure the association between energy devices through their own data association configuration scheme. Afterwards, the configuration is completed according to the prescribed data association model (which mainly constrains the units, length, and legality of the data), and the configured JSON data is output to the data management platform. When outputting the configured JSON data to the data management platform, it can be imported via file upload or JSON data entry. Since the association between energy devices is configured through a user-defined data association configuration scheme, rather than operating on the data management platform, there is a possibility of malicious files being uploaded during the data upload process. This embodiment of the application avoids this possibility by encrypting and decrypting the uploaded JSON data, as explained in detail below:
[0088] In the above Figure 2 Based on the corresponding embodiments, in another optional embodiment provided by this application, the server receives device association data for the fourth device after asymmetric encryption. The device association data is used to indicate component information and node information that are associated with the fourth device.
[0089] The device association data for the fourth device is decrypted to obtain decrypted data;
[0090] Perform format parsing and validation on the decrypted data;
[0091] If the format parsing and verification of the decrypted data passes, the association relationship of the fourth device is set according to the decrypted data.
[0092] In this embodiment, the server receives device association data for a fourth device, encrypted asymmetrically. This device association data indicates component and node information associated with the fourth device. An encryption / decryption key can be pre-agreed. Upon receiving the asymmetrically encrypted device association data, the server can decrypt it using the corresponding key to obtain decrypted data. The server then performs format parsing and verification on the decrypted data (including but not limited to verifying the integrity of structural fields, the security and legality of descriptive information). If the format parsing verification passes, the server assigns the device association to the fourth device based on the decrypted data. This prevents malicious individuals from completing authentication through unauthorized channels or stealing legitimate user accounts to upload data containing malicious information to the data management platform.
[0093] The following is a detailed explanation of how to describe device association data using the standard JSON language structure:
[0094]
[0095]
[0096]
[0097] It should be noted that, since the data formats defined in this application cannot cover all the data formats corresponding to all energy devices uploaded to the data management platform, it is also necessary to summarize and organize the energy consumption data uploaded by energy devices that do not belong to the defined formats, and adjust the predefined data formats, as follows:
[0098] In the above Figure 2 Based on the corresponding embodiments, in another optional embodiment provided by this application, if the first energy consumption data of the third device has a target format after format conversion, then the target format is recorded;
[0099] Adjust the data format corresponding to each energy consumption data point according to the target format;
[0100] The first energy consumption data of the third device is converted according to the data format corresponding to each of the adjusted energy consumption data.
[0101] Add the first energy consumption data of the third device after format conversion to the first child node.
[0102] In this embodiment, when the server determines that the first energy consumption data of the third device contains data in the target format after format conversion, that is, when the server determines that the first energy consumption data of the third device contains a target format that does not appear in the predefined data formats, it can record the target format, adjust the data format corresponding to each energy consumption data according to the target format, and perform format conversion on the first energy consumption data of the third device again according to the adjusted data format. The first energy consumption data after format conversion is added to the first child node to ensure that all energy consumption data uploaded to the server is in a unified standard data format, thus ensuring data interoperability.
[0103] The following is combined Figure 5 For instructions on data querying methods, please refer to [link / reference]. Figure 5 , Figure 5 Another schematic diagram of the data query method provided in this application includes:
[0104] Merchant A501, data management platform 502, and merchant B503 are involved. Merchant operations in both A501 and B503 can be pre-certified on data management platform 502. This can be done by uploading their business license information or making a small payment. After certification, merchants A501 and B503 can construct digital twins representing the relationships between energy devices and between energy devices and components. They can then upload the energy consumption data of the energy devices to the corresponding child nodes in the digital twin according to a specified data format. This allows merchants A or B to... When requesting energy consumption data from other devices from the data management platform 502, the device identifier and component identifier of the energy device can be sent directly. The data management platform 502 can then use these identifiers to find the corresponding energy consumption data in the digital twin and return it to merchant A501 or merchant B502. In this way, by constructing a digital twin, the transmission and integration of data between energy devices can be achieved. This solves the limitations of existing methods that rely on APIs or database associations to obtain data. It also eliminates the need for extensive manual configuration, reduces the time spent on data queries, and improves the efficiency of data queries.
[0105] The embodiments of this application have been described above from the perspective of data query methods. The embodiments of this application will now be described below from the perspective of data query devices.
[0106] Please see Figure 6 This application provides a data query device 600, which includes:
[0107] The receiving unit 601 is used to receive a data query instruction sent by the first device, wherein the data query instruction carries the device identifier of the second device and the component identifier of the first target component;
[0108] The determining unit 602 is used to respond to a data query command and determine the target energy consumption data of the second device for the first target component from K digital twins based on the device identifier of the second device and the component identifier of the first target component. Each digital twin includes a root node and at least one child node. Each child node is used to store the energy consumption data of the component in the device. Each energy consumption data has the same data format, and K is an integer greater than or equal to 1.
[0109] The transmitting unit 603 is used to transmit target energy consumption data of the first target component from the second device to the first device.
[0110] In one possible design,
[0111] The receiving unit 601 is also used to obtain the identifier of the third device and the component identifier of at least one second target component corresponding to the third device, wherein the third device is an energy device for uploading energy consumption data;
[0112] The receiving unit 601 is further configured to obtain the first energy consumption data of the third device based on the device identifier of the third device if there is a first digital twin among the K digital twins that corresponds to at least one second target component;
[0113] The determining unit 602 is also used to convert the first energy consumption data of the third device according to the data format corresponding to each energy consumption data;
[0114] The determining unit 602 is also used to add the converted first energy consumption data to the first child node associated with the third device in the first digital twin.
[0115] In one possible design, the determining unit 602 is also used for:
[0116] If the first digital twin does not exist among the K digital twins, then the first digital twin is constructed. The first digital twin includes the first root node and the second child node.
[0117] The first energy consumption data of the third device is converted according to the data format corresponding to each energy consumption data.
[0118] Add the converted first energy consumption data to the second child node.
[0119] In one possible design, the determining unit 602 is also used for:
[0120] If the first child node stores the second energy consumption data of the third device, then determine the data difference between the second energy consumption data of the third device and the first energy consumption data of the third device;
[0121] Adjust the second energy consumption data of the third device stored in the first child node based on the data differences.
[0122] In one possible design,
[0123] The receiving unit 601 is also configured to receive management information corresponding to the first device, the management information including at least one of business license information and amount information corresponding to the first device;
[0124] The determining unit 602 is also used to authenticate the first device based on the management information corresponding to the first device.
[0125] In one possible design, the determining unit 602 is also used for:
[0126] Receive device association data for the fourth device after asymmetric encryption. The device association data is used to indicate component information and node information that are associated with the fourth device.
[0127] The device association data for the fourth device is decrypted to obtain decrypted data;
[0128] Perform format parsing and validation on the decrypted data;
[0129] If the format parsing and verification of the decrypted data passes, the association relationship of the fourth device is set according to the decrypted data.
[0130] In one possible design, the determining unit 602 is also used for:
[0131] If the first energy consumption data of the third device exists in the target format after format conversion, then the target format is recorded;
[0132] Adjust the data format corresponding to each energy consumption data point according to the target format;
[0133] The first energy consumption data of the third device is converted according to the data format corresponding to each adjusted energy consumption data.
[0134] Add the first energy consumption data of the third device after format conversion to the first child node.
[0135] In summary, it can be seen that in the embodiments provided in this application, since K digital twins have been pre-configured, and each digital twin's child nodes store energy consumption data for the components in the device, when querying the device's energy consumption data, it is only necessary to obtain the device identifier and component identifier to determine the corresponding energy consumption data from the digital twin. Compared with the existing method of configuring APIs and manually creating data associations, this method can improve the efficiency of data query and reduce the time spent on data query.
[0136] This application also provides another data query device, which is deployed on a server. See also: Figure 7 , Figure 7 This is a schematic diagram of a server structure provided in an embodiment of the present invention. The server 700 can vary significantly due to different configurations or performance characteristics. It may include one or more central processing units (CPUs) 722 (e.g., one or more processors) and a memory 732, and one or more storage media 730 (e.g., one or more mass storage devices) for storing application programs 742 or data 744. The memory 732 and storage media 730 can be temporary or persistent storage. The program stored in the storage media 730 may include one or more modules (not shown in the diagram), each module including a series of instruction operations on the server. Furthermore, the CPU 722 may be configured to communicate with the storage media 730 and execute the series of instruction operations stored in the storage media 730 on the server 700.
[0137] Server 700 may further include: one or more power supplies 726, one or more wired or wireless network interfaces 750, one or more input / output interfaces 758, and at least one of one or more operating systems 741, wherein the operating system 741 may be Windows Server. TM Mac OS X TM Unix TM Linux TM FreeBSD TM Operating system, etc.
[0138] The steps performed by the server in the above embodiments can be based on this Figure 7 The server structure shown.
[0139] This application also provides a computer-readable storage medium storing a computer program thereon. When executed by a computer, the computer program implements the method flow related to the data query device in any of the above method embodiments. Correspondingly, the computer can be the aforementioned data query device.
[0140] This application also provides a computer program or a computer program product including a computer program, which, when executed on a computer, causes the computer to implement the method flow related to the data query device in any of the above method embodiments. Correspondingly, the computer can be the aforementioned data query device.
[0141] In the above Figure 2 In the corresponding embodiments, it can be implemented entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially in the form of a computer program product.
[0142] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a server or data center that integrates one or more available media. The available medium may be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., a solid-state disk (SSD)).
[0143] It should be understood that the processor mentioned in this application can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor can be a microprocessor or any conventional processor.
[0144] It should also be understood that the number of processors in this application can be one or more, and can be adjusted according to the actual application scenario. This is merely an illustrative example and is not intended to limit the application. The number of memory in the embodiments of this application can be one or more, and can be adjusted according to the actual application scenario. This is merely an illustrative example and is not intended to limit the application.
[0145] It should also be noted that when the data query device includes a processor (or processing unit) and a memory, the processor in this application may be integrated with the memory, or the processor and the memory may be connected through an interface. The specific configuration can be adjusted according to the actual application scenario and is not limited.
[0146] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0147] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection between apparatuses or units through some interfaces, and may be electrical, mechanical, or other forms.
[0148] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0149] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0150] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, a server, or other device, etc.) to execute this application. Figure 2 All or part of the steps of the data query method described above.
[0151] It should be understood that the storage medium or memory mentioned in this application may include volatile memory or non-volatile memory, or both. Non-volatile memory may be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory may be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDR SDRAM), Enhanced Synchronous DRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), and Direct Rambus RAM (DR RAM).
[0152] It should be noted that the memories described herein are intended to include, but are not limited to, these and any other suitable types of memories.
[0153] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.
Claims
1. A data query method, characterized in that, include: Receive a data query instruction sent by a first device, wherein the data query instruction carries the device identifier of the second device and the component identifier of the first target component; In response to the data query command, based on the device identifier of the second device and the component identifier of the first target component, the target energy consumption data for the first target component in the second device is determined from K digital twins. Each digital twin includes a root node and multiple child nodes. The multiple child nodes are used to mount different devices. There is an edge relationship between any two nodes in the multiple child nodes. The edge relationship is used to represent the association relationship between different devices. The association relationship corresponds to a data association model. The data association model is used to convert the energy consumption data of different devices with the association relationship into energy consumption data in the same data format. Each child node is used to store the energy consumption data for the component in the device. Each energy consumption data has the same data format in the child nodes corresponding to different devices. K is an integer greater than or equal to 1. The digital twin is used to realize the interoperability of energy consumption data between different devices. The different devices include different devices from the same manufacturer, the same device from different manufacturers, or different devices from different manufacturers. Send the target energy consumption data of the second device for the first target component to the first device; Receive device association data for a fourth device after asymmetric encryption, wherein the device association data is used to indicate node information, model information and device information that are associated with the fourth device; The device association data for the fourth device is decrypted to obtain decrypted data; The decrypted data is then parsed and validated for its format. If the format parsing and verification of the decrypted data passes, the association relationship of the fourth device is set according to the decrypted data.
2. The query method according to claim 1, characterized in that, The method further includes: Obtain the identifier of a third device and the component identifier of at least one second target component corresponding to the third device, wherein the third device is an energy device for which energy consumption data is to be uploaded; If there is a first digital twin among the K digital twins that corresponds to at least one second target component, then the first energy consumption data of the third device is obtained according to the device identifier of the third device; The first energy consumption data of the third device is converted according to the data format corresponding to each energy consumption data; The converted first energy consumption data is added to the first child node in the first digital twin associated with the third device.
3. The query method according to claim 2, characterized in that, The method further includes: If the first digital twin is not present among the K digital twins, then the first digital twin is constructed, and the first digital twin includes a first root node and a second child node; The first energy consumption data of the third device is converted according to the data format corresponding to each energy consumption data; Add the converted first energy consumption data to the second child node.
4. The query method according to claim 2, characterized in that, The method further includes: If the first child node stores the second energy consumption data of the third device, then the data difference between the second energy consumption data of the third device and the first energy consumption data of the third device is determined; The second energy consumption data of the third device stored in the first child node is adjusted based on the data differences.
5. The query method according to any one of claims 1 to 4, characterized in that, The method further includes: Receive management information corresponding to the first device, wherein the management information includes at least one of the business license information and amount information corresponding to the first device; The first device is authenticated based on the management information corresponding to the first device.
6. The query method according to any one of claims 2 to 4, characterized in that, The method further includes: If the first energy consumption data of the third device contains data in a target format after format conversion, then the target format is recorded; The data format corresponding to each energy consumption data point is adjusted according to the target format. The first energy consumption data of the third device is converted according to the data format corresponding to each adjusted energy consumption data. The first energy consumption data of the third device after format conversion is added to the first child node.
7. A data query device, characterized in that, include: A receiving unit is configured to receive a data query instruction sent by a first device, wherein the data query instruction carries a device identifier of a second device and a component identifier of a first target component; A determining unit is configured to respond to the data query instruction and, based on the device identifier of the second device and the component identifier of the first target component, determine the target energy consumption data of the second device for the first target component from K digital twins. Each digital twin includes a root node and multiple child nodes. The multiple child nodes are used to mount different devices, and there is an edge relationship between any two nodes. The edge relationship is used to represent the association relationship between different devices. The association relationship corresponds to a data association model, which is used to convert the energy consumption data of different devices with the association relationship into energy consumption data in the same data format. Each child node is used to store the energy consumption data of the component in the device. Each energy consumption data has the same data format in the child nodes corresponding to different devices. K is an integer greater than or equal to 1. The digital twin is used to realize the interoperability of energy consumption data between different devices. The different devices include different devices from the same manufacturer, the same device from different manufacturers, or different devices from different manufacturers. A sending unit is configured to send the target energy consumption data for the first target component from the second device to the first device; The receiving unit is further configured to receive device association data for the fourth device after asymmetric encryption, the device association data being used to indicate node information, model information, and device information that are associated with the fourth device; decrypt the device association data for the fourth device to obtain decrypted data; perform format parsing and verification on the decrypted data; if the format parsing and verification of the decrypted data passes, then set the association relationship of the fourth device according to the decrypted data.
8. The apparatus according to claim 7, characterized in that, The receiving unit is further configured to acquire the identifier of the third device and the component identifier of at least one second target component corresponding to the third device, wherein the third device is an energy device for uploading energy consumption data; The receiving unit is further configured to obtain the first energy consumption data of the third device based on the device identifier of the third device if there is a first digital twin among the K digital twins that corresponds to the at least one second target component; The determining unit is further configured to convert the first energy consumption data of the third device according to the data format corresponding to each energy consumption data; The determining unit is further configured to add the converted first energy consumption data to the first sub-node in the first digital twin associated with the third device.
9. The apparatus according to claim 8, characterized in that, The determining unit is further configured to: If the first digital twin is not present among the K digital twins, then the first digital twin is constructed, and the first digital twin includes a first root node and a second child node; The first energy consumption data of the third device is converted according to the data format corresponding to each energy consumption data; Add the converted first energy consumption data to the second child node.
10. The apparatus according to claim 8, characterized in that, The determining unit is further configured to: If the first child node stores the second energy consumption data of the third device, then the data difference between the second energy consumption data of the third device and the first energy consumption data of the third device is determined; The second energy consumption data of the third device stored in the first child node is adjusted based on the data differences.
11. The apparatus according to any one of claims 7 to 10, characterized in that, The receiving unit is further configured to receive management information corresponding to the first device, the management information including at least one of business license information and amount information corresponding to the first device; The determining unit is further configured to authenticate the first device based on the management information corresponding to the first device.
12. The apparatus according to any one of claims 8 to 10, characterized in that, The determining unit is further configured to: If the first energy consumption data of the third device contains data in a target format after format conversion, then the target format is recorded; The data format corresponding to each energy consumption data point is adjusted according to the target format. The first energy consumption data of the third device is converted according to the data format corresponding to each adjusted energy consumption data. The first energy consumption data of the third device after format conversion is added to the first child node.
13. A computer device, characterized in that, include: Memory, processor, and bus system; The memory is used to store programs; The processor is configured to execute a program in the memory, and the processor is configured to execute the data query method according to any one of claims 1 to 6 according to the instructions in the program code; The bus system is used to connect the memory and the processor to enable communication between the memory and the processor.
14. A computer storage medium, characterized in that, It includes instructions that, when executed on a computer, cause the computer to perform a method for querying data as described in any one of claims 1-6.
15. A computer program product, characterized in that, It includes a computer program that, when executed on a computer, causes the computer to implement the data query method as described in any one of claims 1-6.