Inverter data access method and electronic device
By determining whether the device continuously collects inverter data on the server side, if it is continuous, it returns cached data, and if it is not continuous, it returns real-time or historical data, it solves the problem of insufficient communication efficiency and stability between the server and the inverter, and ensures the data real-time and stability.
Patent Information
- Application Number
- CN202411614312.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-13
- Publication Date
- 2024-12-27
AI Technical Summary
In the prior art, communication efficiency and stability between the server and the inverter are insufficient, making it difficult for other devices to obtain real-time data of the inverter.
Receive requests through the server. If the device continuously collects inverter data and uploads it to the cache, it returns cached data; if it cannot be continuously collected, it returns real-time or historical data to ensure real-time and stability of the data.
It ensures that other devices can obtain real-time data of the inverter in a timely manner, improves the efficiency and stability of data acquisition, reduces multiple accesses to the inverter, and reduces the risk of communication blockage.
Smart Images

Figure CN119211359A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of Internet of Things, and in particular to a method and electronic device for accessing inverter data. Background Art
[0002] The inverter can convert DC power into AC power and is the core device of the power generation system. Other devices in the power generation system can access the inverter data through the server. However, due to the limited communication efficiency and stability between the server and the inverter, it is not always possible to ensure that other devices can obtain effective real-time data. Summary of the invention
[0003] Embodiments of the present application provide a method and an electronic device for accessing inverter data.
[0004] In a first aspect, an embodiment of the present application provides a method for accessing inverter data, the method comprising: The server receives a first request, where the first request is used to request data of a first inverter; If the first device continuously collects data of the first inverter and uploads it to the cache of the server, the server returns the data in the cache to the device that issued the first request, and the first device is connected to the first inverter via Bluetooth; Otherwise, the server returns the real-time data of the first inverter to the device that issued the first request, where the real-time data is obtained based on the server's access to the first inverter.
[0005] Optionally, if there are multiple devices that issue the first request, the server returning the real-time data of the first inverter to the device that issues the first request includes: The server returns the real-time data to the first device that issues the first request, and stores the real-time data in the cache; The server returns the real-time data in the cache to the remaining devices that issued the first request.
[0006] Optionally, the method further includes: If the first inverter is not online and the first device cannot continuously collect data from the first inverter and upload it to the server's cache, the server returns the data in the first database to the device that issues the first request. The first database is used to store historical data of the first inverter, and the data in the first database is uploaded by the first inverter.
[0007] In a second aspect, an embodiment of the present application provides a server device, including: A receiving module, used for receiving a first request, where the first request is used for requesting data of a first inverter; A sending module, configured to return the data in the cache to the device that issued the first request when the first device continuously collects the data of the first inverter and uploads it to the cache of the server, and the first device is connected to the first inverter via Bluetooth; Alternatively, when the first device does not continuously collect data of the first inverter and upload it to the cache of the server, real-time data of the first inverter is returned to the device that issued the first request, and the real-time data is obtained based on the server's access to the first inverter.
[0008] Optionally, if there are multiple devices sending the first request, the sending module is used to: Return the real-time data to the device that first issues the first request, and store the real-time data in the cache; Return the real-time data in the cache to the remaining devices that issued the first request.
[0009] Optionally, the sending module is also used to: If the first inverter is not online and the first device cannot continuously collect data from the first inverter and upload it to the server's cache, the data in the first database is returned to the device that issues the first request. The first database is used to store historical data of the first inverter, and the data in the first database is uploaded by the first inverter.
[0010] In a third aspect, an embodiment of the present application provides an electronic device, including: A collection module, used for continuously collecting data of the first inverter; Upload module, used to upload data to the server.
[0011] Optionally, the electronic device is connected to the first inverter via Bluetooth.
[0012] In a fourth aspect, an embodiment of the present application provides an electronic device, comprising a memory, at least one processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the method described in any one of the first aspects above is implemented.
[0013] In a fifth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method described in any one of the above-mentioned first aspects is implemented.
[0014] In a sixth aspect, an embodiment of the present application provides a computer program product. When the computer program product is run on an electronic device, the electronic device executes any one of the methods described in the first aspect above.
[0015] In this application, if the first device can continuously collect the data of the inverter for caching and upload it to the cache of the server, the data in the cache can be directly returned to the device requesting the inverter data. Otherwise, the real-time data obtained by accessing the inverter is returned to the device requesting the inverter data. Based on this, it can be ensured that the inverter data in the server cache is updated in a timely manner, which helps to ensure that other devices obtain the real-time data of the inverter. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for describing the embodiments are briefly introduced below.
[0017] Figure 1 It is a flowchart of the inverter data access method provided in an embodiment of the present application.
[0018] Figure 2 This is an example diagram of the method for accessing inverter data provided in an embodiment of the present application.
[0019] Figure 3 It is a structural diagram of a server device provided in an embodiment of the present application.
[0020] Figure 4 It is a schematic diagram of the structure of an electronic device provided in one embodiment of the present application.
[0021] Figure 5 It is a structural schematic diagram of an electronic device provided in another embodiment of the present application. DETAILED DESCRIPTION
[0022] The technical solution of the embodiment of the present invention will be described below in conjunction with the accompanying drawings in the embodiment of the present invention.
[0023] The inverter can convert DC power into AC power and is the core device of the power generation system. Other devices in the power generation system can access the inverter data through the server. However, due to the limited communication efficiency and stability between the server and the inverter, it is not always possible to ensure that other devices can obtain effective real-time data.
[0024] Depending on whether the inverter is online, there are two paths for other devices to access the inverter data through the server. One is that when the inverter is online, the server can directly send instructions to the inverter to obtain real-time data and send it to other devices that access the inverter data. This method may be affected by the network status between the server and the inverter, resulting in untimely data acquisition. The other is that when the inverter is not online, the server can send the saved historical data of the inverter to other devices that access the inverter data. Usually, the inverter uploads the generated data to the server for storage. Due to the low performance of the inverter, the fourth generation mobile communication technology (4G) module is generally used for data transmission. However, the amount of data generated by the inverter 24 hours a day is very large, and the upload process may consume more general packet radio service (GPRS) traffic fees. In addition, the interval for uploading data is long. For example, if the inverter uploads data every 10 minutes, the data obtained by other devices between the two intervals is not the latest collected data, so it is difficult to ensure the real-time nature of the data.
[0025] Based on this, Figure 1 As shown, an embodiment of the present application provides a method for accessing inverter data, which may include steps S110-S120.
[0026] In step S110, the server receives a first request, which may be used to request data of a first inverter. The first inverter may be any inverter connected to the server, and the first request may be issued by a device other than the first inverter. For example, the first request may be issued by a mobile phone or a computer, and the mobile phone or the computer may issue the first request to the server through an application (APP).
[0027] In step S120, if the first device continuously collects data of the first inverter and uploads it to the cache of the server, the server returns the data in the cache to the device that issued the first request, otherwise the server returns the real-time data of the first inverter to the device that issued the first request. The first device can be connected to the first inverter via Bluetooth, and the first device can be a terminal device such as a mobile phone. The first device can establish a communication connection with the server, for example, communicating via a wireless local area network. The real-time data of the first inverter can be obtained based on the server's access to the first inverter, for example, the server can send instructions to the inverter to obtain real-time data.
[0028] For example, when the inverter can establish a Bluetooth connection with the first device, and the first device can establish a communication connection with the server, the first device can continuously collect and report the inverter data. Exemplarily, the first device can collect and report the first inverter data once every 5 seconds, thereby realizing continuous collection and update of the inverter data. In this case, it can be considered that the data in the server cache is real-time, so the server can return the data in the cache to the device that issued the first request.
[0029] For another example, when the inverter cannot establish a Bluetooth connection with the first device, and / or the first device cannot establish a communication connection with the server, the first device cannot continuously collect and report the inverter data. In this case, the real-time performance of the data in the server cache cannot be guaranteed, so the server needs to access the inverter to obtain real-time data and send it to the device that issued the first request. After the server returns the real-time data of the first inverter to the device that issued the first request, the real-time data can be updated in the cache.
[0030] It is worth noting that if the connection between the inverter and the server fails (i.e. the inverter is not online), but a communication connection can still be established between the server and the first device, and the first device can still establish a Bluetooth connection with the inverter, the first device can still continuously collect and report the inverter data.
[0031] In this application, if the first device can continuously collect the data of the inverter for caching and upload it to the cache of the server, the data in the cache can be directly returned to the device requesting the inverter data. Otherwise, the real-time data obtained by accessing the inverter is returned to the device requesting the inverter data. Based on this, it can be ensured that the inverter data in the server cache is updated in a timely manner, which helps to ensure that other devices obtain the real-time data of the inverter.
[0032] In some cases, multiple devices may access the inverter data through the server at the same time. In this case, if the first device cannot continuously collect the data of the first inverter and upload it to the server's cache, the server needs to access the inverter separately according to the requests of multiple devices to obtain real-time data. However, multiple accesses may cause message blocking, thereby affecting the stability and efficiency of communication.
[0033] Based on this, optionally, if the first device cannot continuously collect data from the first inverter and upload it to the cache of the server, and there is only one device that issues the first request, the server can directly access the inverter to obtain real-time data and send it to the device that issues the first request. If the first device cannot continuously collect data from the first inverter and upload it to the cache of the server, and there are multiple devices that issue the first request, the server returning the real-time data of the first inverter to the device that issues the first request may include: the server returns the real-time data to the first device that issues the first request, and stores the real-time data in the cache; the server returns the real-time data in the cache to the remaining devices that issue the first request. Based on this, access to the inverter can be reduced, which helps to improve the efficiency of the device in obtaining data.
[0034] Optional, Figure 1 The method shown may also include step S130. In step S130, if the first inverter is not online, and the first device cannot continuously collect data from the first inverter and upload it to the cache of the server, the server returns the data in the first database to the device that issued the first request. The first database is used to store historical data of the first inverter, and the data in the first database is uploaded by the first inverter. When the first inverter is not online, the server cannot directly access the first inverter to obtain data, and the first device cannot continuously collect data from the first inverter and upload it to the cache of the server, then the historical data in the first database can be sent as a return to the device that issued the first request. Based on this, when the first inverter is not online and the first device cannot continuously collect and upload data from the first inverter, it can be ensured that other devices can obtain the historical data of the first inverter.
[0035] Combine the following Figure 2 , an example is given to introduce the method for accessing inverter data in the embodiment of the present application. Figure 2 In the example, the first device is a mobile phone. The mobile phone can establish a Bluetooth connection with the inverter. The mobile phone can collect the data of the inverter through the APP and upload it to the cache of the server. And when the inverter is online, the inverter can report data to the database of the server (i.e., the first database) every 10 minutes.
[0036] like Figure 2 As shown, when the mobile phone can continuously collect the data of the inverter through the APP and upload it to the cache of the server (regardless of whether the inverter is online), the data in the server cache is constantly updated. Therefore, if the server receives the first request, whether the device that issues the first request is one or more, the server can directly return the data in the cache to the device that issues the first request.
[0037] When the mobile phone cannot collect and upload the data of the inverter and the inverter is online, if the server receives the first request, the server can determine the response strategy according to the number of devices that issued the first request. When only one device issues the first request, the server can directly access the inverter to obtain the latest data (i.e., real-time data) and return it to the device, and update the latest data in the cache. When multiple devices issue the first request, the server can access the inverter to obtain the latest data (i.e., real-time data) and return it to the first device that issued the first request, and update the latest data in the cache, and then read the latest data from the cache and return it to the remaining devices.
[0038] In addition, when the mobile phone cannot collect and upload the data of the inverter and the inverter is not online, the server cannot directly access the inverter to obtain data. At this time, if the server receives the first request, no matter there is one or more devices issuing the first request, the server can directly return the data in the database to the device issuing the first request (not shown in the figure).
[0039] based on Figure 2 The method shown can respond to devices accessing inverter data through the server according to different situations, which helps to improve the real-time performance of accessing data.
[0040] The method provided in the embodiment of the present application is described in detail above. The device provided in the embodiment of the present application is described in detail below with reference to the accompanying drawings.
[0041] See also Figure 3 , is a schematic diagram of the structure of a server device provided in an embodiment of the present application. Figure 3 The server device 300 shown may include a receiving module 310 and a sending module 320 .
[0042] The receiving module 310 may be configured to receive a first request, where the first request is configured to request data of a first inverter; The sending module 320 may be used to return the data in the cache to the device that issued the first request when the first device continuously collects the data of the first inverter and uploads it to the cache of the server, and the first device is connected to the first inverter via Bluetooth; Alternatively, when the first device does not continuously collect data of the first inverter and upload it to the cache of the server, real-time data of the first inverter is returned to the device that issued the first request, and the real-time data is obtained based on the server's access to the first inverter.
[0043] Optionally, if there are multiple devices sending the first request, the sending module 320 may be used to: Return the real-time data to the device that first issues the first request, and store the real-time data in the cache; Return the real-time data in the cache to the remaining devices that issued the first request.
[0044] Optionally, the sending module 320 may also be used for: If the first inverter is not online and the first device cannot continuously collect data from the first inverter and upload it to the server's cache, the data in the first database is returned to the device that issues the first request. The first database is used to store historical data of the first inverter, and the data in the first database is uploaded by the first inverter.
[0045] See also Figure 4 , is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 4 The electronic device 400 shown may include a collection module 410 and an upload module 420 .
[0046] The acquisition module 410 may be used to continuously acquire data of the first inverter. The upload module 420 may be used to upload data to a server.
[0047] Optionally, the electronic device 400 may be connected to the first inverter via Bluetooth.
[0048] The present application also provides an electronic device. Figure 5 As shown, the electronic device 500 includes: at least one processor 501, a memory 502, and a computer program 503 stored in the memory 502 and executable on the at least one processor 501. When the processor 501 executes the computer program 503, the method provided in the present application is implemented.
[0049] Exemplarily, the computer program 503 may be divided into one or more modules / units, one or more modules / units are stored in the memory 502, and are executed by the processor 501 to complete the present application. One or more modules / units may be a series of computer program instruction segments capable of completing specific functions, and the instruction segments are used to describe the execution process of the computer program in the electronic device 500.
[0050] Those skilled in the art will understand that Figure 5 It is only an example of the electronic device 500 and does not constitute a limitation of the electronic device. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the electronic device 500 may also include input and output devices, network access devices, buses, etc.
[0051] The processor 501 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or the processor may be any conventional processor, etc.
[0052] The memory 502 may be an internal storage unit of the electronic device 500, such as a hard disk or memory of the electronic device 500. The memory 502 may also be an external storage device of the electronic device 500, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the electronic device 500. Further, the memory 502 may also include both an internal storage unit of the electronic device 500 and an external storage device. The memory 502 is used to store computer programs and other programs and data required by the electronic device 500. The memory 502 may also be used to temporarily store data that has been output or is to be output.
[0053] The electronic device 500 provided in this embodiment can execute the above method embodiment, and its implementation principle and technical effect are similar, which will not be repeated here.
[0054] An embodiment of the present application further provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments can be implemented.
[0055] An embodiment of the present application provides a computer program product. When the computer program product runs on an electronic device, the electronic device can implement the steps in the above-mentioned method embodiments when executing the computer program product.
[0056] If the integrated unit is implemented in the form of 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 present application implements all or part of the processes in the above method embodiments, which can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by the processor, the steps of the above method embodiments can be implemented. Among them, the computer program includes computer program code, which can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may at least include: any entity or device that can carry the computer program code to the camera / electronic device, recording medium, computer memory, ROM (read-only memory), RAM (random access memory), CD-ROM (compact disc read-only memory), magnetic tape, floppy disk and optical data storage device. The computer-readable storage medium mentioned in the present application can be a non-volatile storage medium, in other words, it can be a non-transient storage medium.
[0057] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0058] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0059] In the embodiments provided in the present application, it should be understood that the disclosed devices / equipment and methods can be implemented in other ways. For example, the device / equipment embodiments described above are only schematic, for example, the division of modules or units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0060] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or combinations thereof.
[0061] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0062] As used in the specification and appended claims of this application, the term "if" can be interpreted as "when" or "uponce" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "uponce it is determined" or "in response to determining" or "uponce [described condition or event] is detected" or "in response to detecting [described condition or event]", depending on the context.
[0063] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.
[0064] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.
Claims
1. A method for accessing inverter data, characterized in that: include: The server receives a first request, where the first request is used to request data of a first inverter; If the first device continuously collects data of the first inverter and uploads it to the cache of the server, the server returns the data in the cache to the device that issued the first request, and the first device is connected to the first inverter via Bluetooth; Otherwise, the server returns the real-time data of the first inverter to the device that issues the first request, where the real-time data is obtained based on the server's access to the first inverter.
2. The method according to claim 1, characterized in that: If there are multiple devices that issue the first request, the server returning the real-time data of the first inverter to the device that issues the first request includes: The server returns the real-time data to the first device that issues the first request, and stores the real-time data in the cache; The server returns the real-time data in the cache to the remaining devices that issued the first request.
3. The method according to claim 2, characterized in that The method further comprises: If the first inverter is not online and the first device cannot continuously collect data from the first inverter and upload it to the cache of the server, the server returns the data in the first database to the device that issued the first request. The first database is used to store historical data of the first inverter, and the data in the first database is uploaded by the first inverter.
4. A server device, characterized in that: include: A receiving module, configured to receive a first request, wherein the first request is used to request data of a first inverter; a sending module, configured to return the data in the cache to the device that issued the first request when the first device continuously collects the data of the first inverter and uploads it to the cache of the server, wherein the first device is connected to the first inverter via Bluetooth; Alternatively, when the first device does not continuously collect data of the first inverter and upload it to the cache of the server, real-time data of the first inverter is returned to the device that issued the first request, and the real-time data is obtained based on the server's access to the first inverter.
5. The server device according to claim 4, characterized in that: If there are multiple devices sending the first request, the sending module is used to: Returning the real-time data to the first device that issues the first request, and storing the real-time data in the cache; The real-time data in the cache is returned to the remaining devices that issued the first request.
6. The server device according to claim 5, characterized in that: The sending module is also used for: If the first inverter is not online and the first device cannot continuously collect data from the first inverter and upload it to the cache of the server, the data in the first database is returned to the device that issued the first request. The first database is used to store historical data of the first inverter, and the data in the first database is uploaded by the first inverter.
7. An electronic device, characterized in that: include: A collection module, used for continuously collecting data of the first inverter; The uploading module is used to upload the data to the server.
8. The electronic device according to claim 7, characterized in that: The electronic device is connected to the first inverter via Bluetooth.
9. An electronic device comprising a memory, at least one processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 3 is implemented.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 3 is implemented.
Citation Information
Patent Citations
Network monitor and management platform of solar photovoltaic generation system
CN101917137A
Data acquisition system and method, electronic equipment and storage medium
CN113190583A
Method for real-time caching and synchronizingdatabase using in-memory database management system
KR1020010099350A
